Skip to content

Commit

Permalink
#275: - changed entrypoint.sh regarding venv
Browse files Browse the repository at this point in the history
- redefined dockerfile to include pyZoltan
  • Loading branch information
Marcin Wróbel committed Nov 10, 2022
1 parent 291dc2c commit 7605f18
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
30 changes: 21 additions & 9 deletions lbaf.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,38 @@
FROM python:3.8-slim-buster
ARG INSTALL_PREFIX=/home/install
ARG ZOLTAN=$INSTALL_PREFIX
ARG ZOLTAN_INCLUDE=/usr/include/trilinos
ARG ZOLTAN_LIBRARY=/usr/lib/x86_64-linux-gnu
ARG USE_TRILINOS=1

RUN apt-get update && apt-get upgrade -y
RUN apt-get install -y git xvfb
RUN apt-get install -y openmpi-bin libopenmpi-dev libtrilinos-zoltan-dev build-essential

COPY requirements-3.8.txt /lbaf/requirements.txt

WORKDIR /home
RUN git clone https://github.com/pypr/pyzoltan.git
WORKDIR /home/pyzoltan
RUN sh build_zoltan.sh $INSTALL_PREFIX

WORKDIR /lbaf
RUN python -m venv venv
RUN venv/bin/pip install --upgrade pip
RUN venv/bin/pip install -r /home/pyzoltan/requirements.txt && venv/bin/pip install pyzoltan --no-build-isolation && venv/bin/pip install -r /lbaf/requirements.txt

ENV PYTHONPATH /lbaf/venv/lib/python3.8/site-packages:/lbaf:/lbaf/src
ENV DISPLAY :99.0

COPY src /lbaf/src
COPY data /lbaf/data
COPY requirements.txt /lbaf/requirements.txt
COPY scripts/entrypoint.sh /lbaf/entrypoint.sh
COPY scripts/test_lbaf.py /lbaf/tests/test_lbaf.py
COPY scripts/run_tests.sh /lbaf/tests/run_tests.sh
COPY scripts/test_config/conf.yaml /lbaf/src/Applications/conf.yaml

WORKDIR /lbaf
RUN mkdir /lbaf/in /lbaf/out
RUN /usr/local/bin/python -m pip install --upgrade pip && pip install virtualenv
RUN virtualenv --python /usr/local/bin/python3.8 venv
RUN /bin/sh venv/bin/activate && pip install -r requirements.txt

ENV PYTHONPATH /lbaf/venv/lib/python3.8/site-packages:/lbaf:/lbaf/src
ENV DISPLAY :99.0

RUN ["chmod", "+x", "/lbaf/entrypoint.sh"]
RUN ["chmod", "+x", "/lbaf/tests/run_tests.sh"]
RUN ["/bin/sh", "/lbaf/tests/run_tests.sh"]
ENTRYPOINT ["/lbaf/entrypoint.sh"]
2 changes: 1 addition & 1 deletion scripts/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

/bin/sh /lbaf/venv/bin/activate
/bin/sh venv/bin/activate
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
for var in "$@"
do
Expand Down

0 comments on commit 7605f18

Please sign in to comment.