Skip to content

Commit 8f25b59

Browse files
chore: handle Python 3.9 in GitLab runner startup script (fix #1370) (#1372)
## Description For users on the standard EC2 AMI, the default Python version is 3.9. This causes the `eip.tftpl` startup script to fail when running the `https://bootstrap.pypa.io/get-pip.py` script, as it was updated on May 4th, to require Python >= 3.10. While it's not ideal to support a EOL Python version, we don't have much of a choice because of how the get-pip script works, and how the standard AWS AMIs work. Ideally, we'd just update the default Python version, however this will apparently break other things reliant on 3.9 <img width="977" height="259" alt="image" src="https://github.com/user-attachments/assets/e0c8d02b-19bf-4bae-8468-2255bc9e78ac" /> See https://docs.aws.amazon.com/linux/al2023/ug/python.html Fixes #1370 Co-authored-by: Matthias Kay <matthias.kay@hlag.com>
1 parent d5547d5 commit 8f25b59

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

template/eip.tftpl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
echo 'installing additional software for assigning EIP'
22

33
yum install python3 -y
4-
curl --fail --retry 6 -O https://bootstrap.pypa.io/get-pip.py
4+
5+
# Check if Python version is 3.9, or greater
6+
if python3 -c 'import sys; exit(0) if sys.version_info >= (3, 10) else exit(1)'; then
7+
curl --fail --retry 6 -O https://bootstrap.pypa.io/get-pip.py
8+
else
9+
curl --fail --retry 6 -O https://bootstrap.pypa.io/pip/3.9/get-pip.py
10+
fi
11+
512
python3 get-pip.py --user
613
export PATH=~/.local/bin:$PATH
714

0 commit comments

Comments
 (0)