Skip to content

Commit

Permalink
Update Docker and venv to python3.9 (gwastro#4115)
Browse files Browse the repository at this point in the history
* Update Docker files

* Also update venv

* Also thie file

* Probably don't want python38-devel for python39
  • Loading branch information
spxiwh authored Aug 26, 2022
1 parent 19462bf commit e1d9e26
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_venv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
name: "Set up Python"
uses: actions/setup-python@v1
with:
python-version: 3.8
python-version: 3.9
-
env:
OSG_ACCESS: "${{secrets.OSG_ACCESS}}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
name: "Set up Python"
uses: actions/setup-python@v1
with:
python-version: 3.8
python-version: 3.9
-
name: "Preparing a host container"
run: "docker build -t pycbc-docker-tmp ."
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ADD docker/etc/cvmfs/config-osg.opensciencegrid.org.conf /etc/cvmfs/config-osg.o
RUN dnf -y install https://ecsft.cern.ch/dist/cvmfs/cvmfs-release/cvmfs-release-latest.noarch.rpm && dnf -y install cvmfs cvmfs-config-default && dnf clean all && dnf makecache && \
dnf -y groupinstall "Development Tools" \
"Scientific Support" && \
rpm -e --nodeps git perl-Git && dnf -y install @python38 rsync zlib-devel libpng-devel libjpeg-devel sqlite-devel openssl-devel fftw-libs-single fftw-devel fftw fftw-libs-long fftw-libs fftw-libs-double gsl gsl-devel hdf5 hdf5-devel python38-devel swig which osg-ca-certs && python3.8 -m pip install --upgrade pip setuptools wheel cython && python3.8 -m pip install mkl ipython jupyter jupyterhub jupyterlab lalsuite && \
rpm -e --nodeps git perl-Git && dnf -y install @python39 rsync zlib-devel libpng-devel libjpeg-devel sqlite-devel openssl-devel fftw-libs-single fftw-devel fftw fftw-libs-long fftw-libs fftw-libs-double gsl gsl-devel hdf5 hdf5-devel python39-devel swig which osg-ca-certs && python3.9 -m pip install --upgrade pip setuptools wheel cython && python3.9 -m pip install mkl ipython jupyter jupyterhub jupyterlab lalsuite && \
dnf -y install https://repo.opensciencegrid.org/osg/3.5/el8/testing/x86_64/osg-wn-client-3.5-5.osg35.el8.noarch.rpm && dnf clean all

# set up environment
Expand All @@ -21,15 +21,15 @@ RUN cd / && \
# Install MPI software needed for pycbc_inference
# at the end.
RUN dnf -y install libibverbs libibverbs-devel libibmad libibmad-devel libibumad libibumad-devel librdmacm librdmacm-devel libmlx5 libmlx4 openmpi openmpi-devel && \
python3.8 -m pip install schwimmbad && \
MPICC=/lib64/openmpi/bin/mpicc CFLAGS='-I /usr/include/openmpi-x86_64/ -L /usr/lib64/openmpi/lib/ -lmpi' python3.8 -m pip install --no-cache-dir mpi4py
python3.9 -m pip install schwimmbad && \
MPICC=/lib64/openmpi/bin/mpicc CFLAGS='-I /usr/include/openmpi-x86_64/ -L /usr/lib64/openmpi/lib/ -lmpi' python3.9 -m pip install --no-cache-dir mpi4py
RUN echo "/usr/lib64/openmpi/lib/" > /etc/ld.so.conf.d/openmpi.conf

# Now update all of our library installations
RUN rm -f /etc/ld.so.cache && /sbin/ldconfig

# Make python be what we want
RUN alternatives --set python /usr/bin/python3.8
RUN alternatives --set python /usr/bin/python3.9

# Explicitly set the path so that it is not inherited from build the environment
ENV PATH "/usr/local/bin:/usr/bin:/bin:/lib64/openmpi/bin/bin"
Expand Down
8 changes: 5 additions & 3 deletions docker/etc/docker-install.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#!/bin/bash -v
set -e
cd /scratch
python3.8 -m pip install --upgrade 'pip<22.0'
python3.8 -m pip install -r requirements.txt
python3.8 -m pip install .
python3.9 -m pip install --upgrade 'pip<22.0'
python3.9 -m pip install -r requirements.txt
python3.9 -m pip install -r requirements-igwn.txt
python3.9 -m pip install -r companion.txt
python3.9 -m pip install .
cd /
mkdir -p /opt/pycbc/src
cp -a /scratch /opt/pycbc/src/pycbc
Expand Down
4 changes: 2 additions & 2 deletions tools/docker_build_dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fi
if [ "x${PYCBC_CONTAINER}" == "xpycbc_rhel_virtualenv" ]; then

ENV_OS="x86_64_rhel_8"
yum -y install python38 python38-devel
yum -y install python39 python39-devel
yum -y groupinstall "Development Tools"
yum -y install which rsync
yum clean all
Expand All @@ -51,7 +51,7 @@ if [ "x${PYCBC_CONTAINER}" == "xpycbc_rhel_virtualenv" ]; then
mkdir -p ${CVMFS_PATH}

VENV_PATH=${CVMFS_PATH}/pycbc-${SOURCE_TAG}
virtualenv -p python3.8 ${VENV_PATH}
virtualenv -p python3.9 ${VENV_PATH}
echo 'export PYTHONUSERBASE=${VIRTUAL_ENV}/.local' >> ${VENV_PATH}/bin/activate
echo "export XDG_CACHE_HOME=\${HOME}/cvmfs-pycbc-${SOURCE_TAG}/.cache" >> ${VENV_PATH}/bin/activate
source ${VENV_PATH}/bin/activate
Expand Down

0 comments on commit e1d9e26

Please sign in to comment.