From ebab9812d5de46f34a4efe225ab3576fe4a61c0e Mon Sep 17 00:00:00 2001 From: James Tanner Date: Wed, 21 Feb 2024 12:35:45 -0500 Subject: [PATCH] More files. No-Issue Signed-off-by: James Tanner --- dev/playbooks/docker/BUILD.sh | 19 +++++++++++++++++++ dev/playbooks/docker/py311.patch | 15 +++++++++++++++ dev/playbooks/docker/switch_python | 18 ++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100755 dev/playbooks/docker/BUILD.sh create mode 100644 dev/playbooks/docker/py311.patch create mode 100644 dev/playbooks/docker/switch_python diff --git a/dev/playbooks/docker/BUILD.sh b/dev/playbooks/docker/BUILD.sh new file mode 100755 index 0000000000..b5d6925e2a --- /dev/null +++ b/dev/playbooks/docker/BUILD.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +if [[ ! -d pulp-oci-images ]]; then + git clone https://github.com/pulp/pulp-oci-images +fi +cd pulp-oci-images +git reset --hard +cd .. + +curl -o pulp-oci-images/images/assets/switch_python \ + https://raw.githubusercontent.com/pulp/oci_env/main/base/switch_python +chmod +x pulp-oci-images/images/assets/switch_python + +cd pulp-oci-images +git apply ../py311.patch + +docker build --file images/Containerfile.core.base --tag pulp/base:latest . +docker build --file images/pulp_ci_centos/Containerfile --tag pulp/pulp-ci-centos9:latest . + diff --git a/dev/playbooks/docker/py311.patch b/dev/playbooks/docker/py311.patch new file mode 100644 index 0000000000..7182bff61c --- /dev/null +++ b/dev/playbooks/docker/py311.patch @@ -0,0 +1,15 @@ +diff --git a/images/Containerfile.core.base b/images/Containerfile.core.base +index c05669c..7d84cb8 100644 +--- a/images/Containerfile.core.base ++++ b/images/Containerfile.core.base +@@ -130,6 +130,10 @@ COPY images/assets/add_signing_service.sh /usr/bin/add_signing_service.sh + COPY images/assets/pulp-api /usr/bin/pulp-api + COPY images/assets/pulp-content /usr/bin/pulp-content + COPY images/assets/pulp-worker /usr/bin/pulp-worker ++COPY images/assets/switch_python /usr/bin/switch_python ++ ++ARG PYTHON_VERSION=3.11 ++RUN switch_python "$PYTHON_VERSION" + + # Need to precreate when running pulp as the pulp user + RUN touch /var/log/galaxy_api_access.log && \ diff --git a/dev/playbooks/docker/switch_python b/dev/playbooks/docker/switch_python new file mode 100644 index 0000000000..03f5128457 --- /dev/null +++ b/dev/playbooks/docker/switch_python @@ -0,0 +1,18 @@ +#!/bin/bash + +set -e + +NEWV=$1 +if [[ "$NEWV" == "3.8" ]]; then + echo "using default python 3.8" + exit 0 +fi + +echo "switching python to $NEWV" + +rm -f /usr/local/bin/pip3 +dnf install -y python${NEWV} python${NEWV}-pip python${NEWV}-devel +update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${NEWV} 1 +update-alternatives --set python3 /usr/bin/python${NEWV} +update-alternatives --install /usr/bin/pip3 pip3 /usr/bin/pip-${NEWV} 1 +update-alternatives --set pip3 /usr/bin/pip-${NEWV}