Skip to content

Commit

Permalink
Isolate AWS CLI (v1) into its own Python venv
Browse files Browse the repository at this point in the history
Otherwise, the awscli → botocore dependency is broken by the subsequent
installation of the nextstrain-cli → botocore dependency, which results
in --no-sign-request not working as it should.

This approach seemed like the option of least change.  Alternatives to
and/or additional improvements to this include a) installing Nextstrain
CLI in its own venv instead/as well, b) upgrading to AWS CLI v2 (which
is always isolated) or c) updating the nextstrain-cli → botocore
dependency to not conflict.

Resolves: <#213>
Related-to: <#214>
  • Loading branch information
tsibley committed Jun 11, 2024
1 parent 822a459 commit d041d6c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
RUN pip3 install envdir==1.0.1

# Install tooling for our AWS Batch builds, which use `aws s3`.
RUN pip3 install awscli==1.18.195
RUN python3 -m venv /usr/local/libexec/awscli \
&& /usr/local/libexec/awscli/bin/python -m pip install awscli==1.18.195 \
&& ln -sv /usr/local/libexec/awscli/bin/aws /usr/local/bin/aws

# Install Snakemake and related optional dependencies.
# Pinned to 7.32.3 for stability (2023-09-09)
Expand Down Expand Up @@ -425,6 +427,9 @@ RUN chmod a+rx /usr/local/bin/* /usr/local/libexec/*
# Add installed Python libs
COPY --from=builder-target-platform /usr/local/lib/python3.10/site-packages/ /usr/local/lib/python3.10/site-packages/

# AWS CLI
COPY --from=builder-target-platform /usr/local/libexec/awscli/ /usr/local/libexec/awscli/

# Add installed Python scripts that we need.
#
# XXX TODO: This isn't great. It's prone to needing manual updates because it
Expand Down

0 comments on commit d041d6c

Please sign in to comment.