From da3e9b17c19ba85f2cb15213061e080dc8545f90 Mon Sep 17 00:00:00 2001 From: davemfish Date: Mon, 22 Apr 2024 12:48:01 -0400 Subject: [PATCH 1/4] define the python version for the conda env to match the debian system python. #1560 --- docker/Dockerfile | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index ab38b0a139..bde10338c6 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -13,14 +13,21 @@ RUN cd / && \ # Create the container for distribution that has runtime dependencies. FROM mambaorg/micromamba:1.5.0-bookworm-slim + +# Python version should match the version used in stage 1. +# If we update the stage 1 debian version, also update this python version +ARG PYTHON_VERSION="3.11" + COPY --from=build /invest/dist/*.whl /tmp/ # The environment.yml file will be built during github actions. COPY --chown=$MAMBA_USER:$MAMBA_USER environment.yml /tmp/environment.yml -RUN micromamba install -y -n base -c conda-forge -f /tmp/environment.yml && \ +RUN micromamba create -n invest-env -c conda-forge python==${PYTHON_VERSION} && \ + micromamba activate invest-env && \ + micromamba install -y -c conda-forge -f /tmp/environment.yml && \ micromamba clean --all --yes && \ - /opt/conda/bin/python -m pip install /tmp/*.whl && \ - /opt/conda/bin/python -m pip cache purge && \ - micromamba remove -y -n base cxx-compiler git + python -m pip install /tmp/*.whl && \ + python -m pip cache purge && \ + micromamba remove -y cxx-compiler git ENTRYPOINT ["/usr/local/bin/_entrypoint.sh"] From 1343e84ad46c35360999810ca0cf1c39b078bbd3 Mon Sep 17 00:00:00 2001 From: davemfish Date: Mon, 22 Apr 2024 13:06:52 -0400 Subject: [PATCH 2/4] use the base env. #1560 --- docker/Dockerfile | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index bde10338c6..080b7b577f 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -13,21 +13,18 @@ RUN cd / && \ # Create the container for distribution that has runtime dependencies. FROM mambaorg/micromamba:1.5.0-bookworm-slim - # Python version should match the version used in stage 1. # If we update the stage 1 debian version, also update this python version ARG PYTHON_VERSION="3.11" - COPY --from=build /invest/dist/*.whl /tmp/ # The environment.yml file will be built during github actions. COPY --chown=$MAMBA_USER:$MAMBA_USER environment.yml /tmp/environment.yml -RUN micromamba create -n invest-env -c conda-forge python==${PYTHON_VERSION} && \ - micromamba activate invest-env && \ - micromamba install -y -c conda-forge -f /tmp/environment.yml && \ +RUN micromamba install -y -n base -c conda-forge python==${PYTHON_VERSION} && \ +RUN micromamba install -y -n base -c conda-forge -f /tmp/environment.yml && \ micromamba clean --all --yes && \ - python -m pip install /tmp/*.whl && \ - python -m pip cache purge && \ - micromamba remove -y cxx-compiler git + /opt/conda/bin/python -m pip install /tmp/*.whl && \ + /opt/conda/bin/python -m pip cache purge && \ + micromamba remove -y -n base cxx-compiler git ENTRYPOINT ["/usr/local/bin/_entrypoint.sh"] From e400ec7250928c78527fc754ca68e734ace11e16 Mon Sep 17 00:00:00 2001 From: davemfish Date: Mon, 22 Apr 2024 13:11:50 -0400 Subject: [PATCH 3/4] syntax error. #1560 --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 080b7b577f..496948c370 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -21,7 +21,7 @@ COPY --from=build /invest/dist/*.whl /tmp/ # The environment.yml file will be built during github actions. COPY --chown=$MAMBA_USER:$MAMBA_USER environment.yml /tmp/environment.yml RUN micromamba install -y -n base -c conda-forge python==${PYTHON_VERSION} && \ -RUN micromamba install -y -n base -c conda-forge -f /tmp/environment.yml && \ + micromamba install -y -n base -c conda-forge -f /tmp/environment.yml && \ micromamba clean --all --yes && \ /opt/conda/bin/python -m pip install /tmp/*.whl && \ /opt/conda/bin/python -m pip cache purge && \ From 0ddab81d1cb6dcd4df7b1b30260517650d8095c9 Mon Sep 17 00:00:00 2001 From: davemfish Date: Mon, 22 Apr 2024 15:02:20 -0400 Subject: [PATCH 4/4] debug an unrelated build step --- .github/workflows/build-and-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 26ef26c088..691265ae89 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -181,7 +181,7 @@ jobs: - name: Install from source distribution run : | # Install natcap.invest from the sdist in dist/ - pip install $(find dist -name "natcap.invest*") + pip install $(find dist -name "natcap[._-]invest*") # Model tests should cover model functionality, we just want # to be sure that we can import `natcap.invest` here.