Skip to content

Commit

Permalink
Use venv (#32)
Browse files Browse the repository at this point in the history
Use python venv
  • Loading branch information
mrogowski authored Apr 28, 2024
1 parent b41d57b commit 41986de
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 20 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:
- name: Build Docker container
run: docker build -t local docker/${{ matrix.shmem }}/
- name: run shmem4py test-1
run: docker run -v $PWD:/repo -w/repo local /bin/bash -c "pip install . && make test-1 opt=-v"
run: docker run -v $PWD:/repo -w/repo local /bin/bash -c "source /venv/bin/activate && pip install . && make test-1 opt=-v"
- name: run shmem4py test-2
run: docker run -v $PWD:/repo -w/repo local /bin/bash -c "pip install . && make test-2 opt=-v"
run: docker run -v $PWD:/repo -w/repo local /bin/bash -c "source /venv/bin/activate && pip install . && make test-2 opt=-v"
- name: run shmem4py demo-test-1
run: docker run -v $PWD:/repo -w/repo local /bin/bash -c "pip install . && cd demo && make test-1 opt=-v"
run: docker run -v $PWD:/repo -w/repo local /bin/bash -c "source /venv/bin/activate && pip install . && cd demo && make test-1 opt=-v"
- name: run shmem4py demo-test-2
run: docker run -v $PWD:/repo -w/repo local /bin/bash -c "pip install . && cd demo && make test-2 opt=-v"
run: docker run -v $PWD:/repo -w/repo local /bin/bash -c "source /venv/bin/activate && pip install . && cd demo && make test-2 opt=-v"
5 changes: 3 additions & 2 deletions docker/oshmem_fedora/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM fedora:latest
SHELL ["/bin/bash", "-c"]

ENV INSTALL_DIR=/home/shmem
RUN mkdir /home/shmem
Expand Down Expand Up @@ -29,5 +30,5 @@ ENV PATH=/home/shmem/openmpi-4.1.6/install/bin:"${PATH}" \
OMPI_ALLOW_RUN_AS_ROOT=1 \
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1

RUN ln -s /usr/bin/python3 /usr/bin/python
RUN python -m pip install setuptools cffi numpy
RUN python3 -m venv /venv
RUN source /venv/bin/activate && pip install setuptools cffi numpy
7 changes: 5 additions & 2 deletions docker/oshmem_ubuntu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM ubuntu:latest
SHELL ["/bin/bash", "-c"]

ENV INSTALL_DIR=/home/shmem
RUN mkdir /home/shmem
ENV DEBIAN_FRONTEND=noninteractive
Expand All @@ -10,7 +12,7 @@ RUN apt-get update -y && apt-get install -y \
automake \
libtool \
wget \
python3 python3-pip python-is-python3
python3 python3-pip python-is-python3 python3-venv

RUN cd $INSTALL_DIR && \
wget https://github.com/openucx/ucx/archive/refs/tags/v1.15.0.tar.gz && \
Expand All @@ -33,4 +35,5 @@ ENV PATH=/home/shmem/openmpi-4.1.6/install/bin:"${PATH}" \
OMPI_ALLOW_RUN_AS_ROOT=1 \
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1

RUN python -m pip install numpy cffi
RUN python3 -m venv /venv
RUN source /venv/bin/activate && pip install numpy cffi
5 changes: 3 additions & 2 deletions docker/oshmpi_fedora/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM fedora:latest
SHELL ["/bin/bash", "-c"]

ENV INSTALL_DIR=/home/shmem
RUN mkdir /home/shmem
Expand All @@ -16,6 +17,6 @@ RUN cd $INSTALL_DIR
make -j && make install

ENV PATH="/home/shmem/oshmpi/install/bin/:/usr/lib64/mpich/bin/:${PATH}"
RUN ln -s /usr/bin/python3 /usr/bin/python
RUN python -m pip install numpy cffi
RUN python3 -m venv /venv
RUN source /venv/bin/activate && pip install numpy cffi
ENV PSM3_DEVICES="self,shm"
6 changes: 4 additions & 2 deletions docker/oshmpi_ubuntu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM ubuntu:latest
SHELL ["/bin/bash", "-c"]

ENV INSTALL_DIR=/home/shmem
RUN mkdir /home/shmem
Expand All @@ -12,7 +13,7 @@ RUN apt-get update -y && apt-get install -y \
automake \
libtool \
mpich \
python3 python3-pip python-is-python3
python3 python3-pip python-is-python3 python3-venv

RUN cd $INSTALL_DIR && \
git clone https://github.com/pmodels/oshmpi --recurse-submodules && \
Expand All @@ -22,4 +23,5 @@ RUN cd $INSTALL_DIR
make -j && make install

ENV PATH="/home/shmem/oshmpi/install/bin/:${PATH}"
RUN python -m pip install numpy cffi
RUN python3 -m venv /venv
RUN source /venv/bin/activate && pip install numpy cffi
5 changes: 3 additions & 2 deletions docker/osss_fedora/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM fedora:latest
SHELL ["/bin/bash", "-c"]

ENV INSTALL_DIR=/home/shmem
RUN mkdir /home/shmem
Expand Down Expand Up @@ -36,5 +37,5 @@ ENV PATH=$INSTALL_DIR/osss-ucx/install/bin:/home/shmem/openmpi-4.1.6/install/bin
OMPI_ALLOW_RUN_AS_ROOT=1 \
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1

RUN ln -s /usr/bin/python3 /usr/bin/python
RUN python -m pip install setuptools cffi numpy
RUN python3 -m venv /venv
RUN source /venv/bin/activate && pip install setuptools cffi numpy
6 changes: 4 additions & 2 deletions docker/osss_ubuntu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM ubuntu:latest
SHELL ["/bin/bash", "-c"]

ENV INSTALL_DIR=/home/shmem
RUN mkdir /home/shmem
Expand All @@ -13,7 +14,7 @@ RUN apt-get update -y && apt-get install -y \
libtool \
pkg-config \
libpmix-bin libpmix-dev \
python3 python3-pip python-is-python3
python3 python3-pip python-is-python3 python3-venv

RUN cd $INSTALL_DIR && \
wget https://github.com/openucx/ucx/archive/refs/tags/v1.15.0.tar.gz && \
Expand Down Expand Up @@ -43,4 +44,5 @@ ENV PATH=$INSTALL_DIR/osss-ucx/install/bin:/home/shmem/openmpi-4.1.6/install/bin
OMPI_ALLOW_RUN_AS_ROOT=1 \
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1

RUN python -m pip install setuptools cffi numpy
RUN python3 -m venv /venv
RUN source /venv/bin/activate && pip install setuptools cffi numpy
5 changes: 3 additions & 2 deletions docker/sos_fedora/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# adapted from https://github.com/Sandia-OpenSHMEM/SOS/blob/master/scripts/docker/Dockerfile

FROM fedora:latest
SHELL ["/bin/bash", "-c"]

ENV INSTALL_DIR=/home/shmem
RUN mkdir /home/shmem
Expand Down Expand Up @@ -33,5 +34,5 @@ RUN cd $INSTALL_DIR
make check TESTS= -j

ENV PATH="/home/shmem/SOS/install/bin:/usr/lib64/mpich/bin:${PATH}"
RUN ln -s /usr/bin/python3 /usr/bin/python
RUN python -m pip install numpy cffi setuptools
RUN python3 -m venv /venv
RUN source /venv/bin/activate && pip install numpy cffi setuptools
6 changes: 4 additions & 2 deletions docker/sos_ubuntu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# adapted from https://github.com/Sandia-OpenSHMEM/SOS/blob/master/scripts/docker/Dockerfile

FROM ubuntu:latest
SHELL ["/bin/bash", "-c"]

ENV INSTALL_DIR=/home/shmem
RUN mkdir /home/shmem
Expand All @@ -19,7 +20,7 @@ RUN apt-get update -y && apt-get install -y \
libhwloc-dev \
libevent-dev \
mpich \
python3 python3-pip python-is-python3
python3 python3-pip python-is-python3 python3-venv

# Build Libfabric
RUN cd $INSTALL_DIR && \
Expand All @@ -41,4 +42,5 @@ RUN cd $INSTALL_DIR
make check TESTS= -j

ENV PATH="/home/shmem/SOS/install/bin:${PATH}"
RUN python -m pip install numpy cffi setuptools
RUN python3 -m venv /venv
RUN source /venv/bin/activate && pip install numpy cffi setuptools

0 comments on commit 41986de

Please sign in to comment.