From 7d332d06874ced26fc8195635b126f2658078099 Mon Sep 17 00:00:00 2001 From: Chiara Rasi Date: Thu, 21 Nov 2024 11:51:11 +0100 Subject: [PATCH 1/6] Updated actions using the latest base images and to run using Python 3.9 --- .github/workflows/black.yml | 4 ++-- .github/workflows/dockerhub_stage_push.yml | 4 ++-- .github/workflows/keep_changelog.yml | 2 +- .github/workflows/lint.yml | 4 ++-- .github/workflows/test_n_coverage.yml | 6 +++--- .github/workflows/vulture.yml | 4 ++-- CHANGELOG.md | 1 + README.md | 2 +- 8 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml index eb99c11..2d8ddfd 100644 --- a/.github/workflows/black.yml +++ b/.github/workflows/black.yml @@ -9,9 +9,9 @@ jobs: steps: - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: 3.9 - name: install black run: | pip install black==22.3.0 diff --git a/.github/workflows/dockerhub_stage_push.yml b/.github/workflows/dockerhub_stage_push.yml index bbf6e59..95777e5 100644 --- a/.github/workflows/dockerhub_stage_push.yml +++ b/.github/workflows/dockerhub_stage_push.yml @@ -15,7 +15,7 @@ jobs: - name: Get branch name id: branch-name - uses: tj-actions/branch-names@v7 + uses: tj-actions/branch-names@v8 - name: Login to Docker Hub uses: docker/login-action@v3 @@ -29,7 +29,7 @@ jobs: - name: Build and push if: steps.branch-name.outputs.is_default == 'false' - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: context: ./ file: ./Dockerfile diff --git a/.github/workflows/keep_changelog.yml b/.github/workflows/keep_changelog.yml index 7711de4..1d56d9f 100644 --- a/.github/workflows/keep_changelog.yml +++ b/.github/workflows/keep_changelog.yml @@ -8,7 +8,7 @@ jobs: changelog: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - uses: dangoslen/changelog-enforcer@v3 with: changeLogPath: 'CHANGELOG.md' diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index bdd2605..6d2321e 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -9,9 +9,9 @@ jobs: steps: - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@master + uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: 3.9 - name: install flake8 run: | pip install flake8 diff --git a/.github/workflows/test_n_coverage.yml b/.github/workflows/test_n_coverage.yml index e8152ae..f0162a1 100644 --- a/.github/workflows/test_n_coverage.yml +++ b/.github/workflows/test_n_coverage.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ '3.8' ] + python-version: [ '3.9' ] steps: - uses: actions/checkout@v4 - name: Install poetry @@ -18,7 +18,7 @@ jobs: rm install-poetry.py - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} cache: 'poetry' @@ -37,7 +37,7 @@ jobs: run: poetry run pytest --cov=./ --cov-report=xml - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v5 with: flags: unittests files: ./coverage.xml diff --git a/.github/workflows/vulture.yml b/.github/workflows/vulture.yml index 67e0b08..5d6e6fb 100644 --- a/.github/workflows/vulture.yml +++ b/.github/workflows/vulture.yml @@ -13,12 +13,12 @@ jobs: - name: Find changed Python files id: files - uses: Ana06/get-changed-files@v2.0.0 + uses: Ana06/get-changed-files@v2 with: filter: "*.py" - name: Scavenge - uses: anaynayak/python-vulture-action@v1.0 + uses: anaynayak/python-vulture-action@v1 id: vulture with: vulture-args: --min-confidence 80 ${{steps.files.outputs.all}} diff --git a/CHANGELOG.md b/CHANGELOG.md index 37b51e8..47c59bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - Updated API submission schema to the latest available on `ncbi/clinvar` GitHub pages - Modified the json submission example to use one from the ClinVar GitHib repo (`sample_clinical_significance_hgvs_submission.json`) - Removed the example of an old json submission (before 2022-11-21) +- Updated actions using the latest base images and to run using Python 3.9 ### Fixed - Updated issue templates - Updated a number of libraries to address all current security advisories diff --git a/README.md b/README.md index 22de14f..2fcf06c 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ The server will be running and accepting requests sent from outside the containe ## Installing the application on a local conda environment -Given a conda environment sontaining python 3.8 and [poetry](https://github.com/python-poetry/poetry), clone the repository from Github with the following command: +Given a conda environment containing Python 3.9 and [poetry](https://github.com/python-poetry/poetry), clone the repository from Github with the following command: ``` git clone https://github.com/Clinical-Genomics/preClinVar.git From adac341482e5b697643ab7628d6c1df56898921c Mon Sep 17 00:00:00 2001 From: Chiara Rasi Date: Thu, 21 Nov 2024 11:54:55 +0100 Subject: [PATCH 2/6] Fix action --- .github/workflows/vulture.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vulture.yml b/.github/workflows/vulture.yml index 5d6e6fb..27c1529 100644 --- a/.github/workflows/vulture.yml +++ b/.github/workflows/vulture.yml @@ -13,7 +13,7 @@ jobs: - name: Find changed Python files id: files - uses: Ana06/get-changed-files@v2 + uses: Ana06/get-changed-files@v2.3.0 with: filter: "*.py" From 50122004e45f57b3840f01a3ce19a50f29423aed Mon Sep 17 00:00:00 2001 From: Chiara Rasi Date: Thu, 21 Nov 2024 11:57:03 +0100 Subject: [PATCH 3/6] Other fix in the Vulture action --- .github/workflows/vulture.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vulture.yml b/.github/workflows/vulture.yml index 27c1529..0c6f974 100644 --- a/.github/workflows/vulture.yml +++ b/.github/workflows/vulture.yml @@ -18,7 +18,7 @@ jobs: filter: "*.py" - name: Scavenge - uses: anaynayak/python-vulture-action@v1 + uses: anaynayak/python-vulture-action@v1.0 id: vulture with: vulture-args: --min-confidence 80 ${{steps.files.outputs.all}} From e9568d2aa05de08cf3bc9e164e116af6e1de546e Mon Sep 17 00:00:00 2001 From: Chiara Rasi Date: Thu, 21 Nov 2024 12:03:16 +0100 Subject: [PATCH 4/6] Fix warnings in the Dockerfile --- CHANGELOG.md | 1 + Dockerfile | 34 ++++++++++++++++++---------------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 47c59bc..2e50f27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ ### Fixed - Updated issue templates - Updated a number of libraries to address all current security advisories +- Warnings in the Dockerfile ## [2.6] ### Added diff --git a/Dockerfile b/Dockerfile index 6b228af..b95714f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ ########### # BUILDER # ########### -FROM clinicalgenomics/python3.8-venv:1.0 AS BUILDER +FROM clinicalgenomics/python3.8-venv:1.0 AS builder # Install and run commands from virtual environment RUN python3 -m venv /home/worker/venv @@ -16,10 +16,10 @@ RUN poetry install --no-interaction ######### # FINAL # ######### -FROM clinicalgenomics/python3.8-venv:1.0 AS DEPLOYER +FROM clinicalgenomics/python3.8-venv:1.0 RUN groupadd --gid 1000 worker && useradd -g worker --uid 1000 --create-home worker -COPY --chown=worker:worker --from=BUILDER /home/worker/venv /home/worker/venv +COPY --chown=worker:worker --from=builder /home/worker/venv /home/worker/venv RUN mkdir /home/worker/app WORKDIR /home/worker/app @@ -37,16 +37,18 @@ ENV GUNICORN_THREADS=1 ENV GUNICORN_BIND="0.0.0.0:8000" ENV GUNICORN_TIMEOUT=400 -CMD gunicorn \ - --workers=$GUNICORN_WORKERS \ - --worker-class=uvicorn.workers.UvicornWorker \ - --bind=$GUNICORN_BIND \ - --threads=$GUNICORN_THREADS \ - --timeout=$GUNICORN_TIMEOUT \ - --proxy-protocol \ - --forwarded-allow-ips="10.0.2.100,127.0.0.1" \ - --log-syslog \ - --access-logfile - \ - --error-logfile - \ - --log-level="debug" \ - preClinVar.main:app +CMD [ + "gunicorn", + "--workers=${GUNICORN_WORKERS}", + "--worker-class=uvicorn.workers.UvicornWorker", + "--bind=${GUNICORN_BIND}", + "--threads=${GUNICORN_THREADS}", + "--timeout=${GUNICORN_TIMEOUT}", + "--proxy-protocol", + "--forwarded-allow-ips=10.0.2.100,127.0.0.1", + "--log-syslog", + "--access-logfile", "-", + "--error-logfile", "-", + "--log-level=debug", + "preClinVar.main:app" +] From 86af5122544bfad6113b51d77d7720880eae6b54 Mon Sep 17 00:00:00 2001 From: Chiara Rasi Date: Thu, 21 Nov 2024 12:11:24 +0100 Subject: [PATCH 5/6] try like this --- Dockerfile | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index b95714f..1e97ff3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,18 +37,18 @@ ENV GUNICORN_THREADS=1 ENV GUNICORN_BIND="0.0.0.0:8000" ENV GUNICORN_TIMEOUT=400 -CMD [ - "gunicorn", - "--workers=${GUNICORN_WORKERS}", - "--worker-class=uvicorn.workers.UvicornWorker", - "--bind=${GUNICORN_BIND}", - "--threads=${GUNICORN_THREADS}", - "--timeout=${GUNICORN_TIMEOUT}", - "--proxy-protocol", - "--forwarded-allow-ips=10.0.2.100,127.0.0.1", - "--log-syslog", - "--access-logfile", "-", - "--error-logfile", "-", - "--log-level=debug", - "preClinVar.main:app" +CMD [ \ + "gunicorn", \ + "--workers=${GUNICORN_WORKERS}", \ + "--worker-class=uvicorn.workers.UvicornWorker", \ + "--bind=${GUNICORN_BIND}", \ + "--threads=${GUNICORN_THREADS}", \ + "--timeout=${GUNICORN_TIMEOUT}", \ + "--proxy-protocol", \ + "--forwarded-allow-ips=10.0.2.100,127.0.0.1", \ + "--log-syslog", \ + "--access-logfile", "-", \ + "--error-logfile", "-", \ + "--log-level=debug", \ + "preClinVar.main:app" \ ] From 8016aba59370a10a280f9ed3a8bbc07c3ab0afe2 Mon Sep 17 00:00:00 2001 From: Chiara Rasi Date: Thu, 21 Nov 2024 12:15:53 +0100 Subject: [PATCH 6/6] Update Dockerfile to use Pythin 3.11 --- CHANGELOG.md | 1 + Dockerfile | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e50f27..980a9b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - Modified the json submission example to use one from the ClinVar GitHib repo (`sample_clinical_significance_hgvs_submission.json`) - Removed the example of an old json submission (before 2022-11-21) - Updated actions using the latest base images and to run using Python 3.9 +- Docker image uses Python 3.11 instead of 3.8 ### Fixed - Updated issue templates - Updated a number of libraries to address all current security advisories diff --git a/Dockerfile b/Dockerfile index 1e97ff3..22c85a2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ ########### # BUILDER # ########### -FROM clinicalgenomics/python3.8-venv:1.0 AS builder +FROM clinicalgenomics/python3.11-venv:1.0 AS builder # Install and run commands from virtual environment RUN python3 -m venv /home/worker/venv @@ -16,7 +16,7 @@ RUN poetry install --no-interaction ######### # FINAL # ######### -FROM clinicalgenomics/python3.8-venv:1.0 +FROM clinicalgenomics/python3.11-venv:1.0 RUN groupadd --gid 1000 worker && useradd -g worker --uid 1000 --create-home worker COPY --chown=worker:worker --from=builder /home/worker/venv /home/worker/venv