Skip to content

Commit 1b9ab35

Browse files
committed
fix(ci): "deadsnakes" causes unreliable CI
Problem: deadsnakes sometimes fails our CI: lazr.restfulclient.errors.ServerError: HTTP Error 504: Gateway Time-out Solution: Remove use of deadsnakes. We no longer test against python 3.7/3.8. Use python virtualenv and activate it with non-root `codebuild-user`.
1 parent 819e63a commit 1b9ab35

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

buildspec/linuxIntegrationTests.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,8 @@ phases:
2727
- '>/dev/null apt-get -qq update'
2828
- '>/dev/null apt-get -qq install -y ca-certificates'
2929
- 'apt-get install --reinstall ca-certificates'
30-
- 'add-apt-repository -y ppa:deadsnakes/ppa'
3130
# Other dependencies.
32-
- 'apt-get -qq install -y jq python3.7 python3.8 python3-pip'
33-
# Fail early if any of these not found.
34-
- 'python3.7 --version'
35-
- 'python3.8 --version'
31+
- 'apt-get -qq install -y jq python3-venv'
3632
# login to DockerHub so we don't get throttled
3733
# - docker login --username $(echo $DOCKER_HUB_TOKEN | jq -r '.username') --password $(echo $DOCKER_HUB_TOKEN | jq -r '.password') || true
3834
# increase file watcher count so CodeLens tests do not fail unexpectedly (ENOSPC error)
@@ -51,12 +47,14 @@ phases:
5147
- export HOME=/home/codebuild-user
5248
- bash buildspec/shared/setup-github-token.sh
5349
- bash buildspec/shared/linux-pre_build.sh
54-
# Where non-root "pip3 install" puts things:
55-
- 'export PATH="$HOME/.local/bin:$PATH"'
56-
- '>/dev/null pip3 install --upgrade aws-sam-cli'
57-
- '>/dev/null pip3 install --upgrade awscli'
58-
# Print info about sam (version, location, …).
59-
- 'pip3 show aws-sam-cli'
50+
- 'python3 --version'
51+
- 'python3 -m venv venv'
52+
- 'chown -R codebuild-user:codebuild-user venv/bin/activate'
53+
- 'source venv/bin/activate'
54+
# - '>/dev/null pip install --upgrade pip'
55+
- '>/dev/null pip install --upgrade awscli aws-sam-cli'
56+
# Print info (version, location, …) or fail early.
57+
- 'pip show aws-sam-cli'
6058
- 'sam --version'
6159
# Install latest version of Go (known to 'goenv')
6260
# - eval "$(goenv init -)"
@@ -68,6 +66,7 @@ phases:
6866
build:
6967
commands:
7068
- export HOME=/home/codebuild-user
69+
- 'source venv/bin/activate'
7170
- xvfb-run npm run testInteg
7271
- VCS_COMMIT_ID="${CODEBUILD_RESOLVED_SOURCE_VERSION}"
7372
- CI_BUILD_URL=$(echo $CODEBUILD_BUILD_URL | sed 's/#/%23/g')

0 commit comments

Comments
 (0)