Skip to content

Commit

Permalink
Stop using python 3.6, which is long past end of life. (#198)
Browse files Browse the repository at this point in the history
**Issue:**
aws-crt-python is removing support for python3.6: awslabs/aws-crt-python#402
but several of our docker images are still using python3.6

**Description of change:**
For distros where python3.6 was the default (ubuntu18, rhel8), switch to using the newest python version available to that distro.
  • Loading branch information
graebm authored Oct 26, 2022
1 parent 6f1e77c commit fe5786b
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .github/docker-images/opensuse-leap/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM opensuse/leap:15.3
SHELL ["/bin/bash", "-c"]

RUN zypper refresh
RUN zypper install -y git gcc gcc-c++ cmake curl python3 python3-pip wget sudo python3-devel tar gzip
RUN zypper install -y git gcc gcc-c++ cmake curl python39-devel python39-pip wget sudo tar gzip

# normally we let the builder install this, but the builder does a non-standard install that doesn't play nice
# with opensuse's alternatives framework. So just install the jdk 11 development package in the base container
Expand All @@ -13,8 +13,8 @@ RUN zypper install -y java-11-openjdk-devel
###############################################################################
# Python/AWS CLI
###############################################################################
RUN python3 -m pip install --upgrade pip setuptools virtualenv \
&& python3 -m pip install --upgrade awscli \
RUN python3.9 -m pip install --upgrade pip setuptools virtualenv \
&& python3.9 -m pip install --upgrade awscli \
&& aws --version

###############################################################################
Expand Down
12 changes: 11 additions & 1 deletion .github/docker-images/rhel8-x64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,17 @@ FROM registry.access.redhat.com/ubi8/ubi:latest

SHELL ["/bin/bash", "-c"]

RUN dnf install -y gcc gcc-c++ cmake wget python3 python3-pip git make sudo python3-devel
RUN dnf install -y \
gcc \
gcc-c++ \
cmake \
wget \
git \
make \
sudo \
# RHEL8's default python3 is python3.6, which is EOL.
# So install python3.9 (latest version on this distro, circa Oct 2022)
python39-devel

###############################################################################
# Python/AWS CLI
Expand Down
12 changes: 7 additions & 5 deletions .github/docker-images/ubuntu-18-x64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ RUN apt-get update -qq \
curl \
sudo \
unzip \
# Python
python3 \
python3-dev \
# Ubuntu18's default python3 is python3.6, which is EOL.
# So install python3.8 (latest version on this distro, circa Oct 2022)
python3.8-dev \
# This installs pip for all python versions on the system
# (there is no "python3.8-pip")
python3-pip \
build-essential \
# For PPAs
Expand All @@ -27,8 +29,8 @@ RUN apt-get update -qq \
###############################################################################
WORKDIR /tmp

RUN python3 -m pip install setuptools \
&& python3 -m pip install --upgrade pip \
RUN python3.8 -m pip install setuptools \
&& python3.8 -m pip install --upgrade pip \
&& curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o awscliv2.zip \
&& unzip awscliv2.zip \
&& sudo aws/install \
Expand Down
6 changes: 6 additions & 0 deletions builder/core/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ class PKG_TOOLS(Enum):
],
'pkg_update': 'apt-get -qq update -y',
'pkg_install': 'apt-get -qq install -y',
'variables': {
'python': "python3.8",
},
},
'debian': {
'os': 'linux',
Expand Down Expand Up @@ -169,6 +172,9 @@ class PKG_TOOLS(Enum):
'pkg_tool': PKG_TOOLS.ZYPPER,
'pkg_update': 'zypper refresh && zypper --non-interactive patch',
'pkg_install': 'zypper install -y',
'variables': {
'python': "python3.9",
},
},
'rhel': {
'os': 'linux',
Expand Down

0 comments on commit fe5786b

Please sign in to comment.