Skip to content

Commit

Permalink
DRIVERS-3077 Drop support for Python 3.8 (#567)
Browse files Browse the repository at this point in the history
Co-authored-by: Noah Stapp <[email protected]>
  • Loading branch information
blink1073 and NoahStapp authored Jan 3, 2025
1 parent 81c6b49 commit 50f50f9
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 69 deletions.
1 change: 0 additions & 1 deletion .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1381,7 +1381,6 @@ buildvariants:
display_name: Docker
run_on:
- ubuntu2204-small
- macos-14
tasks:
- ".docker" # Run all tasks with the "docker" tag

Expand Down
12 changes: 4 additions & 8 deletions .evergreen/docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,13 @@ Note that the default `TOPOLOGY` is [`servers`](https://github.com/mongodb-labs/
TOPOLOGY=replica_set ORCHESTRATION_FILE=auth.json bash ./run-server.sh
```

If you want to test server versions older than 4.4, you can use the 18.04 image, e.g.:
If you want to test server versions older than 4.4, you can use the rhel8 image, e.g.:

```bash
TOPOLOGY=sharded_cluster MONGODB_VERSION=4.2 TARGET_IMAGE=ubuntu18.04 ./run-server.sh
```

You must also specify `ARCH=amd64` in order to run MongoDB 3.6 and 4.0, since `aarch` support
is not available in Ubuntu 18.04 for those versions.
You must also specify `ARCH=amd64` in order to run MongoDB versions older than 4.4 on RHEL8, since `aarch` support
is not available in RHEL8 for those versions.

```bash
ARCH=amd64 TOPOLOGY=sharded_cluster MONGODB_VERSION=3.6 TARGET_IMAGE=ubuntu18.04 ./run-server.sh
ARCH=amd64 TOPOLOGY=sharded_cluster MONGODB_VERSION=4.2 TARGET_IMAGE=rhel8 ./run-server.sh
```

### Get Logs
Expand Down
38 changes: 38 additions & 0 deletions .evergreen/docker/rhel8/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
FROM registry.access.redhat.com/ubi8/ubi:8.4

# Install mongodb 4.4 server to get older deps.
RUN echo -e "\
[mongodb-enterprise-4.4] \n\
name=MongoDB Enterprise Repository \n\
baseurl=https://repo.mongodb.com/yum/redhat/8/mongodb-enterprise/4.4/$(uname -m)/ \n\
enabled = 1 \n\
gpgkey=https://pgp.mongodb.com/server-4.4.asc \n\
gpgcheck = 1\
" > /etc/yum.repos.d/mongodb-enterprise-4.4.repo

RUN dnf update -y && \
dnf install -y \
git \
ca-certificates \
curl \
wget \
sudo \
make \
gnupg \
python3.9 \
mongodb-enterprise \
lsof < /dev/null > /dev/null

# Alias python3 -> python3.9
RUN ln -f -s /usr/bin/python3.9 /usr/bin/python3

ARG USER_ID
ARG GROUP_ID

ENV DRIVERS_TOOLS=/root/drivers-tools
ENV MONGO_ORCHESTRATION_HOME=/root/drivers-tools/.evergreen/orchestration
ENV MONGODB_BINARIES=/root/drivers-tools/mongodb/bin
ENV DOCKER_RUNNING=true

COPY . /root/drivers-tools
COPY .evergreen/docker/rhel8/*.sh /root
File renamed without changes.
File renamed without changes.
File renamed without changes.
55 changes: 0 additions & 55 deletions .evergreen/docker/ubuntu18.04/Dockerfile

This file was deleted.

11 changes: 9 additions & 2 deletions .evergreen/docker/ubuntu20.04/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,21 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
sudo \
gnupg \
python \
python3 \
python3.8-venv \
lsof \
software-properties-common \
libsnmp35 \
net-tools < /dev/null > /dev/null \
&& rm -rf /var/lib/apt/lists/*

# Install python 3.9 from ppa
RUN export DEBIAN_FRONTEND=noninteractive \
&& export TZ=Etc/UTC \
&& add-apt-repository ppa:deadsnakes/ppa \
&& apt-get -qq update \
&& apt-get -qq -y install python3.9 python3.9-venv python3-venv < /dev/null > /dev/null \
&& ln -sf /usr/bin/python3.9 /usr/bin/python3 \
&& rm -rf /var/lib/apt/lists/*

ARG USER_ID
ARG GROUP_ID

Expand Down
3 changes: 2 additions & 1 deletion .evergreen/find-python3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ is_python3() (
return 1
fi

# The minimum version we support is Python 3.9. All other versions are EOL.
# shellcheck disable=SC2091
if ! $("$bin" -c "import sys; exit(sys.version_info[0] == 3 and sys.version_info[1] < 8)"); then
if ! $("$bin" -c "import sys; exit(sys.version_info[0] == 3 and sys.version_info[1] < 9)"); then
version=$($bin --version)
echo "Detected EOL Python ${version}, skipping."
return 1
Expand Down
2 changes: 1 addition & 1 deletion .evergreen/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "hatchling.build"
name = "drivers-evergreen-tools"
version = "0.1.0"
description = 'Scripts for drivers-evergreen-tools'
requires-python = ">=3.8"
requires-python = ">=3.9"
license = "MIT"
keywords = []
authors = [
Expand Down
2 changes: 1 addition & 1 deletion .evergreen/tests/test-csfle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ if [[ "$(uname -s)" == CYGWIN* ]]; then
fi

# Test with supported pythons
pythons="3.8 3.9 3.10 3.11 3.12 3.13"
pythons="3.9 3.10 3.11 3.12 3.13"
for python in $pythons; do
if [ "$(uname -s)" = "Darwin" ]; then
PYTHON_BINARY="/Library/Frameworks/Python.Framework/Versions/$python/bin/python3"
Expand Down

0 comments on commit 50f50f9

Please sign in to comment.