Skip to content

Commit

Permalink
Add venv's to a number of dockerfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
linusseelinger committed May 17, 2024
1 parent 3e0e1dd commit ae02ff8
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 39 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/test-readmes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@ jobs:
-
name: Dependencies
run: |
apt update; apt install -y python3-pip; pip3 install marko
apt update && DEBIAN_FRONTEND="noninteractive" apt install -y python3-pip python3-venv
python3 -m venv venv
. venv/bin/activate
pip3 install marko
-
name: Validate
run: |
. venv/bin/activate
cd docs && python3 test_benchmark_readmes.py
9 changes: 5 additions & 4 deletions benchmarks/analytic-banana/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ FROM ubuntu:latest
COPY . /server

RUN apt update && \
DEBIAN_FRONTEND="noninteractive" apt install -y python3-pip
DEBIAN_FRONTEND="noninteractive" apt install -y python3-pip python3-venv && \
python3 -m venv venv && \
. venv/bin/activate && \
pip install umbridge umbridge numpy scipy

RUN pip3 install umbridge numpy scipy

CMD python3 /server/server.py
CMD . venv/bin/activate && python3 /server/server.py
9 changes: 5 additions & 4 deletions benchmarks/analytic-donut/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ FROM ubuntu:latest
COPY . /server

RUN apt update && \
DEBIAN_FRONTEND="noninteractive" apt install -y python3-pip
DEBIAN_FRONTEND="noninteractive" apt install -y python3-venv && \
python3 -m venv venv && \
. venv/bin/activate && \
pip install install umbridge numpy

RUN pip3 install umbridge numpy

CMD python3 /server/server.py
CMD . venv/bin/activate && python3 /server/server.py
9 changes: 5 additions & 4 deletions benchmarks/analytic-funnel/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ FROM ubuntu:latest
COPY . /server

RUN apt update && \
DEBIAN_FRONTEND="noninteractive" apt install -y python3-pip
DEBIAN_FRONTEND="noninteractive" apt install -y python3-pip python3-venv && \
python3 -m venv venv && \
. venv/bin/activate && \
pip install umbridge numpy

RUN pip3 install umbridge numpy

CMD python3 /server/server.py
CMD . venv/bin/activate && python3 /server/server.py
9 changes: 5 additions & 4 deletions benchmarks/analytic-gaussian-mixture/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ FROM ubuntu:latest
COPY . /server

RUN apt update && \
DEBIAN_FRONTEND="noninteractive" apt install -y python3-pip
DEBIAN_FRONTEND="noninteractive" apt install -y python3-pip python3-venv && \
python3 -m venv venv && \
. venv/bin/activate && \
pip install umbridge numpy scipy

RUN pip3 install umbridge numpy scipy

CMD python3 /server/server.py
CMD . venv/bin/activate && python3 /server/server.py
13 changes: 7 additions & 6 deletions benchmarks/cuqi-ct/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
FROM ubuntu:latest

RUN apt update && \
DEBIAN_FRONTEND="noninteractive" apt install -y python3-pip

RUN pip3 install umbridge cuqipy

COPY . /server

WORKDIR /server

CMD python3 server.py
RUN apt update && \
DEBIAN_FRONTEND="noninteractive" apt install -y python3-pip python3-venv && \
python3 -m venv venv && \
. venv/bin/activate && \
pip install umbridge cuqipy

CMD . venv/bin/activate && python3 server.py
13 changes: 7 additions & 6 deletions benchmarks/deconvolution-1d/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
FROM ubuntu:latest

RUN apt update && \
DEBIAN_FRONTEND="noninteractive" apt install -y python3-pip

RUN pip3 install umbridge cuqipy

COPY . /server

WORKDIR /server

CMD python3 server.py
RUN apt update && \
DEBIAN_FRONTEND="noninteractive" apt install -y python3-pip python3-venv && \
python3 -m venv venv && \
. venv/bin/activate && \
pip install umbridge cuqipy

CMD . venv/bin/activate && python3 server.py
13 changes: 7 additions & 6 deletions benchmarks/heat-1d/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
FROM ubuntu:latest

RUN apt update && \
DEBIAN_FRONTEND="noninteractive" apt install -y python3-pip

RUN pip3 install umbridge cuqipy

COPY . /server

WORKDIR /server

CMD python3 server.py
RUN apt update && \
DEBIAN_FRONTEND="noninteractive" apt install -y python3-pip python3-venv && \
python3 -m venv venv && \
. venv/bin/activate && \
pip install umbridge cuqipy

CMD . venv/bin/activate && python3 server.py
7 changes: 5 additions & 2 deletions models/achlys/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ FROM linusseelinger/achlys-ubuntu
RUN apt update && apt install -y inotify-tools && \
rm -rf /var/lib/apt/lists/*

RUN apt install -y python3-pip && pip3 install umbridge
RUN apt install -y python3-pip python3-venv && \
python3 -m venv venv && \
. venv/bin/activate && \
pip install umbridge

COPY server.py /server.py

COPY modify_input_file /opt/modify_input_file

CMD python3 /server.py
CMD . venv/bin/activate && python3 /server.py
7 changes: 5 additions & 2 deletions models/dune-composites/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@ WORKDIR /dune/build/dune-composites/src

ENV OMP_NUM_THREADS=1

RUN apt install -y python3-pip && pip3 install umbridge
RUN apt install -y python3-pip python3-venv && \
python3 -m venv venv && \
. venv/bin/activate && \
pip install umbridge

COPY server.py server.py

CMD python3 server.py
CMD . venv/bin/activate && python3 server.py

0 comments on commit ae02ff8

Please sign in to comment.