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

Sync to master #338

Merged
merged 95 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
71ebe15
Improve readability of warnings.
gaurav Sep 26, 2023
1df596c
Added CORSMiddleware to allow Dug to make CORS requests.
gaurav Oct 17, 2023
7dcb0cf
feat:
braswent Oct 26, 2023
36120d5
feat:
braswent Oct 27, 2023
f8a45e1
feat:
braswent Oct 27, 2023
3a9c710
feat:
braswent Oct 31, 2023
0374ff4
feat:
braswent Oct 31, 2023
2852f22
feat:
braswent Oct 31, 2023
ac5c826
use action vs collection_action
YaphetKG Nov 2, 2023
d687e0d
handle synonyms only take in list of strings
YaphetKG Nov 2, 2023
05e6528
pin linkml
YaphetKG Nov 6, 2023
a8bcf52
pin linkml
YaphetKG Nov 6, 2023
e0625e5
is instance swapped args
YaphetKG Nov 6, 2023
93eeb60
fix list first bug;
YaphetKG Nov 7, 2023
bdc5ca9
add total counts to vars unscored
YaphetKG Nov 8, 2023
e680167
Merge pull request #321 from helxplatform/improve-vlmd-to-dbgap
YaphetKG Nov 8, 2023
13b2113
Merge pull request #326 from helxplatform/add-cors-middleware
YaphetKG Nov 8, 2023
341e534
Updates and new logic for trivy scan
joshua-seals Nov 22, 2023
3cf5f82
A few more adjustments to trivy scan logic
joshua-seals Nov 22, 2023
6fe7f94
Introducing trivy with codeql integration for prs and removing a step…
joshua-seals Nov 23, 2023
4bf178d
For fidelity
joshua-seals Nov 23, 2023
0313505
Fix on calls to actions
joshua-seals Nov 23, 2023
cce9cb9
Adjusting trivy checks in two files
joshua-seals Nov 23, 2023
7def787
Uncomment ignore-files for action stuff
joshua-seals Nov 23, 2023
1c9d31e
Update readme
joshua-seals Nov 23, 2023
8775a5d
Merge pull request #332 from helxplatform/trivy_action
YaphetKG Dec 4, 2023
2b09941
Merge pull request #331 from helxplatform/cde-links-2
YaphetKG Dec 4, 2023
b333178
feat:
braswent Dec 4, 2023
ce35cd3
fix response from nn
YaphetKG Dec 13, 2023
149be9f
norm returned values from make_request
YaphetKG Dec 13, 2023
5980112
Short circuit the integration test if dummy configuration is detected
mbacon-renci Dec 13, 2023
de8610d
feat:
braswent Dec 14, 2023
24b34e9
correcting jsonable to recursively serialize sub objects
YaphetKG Dec 19, 2023
785b789
correcting jsonable to recursively serialize sub objects
YaphetKG Dec 19, 2023
fec990a
correcting jsonable to recursively serialize sub objects
YaphetKG Dec 19, 2023
edfff4f
correcting jsonable to recursively serialize sub objects
YaphetKG Dec 19, 2023
2cac291
feat:
braswent Dec 19, 2023
f01844a
parameterize all identifier inner vars;
YaphetKG Dec 19, 2023
c70940f
parameterize everything for init from json form
YaphetKG Dec 19, 2023
a95bd2e
probably not a revealation but making everything optional in initial…
YaphetKG Dec 19, 2023
f3fca0f
probably not a revealation but making everything optional in initial…
YaphetKG Dec 19, 2023
1bd901f
missed description
YaphetKG Dec 19, 2023
3f4e334
normalize search test in identifier
YaphetKG Dec 19, 2023
227ad4a
https://github.com/TranslatorSRI/NameResolution/issues/129
YaphetKG Dec 20, 2023
5888094
avoid deep copy
YaphetKG Dec 20, 2023
527fbb8
see if this helps
YaphetKG Dec 20, 2023
17893a0
shallow copy and dump
YaphetKG Dec 20, 2023
1aa475f
logging for crawler
YaphetKG Dec 20, 2023
b5405eb
reverting cause of memory leak
YaphetKG Dec 21, 2023
f1950e0
debug message for tranql
YaphetKG Dec 21, 2023
b94374d
Update tests command in code-checks.yml
braswent Jan 2, 2024
ea610e1
Update code-checks.yml to use make test
braswent Jan 2, 2024
dfa65cf
Fixed make test in workflow
braswent Jan 2, 2024
5658b38
bump python version to minimal image
YaphetKG Jan 3, 2024
0677a77
bump versions
YaphetKG Jan 3, 2024
1da155c
bump python version in workflows
YaphetKG Jan 3, 2024
719d7c5
Merge branch 'develop' into trivy-scan-sapbert
YaphetKG Jan 3, 2024
c3a3371
change to bullseye
YaphetKG Jan 3, 2024
8e10f69
alpine image
YaphetKG Jan 3, 2024
0a7c368
do absolute imports for annotator modules for webserver
YaphetKG Jan 3, 2024
a863d38
assert called once is a function these days
YaphetKG Jan 3, 2024
2448dd6
Merge pull request #335 from helxplatform/trivy-scan-sapbert
YaphetKG Jan 3, 2024
814a247
trivy scan skip unfixed
YaphetKG Jan 3, 2024
ceece16
upgrade system pip version for vul scan
YaphetKG Jan 3, 2024
1c42441
Merge pull request #334 from helxplatform/feat/165-sapbert-annotator
YaphetKG Jan 3, 2024
7afd258
Merge branch 'develop' into patch-nrslv-resp
YaphetKG Jan 3, 2024
9ae8e0a
remove annotate commented out code, backdrop python min requriement
YaphetKG Jan 4, 2024
a18670e
feat: updated elasticsearch auth protocol to latest version
braswent Jan 4, 2024
4c4977d
feat: change annotator config to allow for different configs
braswent Jan 4, 2024
4eb6d2e
pass down config , no global access
YaphetKG Jan 4, 2024
0147fae
remove `-` from annotator names
YaphetKG Jan 4, 2024
80e35ae
normalize args for sapbert so it becomes easier parsing from env
YaphetKG Jan 4, 2024
096ba47
Sorted lists for json serialization for parser and annotator outputs
mbacon-renci Jan 11, 2024
0b7b51f
Reverted jsonable, sorted lists on assignment and change, rather than…
mbacon-renci Jan 16, 2024
0bb7085
Trying bumps in Docker base images
mbacon-renci Jan 17, 2024
ef0b74d
Adding jsonpickle to requirements.txt
mbacon-renci Jan 17, 2024
ebf9078
Moving required python version back to 3.11.
mbacon-renci Jan 22, 2024
56b85df
Changing image back to 3.11 as well
mbacon-renci Jan 22, 2024
8834423
Backing up redis image change to see if I can get dug auto-build to w…
mbacon-renci Jan 22, 2024
022f698
Build all branches for testing, pushing only to docker. Fix tag bypas…
joshua-seals Jan 23, 2024
ef8b721
Testing alpine to fix trivy error
joshua-seals Jan 23, 2024
e16a347
Vuln confirmed in image, new docker image test
joshua-seals Jan 23, 2024
5be0195
Is buildcache causing trivy failures?
joshua-seals Jan 23, 2024
d17578d
Re-enabling cache after testing
joshua-seals Jan 23, 2024
d1ff3c9
Revert to older trivy relelase
joshua-seals Jan 23, 2024
96f7338
trivy scan update
joshua-seals Jan 23, 2024
5bee00d
adding pytest asyncio
YaphetKG Jan 24, 2024
9cb89ca
fix tests
YaphetKG Jan 24, 2024
64f3cb6
fix annotator init
YaphetKG Jan 24, 2024
15cccfe
fix all the tests
YaphetKG Jan 24, 2024
f3d9411
Forced Python 3.11
mbacon-renci Jan 24, 2024
d7257df
bump docker image version to 0 vuls
YaphetKG Jan 24, 2024
92cec85
Merge branch 'sort_pickle_lists' into patch-nrslv-resp
YaphetKG Jan 24, 2024
275abcb
zero again 0_o
YaphetKG Jan 24, 2024
073aefa
Merge pull request #337 from helxplatform/patch-nrslv-resp
YaphetKG Jan 25, 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
8 changes: 4 additions & 4 deletions .github/workflows/build-push-dev-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,20 @@ jobs:
# https://github.com/marketplace/actions/build-and-push-docker-images

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
with:
driver-opts: |
network=host
- name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
logout: true

