From 946278b85177fca37c064f3c517eee7130f2c04d Mon Sep 17 00:00:00 2001 From: Drew Perttula Date: Wed, 7 Aug 2024 13:45:26 -0700 Subject: [PATCH 1/2] Dockerfile: reduce trips to github.com; take advantage of WORKDIR No functionality changes expected. --- docker/Dockerfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 5f8c3fe..9231e64 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -14,18 +14,18 @@ RUN apt update RUN apt install --yes graphviz ${EXTRA_DEBIAN_PACKAGES} # Store a list of all installed packages. Aeromancy will include this as # metadata for each task. -RUN dpkg-query -f '${binary:Package}=${Version}\n' -W > /base/packages_list.txt +RUN dpkg-query -f '${binary:Package}=${Version}\n' -W > ./packages_list.txt # Set up Python environment with pdm. RUN pip3 install pdm -# pdm needs to see README.md and src/ (can be empty) to validate the project. -COPY --from=project pyproject.toml pdm.lock README.md /base/ -RUN mkdir /base/src - # To access private repos on GitHub, we need to add it as a known host. RUN mkdir -p -m 0700 ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts +# pdm needs to see README.md and src/ (can be empty) to validate the project. +COPY --from=project pyproject.toml pdm.lock README.md ./ +RUN mkdir ./src + # --mount=type=ssh allows us to use forwarded SSH authentication. # --no-self since we haven't copied our project-specific code here yet (we do # that last since it's the most variable step and should help keep image build @@ -35,4 +35,4 @@ RUN --mount=type=ssh pdm install --prod --no-self # Include Python code. # Note that `project` must be mapped as a build context: # https://docs.docker.com/engine/reference/commandline/buildx_build/#build-context -COPY --from=project ./src/ /base/src/ +COPY --from=project ./src/ ./src/ From 6a2314d0d882be5e6f656e1bd29fd62c80b9abb0 Mon Sep 17 00:00:00 2001 From: David McClosky Date: Thu, 8 Aug 2024 16:22:28 -0400 Subject: [PATCH 2/2] Update runner to use (upcoming) released version for Docker --- src/aeromancy/runner.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/aeromancy/runner.py b/src/aeromancy/runner.py index 059946b..5ad58f2 100644 --- a/src/aeromancy/runner.py +++ b/src/aeromancy/runner.py @@ -6,6 +6,7 @@ You shouldn't ever need to run or call this directly -- the "pdm go" pdm script should be setup in pyproject.toml. """ + import os import subprocess import sys @@ -110,7 +111,7 @@ def build_docker( ( "--tag", docker_tag, - "https://github.com/quant-aq/aeromancy.git#v0.1.0:docker", + "https://github.com/quant-aq/aeromancy.git#v0.2.2:docker", ), ) docker_command = " ".join(docker_commmand_pieces)