Skip to content

Commit e13614a

Browse files
committed
try installing missing version of python with a script
1 parent f5de400 commit e13614a

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ jobs:
208208
permissions:
209209
id-token: write # This is required for requesting the JWT
210210
steps:
211+
- uses: actions/checkout@v4
211212
- name: configure AWS credentials (containers)
212213
uses: aws-actions/configure-aws-credentials@v4
213214
with:
@@ -219,7 +220,20 @@ jobs:
219220
- name: Build ${{ env.PACKAGE_NAME }}
220221
run: |
221222
aws s3 cp s3://aws-crt-test-stuff/ci/${{ env.BUILDER_VERSION }}/linux-container-ci.sh ./linux-container-ci.sh && chmod a+x ./linux-container-ci.sh
222-
./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ env.LINUX_BASE_IMAGE }} build -p ${{ env.PACKAGE_NAME }} --compiler=${{ matrix.compiler }}
223+
# Create modified container script that installs Python 3.10
224+
cat > ./linux-container-ci-python310.sh << 'EOF'
225+
#!/bin/bash
226+
set -e
227+
BUILDER_VERSION=$1
228+
shift
229+
IMAGE_NAME=$1
230+
shift
231+
aws ecr get-login-password | docker login 123124136734.dkr.ecr.us-east-1.amazonaws.com -u AWS --password-stdin
232+
export DOCKER_IMAGE=123124136734.dkr.ecr.us-east-1.amazonaws.com/${IMAGE_NAME}:${BUILDER_VERSION}
233+
docker run --env GITHUB_REF --env GITHUB_HEAD_REF --env AWS_ACCESS_KEY_ID --env AWS_SECRET_ACCESS_KEY --env AWS_SESSION_TOKEN --env AWS_DEFAULT_REGION --env CXXFLAGS --env AWS_CRT_ARCH --env CTEST_PARALLEL_LEVEL -v $(pwd)/scripts:/scripts $DOCKER_IMAGE bash -c "/scripts/install-python310.sh && /usr/local/bin/builder.pyz --version=${BUILDER_VERSION} $@"
234+
EOF
235+
chmod +x ./linux-container-ci-python310.sh
236+
./linux-container-ci-python310.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ env.LINUX_BASE_IMAGE }} build -p ${{ env.PACKAGE_NAME }} --compiler=${{ matrix.compiler }}
223237
224238
use-system-libcrypto:
225239
runs-on: ubuntu-24.04 # latest

scripts/install-python310.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# Install Python 3.10 on Ubuntu 18.04
5+
apt-get update
6+
apt-get install -y software-properties-common
7+
add-apt-repository -y ppa:deadsnakes/ppa
8+
apt-get update
9+
apt-get install -y python3.10 python3.10-venv python3.10-dev
10+
11+
# Create symlink for python3.10 if it doesn't exist
12+
if [ ! -f /usr/bin/python3.10 ]; then
13+
ln -sf /usr/bin/python3.10 /usr/bin/python3.10
14+
fi

0 commit comments

Comments
 (0)