- name: Login to Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: containers.renci.org
username: ${{ secrets.CONTAINERHUB_USERNAME }}
Expand All @@ -72,7 +72,7 @@ jobs:
# Notes on Cache:
# https://docs.docker.com/build/ci/github-actions/examples/#inline-cache
- name: Build Push Container
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: .
push: true
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/build-push-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
- .dockerignore
- .githooks
tags-ignore:
- 'v[0-9]+.[0-9]+.*'
- '*'
jobs:
build-push-release:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -63,20 +63,20 @@ jobs:
# step
# https://github.com/marketplace/actions/build-and-push-docker-images
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
with:
driver-opts: |
network=host

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

- name: Login to Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: containers.renci.org
username: ${{ secrets.CONTAINERHUB_USERNAME }}
Expand All @@ -86,7 +86,7 @@ jobs:
# Notes on Cache:
# https://docs.docker.com/build/ci/github-actions/examples/#inline-cache
- name: Build Push Container
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
push: true
# Push to renci-registry and dockerhub here.
Expand Down
113 changes: 62 additions & 51 deletions .github/workflows/code-checks.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
# Workflow responsible for core acceptance testing.
# Tests Currently Run:
# - flake8-linter
# - image-build-test
#
# This workflow only validates images can build
# but does not push images to any repository.
#
# - PYTest
# - Bandit
# For PR Vulnerability Scanning a separate workflow will run.
# The build-push-dev-image and build-push-release workflows
# handle the develop and release image storage respectively.
#
#

