Skip to content

Commit

Permalink
More files.
Browse files Browse the repository at this point in the history
No-Issue

Signed-off-by: James Tanner <[email protected]>
  • Loading branch information
jctanner committed Feb 21, 2024
1 parent f6b28a7 commit ebab981
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
19 changes: 19 additions & 0 deletions dev/playbooks/docker/BUILD.sh
Original file line number Diff line number Diff line change
@@ -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 .

15 changes: 15 additions & 0 deletions dev/playbooks/docker/py311.patch
Original file line number Diff line number Diff line change
@@ -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 && \
18 changes: 18 additions & 0 deletions dev/playbooks/docker/switch_python
Original file line number Diff line number Diff line change
@@ -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}

0 comments on commit ebab981

Please sign in to comment.