Skip to content

Commit 44cb30c

Browse files
committed
fix(ci): give up on python virtualenv
Problem: Cannot activate python virtualenv in CodeBuild, it fails with an inscrutable "Permission denied" error: [Container] 2024/02/05 19:19:39.500237 Running command python3 --version Python 3.10.12 [Container] 2024/02/05 19:19:39.513374 Running command python3 -m venv venv [Container] 2024/02/05 19:19:43.841746 Running command chown -R codebuild-user:codebuild-user venv/bin/activate [Container] 2024/02/05 19:19:43.856202 Running command source venv/bin/activate /codebuild/output/tmp/script.sh: 4: source: Permission denied [Container] 2024/02/05 19:19:43.868272 Command did not exit successfully source venv/bin/activate exit status 127 [Container] 2024/02/05 19:19:43.874755 Phase complete: PRE_BUILD State: FAILED Solution: Since 8faa551, the `src/testInteg/sam.test.ts` integ tests always build in-container, which avoids all the tragedy of "in-host" (i.e. the local machine) tooling. So we don't actually need virtualenv and can avoid CodeBuild's brain damage.
1 parent 1b9ab35 commit 44cb30c

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

buildspec/linuxIntegrationTests.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@ phases:
2828
- '>/dev/null apt-get -qq install -y ca-certificates'
2929
- 'apt-get install --reinstall ca-certificates'
3030
# Other dependencies.
31-
- 'apt-get -qq install -y jq python3-venv'
31+
- 'apt-get -qq install -y jq'
32+
- |
33+
curl --silent -LO https://github.com/aws/aws-sam-cli/releases/latest/download/aws-sam-cli-linux-x86_64.zip
34+
unzip -q aws-sam-cli-linux-x86_64.zip -d samcli
35+
sudo ./samcli/install
36+
rm -rf samcli
3237
# login to DockerHub so we don't get throttled
3338
# - docker login --username $(echo $DOCKER_HUB_TOKEN | jq -r '.username') --password $(echo $DOCKER_HUB_TOKEN | jq -r '.password') || true
3439
# increase file watcher count so CodeLens tests do not fail unexpectedly (ENOSPC error)
@@ -47,15 +52,10 @@ phases:
4752
- export HOME=/home/codebuild-user
4853
- bash buildspec/shared/setup-github-token.sh
4954
- bash buildspec/shared/linux-pre_build.sh
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'
5655
# Print info (version, location, …) or fail early.
57-
- 'pip show aws-sam-cli'
58-
- 'sam --version'
56+
- |
57+
python3 --version
58+
sam --version
5959
# Install latest version of Go (known to 'goenv')
6060
# - eval "$(goenv init -)"
6161
# - 'export PATH="$GOROOT/bin:$PATH:$GOPATH/bin"'
@@ -66,7 +66,6 @@ phases:
6666
build:
6767
commands:
6868
- export HOME=/home/codebuild-user
69-
- 'source venv/bin/activate'
7069
- xvfb-run npm run testInteg
7170
- VCS_COMMIT_ID="${CODEBUILD_RESOLVED_SOURCE_VERSION}"
7271
- CI_BUILD_URL=$(echo $CODEBUILD_BUILD_URL | sed 's/#/%23/g')

0 commit comments

Comments
 (0)