name: Code-Checks
on:
push:
branches-ignore:
- master
- main
# push:
# branches-ignore:
# - master
# - main
# - develop
pull_request:
branches:
- develop
- master
- main
types: [ opened, synchronize ]
paths-ignore:
- README.md
- .old_cicd/*
Expand All @@ -27,13 +31,6 @@ on:
- .gitignore
- .dockerignore
- .githooks
pull_request:
branches:
- develop
- master
- main
types: [ opened, synchronize ]


jobs:
############################## flake8-linter ##############################
Expand All @@ -45,7 +42,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.12'

# Currently actions/setup-python supports caching
# but the cache is not as robust as cache action.
Expand All @@ -69,35 +66,6 @@ jobs:
# flake8 --ignore=E,W --exit-zero .
continue-on-error: true

############################## test-image-build ##############################
test-image-build:
# needs: flake8-linter
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- 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

# Notes on Cache:
# https://docs.docker.com/build/ci/github-actions/examples/#inline-cache
- name: Build Container
uses: docker/build-push-action@v4
with:
context: .
push: false
cache-from: type=registry,ref=${{ github.repository }}:buildcache
cache-to: type=registry,ref=${{ github.repository }}:buildcache,mode=max
################################### PYTEST ###################################
pytest:
runs-on: ubuntu-latest
Expand All @@ -106,7 +74,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.12'

- name: Install Requirements
run: |
Expand All @@ -116,8 +84,7 @@ jobs:

- name: Test with pytest
run: |
pytest --doctest-modules src
coverage run -m pytest tests/unit
make test

############################ Bandit ################################
bandit:
Expand All @@ -127,7 +94,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.12'

- name: Install Requirements
run: |
Expand All @@ -138,4 +105,48 @@ jobs:
# Only report high security issues
- name: Test with Bandit
run: |
bandit -r src -n3 -lll
bandit -r src -n3 -lll

############################## test-image-build ##############################
test-image-build:
runs-on: ubuntu-latest
# if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- uses: actions/checkout@v3

- 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 }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

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

- name: Parse Github Reference Name
id: branch
run: |
REF=${{ github.ref_name }}
echo "GHR=${REF%/*}" >> $GITHUB_OUTPUT

# 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: true
tags: |
${{ github.repository }}:test_${{ steps.branch.outputs.GHR }}
cache-from: type=registry,ref=${{ github.repository }}:buildcache
cache-to: type=registry,ref=${{ github.repository }}:buildcache,mode=max
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'
16 changes: 10 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,23 @@
# A container for the core semantic-search capability.
#
######################################################
FROM python:3.10.10-slim
FROM python:3.12.1-alpine3.19


# Install required packages
RUN apt-get update && \
apt-get install -y curl make vim && \
rm -rf /var/cache/apt/*
RUN apk update && \
apk add g++ make

#upgrade openssl \
RUN apk add openssl=3.1.4-r4

RUN pip install --upgrade pip
# Create a non-root user.
ENV USER dug
ENV HOME /home/$USER
ENV UID 1000

RUN adduser --disabled-login --home $HOME --shell /bin/bash --uid $UID $USER
RUN adduser -D --home $HOME --uid $UID $USER

USER $USER
WORKDIR $HOME
Expand All @@ -31,4 +35,4 @@ RUN make install
RUN make install.dug

# Run it
ENTRYPOINT dug
ENTRYPOINT dug
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ install.dug:

#test: Run all tests
test:
# ${PYTHON} -m flake8 src
${PYTHON} -m pytest --doctest-modules src
coverage run -m pytest tests

coverage:
Expand Down
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ dug crawl tests/integration/data/test_variables_v1.0.csv -p "TOPMedTag"

After crawling, you can search:
```shell
dug search -q "heart attack" -t "concepts"
dug search -q "heart attack" -t "variables" -k "concept=MONDO:0005068"
dug search -q "vein" -t "concepts"
dug search -q "vein" -t "variables" -k "concept=UBERON:0001638"
```

You can also query Dug's REST API:
```shell
query="`echo '{"index" : "concepts_index", "query" : "heart attack"}'`"
query="`echo '{"index" : "concepts_index", "query" : "vein"}'`"

curl --data "$query" \
--header "Content-Type: application/json" \
Expand Down Expand Up @@ -290,3 +290,8 @@ TOPMed phenotypic concept data is [here](https://github.com/helxplatform/dug/tre
## Release

To release, commit the change and select feature.

#### Fail on Vulnerability Detection

During PR's several vulnerability scanners are run. If there are vulnerabilities detected, the pr checks will fail and a report will be sent to Github Security Dashboard for viewing. Please ensure the vulnerability is mitigated prior to continuing the merge to protected branches.

Loading
Loading