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

ci: download awscli from our mirror #63050

Merged
merged 1 commit into from
Jul 28, 2019
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
42 changes: 5 additions & 37 deletions .azure-pipelines/steps/run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,43 +138,11 @@ steps:

# Ensure the `aws` CLI is installed so we can deploy later on, cache docker
# images, etc.
- bash: |
set -e
# Temporary code to debug #62967.
debug_failed_connections() {
echo "trying to ping pypi.org"
ping pypi.org -c10 || true
echo "trying to ping google.com"
ping google.com -c10 || true
echo "trying to ping 8.8.8.8"
ping 8.8.8.8 -c10 || true
echo "trying to download pypi.org"
curl https://pypi.org || true
echo "trying to download from our S3 bucket"
curl https://rust-lang-ci2.s3.amazonaws.com || true
echo "trying to dig pypi.org"
dig pypi.org || true
echo "trying to dig files.pythonhosted.org"
dig files.pythonhosted.org || true
echo "trying to connect to pypi.org with openssl"
echo | openssl s_client -connect pypi.org:443 || true
echo "trying to connect to files.pythonhosted.org with openssl"
echo | openssl s_client -connect files.pythonhosted.org:443 || true
}
debug_failed_connections_and_fail() {
debug_failed_connections
return 1
}
source src/ci/shared.sh
sudo apt-get install -y python3-setuptools
debug_failed_connections
retry pip3 install -r src/ci/awscli-requirements.txt --upgrade --user || debug_failed_connections_and_fail
echo "##vso[task.prependpath]$HOME/.local/bin"
displayName: Install awscli (Linux)
condition: and(succeeded(), not(variables.SKIP_JOB), eq(variables['Agent.OS'], 'Linux'))
- script: pip install -r src/ci/awscli-requirements.txt
displayName: Install awscli (non-Linux)
condition: and(succeeded(), not(variables.SKIP_JOB), ne(variables['Agent.OS'], 'Linux'))
- bash: src/ci/install-awscli.sh
env:
AGENT_OS: $(Agent.OS)
condition: and(succeeded(), not(variables.SKIP_JOB))
displayName: Install awscli

# Configure our CI_JOB_NAME variable which log analyzers can use for the main
# step to see what's going on.
Expand Down
13 changes: 0 additions & 13 deletions src/ci/awscli-requirements.txt

This file was deleted.

35 changes: 35 additions & 0 deletions src/ci/install-awscli.sh
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}"