diff --git a/.github/workflows/PR-validation.yml b/.github/workflows/PR-validation.yml index fb197605..97540100 100644 --- a/.github/workflows/PR-validation.yml +++ b/.github/workflows/PR-validation.yml @@ -40,7 +40,7 @@ jobs: if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-deps-lock-updates') }} shell: bash run: | - make pip-tools deps-lock-update test-deps-lock-update + make pip-tools update-deps-lock update-test-deps-lock - name: Upload updated (main) lock file as artifact uses: actions/upload-artifact@v4 with: @@ -74,7 +74,7 @@ jobs: if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-deps-lock-updates') }} shell: bash run: | - make pip-tools deps-lock-update test-deps-lock-update + make pip-tools update-deps-lock update-test-deps-lock - name: Upload updated (main) lock file as artifact uses: actions/upload-artifact@v4 with: @@ -108,7 +108,7 @@ jobs: if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-deps-lock-updates') }} shell: bash run: | - make deps-lock-update + make update-deps-lock - name: Upload updated lock file as artifact uses: actions/upload-artifact@v4 with: @@ -117,6 +117,8 @@ jobs: if-no-files-found: error pipeline-aws-infra-update-dependency-lock-files: name: pipeline/aws_infra update and upload dependency lock file + needs: + - shared-aws-infra-package-build runs-on: ubuntu-22.04 defaults: run: @@ -132,11 +134,16 @@ jobs: fetch-depth: 0 sparse-checkout: | pipeline/aws_infra/ + - name: Download shared AWS infra package + uses: actions/download-artifact@v4 + with: + name: shared_aws_infra_package + path: /tmp/ - name: Update lock files if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-deps-lock-updates') }} shell: bash run: | - make pip-tools deps-lock-update test-deps-lock-update + make pip-tools update-deps-lock update-test-deps-lock - name: Upload updated (main) lock file as artifact uses: actions/upload-artifact@v4 with: @@ -151,6 +158,8 @@ jobs: if-no-files-found: error api-aws-infra-update-dependency-lock-files: name: api/aws_infra update and upload dependency lock file + needs: + - shared-aws-infra-package-build runs-on: ubuntu-22.04 defaults: run: @@ -166,11 +175,16 @@ jobs: fetch-depth: 0 sparse-checkout: | api/aws_infra/ + - name: Download shared AWS infra package + uses: actions/download-artifact@v4 + with: + name: shared_aws_infra_package + path: /tmp/ - name: Update lock files if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-deps-lock-updates') }} shell: bash run: | - make pip-tools deps-lock-update test-deps-lock-update + make pip-tools update-deps-lock update-test-deps-lock - name: Upload updated (main) lock file as artifact uses: actions/upload-artifact@v4 with: @@ -204,7 +218,7 @@ jobs: if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-deps-lock-updates') }} shell: bash run: | - make pip-tools deps-lock-update test-deps-lock-update + make pip-tools update-deps-lock update-test-deps-lock - name: Upload updated (main) lock file as artifact uses: actions/upload-artifact@v4 with: @@ -254,6 +268,43 @@ jobs: make run-style-checks - name: Unit tests run: make run-unit-tests + shared-aws-infra-package-build: + name: shared_aws_infra python package build + needs: + - shared-aws-infra-code-checks + runs-on: ubuntu-22.04 + defaults: + run: + working-directory: ./shared_aws_infra + steps: + - name: Check out repository code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + sparse-checkout: | + shared_aws_infra/ + - name: Download updated shared_aws_infra (main) dependencies lock file + uses: actions/download-artifact@v4 + with: + name: shared_aws_infra_deps_lock + path: shared_aws_infra + - name: Download updated shared_aws_infra (test) dependencies lock file + uses: actions/download-artifact@v4 + with: + name: shared_aws_infra_test_deps_lock + path: shared_aws_infra/tests + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + - name: Build package + run: | + make build + - name: Upload package as artifact + uses: actions/upload-artifact@v4 + with: + name: shared_aws_infra_package + path: shared_aws_infra/dist/pavi_shared_aws_infra-0.0.0-py3-none-any.whl pipeline-seq-retrieval-container-image-build: name: pipeline/seq_retrieval container-image build needs: @@ -468,7 +519,7 @@ jobs: name: pipeline/aws_infra code checks needs: - pipeline-aws-infra-update-dependency-lock-files - - shared-aws-infra-update-dependency-lock-files + - shared-aws-infra-package-build permissions: id-token: write # This is required for requesting the JWT for gaining permissions to assume the IAM role to perform AWS actions runs-on: ubuntu-22.04 @@ -482,7 +533,6 @@ jobs: fetch-depth: 0 sparse-checkout: | pipeline/aws_infra/ - shared_aws_infra/ - name: Download updated pipeline/aws_infra (main) dependencies lock file uses: actions/download-artifact@v4 with: @@ -493,6 +543,11 @@ jobs: with: name: pipeline_aws_infra_tests_deps_lock path: pipeline/aws_infra/tests + - name: Download shared AWS infra package + uses: actions/download-artifact@v4 + with: + name: shared_aws_infra_package + path: /tmp/ - name: Setup Python uses: actions/setup-python@v5 with: @@ -696,6 +751,7 @@ jobs: name: api/aws_infra code checks needs: - api-aws-infra-update-dependency-lock-files + - shared-aws-infra-package-build permissions: id-token: write # This is required for requesting the JWT for gaining permissions to assume the IAM role to perform AWS actions runs-on: ubuntu-22.04 @@ -709,7 +765,6 @@ jobs: fetch-depth: 0 sparse-checkout: | api/aws_infra/ - shared_aws_infra/ - name: Download updated api/aws_infra (main) dependencies lock file uses: actions/download-artifact@v4 with: @@ -720,6 +775,11 @@ jobs: with: name: api_aws_infra_tests_deps_lock path: api/aws_infra/tests + - name: Download shared AWS infra package + uses: actions/download-artifact@v4 + with: + name: shared_aws_infra_package + path: /tmp/ - name: Setup Python uses: actions/setup-python@v5 with: @@ -813,7 +873,7 @@ jobs: - pipeline-seq-retrieval-update-dependency-lock-files - pipeline-seq-retrieval-code-checks - shared-aws-infra-update-dependency-lock-files - - shared-aws-infra-code-checks + - shared-aws-infra-package-build - pipeline-aws-infra-update-dependency-lock-files - pipeline-aws-infra-code-checks - pipeline-workflow-integration-testing diff --git a/.github/workflows/main-build-and-deploy.yml b/.github/workflows/main-build-and-deploy.yml index 0914e8b0..58e08777 100644 --- a/.github/workflows/main-build-and-deploy.yml +++ b/.github/workflows/main-build-and-deploy.yml @@ -14,9 +14,36 @@ jobs: shell: bash run: | echo "PR merge detected and deployment wanted." + shared-aws-infra-package-build: + name: shared_aws_infra python package build + needs: + - on-merge-and-deploy + runs-on: ubuntu-22.04 + defaults: + run: + working-directory: ./shared_aws_infra + steps: + - name: Check out repository code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + sparse-checkout: | + shared_aws_infra/ + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + - name: Build package + run: | + make build + - name: Upload package as artifact + uses: actions/upload-artifact@v4 + with: + name: shared_aws_infra_package + path: shared_aws_infra/dist/pavi_shared_aws_infra-0.0.0-py3-none-any.whl pipeline-deploy-aws-infra: name: Deploy/update AWS infrastructure for pipeline - needs: [on-merge-and-deploy] + needs: [shared-aws-infra-package-build] permissions: id-token: write # This is required for requesting the JWT for gaining permissions to assume the IAM role to perform AWS actions runs-on: ubuntu-22.04 @@ -36,6 +63,11 @@ jobs: uses: actions/setup-python@v5 with: python-version: "3.12" + - name: Download shared AWS infra package + uses: actions/download-artifact@v4 + with: + name: shared_aws_infra_package + path: /tmp/ - name: Install CDK stack dependencies run: pip install -r requirements.txt - name: AWS credentials configuration @@ -50,7 +82,7 @@ jobs: run: make deploy ADD_CDK_ARGS="--require-approval never" api-deploy-image-repo: name: Deploy/update container image repository stack for API - needs: [on-merge-and-deploy] + needs: [shared-aws-infra-package-build] permissions: id-token: write # This is required for requesting the JWT for gaining permissions to assume the IAM role to perform AWS actions runs-on: ubuntu-22.04 @@ -70,6 +102,11 @@ jobs: uses: actions/setup-python@v5 with: python-version: "3.12" + - name: Download shared AWS infra package + uses: actions/download-artifact@v4 + with: + name: shared_aws_infra_package + path: /tmp/ - name: Install CDK stack dependencies run: pip install -r requirements.txt - name: AWS credentials configuration @@ -193,6 +230,7 @@ jobs: name: Deploy application (version) for API needs: - on-merge-and-deploy + - shared-aws-infra-package-build - api-build-and-push-docker-image - pipeline-alignment-build-and-push-docker-image - pipeline-seq-retrieval-build-and-push-docker-image @@ -221,6 +259,11 @@ jobs: uses: actions/setup-python@v5 with: python-version: "3.12" + - name: Download shared AWS infra package + uses: actions/download-artifact@v4 + with: + name: shared_aws_infra_package + path: /tmp/ - name: Install CDK stack dependencies run: pip install -r requirements.txt - name: AWS credentials configuration diff --git a/api/Makefile b/api/Makefile index ebfb2882..2a5163bf 100644 --- a/api/Makefile +++ b/api/Makefile @@ -31,7 +31,7 @@ protein-msa.nf: nextflow.config: ln -s ../pipeline/workflow/nextflow.config nextflow.config -run-server-dev: deps nextflow.sh protein-msa.nf nextflow.config +run-server-dev: install-deps nextflow.sh protein-msa.nf nextflow.config @export API_RESULTS_PATH_PREFIX="`pwd`/" && \ export API_EXECUTION_ENV="local" && \ fastapi dev src/main.py @@ -58,31 +58,31 @@ requirements.txt: tests/requirements.txt: pip-compile --generate-hashes --no-strip-extras --extra=test -o tests/requirements.txt -deps-lock-update: +update-deps-lock: pip-compile --generate-hashes --no-strip-extras --upgrade -o requirements.txt -test-deps-lock-update: +update-test-deps-lock: pip-compile --generate-hashes --no-strip-extras --extra=test --upgrade -o tests/requirements.txt -deps: requirements.txt +install-deps: requirements.txt pip install -r requirements.txt -test-deps: tests/requirements.txt +install-test-deps: tests/requirements.txt pip install -r tests/requirements.txt -run-type-checks: test-deps +run-type-checks: install-test-deps mypy --install-types --non-interactive --warn-unused-config ./ -run-style-checks: test-deps +run-style-checks: install-test-deps flake8 ./ -run-tests: test-deps nextflow.sh protein-msa.nf nextflow.config +run-tests: install-test-deps nextflow.sh protein-msa.nf nextflow.config python -m pytest --cov --cov-fail-under=80 -run-tests-dev: test-deps nextflow.sh protein-msa.nf nextflow.config +run-tests-dev: install-test-deps nextflow.sh protein-msa.nf nextflow.config python -m pytest --cov --cov-fail-under=80 --cov-report html -v -run-integration-test-container: test-deps +run-integration-test-container: install-test-deps export API_PIPELINE_IMAGE_TAG=${TAG_NAME} && \ docker-compose -f docker-compose-dev.yml --env-file dev.env up -d agr.pavi.dev-local.api sleep 30 # Allow container some startup time before attempting to connect diff --git a/api/aws_infra/Makefile b/api/aws_infra/Makefile index 72b55346..c32523c5 100644 --- a/api/aws_infra/Makefile +++ b/api/aws_infra/Makefile @@ -43,28 +43,28 @@ requirements.txt: tests/requirements.txt: pip-compile --generate-hashes --no-strip-extras --extra=test -o tests/requirements.txt -deps-lock-update: +update-deps-lock: pip-compile --generate-hashes --no-strip-extras --upgrade -o requirements.txt -test-deps-lock-update: +update-test-deps-lock: pip-compile --generate-hashes --no-strip-extras --extra=test --upgrade -o tests/requirements.txt -deps: requirements.txt +install-deps: requirements.txt pip install -r requirements.txt -test-deps: tests/requirements.txt +install-test-deps: tests/requirements.txt pip install -r tests/requirements.txt -run-unit-tests: check-node test-deps +run-unit-tests: check-node install-test-deps python -m pytest run-unit-tests-dev: check-venv-active run-unit-tests @: -run-type-checks: test-deps +run-type-checks: install-test-deps mypy --install-types --non-interactive --warn-unused-config ./ -run-style-checks: test-deps +run-style-checks: install-test-deps flake8 ./ validate-image-stack: check-node run-unit-tests diff --git a/api/aws_infra/README.md b/api/aws_infra/README.md index c67537ad..3bf4d3ce 100644 --- a/api/aws_infra/README.md +++ b/api/aws_infra/README.md @@ -1,9 +1,9 @@ # AGR PAVI infra using CDK (Python) -This is the AWS infrastructure component of the AGR PAVI application. -This includes all AWS resources and infrastructure required to make the main -application executable in AWS, and is defined and deployed using +This is the AWS infrastructure component of the AGR PAVI API. +This includes all AWS resources and infrastructure required to make the API +executable in AWS, and is defined and deployed using AWS CDK and written as Python code in this subdirectory. AWS CDK is an open-source framework that enables writing @@ -46,6 +46,13 @@ Once done working with the code in this directory, deactivate the virtualenv: $ deactivate ``` +## Dependencies +The code in this subdirectory depends on a set of shared AWS infra modules and variables, +found in the the `/shared_aws_infra` directory in this repository. + +Before proceeding to run or make any changes in this repository, build and install +this shared AWS infra module by following the [build-and-install](../../shared_aws_infra/README.md#build-and-install) instructions in the README. + ## Important files Two standard CDK configuration files can be found at the root level of this directory: * [cdk.json](./cdk.json) diff --git a/api/aws_infra/cdk_app.py b/api/aws_infra/cdk_app.py index e1dc386e..4928762b 100644 --- a/api/aws_infra/cdk_app.py +++ b/api/aws_infra/cdk_app.py @@ -1,16 +1,10 @@ #!/usr/bin/env python3 from aws_cdk import App -from pathlib import Path -from sys import path as sys_path - from cdk_classes.image_repo_stack import CdkImageRepoStack from cdk_classes.application_stack import EBApplicationCdkStack, EbEnvironmentCdkStack -repo_root_path = Path(__file__).parent.parent.parent.parent -sys_path.append(str(repo_root_path)) - -from shared_aws_infra.agr_aws_env import agr_aws_environment # noqa: E402 +from pavi_shared_aws_infra.agr_aws_env import agr_aws_environment app = App() diff --git a/api/aws_infra/cdk_classes/image_repo_stack.py b/api/aws_infra/cdk_classes/image_repo_stack.py index 08a3ba1b..1e1465a9 100644 --- a/api/aws_infra/cdk_classes/image_repo_stack.py +++ b/api/aws_infra/cdk_classes/image_repo_stack.py @@ -6,14 +6,9 @@ from constructs import Construct -from pathlib import Path -from sys import path as sys_path from typing import Any, Optional -repo_root_path = Path(__file__).parent.parent.parent.parent -sys_path.append(str(repo_root_path)) - -from shared_aws_infra.shared_cdk_classes.pavi_ecr_repo import PaviEcrRepository # noqa: E402 +from pavi_shared_aws_infra.shared_cdk_classes.pavi_ecr_repo import PaviEcrRepository class CdkImageRepoStack(Stack): diff --git a/api/aws_infra/pyproject.toml b/api/aws_infra/pyproject.toml index 472770aa..0a17fd4a 100644 --- a/api/aws_infra/pyproject.toml +++ b/api/aws_infra/pyproject.toml @@ -14,7 +14,9 @@ dependencies = [ "click==8.1.*", # CDK requirements "aws-cdk-lib==2.*", - "constructs==10.*" + "constructs==10.*", + # PAVI shared AWS infra + "pavi_shared_aws_infra @ file:///tmp/pavi_shared_aws_infra-0.0.0-py3-none-any.whl" ] [project.optional-dependencies] diff --git a/api/aws_infra/requirements.txt b/api/aws_infra/requirements.txt index 5927af72..4e681183 100644 --- a/api/aws_infra/requirements.txt +++ b/api/aws_infra/requirements.txt @@ -25,14 +25,16 @@ aws-cdk-asset-node-proxy-agent-v6==2.0.3 \ aws-cdk-lib==2.146.0 \ --hash=sha256:4a4becc173d8b4fad35ba86c5d0b2f52e2c4ebe9e3dc08c9dd276fed3602f689 \ --hash=sha256:63e1c3084a49a001f1e6e5399af9b4ac6b1c3566b28a6b2e3f25e0d4c00df0af + # via + # api-aws_infra (pyproject.toml) + # pavi-shared-aws-infra +boto3==1.34.130 \ + --hash=sha256:b781d267dd5e7583966e05697f6bd45e2f46c01dc619ba0860b042963ee69296 \ + --hash=sha256:c163fb7135a94e7b8c8c478a44071c843f05e212fa4bec3105f8a437ecbf1bcb # via api-aws_infra (pyproject.toml) -boto3==1.34.129 \ - --hash=sha256:a7a696fd3e7f5f43a81450b441f3eb6c5a89d28efe867cd97d8fc73ea5d8c139 \ - --hash=sha256:cc73de1c9d953b1f9da6ee2404af717e93d888f790f3e0291b22d1b8489eb401 - # via api-aws_infra (pyproject.toml) -botocore==1.34.129 \ - --hash=sha256:7c56e25af6112d69c5d14a15b42f76ba7687687abc463a96ac5edca19c0a9c2d \ - --hash=sha256:86d3dd30996aa459e9c3321edac12aebe47c73cb4acc7556941f9b4c39726088 +botocore==1.34.130 \ + --hash=sha256:a242b3b0a836b14f308a309565cd63e88654cec238f9b73abbbd3c0526db4c81 \ + --hash=sha256:a3b36e9dac1ed31c4cb3a5c5e540a7d8a9b90ff1d17f87734e674154b41776d8 # via # boto3 # s3transfer @@ -50,6 +52,7 @@ constructs==10.3.0 \ # via # api-aws_infra (pyproject.toml) # aws-cdk-lib + # pavi-shared-aws-infra importlib-resources==6.4.0 \ --hash=sha256:50d10f043df931902d4194ea07ec57960f66a80449ff867bfe782b4c486ba78c \ --hash=sha256:cdb2b453b8046ca4e3798eb1d84f3cce1446a0e8e7b5ef4efb600f19fc398145 @@ -69,6 +72,9 @@ jsii==1.100.0 \ # aws-cdk-asset-node-proxy-agent-v6 # aws-cdk-lib # constructs +pavi-shared-aws-infra @ file:///tmp/pavi_shared_aws_infra-0.0.0-py3-none-any.whl \ + --hash=sha256:e84a4a121d0981d5c6a164db9690db054f3ee7a06fc97d689e10f29bd1ccad4a + # via api-aws_infra (pyproject.toml) publication==0.0.3 \ --hash=sha256:0248885351febc11d8a1098d5c8e3ab2dabcf3e8c0c96db1e17ecd12b53afbe6 \ --hash=sha256:68416a0de76dddcdd2930d1c8ef853a743cc96c82416c4e4d3b5d901c6276dc4 diff --git a/api/aws_infra/tests/requirements.txt b/api/aws_infra/tests/requirements.txt index 915666bd..321e0bce 100644 --- a/api/aws_infra/tests/requirements.txt +++ b/api/aws_infra/tests/requirements.txt @@ -25,24 +25,26 @@ aws-cdk-asset-node-proxy-agent-v6==2.0.3 \ aws-cdk-lib==2.146.0 \ --hash=sha256:4a4becc173d8b4fad35ba86c5d0b2f52e2c4ebe9e3dc08c9dd276fed3602f689 \ --hash=sha256:63e1c3084a49a001f1e6e5399af9b4ac6b1c3566b28a6b2e3f25e0d4c00df0af + # via + # api-aws_infra (pyproject.toml) + # pavi-shared-aws-infra +boto3==1.34.130 \ + --hash=sha256:b781d267dd5e7583966e05697f6bd45e2f46c01dc619ba0860b042963ee69296 \ + --hash=sha256:c163fb7135a94e7b8c8c478a44071c843f05e212fa4bec3105f8a437ecbf1bcb # via api-aws_infra (pyproject.toml) -boto3==1.34.129 \ - --hash=sha256:a7a696fd3e7f5f43a81450b441f3eb6c5a89d28efe867cd97d8fc73ea5d8c139 \ - --hash=sha256:cc73de1c9d953b1f9da6ee2404af717e93d888f790f3e0291b22d1b8489eb401 - # via api-aws_infra (pyproject.toml) -boto3-stubs==1.34.129 \ - --hash=sha256:0971e0b3394ee1a80e49f4dc2e8508dc9a878bf91b34d95bb31e8cc3409d16f9 \ - --hash=sha256:f9099d3a013b0a8c9b0fef478a91e27dcc208211bc0f3c3aaf9e420b990752b7 +boto3-stubs==1.34.130 \ + --hash=sha256:1c2d39aed76ea65845d1c1fd659209c2f9f9febf9e2b25f1b63920dea5e6d47e \ + --hash=sha256:3691001730844fa64a2f53632bd476af1331a321f2f168833da5ae65fa6d3253 # via api-aws_infra (pyproject.toml) -botocore==1.34.129 \ - --hash=sha256:7c56e25af6112d69c5d14a15b42f76ba7687687abc463a96ac5edca19c0a9c2d \ - --hash=sha256:86d3dd30996aa459e9c3321edac12aebe47c73cb4acc7556941f9b4c39726088 +botocore==1.34.130 \ + --hash=sha256:a242b3b0a836b14f308a309565cd63e88654cec238f9b73abbbd3c0526db4c81 \ + --hash=sha256:a3b36e9dac1ed31c4cb3a5c5e540a7d8a9b90ff1d17f87734e674154b41776d8 # via # boto3 # s3transfer -botocore-stubs==1.34.129 \ - --hash=sha256:51bfcd000d9b69f164b9c64c6215189afc7a8609bc263f939abd10704cda87a4 \ - --hash=sha256:abb72262ff8ecb6a39215a51df81c885d2558211138f7fc7ab3e00f56e596367 +botocore-stubs==1.34.130 \ + --hash=sha256:96a7946db5093bc3f16e407ee8e334bb62ea52a2adcd00b4d09006ae1cbc0050 \ + --hash=sha256:f923640dfaf63c7c9d13eb84ae5bacf6447739a6f5f88d450b87db0d3a1a04d9 # via boto3-stubs cattrs==23.2.3 \ --hash=sha256:0341994d94971052e9ee70662542699a3162ea1e0c62f7ce1b4a57f563685108 \ @@ -58,6 +60,7 @@ constructs==10.3.0 \ # via # api-aws_infra (pyproject.toml) # aws-cdk-lib + # pavi-shared-aws-infra flake8==7.0.0 \ --hash=sha256:33f96621059e65eec474169085dc92bf26e7b2d47366b70be2f67ab80dc25132 \ --hash=sha256:a6dfbb75e03252917f2473ea9653f7cd799c3064e54d4c8140044c5c065f53c3 @@ -126,6 +129,9 @@ packaging==24.1 \ --hash=sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002 \ --hash=sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124 # via pytest +pavi-shared-aws-infra @ file:///tmp/pavi_shared_aws_infra-0.0.0-py3-none-any.whl \ + --hash=sha256:e84a4a121d0981d5c6a164db9690db054f3ee7a06fc97d689e10f29bd1ccad4a + # via api-aws_infra (pyproject.toml) pluggy==1.5.0 \ --hash=sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1 \ --hash=sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669 diff --git a/api/aws_infra/tests/unit/test_cdk_application_stack.py b/api/aws_infra/tests/unit/test_cdk_application_stack.py index a4a55f16..5dc7a311 100644 --- a/api/aws_infra/tests/unit/test_cdk_application_stack.py +++ b/api/aws_infra/tests/unit/test_cdk_application_stack.py @@ -10,15 +10,7 @@ from cdk_classes.application_stack import EBApplicationCdkStack, EbEnvironmentCdkStack -from pathlib import Path -from sys import path as sys_path - -print(__file__) -repo_root_path = Path(__file__).parent.parent.parent.parent.parent -print(repo_root_path) -sys_path.append(str(repo_root_path)) - -from shared_aws_infra.agr_aws_env import agr_aws_environment # noqa: E402 +from pavi_shared_aws_infra.agr_aws_env import agr_aws_environment app = App() eb_app_stack = EBApplicationCdkStack(app, "pytest-api-EB-Application-stack", env=agr_aws_environment) diff --git a/api/aws_infra/tests/unit/test_cdk_image_repo_stack.py b/api/aws_infra/tests/unit/test_cdk_image_repo_stack.py index ef481d17..48e85594 100644 --- a/api/aws_infra/tests/unit/test_cdk_image_repo_stack.py +++ b/api/aws_infra/tests/unit/test_cdk_image_repo_stack.py @@ -10,13 +10,7 @@ from cdk_classes.image_repo_stack import CdkImageRepoStack -from pathlib import Path -from sys import path as sys_path - -repo_root_path = Path(__file__).parent.parent.parent.parent.parent -sys_path.append(str(repo_root_path)) - -from shared_aws_infra.agr_aws_env import agr_aws_environment # noqa: E402 +from pavi_shared_aws_infra.agr_aws_env import agr_aws_environment app = App() stack = CdkImageRepoStack(app, "pytest-stack", env=agr_aws_environment) diff --git a/api/requirements.txt b/api/requirements.txt index 6644279d..2c4ed20f 100644 --- a/api/requirements.txt +++ b/api/requirements.txt @@ -15,13 +15,13 @@ anyio==4.4.0 \ # httpx # starlette # watchfiles -boto3==1.34.129 \ - --hash=sha256:a7a696fd3e7f5f43a81450b441f3eb6c5a89d28efe867cd97d8fc73ea5d8c139 \ - --hash=sha256:cc73de1c9d953b1f9da6ee2404af717e93d888f790f3e0291b22d1b8489eb401 +boto3==1.34.130 \ + --hash=sha256:b781d267dd5e7583966e05697f6bd45e2f46c01dc619ba0860b042963ee69296 \ + --hash=sha256:c163fb7135a94e7b8c8c478a44071c843f05e212fa4bec3105f8a437ecbf1bcb # via smart-open -botocore==1.34.129 \ - --hash=sha256:7c56e25af6112d69c5d14a15b42f76ba7687687abc463a96ac5edca19c0a9c2d \ - --hash=sha256:86d3dd30996aa459e9c3321edac12aebe47c73cb4acc7556941f9b4c39726088 +botocore==1.34.130 \ + --hash=sha256:a242b3b0a836b14f308a309565cd63e88654cec238f9b73abbbd3c0526db4c81 \ + --hash=sha256:a3b36e9dac1ed31c4cb3a5c5e540a7d8a9b90ff1d17f87734e674154b41776d8 # via # boto3 # s3transfer diff --git a/api/tests/requirements.txt b/api/tests/requirements.txt index 5109a93d..dd422e08 100644 --- a/api/tests/requirements.txt +++ b/api/tests/requirements.txt @@ -15,13 +15,13 @@ anyio==4.4.0 \ # httpx # starlette # watchfiles -boto3==1.34.129 \ - --hash=sha256:a7a696fd3e7f5f43a81450b441f3eb6c5a89d28efe867cd97d8fc73ea5d8c139 \ - --hash=sha256:cc73de1c9d953b1f9da6ee2404af717e93d888f790f3e0291b22d1b8489eb401 +boto3==1.34.130 \ + --hash=sha256:b781d267dd5e7583966e05697f6bd45e2f46c01dc619ba0860b042963ee69296 \ + --hash=sha256:c163fb7135a94e7b8c8c478a44071c843f05e212fa4bec3105f8a437ecbf1bcb # via smart-open -botocore==1.34.129 \ - --hash=sha256:7c56e25af6112d69c5d14a15b42f76ba7687687abc463a96ac5edca19c0a9c2d \ - --hash=sha256:86d3dd30996aa459e9c3321edac12aebe47c73cb4acc7556941f9b4c39726088 +botocore==1.34.130 \ + --hash=sha256:a242b3b0a836b14f308a309565cd63e88654cec238f9b73abbbd3c0526db4c81 \ + --hash=sha256:a3b36e9dac1ed31c4cb3a5c5e540a7d8a9b90ff1d17f87734e674154b41776d8 # via # boto3 # s3transfer diff --git a/pipeline/aws_infra/Makefile b/pipeline/aws_infra/Makefile index abe3dd08..9f7a64a3 100644 --- a/pipeline/aws_infra/Makefile +++ b/pipeline/aws_infra/Makefile @@ -37,28 +37,28 @@ requirements.txt: tests/requirements.txt: pip-compile --generate-hashes --no-strip-extras --extra=test -o tests/requirements.txt -deps-lock-update: +update-deps-lock: pip-compile --generate-hashes --no-strip-extras --upgrade -o requirements.txt -test-deps-lock-update: +update-test-deps-lock: pip-compile --generate-hashes --no-strip-extras --extra=test --upgrade -o tests/requirements.txt -deps: requirements.txt +install-deps: requirements.txt pip install -r requirements.txt -test-deps: tests/requirements.txt +install-test-deps: tests/requirements.txt pip install -r tests/requirements.txt -run-unit-tests: check-node test-deps +run-unit-tests: check-node install-test-deps python -m pytest run-unit-tests-dev: check-venv-active run-unit-tests @: -run-type-checks: test-deps +run-type-checks: install-test-deps mypy --install-types --non-interactive --warn-unused-config ./ -run-style-checks: test-deps +run-style-checks: install-test-deps flake8 ./ validate: check-node run-unit-tests diff --git a/pipeline/aws_infra/cdk_app.py b/pipeline/aws_infra/cdk_app.py index fdb60209..5a999808 100644 --- a/pipeline/aws_infra/cdk_app.py +++ b/pipeline/aws_infra/cdk_app.py @@ -1,15 +1,9 @@ #!/usr/bin/env python3 from aws_cdk import App -from pathlib import Path -from sys import path as sys_path - from cdk_classes.cdk_infra_stack import CdkInfraStack -repo_root_path = Path(__file__).parent.parent.parent.parent -sys_path.append(str(repo_root_path)) - -from shared_aws_infra.agr_aws_env import agr_aws_environment # noqa: E402 +from pavi_shared_aws_infra.agr_aws_env import agr_aws_environment app = App() diff --git a/pipeline/aws_infra/cdk_classes/cdk_infra_stack.py b/pipeline/aws_infra/cdk_classes/cdk_infra_stack.py index 6b5bfdaf..6dc6be87 100644 --- a/pipeline/aws_infra/cdk_classes/cdk_infra_stack.py +++ b/pipeline/aws_infra/cdk_classes/cdk_infra_stack.py @@ -6,15 +6,10 @@ from constructs import Construct -from pathlib import Path -from sys import path as sys_path from typing import Any, Optional -repo_root_path = Path(__file__).parent.parent.parent.parent -sys_path.append(str(repo_root_path)) - -from shared_aws_infra.shared_cdk_classes.pavi_ecr_repo import PaviEcrRepository # noqa: E402 -from cdk_classes.aws_batch import PaviExecutionEnvironment # noqa: E402 +from pavi_shared_aws_infra.shared_cdk_classes.pavi_ecr_repo import PaviEcrRepository +from cdk_classes.aws_batch import PaviExecutionEnvironment class CdkInfraStack(Stack): diff --git a/pipeline/aws_infra/pyproject.toml b/pipeline/aws_infra/pyproject.toml index 5c0fbdff..75614095 100644 --- a/pipeline/aws_infra/pyproject.toml +++ b/pipeline/aws_infra/pyproject.toml @@ -9,8 +9,11 @@ authors = [ requires-python = "==3.12.*" dependencies = [ + # CDK requirements "aws-cdk-lib==2.*", - "constructs==10.*" + "constructs==10.*", + # PAVI shared AWS infra + "pavi_shared_aws_infra @ file:///tmp/pavi_shared_aws_infra-0.0.0-py3-none-any.whl" ] [project.optional-dependencies] diff --git a/pipeline/aws_infra/requirements.txt b/pipeline/aws_infra/requirements.txt index 58c69a31..12de6815 100644 --- a/pipeline/aws_infra/requirements.txt +++ b/pipeline/aws_infra/requirements.txt @@ -25,7 +25,9 @@ aws-cdk-asset-node-proxy-agent-v6==2.0.3 \ aws-cdk-lib==2.146.0 \ --hash=sha256:4a4becc173d8b4fad35ba86c5d0b2f52e2c4ebe9e3dc08c9dd276fed3602f689 \ --hash=sha256:63e1c3084a49a001f1e6e5399af9b4ac6b1c3566b28a6b2e3f25e0d4c00df0af - # via pipeline-aws_infra (pyproject.toml) + # via + # pavi-shared-aws-infra + # pipeline-aws_infra (pyproject.toml) cattrs==23.2.3 \ --hash=sha256:0341994d94971052e9ee70662542699a3162ea1e0c62f7ce1b4a57f563685108 \ --hash=sha256:a934090d95abaa9e911dac357e3a8699e0b4b14f8529bcc7d2b1ad9d51672b9f @@ -35,6 +37,7 @@ constructs==10.3.0 \ --hash=sha256:518551135ec236f9cc6b86500f4fbbe83b803ccdc6c2cb7684e0b7c4d234e7b1 # via # aws-cdk-lib + # pavi-shared-aws-infra # pipeline-aws_infra (pyproject.toml) importlib-resources==6.4.0 \ --hash=sha256:50d10f043df931902d4194ea07ec57960f66a80449ff867bfe782b4c486ba78c \ @@ -49,6 +52,9 @@ jsii==1.100.0 \ # aws-cdk-asset-node-proxy-agent-v6 # aws-cdk-lib # constructs +pavi-shared-aws-infra @ file:///tmp/pavi_shared_aws_infra-0.0.0-py3-none-any.whl \ + --hash=sha256:e84a4a121d0981d5c6a164db9690db054f3ee7a06fc97d689e10f29bd1ccad4a + # via pipeline-aws_infra (pyproject.toml) publication==0.0.3 \ --hash=sha256:0248885351febc11d8a1098d5c8e3ab2dabcf3e8c0c96db1e17ecd12b53afbe6 \ --hash=sha256:68416a0de76dddcdd2930d1c8ef853a743cc96c82416c4e4d3b5d901c6276dc4 diff --git a/pipeline/aws_infra/tests/requirements.txt b/pipeline/aws_infra/tests/requirements.txt index 626d86a1..5275c7f7 100644 --- a/pipeline/aws_infra/tests/requirements.txt +++ b/pipeline/aws_infra/tests/requirements.txt @@ -25,7 +25,9 @@ aws-cdk-asset-node-proxy-agent-v6==2.0.3 \ aws-cdk-lib==2.146.0 \ --hash=sha256:4a4becc173d8b4fad35ba86c5d0b2f52e2c4ebe9e3dc08c9dd276fed3602f689 \ --hash=sha256:63e1c3084a49a001f1e6e5399af9b4ac6b1c3566b28a6b2e3f25e0d4c00df0af - # via pipeline-aws_infra (pyproject.toml) + # via + # pavi-shared-aws-infra + # pipeline-aws_infra (pyproject.toml) cattrs==23.2.3 \ --hash=sha256:0341994d94971052e9ee70662542699a3162ea1e0c62f7ce1b4a57f563685108 \ --hash=sha256:a934090d95abaa9e911dac357e3a8699e0b4b14f8529bcc7d2b1ad9d51672b9f @@ -35,6 +37,7 @@ constructs==10.3.0 \ --hash=sha256:518551135ec236f9cc6b86500f4fbbe83b803ccdc6c2cb7684e0b7c4d234e7b1 # via # aws-cdk-lib + # pavi-shared-aws-infra # pipeline-aws_infra (pyproject.toml) flake8==7.0.0 \ --hash=sha256:33f96621059e65eec474169085dc92bf26e7b2d47366b70be2f67ab80dc25132 \ @@ -98,6 +101,9 @@ packaging==24.1 \ --hash=sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002 \ --hash=sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124 # via pytest +pavi-shared-aws-infra @ file:///tmp/pavi_shared_aws_infra-0.0.0-py3-none-any.whl \ + --hash=sha256:e84a4a121d0981d5c6a164db9690db054f3ee7a06fc97d689e10f29bd1ccad4a + # via pipeline-aws_infra (pyproject.toml) pluggy==1.5.0 \ --hash=sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1 \ --hash=sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669 diff --git a/pipeline/aws_infra/tests/unit/test_cdk_infra_stack.py b/pipeline/aws_infra/tests/unit/test_cdk_infra_stack.py index 9fa433f9..de3bb66e 100644 --- a/pipeline/aws_infra/tests/unit/test_cdk_infra_stack.py +++ b/pipeline/aws_infra/tests/unit/test_cdk_infra_stack.py @@ -10,13 +10,7 @@ from cdk_classes.cdk_infra_stack import CdkInfraStack -from pathlib import Path -from sys import path as sys_path - -repo_root_path = Path(__file__).parent.parent.parent.parent -sys_path.append(str(repo_root_path)) - -from shared_aws_infra.agr_aws_env import agr_aws_environment # noqa: E402 +from pavi_shared_aws_infra.agr_aws_env import agr_aws_environment app = App() stack = CdkInfraStack(app, "pytest-stack", env=agr_aws_environment) diff --git a/pipeline/seq_retrieval/Dockerfile b/pipeline/seq_retrieval/Dockerfile index cdeb0a2f..0531ef17 100644 --- a/pipeline/seq_retrieval/Dockerfile +++ b/pipeline/seq_retrieval/Dockerfile @@ -12,7 +12,7 @@ RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2 rm -rf ./aws/ COPY Makefile pyproject.toml requirements.txt ./ -RUN make deps +RUN make install-deps COPY src/ ./ RUN chmod a+x main.py diff --git a/pipeline/seq_retrieval/Makefile b/pipeline/seq_retrieval/Makefile index 3bf33320..a79322cc 100644 --- a/pipeline/seq_retrieval/Makefile +++ b/pipeline/seq_retrieval/Makefile @@ -38,31 +38,31 @@ requirements.txt: tests/requirements.txt: pip-compile --generate-hashes --no-strip-extras --extra=test -o tests/requirements.txt -deps: requirements.txt +install-deps: requirements.txt pip install -r requirements.txt -deps-update: +install-deps-update: pip install -U -r requirements.txt -deps-lock-update: +update-deps-lock: pip-compile --generate-hashes --no-strip-extras --upgrade -o requirements.txt -test-deps: tests/requirements.txt +install-test-deps: tests/requirements.txt pip install -r tests/requirements.txt -test-deps-lock-update: +update-test-deps-lock: pip-compile --generate-hashes --no-strip-extras --extra=test --upgrade -o tests/requirements.txt -run-type-checks: test-deps +run-type-checks: install-test-deps mypy --install-types --non-interactive --warn-unused-config ./ -run-style-checks: test-deps +run-style-checks: install-test-deps flake8 ./ -run-unit-tests: test-deps +run-unit-tests: install-test-deps python -m pytest --cov --cov-fail-under=80 -run-unit-tests-dev: test-deps +run-unit-tests-dev: install-test-deps python -m pytest --cov --cov-fail-under=80 --cov-report html -v run-code-checks: run-type-checks run-style-checks run-unit-tests @@ -79,9 +79,9 @@ else @: endif -deps-dev: check-venv-active deps +install-deps-dev: check-venv-active install-deps -deps-dev-update: check-venv-active deps-update +install-deps-dev-update: check-venv-active deps-update run-type-checks-dev: check-venv-active run-type-checks diff --git a/shared_aws_infra/Makefile b/shared_aws_infra/Makefile index 1b474312..9fe71903 100644 --- a/shared_aws_infra/Makefile +++ b/shared_aws_infra/Makefile @@ -1,9 +1,27 @@ -.PHONY: check-venv-active check-node pip-tools +.PHONY: check-venv-active check-node pip-tools clean install SUPPORTED_NODE := ^v18\. .venv/: python3.12 -m venv .venv/ +build: + pip install build==1.* +# Setting SOURCE_DATE_EPOCH to commit date, +# so that build produces whl with reproducable hash given same source-code +# ,resulting in reproducable builds that don't result in hash mismatches on rebuild +#TODO: figure out why this worked and then suddenly broke? Individual commands work but make run does not? $(shell ...)? + REF=$$(git log -n 1 --format=%H ./) && \ + export SOURCE_DATE_EPOCH=$$(git show --no-patch --format=%ct $$REF) && \ + echo $$SOURCE_DATE_EPOCH && \ + python3.12 -m build + +install: + cp dist/pavi_shared_aws_infra-0.0.0-py3-none-any.whl /tmp/ + +clean: + rm -rf build/ || true + rm dist/* || true + check-venv-active: ifeq ($(VIRTUAL_ENV),) @echo 'No active python virtual environment found.'\ @@ -33,23 +51,23 @@ requirements.txt: tests/requirements.txt: pip-compile --generate-hashes --no-strip-extras --extra=test -o tests/requirements.txt -deps-lock-update: +update-deps-lock: pip-compile --generate-hashes --no-strip-extras --upgrade -o requirements.txt -test-deps-lock-update: +update-test-deps-lock: pip-compile --generate-hashes --no-strip-extras --extra=test --upgrade -o tests/requirements.txt -deps: requirements.txt +install-deps: requirements.txt pip install -r requirements.txt -test-deps: tests/requirements.txt +install-test-deps: tests/requirements.txt pip install -r tests/requirements.txt -run-unit-tests: check-node test-deps +run-unit-tests: check-node install-test-deps python -m pytest -run-type-checks: test-deps +run-type-checks: install-test-deps mypy --install-types --non-interactive --warn-unused-config ./ -run-style-checks: test-deps +run-style-checks: install-test-deps flake8 ./ diff --git a/shared_aws_infra/README.md b/shared_aws_infra/README.md new file mode 100644 index 00000000..91af3605 --- /dev/null +++ b/shared_aws_infra/README.md @@ -0,0 +1,33 @@ +# About +This subdirectory contains a python package that is built and included in the AWS-infra code of all subcomponents of PAVI. +The source code of the python package is located in the `pavi_shared_aws_infra` subdirectory. + +# Build and install +To allow this package to be included in AWS-infra of subcomponents during local development, +build and install the shared AWS infra package with the following command(s): +```bash +make clean build install +``` +This will build the package and copy the `.whl` file to `/tmp/`, where subcomponents depending on it will search for it. +This "install" procedure is adopted because `pyproject.toml` file standards do not support dependency specifications containing +relative paths at current (2024/06/19). + +This package is built and installed ad-hoc, meaning it is built and installed every time it is needed, +and is not versioned, released or deployed independently. + +In order to ensure that package builds are reproducible and result in the same hash when the source did not change, +the `build` target sets the `SOURCE_DATE_EPOCH` variable to the date of the last commit made on this subdirectory before building. +This ensures the source date does not change every time a build is run, which makes the build more reproducable +(multiple builds from the same commit will always result in the same hash). +**Note:** A consequence of this is that the hash of the `pavi_shared_aws_infra` package will change when you build from uncommitted changes +vs when you commit those changes first and then build the package. +Before updating dependency files of other PAVI components to include a new version of this package, +always commit changes to this directory first, before building the package and including the updated hash in other component's dependency lists. + +Additionally, this package is versioned as 0.0.0 to indicate this ad-hoc build process. +The consequence of this fixed version is that when you need to update this package to a newer "version" +after having installed it in subcomponents through pip earlier, pip will refuse to update because the version did not change but the hash did. +Uninstall the package first in order to fix this (without needing to force-reinstall all dependencies): +```bash +pip uninstall pavi_shared_aws_infra +``` diff --git a/shared_aws_infra/__init__.py b/shared_aws_infra/pavi_shared_aws_infra/__init__.py similarity index 100% rename from shared_aws_infra/__init__.py rename to shared_aws_infra/pavi_shared_aws_infra/__init__.py diff --git a/shared_aws_infra/agr_aws_env.py b/shared_aws_infra/pavi_shared_aws_infra/agr_aws_env.py similarity index 100% rename from shared_aws_infra/agr_aws_env.py rename to shared_aws_infra/pavi_shared_aws_infra/agr_aws_env.py diff --git a/shared_aws_infra/pavi_shared_aws_infra/py.typed b/shared_aws_infra/pavi_shared_aws_infra/py.typed new file mode 100644 index 00000000..e69de29b diff --git a/shared_aws_infra/pavi_shared_aws_infra/shared_cdk_classes/__init__.py b/shared_aws_infra/pavi_shared_aws_infra/shared_cdk_classes/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/shared_aws_infra/shared_cdk_classes/pavi_ecr_repo.py b/shared_aws_infra/pavi_shared_aws_infra/shared_cdk_classes/pavi_ecr_repo.py similarity index 100% rename from shared_aws_infra/shared_cdk_classes/pavi_ecr_repo.py rename to shared_aws_infra/pavi_shared_aws_infra/shared_cdk_classes/pavi_ecr_repo.py diff --git a/shared_aws_infra/pyproject.toml b/shared_aws_infra/pyproject.toml index 65d060b8..90c4f7de 100644 --- a/shared_aws_infra/pyproject.toml +++ b/shared_aws_infra/pyproject.toml @@ -1,6 +1,6 @@ [project] -name = "shared_aws_infra" -version = "0.1.0" +name = "pavi_shared_aws_infra" +version = "0.0.0" description = "PAVI shared AWS resource definitions" authors = [ {name = "Manuel Luypaert", email = "luypaert@ebi.ac.uk"} @@ -18,3 +18,7 @@ test = [ "mypy==1.10.*", "pytest==8.2.*" ] + +[build-system] +requires = ["setuptools >= 61.0"] +build-backend = "setuptools.build_meta" diff --git a/shared_aws_infra/requirements.txt b/shared_aws_infra/requirements.txt index 11c88d7a..a3f5344c 100644 --- a/shared_aws_infra/requirements.txt +++ b/shared_aws_infra/requirements.txt @@ -25,7 +25,7 @@ aws-cdk-asset-node-proxy-agent-v6==2.0.3 \ aws-cdk-lib==2.146.0 \ --hash=sha256:4a4becc173d8b4fad35ba86c5d0b2f52e2c4ebe9e3dc08c9dd276fed3602f689 \ --hash=sha256:63e1c3084a49a001f1e6e5399af9b4ac6b1c3566b28a6b2e3f25e0d4c00df0af - # via shared_aws_infra (pyproject.toml) + # via pavi_shared_aws_infra (pyproject.toml) cattrs==23.2.3 \ --hash=sha256:0341994d94971052e9ee70662542699a3162ea1e0c62f7ce1b4a57f563685108 \ --hash=sha256:a934090d95abaa9e911dac357e3a8699e0b4b14f8529bcc7d2b1ad9d51672b9f @@ -35,7 +35,7 @@ constructs==10.3.0 \ --hash=sha256:518551135ec236f9cc6b86500f4fbbe83b803ccdc6c2cb7684e0b7c4d234e7b1 # via # aws-cdk-lib - # shared_aws_infra (pyproject.toml) + # pavi_shared_aws_infra (pyproject.toml) importlib-resources==6.4.0 \ --hash=sha256:50d10f043df931902d4194ea07ec57960f66a80449ff867bfe782b4c486ba78c \ --hash=sha256:cdb2b453b8046ca4e3798eb1d84f3cce1446a0e8e7b5ef4efb600f19fc398145 diff --git a/shared_aws_infra/tests/requirements.txt b/shared_aws_infra/tests/requirements.txt index 6c3989c2..913b1f47 100644 --- a/shared_aws_infra/tests/requirements.txt +++ b/shared_aws_infra/tests/requirements.txt @@ -25,7 +25,7 @@ aws-cdk-asset-node-proxy-agent-v6==2.0.3 \ aws-cdk-lib==2.146.0 \ --hash=sha256:4a4becc173d8b4fad35ba86c5d0b2f52e2c4ebe9e3dc08c9dd276fed3602f689 \ --hash=sha256:63e1c3084a49a001f1e6e5399af9b4ac6b1c3566b28a6b2e3f25e0d4c00df0af - # via shared_aws_infra (pyproject.toml) + # via pavi_shared_aws_infra (pyproject.toml) cattrs==23.2.3 \ --hash=sha256:0341994d94971052e9ee70662542699a3162ea1e0c62f7ce1b4a57f563685108 \ --hash=sha256:a934090d95abaa9e911dac357e3a8699e0b4b14f8529bcc7d2b1ad9d51672b9f @@ -35,11 +35,11 @@ constructs==10.3.0 \ --hash=sha256:518551135ec236f9cc6b86500f4fbbe83b803ccdc6c2cb7684e0b7c4d234e7b1 # via # aws-cdk-lib - # shared_aws_infra (pyproject.toml) + # pavi_shared_aws_infra (pyproject.toml) flake8==7.0.0 \ --hash=sha256:33f96621059e65eec474169085dc92bf26e7b2d47366b70be2f67ab80dc25132 \ --hash=sha256:a6dfbb75e03252917f2473ea9653f7cd799c3064e54d4c8140044c5c065f53c3 - # via shared_aws_infra (pyproject.toml) + # via pavi_shared_aws_infra (pyproject.toml) importlib-resources==6.4.0 \ --hash=sha256:50d10f043df931902d4194ea07ec57960f66a80449ff867bfe782b4c486ba78c \ --hash=sha256:cdb2b453b8046ca4e3798eb1d84f3cce1446a0e8e7b5ef4efb600f19fc398145 @@ -89,7 +89,7 @@ mypy==1.10.0 \ --hash=sha256:f90cff89eea89273727d8783fef5d4a934be2fdca11b47def50cf5d311aff727 \ --hash=sha256:fa7ef5244615a2523b56c034becde4e9e3f9b034854c93639adb667ec9ec2976 \ --hash=sha256:fcfc70599efde5c67862a07a1aaf50e55bce629ace26bb19dc17cece5dd31ca4 - # via shared_aws_infra (pyproject.toml) + # via pavi_shared_aws_infra (pyproject.toml) mypy-extensions==1.0.0 \ --hash=sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d \ --hash=sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782 @@ -123,7 +123,7 @@ pyflakes==3.2.0 \ pytest==8.2.2 \ --hash=sha256:c434598117762e2bd304e526244f67bf66bbd7b5d6cf22138be51ff661980343 \ --hash=sha256:de4bb8104e201939ccdc688b27a89a7be2079b22e2bd2b07f806b6ba71117977 - # via shared_aws_infra (pyproject.toml) + # via pavi_shared_aws_infra (pyproject.toml) python-dateutil==2.9.0.post0 \ --hash=sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3 \ --hash=sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427 diff --git a/shared_aws_infra/tests/unit/test_shared_cdk_classes.py b/shared_aws_infra/tests/unit/test_shared_cdk_classes.py index 5efaecb2..6dec4c79 100644 --- a/shared_aws_infra/tests/unit/test_shared_cdk_classes.py +++ b/shared_aws_infra/tests/unit/test_shared_cdk_classes.py @@ -13,8 +13,8 @@ from aws_cdk.aws_config import ResourceType import aws_cdk.assertions as assertions -from shared_cdk_classes.pavi_ecr_repo import PaviEcrRepository -from agr_aws_env import agr_aws_environment +from pavi_shared_aws_infra.shared_cdk_classes.pavi_ecr_repo import PaviEcrRepository +from pavi_shared_aws_infra.agr_aws_env import agr_aws_environment from typing import Any diff --git a/webui/Makefile b/webui/Makefile index 35c90c3f..9464bafa 100644 --- a/webui/Makefile +++ b/webui/Makefile @@ -21,22 +21,22 @@ endif container-image: docker build ${ADDITIONAL_BUILD_ARGS} -t ${CONTAINER_NAME} . -deps: check-node +install-deps: check-node npm install -deps-lock-update: check-node +update-deps-lock: check-node npm update --package-lock-only run-container-dev: @export PAVI_API_BASE_URL=${PAVI_API_BASE_URL} && \ docker-compose -f docker-compose-dev.yml --env-file dev.env up agr.pavi.dev-local.webui -run-server-dev: check-node deps +run-server-dev: check-node install-deps @export PAVI_API_BASE_URL=${PAVI_API_BASE_URL} && \ npm run dev -run-style-checks: check-node deps +run-style-checks: check-node install-deps npm run lint -run-type-checks: check-node deps +run-type-checks: check-node install-deps npm run typecheck