Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

master dev sync #32

Open
wants to merge 207 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
207 commits
Select commit Hold shift + click to select a range
d7b8cf5
Merging Griffin's changes (#118)
YaphetKG Sep 29, 2020
aedb097
when using schema the expand nodes function fails to set starting nod…
YaphetKG Oct 1, 2020
3521f12
Udfs functions for parents and sibilings looking up wrong keys fix
YaphetKG Oct 1, 2020
cb3e287
Error modal not closing properly fix
YaphetKG Oct 1, 2020
c5f7825
docker image version bump for new dev image
YaphetKG Oct 1, 2020
8acb458
Update for planner, to fail iff no results can be found after trying …
YaphetKG Oct 28, 2020
fbaba7f
docker version bump
YaphetKG Oct 28, 2020
4093ea0
Varnish docker image to slim debian version
YaphetKG Nov 9, 2020
33645de
Trapi updates (#122)
YaphetKG Dec 11, 2020
cf453c3
Merge branch 'master' into develop
YaphetKG Dec 15, 2020
1de6754
Merge branch 'master' into develop
Jan 21, 2021
16bf91d
Trapi 1.0 (#126)
YaphetKG Feb 8, 2021
75f491d
Web prefix (#129)
YaphetKG Mar 3, 2021
be33cc9
Convert renciorg refs to helxplatform refs.
cnbennett3 Mar 3, 2021
7063532
Web prefix (#133)
YaphetKG Mar 25, 2021
bbc2154
Add UI conversion from TRAPI 1.0 to TRAPI 0.9.
cnbennett3 Apr 5, 2021
af2ee76
Merge pull request #138 from NCATS-Tangerine/chuck_kg
cnbennett3 Apr 6, 2021
a2765b0
Web prefix for UI (#139)
YaphetKG May 17, 2021
d44c8a9
Parameterizes docker file to support building a branch for CI/CD. (#145)
YaphetKG May 18, 2021
61c1ce6
Configure message not being called filters out important nodes. (#147)
YaphetKG May 25, 2021
6623981
skip and limit additions for cypher queries
YaphetKG May 27, 2021
929b72f
plater lib version bump
YaphetKG May 27, 2021
d31c14c
test for skip and limit options on redis
YaphetKG May 28, 2021
565d5c3
fixes test , upgrades plater
YaphetKG Jun 7, 2021
0d7bb58
Merge pull request #148 from NCATS-Tangerine/plater-version-bump
stevencox Jun 8, 2021
980e765
strips / from main url (#154)
YaphetKG Jun 11, 2021
7a923c2
Adding db to schema so it shows up on UI auto complete
YaphetKG Jul 16, 2021
30e2bfe
Refactoring merge endpoint.
YaphetKG Jul 16, 2021
ad108ae
Modify schema factory sending tranql config so its able to resolve re…
YaphetKG Jul 16, 2021
20d48a9
Parsing tweaks for 1. Suggesting concepts only base on context, i.e c…
YaphetKG Jul 16, 2021
fed19cc
merge for trapi 1.0
YaphetKG Jul 16, 2021
c479e78
test overhaul for merge and schema supporting redis
YaphetKG Jul 16, 2021
4daf132
Score as summation of publication counts on each edge
YaphetKG Jul 16, 2021
dec3ef6
score test disable
YaphetKG Jul 16, 2021
d4dc2ac
Support for max connections
YaphetKG Jul 16, 2021
a1a66a5
fixing api test for score
YaphetKG Jul 19, 2021
d40752a
Merge pull request #1 from helxplatform/feature/redis-schema
stevencox Jul 19, 2021
2a0ff1a
Adding Makefile, Jenkinsfile, consolidated Docker, tranql src dir
Jul 20, 2021
c2c70ad
Makefile and Jenkinsfile
Jul 20, 2021
0cf8061
Starting to organize & cleanup tests
Jul 20, 2021
6946155
Makefile
Jul 20, 2021
376a491
Test cleanup
Jul 20, 2021
42ce0e3
Bumping version
Jul 20, 2021
161fe93
Makefile
Jul 20, 2021
49f9cd1
Testing jenkins file
Jul 21, 2021
fffa8b5
Temp changing jenkins control flow
Jul 21, 2021
f48f28a
Update Dockerfile
YaphetKG Jul 21, 2021
8dd58b6
Merge pull request #2 from helxplatform/fix/docker-file-update-to-new…
YaphetKG Jul 21, 2021
8518491
Structural changes for simplified deployment
Jul 22, 2021
76362d4
Jenkins and Makefile
Jul 22, 2021
33e9d92
using first message query graph fixed, now questions are also merged.
YaphetKG Jul 28, 2021
aab933e
root question as query graph for merged answers when using schema on …
YaphetKG Jul 28, 2021
6b81b49
schema to updated dynamically after redis is populated, and some tests
YaphetKG Jul 28, 2021
e2fecd7
test for empty schema tweak
YaphetKG Jul 28, 2021
c07ec30
import at top
YaphetKG Jul 28, 2021
e409ffd
plater version bump
YaphetKG Jul 28, 2021
828bea2
when grabbing trapi option, if tranql query parser does not set it, s…
YaphetKG Jul 29, 2021
06ae535
Merge pull request #3 from helxplatform/bugfix/schema-and-timeout
stevencox Jul 29, 2021
2f3f878
Merge branch 'develop' of github.com:helxplatform/tranql into feature…
Aug 11, 2021
b10bb62
Fixing merge conflicts
Aug 11, 2021
ae43a70
bump plater version
Aug 18, 2021
4c6f5d3
requirements to fix tests
Aug 18, 2021
9f68a99
Removing travis file
Aug 30, 2021
0f90dff
Merge branch 'feature/cicd-improvements' of github.com:helxplatform/t…
Aug 30, 2021
de55d10
- Update requirements.txt , just the required libs
Aug 31, 2021
ea5e8e9
Merge pull request #4 from helxplatform/feature/cicd-improvements
cschreep Sep 1, 2021
dbaf5c5
upgrade bmt concept model, and tests to remove chemical substance
Sep 2, 2021
baeada2
upgrade bmt concept model, and tests to remove chemical substance (#6)
YaphetKG Sep 2, 2021
0a5521f
Updates schema.yaml to be redis dependent.
Sep 3, 2021
c2ba135
Merge branch 'develop' into feature/local-development
Sep 3, 2021
4122c9a
Make schema.yaml path configurable via env var
Sep 7, 2021
b5f0ae6
Feature/local development (#7)
YaphetKG Sep 8, 2021
8ce132a
Updates number of major web dependencies. Notes a bug in App.js
Sep 10, 2021
b1a4701
Updates numerous web dependencies
Sep 10, 2021
d01d47a
Removes a few unused dependencies
Sep 10, 2021
56f7d5c
Adds boilerplate jest testing and sample test
Sep 16, 2021
5960a44
Replaces domjs with Puppeteer testing
Sep 17, 2021
bacfce1
Small change to App in order ot make it easier to resolve API url out…
Sep 17, 2021
214e183
Downgrades react-force-graph to fix dependency conflict
Sep 17, 2021
27f8dc3
Undo react-force-graph downgrade beacuse it only causes more errors
Sep 17, 2021
9d66c4a
Adds schema testing, request mocking, test setup/env
Sep 18, 2021
9c29e6d
Adds graph testing
Sep 22, 2021
e46b26a
Polishes aspects of schema/graph unit tests and tidies things up
Sep 23, 2021
a9d38f5
Fixes non-mocked tests. Verifies that non-mocked tests work correctly.
Sep 23, 2021
8b21d3e
Adds web tests to makefile
Sep 24, 2021
ccdbb27
Updates API/backplane to use Flask-RESTX
Sep 24, 2021
bbb8e91
Updates graph unit test to throughly check node/edge existence in Thr…
Sep 24, 2021
0015e91
Adds legend unit test
Sep 25, 2021
ef60a3c
Adds simple autocompletion test and slightly restructures tests to us…
Sep 27, 2021
856da92
Adds more comprehensive request mocking utility and fixes autocomplet…
Sep 27, 2021
b3c5f8a
Restructures autocomplete unit test so that it can test multiple type…
Sep 27, 2021
ac28835
Fixes a bug that made it so that mocking didn't work properly in auto…
Sep 29, 2021
a268ee3
Slight syntactic change to testUtil
Sep 30, 2021
2fa53df
Remove test block that was accidentally left in
Sep 30, 2021
d7c2bb2
Modularizes and refactors various parts of App
Sep 30, 2021
89b1308
Moves bulky table viewer initialization into AppTableViewer under Tab…
Oct 1, 2021
89f5517
Fixes error in Makefile test.npm
Oct 1, 2021
e31f9c7
Makes sure Jenkins installs package.json before running tests
Oct 1, 2021
6e964d6
setupTests.js will load environment variables when cnofiguring test v…
Oct 1, 2021
c536483
Fixes environment directive under test stage
Oct 1, 2021
12fe6dd
Fixes Jenkinsfile environment directive?
Oct 1, 2021
292ea85
Wrap after all in try block to see if it fixes Jenkins build
Oct 1, 2021
f48fc8e
Removes web build from web test installation
Oct 1, 2021
ebfd1ef
Stops jenkins from building production build. Hopefully fixes puppete…
Oct 1, 2021
9e1f27c
Hopefully fixes Jenkins puppeteer browser launch
Oct 1, 2021
93a41cf
Jenkins list chrome dpeendnecies
Oct 1, 2021
1281984
Another change to see if browser is being properly initialized
Oct 1, 2021
ac2ca08
Hopefully locates chromium executable on Jenkins
Oct 1, 2021
c8f7ccd
Adds find_chromium to makefile
Oct 1, 2021
209ea68
Adds test_puppeteer to get error information on browser installation …
Oct 1, 2021
17bd0ed
fixes typo in test_puppeteer
Oct 1, 2021
5899d8d
Fix bug in test_puppeteer
Oct 1, 2021
50b9ca4
Should fix Jenkins Puppeteer by installing chrome dependencies
Oct 4, 2021
717dc66
Should fix Puppeteer problem in Jenkins
Oct 7, 2021
cd91e25
Fixes improper quotes/apostrophes in Jenkinsfile
Oct 7, 2021
30a884d
Adds test_puppeteer back for additional debugging
Oct 7, 2021
afde45e
Adds env variable/option to disable chromium sandboxing
Oct 7, 2021
7e88c10
Tests will launch webserver prior to launching Puppeteer
Oct 7, 2021
2368d8b
Fixes merge conflict?
Oct 7, 2021
4138e3f
Merge branch 'develop' into feature/jest-e2e-testing
frostyfan109 Oct 7, 2021
eefe8fe
Jenkinks should now launch webserver in background
Oct 7, 2021
2b60e05
Merge branch 'feature/jest-e2e-testing' of https://github.com/helxpla…
Oct 7, 2021
9406b0f
Changes wget to curl in Jenkinsfile. Adds brief comment of what it's …
Oct 8, 2021
4aaeed5
Remove null output of curl
Oct 8, 2021
ea6d2b2
Adds wget back
Oct 8, 2021
445326f
Kill webserver after testing is complete
Oct 8, 2021
bd68caf
Changes lsof to npx kill-port since lsof is not installed on the build
Oct 8, 2021
cf0aa8a
Fix bug that stopped app from being served on root path
Oct 14, 2021
52d91b8
Merge pull request #9 from helxplatform/feature/jest-e2e-testing
frostyfan109 Oct 15, 2021
6a965cc
Adds embeddable functionality with qs arg "embed" and adds try catch …
Nov 1, 2021
f1382b5
Adds empty state to embedded graph when a query returns no results. R…
Nov 2, 2021
16516d1
Adds EmbedMode enum that allows embedding to either be simple (just t…
Nov 3, 2021
e960360
More changes to how embedding works. Adds debounced query auto-execut…
Nov 5, 2021
2990e84
Replaces old Robokop answer viewer with gamma-viewer-web component. A…
Nov 5, 2021
08018dc
Moves embedded tranql rendering to inside a hook. Changes the way ans…
Nov 9, 2021
fd55500
Fixes repo-wide dependency conflict bug
Nov 9, 2021
8fd4bcb
Fixes Dockerfile and Makefile to be up to date with develop
Nov 9, 2021
8a5ae59
Remove extraneous console log & bump debounce on codemirror query fro…
Nov 10, 2021
c6efed5
Fixes styling on Gamma Viewer inside Bootstrap modal
Nov 10, 2021
4fd04ef
Merge pull request #10 from helxplatform/feature/modularization
frostyfan109 Nov 10, 2021
bca3926
Merge develop into feature/embeddable-iframe
Nov 10, 2021
821e596
Adds check for ?embed=false
Nov 11, 2021
9b02786
Merge pull request #11 from helxplatform/feature/embeddable-iframe
frostyfan109 Nov 11, 2021
8e8c2f7
Update _version.py (#12)
YaphetKG Nov 11, 2021
86b78db
add heap size for build (#13)
YaphetKG Nov 12, 2021
386c888
add publish to (#14)
YaphetKG Nov 15, 2021
eca6260
Fixes tranqlURL parsing on production env (#15)
frostyfan109 Nov 16, 2021
95ba45d
Where statement autocomplete, TranQLIncompleteParser unit tests, and …
frostyfan109 Nov 17, 2021
1f73fd8
Update _version.py
YaphetKG Nov 17, 2021
30376af
Update _version.py
YaphetKG Nov 17, 2021
1c93825
HeLx-UI/TranQL Integration Iteration 2 and Autocompletion Improvement…
frostyfan109 Jan 18, 2022
0f18e49
Update _version.py
YaphetKG Jan 18, 2022
8ecc119
New autocomplete changes (#18)
frostyfan109 Feb 17, 2022
f96a696
use latest plater with connection fix (#19)
YaphetKG Feb 17, 2022
de5d653
Update _version.py
YaphetKG Feb 17, 2022
642c208
Bmt version fix (#20)
YaphetKG Feb 18, 2022
3adee0c
Adds api/schema methods for performing a full-text search against the…
frostyfan109 May 20, 2022
0cb386b
Adds frontend support for /tranql/autocomplete endpoint which overhau…
frostyfan109 May 20, 2022
7c3e282
Adds open-ended autocomplete support to search against all supported …
frostyfan109 May 20, 2022
a17268b
Adds levenshtein distance + postprocessing removes all search suggest…
frostyfan109 Jun 1, 2022
fdb81cb
Fix LD qs default + throw 400 when prefix_search and LD are used simu…
frostyfan109 Jun 1, 2022
5f609c9
Adds prototype for prefix search and fuzzy search usage together. Add…
frostyfan109 Jun 13, 2022
32888ee
Implements query search + fuzzy search on autocomplete endpoint
frostyfan109 Jun 14, 2022
ac8505e
Make changes to autocomplete so that it works properly with CDEs
frostyfan109 Nov 2, 2022
548dfe6
Update study_linked autocomplete to work with new redis schema
frostyfan109 Feb 7, 2023
86b5c6f
Fix plater version to latest release
frostyfan109 Feb 7, 2023
d7186ef
Increment version
frostyfan109 Feb 7, 2023
b2c3784
add jenkins file
YaphetKG Feb 8, 2023
ba741f9
lower ephemeral storage
YaphetKG Feb 8, 2023
a259fc7
bump memory
YaphetKG Feb 8, 2023
b42ac86
Disable sourcemap generation on tranql webapp
frostyfan109 Feb 8, 2023
7f2108f
Updates to fix docker build
frostyfan109 Feb 9, 2023
f534941
Fix postprocessing study_linked
frostyfan109 Feb 10, 2023
cead77d
Merge pull request #23 from helxplatform/feature/redisgraph-autocomplete
frostyfan109 Feb 16, 2023
8d5fdd6
Fix build
frostyfan109 Feb 25, 2023
32e2af3
Raise memory requests in Jenkins
frostyfan109 Feb 27, 2023
2f1d34d
Add lots and lots of memory to jenkins to test if it fixes problem
frostyfan109 Feb 27, 2023
a27dcd6
Fix npm web build
frostyfan109 Feb 27, 2023
c77b3b5
Bump memory requests/limits
frostyfan109 Feb 28, 2023
329d8e0
Hopefully fix jenkins
frostyfan109 Feb 28, 2023
6c0d131
Test
frostyfan109 Mar 1, 2023
108f389
Move the old cicd out and add the github actions
joshua-seals Mar 1, 2023
3257a9f
Tweaking linter for tranql
joshua-seals Mar 1, 2023
f8226e8
correction imagebuild.needs section
joshua-seals Mar 1, 2023
cfda464
removing flake8 - issues on tranql
joshua-seals Mar 1, 2023
3968c3c
Adjusting to only use buildcache over other caches specific to dev an…
joshua-seals Mar 1, 2023
13b7127
remove testing the build for now until we can speed up these npm pack…
joshua-seals Mar 1, 2023
9a8f1c8
changing step order
joshua-seals Mar 1, 2023
ce31881
Merge pull request #25 from helxplatform/feat/add_github_actions
joshua-seals Mar 1, 2023
ee4e696
Merge branch 'develop' into fix/prod-build
frostyfan109 Mar 1, 2023
8843294
Merge pull request #24 from helxplatform/fix/prod-build
frostyfan109 Mar 1, 2023
f839dc7
Bump node heap memory
frostyfan109 Mar 1, 2023
e7ad178
Merge pull request #26 from helxplatform/fix/build-heap-memory
frostyfan109 Mar 1, 2023
4f07caa
Changes to build-push-release action
joshua-seals Apr 12, 2023
103f34e
Updates to workflow files
joshua-seals Apr 12, 2023
b14b6c6
Adding driver-option for testing
joshua-seals Apr 12, 2023
8b1d4a3
Updates to build workflows
joshua-seals Apr 12, 2023
10362c4
Updates to semver patterns
joshua-seals May 17, 2023
bcddea0
Rti merge (#28)
YaphetKG Oct 25, 2023
886fe05
Rti merge (#29)
YaphetKG Nov 17, 2023
19cf521
bump redis
YaphetKG Nov 20, 2023
b27cbac
Schema fix (#30)
YaphetKG Nov 30, 2023
4d8d19b
Dev master sync (#22)
YaphetKG Apr 16, 2024
92238f4
bumping bmt version (#31)
YaphetKG Apr 16, 2024
95110fe
added trivy and linked other to helxactions
pchachicho Jun 6, 2024
97f8f93
unlinked from helx-actions
pchachicho Jun 7, 2024
5e92a81
Merge pull request #33 from helxplatform/gh_actions
joshua-seals Jun 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
npm-debug.log
.github/
.pytest_cache
docker/
docs/
kubernetes/
varnish-cache/
web/node_modules/

*.egg-info/

.env
.gitignore
.python-version
.travis.yml
docker-compose.yml
Dockerfile
Jenkinsfile

*.log
111 changes: 111 additions & 0 deletions .github/workflows/build-push-dev-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# Workflow responsible for the
# development release processes.
#
# CI/CD Maintainer: Joshua Seals 🦭
#

name: Build-Push-Dev-Image
on:
push:
branches:
- develop
paths-ignore:
- README.md
- .old_cicd/*
- .github/*
- .github/workflows/*
- LICENSE
- .gitignore
- .dockerignore
- .githooks
# Do not build another image on a pull request.
# Any push to develop will trigger a new build however.
pull_request:
branches-ignore:
- '*'

jobs:
build-push-dev-image:
runs-on: ubuntu-latest
steps:

- name: Checkout Code
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
# fetch-depth: 0 means, get all branches and commits
fetch-depth: 0

- name: Set short git commit SHA
id: vars
run: |
echo "short_sha=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_OUTPUT
# https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

- name: Confirm git commit SHA output
run: echo ${{ steps.vars.outputs.short_sha }}

# https://github.com/marketplace/actions/git-semantic-version
- name: Semver Check
uses: paulhatch/[email protected]
id: version
with:
# The prefix to use to identify tags
tag_prefix: "v"
# A string which, if present in a git commit, indicates that a change represents a
# major (breaking) change, supports regular expressions wrapped with '/'
major_pattern: "/breaking|major/"
# A string which indicates the flags used by the `major_pattern` regular expression. Supported flags: idgs
major_regexp_flags: "ig"
# Same as above except indicating a minor change, supports regular expressions wrapped with '/'
minor_pattern: "/feat|feature/"
# A string which indicates the flags used by the `minor_pattern` regular expression. Supported flags: idgs
minor_regexp_flags: "ig"
# A string to determine the format of the version output
# version_format: "${major}.${minor}.${patch}-prerelease${increment}"
version_format: "${major}.${minor}.${patch}-prerelease${increment}"
search_commit_body: false

# Docker Buildx is important to caching in the Build And Push Container
# step
# https://github.com/marketplace/actions/build-and-push-docker-images

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
driver-opts: |
network=host

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
logout: true

- name: Login to Container Registry
uses: docker/login-action@v2
with:
registry: containers.renci.org
username: ${{ secrets.CONTAINERHUB_USERNAME }}
password: ${{ secrets.CONTAINERHUB_TOKEN }}
logout: true

# Notes on Cache:
# https://docs.docker.com/build/ci/github-actions/examples/#inline-cache
- name: Build Push Container
uses: docker/build-push-action@v4
with:
context: .
push: true
# Push to renci-registry and dockerhub here.
# cache comes from dockerhub.
tags: |
${{ github.repository }}:v${{ steps.version.outputs.version }}
${{ github.repository }}:develop
${{ github.repository }}:${{ steps.vars.outputs.short_sha }}
containers.renci.org/${{ github.repository }}:v${{ steps.version.outputs.version }}
containers.renci.org/${{ github.repository }}:develop
containers.renci.org/${{ github.repository }}:${{ steps.vars.outputs.short_sha }}
cache-from: type=registry,ref=${{ github.repository }}:buildcache
cache-to: type=registry,ref=${{ github.repository }}:buildcache,mode=max
128 changes: 128 additions & 0 deletions .github/workflows/build-push-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
# Workflow responsible for the
# major release processes.
#
# CI/CD Maintainer: Joshua Seals 🦭
#

name: Build-Push-Release
on:
push:
branches:
- master
- main
paths-ignore:
- README.md
- .old_cicd/*
- .github/*
- .github/workflows/*
- LICENSE
- .gitignore
- .dockerignore
- .githooks
tags-ignore:
- 'v[0-9]+.[0-9]+.*'
jobs:
build-push-release:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
fetch-depth: 0

- name: Set short git commit SHA
id: vars
run: |
echo "short_sha=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_OUTPUT
# https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

- name: Confirm git commit SHA output
run: echo ${{ steps.vars.outputs.short_sha }}

# https://github.com/marketplace/actions/git-semantic-version
- name: Semver Check
uses: paulhatch/[email protected]
id: version
with:
# The prefix to use to identify tags
tag_prefix: "v"
# A string which, if present in a git commit, indicates that a change represents a
# major (breaking) change, supports regular expressions wrapped with '/'
major_pattern: "/breaking|major/"
# A string which indicates the flags used by the `major_pattern` regular expression. Supported flags: idgs
major_regexp_flags: "ig"
# Same as above except indicating a minor change, supports regular expressions wrapped with '/'
minor_pattern: "/feat|feature/"
# A string which indicates the flags used by the `minor_pattern` regular expression. Supported flags: idgs
minor_regexp_flags: "ig"
# A string to determine the format of the version output
# version_format: "${major}.${minor}.${patch}-prerelease${increment}"
version_format: "${major}.${minor}.${patch}"
search_commit_body: false

# Docker Buildx is important to caching in the Build And Push Container
# step
# https://github.com/marketplace/actions/build-and-push-docker-images
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
driver-opts: |
network=host

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
logout: true

- name: Login to Container Registry
uses: docker/login-action@v2
with:
registry: containers.renci.org
username: ${{ secrets.CONTAINERHUB_USERNAME }}
password: ${{ secrets.CONTAINERHUB_TOKEN }}
logout: true

# Notes on Cache:
# https://docs.docker.com/build/ci/github-actions/examples/#inline-cache
- name: Build Push Container
uses: docker/build-push-action@v4
with:
push: true
# Push to renci-registry and dockerhub here.
# cache comes from dockerhub.
tags: |
containers.renci.org/${{ github.repository }}:v${{ steps.version.outputs.version }}
containers.renci.org/${{ github.repository }}:latest
containers.renci.org/${{ github.repository }}:${{ steps.vars.outputs.short_sha }}
${{ github.repository }}:v${{ steps.version.outputs.version }}
${{ github.repository }}:latest
${{ github.repository }}:${{ steps.vars.outputs.short_sha }}
cache-from: type=registry,ref=${{ github.repository }}:buildcach
cache-to: type=registry,ref=${{ github.repository }}:buildcache,mode=max

# Note: GITHUB_TOKEN is autogenerated feature of github app
# which is auto-enabled when using github actions.
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication
# https://docs.github.com/en/rest/git/tags?apiVersion=2022-11-28#create-a-tag-object
# https://docs.github.com/en/rest/git/refs?apiVersion=2022-11-28#create-a-reference
# This creates a "lightweight" ref tag.
- name: Create Tag for Release
run: |
curl \
-s --fail -X POST \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
https://api.github.com/repos/${{ github.repository }}/git/refs \
-d '{"ref":"refs/tags/v${{ steps.version.outputs.version }}","sha":"${{ github.sha }}"}'

- name: Create Release
env:
RELEASE_VERSION: ${{ steps.version.outputs.version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create ${{ env.RELEASE_VERSION }} \
-t "${{ env.RELEASE_VERSION }}" \
--generate-notes \
--latest
21 changes: 0 additions & 21 deletions .github/workflows/linter.yml

This file was deleted.

68 changes: 68 additions & 0 deletions .github/workflows/trivy-pr-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@

name: trivy-pr-scan
on:
pull_request:
branches:
- develop
- master
- main
types: [ opened, synchronize ]
paths-ignore:
- README.md
- .old_cicd/*
- .github/*
- .github/workflows/*
- LICENSE
- .gitignore
- .dockerignore
- .githooks

jobs:
trivy-pr-scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver-opts: |
network=host

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
logout: true

# Notes on Cache:
# https://docs.docker.com/build/ci/github-actions/examples/#inline-cache
- name: Build Container
uses: docker/build-push-action@v5
with:
context: .
push: false
load: true
tags: ${{ github.repository }}:vuln-test
cache-from: type=registry,ref=${{ github.repository }}:buildcache
cache-to: type=registry,ref=${{ github.repository }}:buildcache,mode=max

# We will not be concerned with Medium and Low vulnerabilities
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: '${{ github.repository }}:vuln-test'
format: 'sarif'
severity: 'CRITICAL,HIGH'
ignore-unfixed: true
output: 'trivy-results.sarif'
exit-code: '1'
# Scan results should be viewable in GitHub Security Dashboard
# We still fail the job if results are found, so below will always run
# unless manually canceled.
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
if: '!cancelled()'
with:
sarif_file: 'trivy-results.sarif'
Loading