-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #63050 - pietroalbini:vendor-awscli, r=Mark-Simulacrum
ci: download awscli from our mirror This fixes multiple network issues we had when downloading awscli from PyPI on Azure Pipelines by vendoring awscli itself and its dependencies in our S3 bucket. Instructions on how to update the cache are present at the top of `src/ci/install-awscli.sh`. r? @alexcrichton or @Mark-Simulacrum fixes #62967
- Loading branch information
Showing
3 changed files
with
40 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
# This script downloads and installs awscli from the packages mirrored in our | ||
# own S3 bucket. This follows the recommendations at: | ||
# | ||
# https://packaging.python.org/guides/index-mirrors-and-caches/#caching-with-pip | ||
# | ||
# To create a new mirrored copy you can run the command: | ||
# | ||
# pip wheel awscli | ||
# | ||
# Before compressing please make sure all the wheels end with `-none-any.whl`. | ||
# If that's not the case you'll need to remove the non-cross-platform ones and | ||
# replace them with the .tar.gz downloaded from https://pypi.org. Also make | ||
# sure it's possible to call this script with both Python 2 and Python 3. | ||
|
||
set -euo pipefail | ||
IFS=$'\n\t' | ||
|
||
MIRROR="https://rust-lang-ci2.s3.amazonaws.com/rust-ci-mirror/2019-07-27-awscli.tar" | ||
DEPS_DIR="/tmp/awscli-deps" | ||
|
||
pip="pip" | ||
pipflags="" | ||
if [[ "${AGENT_OS}" == "Linux" ]]; then | ||
pip="pip3" | ||
pipflags="--user" | ||
|
||
sudo apt-get install -y python3-setuptools | ||
echo "##vso[task.prependpath]$HOME/.local/bin" | ||
fi | ||
|
||
mkdir -p "${DEPS_DIR}" | ||
curl "${MIRROR}" | tar xf - -C "${DEPS_DIR}" | ||
"${pip}" install ${pipflags} --no-index "--find-links=${DEPS_DIR}" awscli | ||
rm -rf "${DEPS_DIR}" |