diff --git a/.github/workflows/aws-ecs-deploy-backend.yml b/.github/workflows/aws-ecs-deploy-backend.yml index 149f56412..9cbd865ae 100644 --- a/.github/workflows/aws-ecs-deploy-backend.yml +++ b/.github/workflows/aws-ecs-deploy-backend.yml @@ -57,6 +57,17 @@ jobs: runs-on: ubuntu-latest needs: [setup_env] steps: + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.13' + cache: 'pip' + cache-dependency-path: | + **/requirements*.txt + - name: Identify pip cache directory + id: vars + run: | + echo "pip-dir=$(pip3 cache dir)" >> $GITHUB_OUTPUT - name: Checkout uses: actions/checkout@v4 with: @@ -79,6 +90,7 @@ jobs: uses: docker/build-push-action@v6 with: context: ${{ env.DOCKER_PATH }} + build-contexts: pip_cache=${{steps.vars.outputs.pip-dir}} file: ${{ env.DOCKERFILE }} platforms: ${{ env.PLATFORMS }} push: true diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index e9aa43c34..63f8c120e 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -24,7 +24,10 @@ jobs: - name: Python 3.13 Setup uses: actions/setup-python@v5 with: - python-version: 3.13 + python-version: '3.13' + cache: 'pip' + cache-dependency-path: | + **/requirements*.txt - name: Install dependencies run: | sudo apt-get update diff --git a/backend/Dockerfile b/backend/Dockerfile index b2400dc2b..811f91794 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -23,11 +23,11 @@ WORKDIR /app/ ARG NPDI_API_PORT=5000 -RUN pip3 install --upgrade pip +RUN --mount=type=cache,target=/root/.cache/pip,from=pip_cache pip3 install --upgrade pip COPY requirements/ requirements/ -RUN pip3 install -r requirements/dev_unix.txt +RUN --mount=type=cache,target=/root/.cache/pip,from=pip_cache pip3 install -r requirements/dev_unix.txt COPY . . ENV PORT=$NPDI_API_PORT diff --git a/requirements/_core.in b/requirements/_core.in index d0bb7ffc0..bbc33d676 100644 --- a/requirements/_core.in +++ b/requirements/_core.in @@ -34,3 +34,4 @@ ua-parser ujson neo4j neomodel==5.3.3 +pyzmq==26.2.1 \ No newline at end of file diff --git a/requirements/dev_unix.txt b/requirements/dev_unix.txt index 97f94df75..792519740 100644 --- a/requirements/dev_unix.txt +++ b/requirements/dev_unix.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.12 +# This file is autogenerated by pip-compile with Python 3.13 # by the following command: # # pip-compile requirements/dev_unix.in @@ -58,9 +58,7 @@ certifi==2024.2.2 # httpx # requests cffi==1.16.0 - # via - # argon2-cffi-bindings - # bcrypt + # via argon2-cffi-bindings charset-normalizer==3.3.2 # via requests click==8.1.7 @@ -379,8 +377,9 @@ pyyaml==6.0.1 # via # -r requirements/_core.in # jupyter-events -pyzmq==25.1.2 +pyzmq==26.2.1 # via + # -r requirements/_core.in # ipykernel # jupyter-client # jupyter-console