Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MNT: Use conda-lock lock file for reproducible environment #32

Merged
merged 2 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/remove-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
environment-name: remove-wheels
create-args: >-
python=3.11
anaconda-client=1.12.0
anaconda-client=1.12.1
curl
jq

Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ SHELL [ "/bin/bash", "-c" ]
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8

# lock file created by running lock.sh in the top level of the repository
COPY --chown=mambauser conda-lock.yml /conda-lock.yml
Comment on lines +11 to +12
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lock file is now under version control so we have it accessible to us at the Docker image build time to be able to COPY in.

COPY --chown=mambauser cmd.sh /cmd.sh
RUN chmod +x /cmd.sh

Expand Down
18 changes: 10 additions & 8 deletions cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,17 @@ if [ -z "${ANACONDA_TOKEN}" ]; then
exit -1
fi

export ANACONDA_CLIENT_VERSION="1.12.0"

# install anaconda-client
echo "Installing anaconda-client v${ANACONDA_CLIENT_VERSION}..."

micromamba install \
# Install anaconda-client from lock file
echo "Installing anaconda-client from upload-nightly-action conda-lock lock file..."
micromamba create \
--yes \
--channel conda-forge \
"anaconda-client==${ANACONDA_CLIENT_VERSION}"
--name upload-nightly-action \
--file /conda-lock.yml

# 'micromamba' is running as a subprocess and can't modify the parent shell.
# Thus you must initialize your shell before using activate and deactivate.
eval "$(micromamba shell hook --shell bash)"
micromamba activate upload-nightly-action

# trim trailing slashes from $INPUT_ARTIFACTS_PATH
INPUT_ARTIFACTS_PATH="${INPUT_ARTIFACTS_PATH%/}"
Expand Down
Loading