Skip to content

Commit

Permalink
Apply tests to python bindings in precice/python-bindings (#133)
Browse files Browse the repository at this point in the history
* replace installation of python bindings from precice/precice with bindings from precice/python-bindings

* directly use repository address for pip3 install, avoids cloning

* Fix fe-fe test by adding cd to user directory
  • Loading branch information
BenjaminRodenberg authored Dec 6, 2019
1 parent f9c5ac9 commit 10d4079
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 18 deletions.
17 changes: 7 additions & 10 deletions adapters/Dockerfile.fenics-adapter
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,17 @@ RUN pip3 install --user cython # TODO: can we put this dependency into requirem

USER precice

# Builds the precice python bindings for python3
RUN cd $PRECICE_ROOT/src/precice/bindings/python && \
pip3 install --user .

# Rebuild image if force_rebuild after that command
ARG CACHEBUST

# Building fenics-adapter
WORKDIR /home/precice
ARG branch=develop
RUN git clone --branch $branch https://github.com/precice/fenics-adapter.git && \
cd fenics-adapter && \
pip3 install --user . && \
python3 setup.py test

# Builds the precice python bindings for python3
RUN pip3 install --user https://github.com/precice/python-bindings/archive/$branch.zip

# Building fenics-adapter
RUN pip3 install --user https://github.com/precice/fenics-adapter/archive/$branch.zip

WORKDIR /home/precice
RUN mkdir -p Data/Input Data/Output Data/Exchange
WORKDIR /home/precice/fenics-adapter
6 changes: 4 additions & 2 deletions tests/TestCompose_fe-fe.Ubuntu1804.home/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ services:
- output:/home/precice/Data/Output
- input:/home/precice/Data/Input
command: >
/bin/bash -c "python3 /home/precice/Data/Input/heat.py -d -i simple
/bin/bash -c "cd /home/precice
&& python3 /home/precice/Data/Input/heat.py -d -i simple
&& cp *.log /home/precice/Data/Output"
container_name: fenics-adapter-dirichlet
depends_on:
Expand All @@ -24,7 +25,8 @@ services:
- output:/home/precice/Data/Output
- input:/home/precice/Data/Input
command: >
/bin/bash -c "python3 /home/precice/Data/Input/heat.py -n -i simple
/bin/bash -c "cd /home/precice
&& python3 /home/precice/Data/Input/heat.py -n -i simple
&& cp *.log /home/precice/Data/Output"
container_name: fenics-adapter-neumann
depends_on:
Expand Down
5 changes: 3 additions & 2 deletions tests/TestCompose_nutils-of/Dockerfile.nutils
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ RUN wget -q https://bootstrap.pypa.io/get-pip.py -O get-pip.py && \
pip3 install Cython mpi4py numpy enum34

USER precice
ARG branch=develop

WORKDIR $PRECICE_ROOT/src/precice/bindings/python
RUN pip3 install --user .
# Builds the precice python bindings for python3
RUN pip3 install --user https://github.com/precice/python-bindings/archive/$branch.zip

WORKDIR /home/precice/
RUN git clone https://github.com/nutils/nutils.git && \
Expand Down
5 changes: 3 additions & 2 deletions tests/Test_bindings.Ubuntu1804/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ RUN apt-get -qq update && apt-get -qq install \

USER precice

ARG branch=develop

# Builds the precice python bindings for python3
WORKDIR $PRECICE_ROOT/src/precice/bindings/python
RUN pip3 install --user .
RUN pip3 install --user https://github.com/precice/python-bindings/archive/$branch.zip

# Runs the python solverdummy with python3
WORKDIR $PRECICE_ROOT/tools/solverdummies/python
Expand Down
5 changes: 3 additions & 2 deletions tests/Test_bindings/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ RUN wget -q https://bootstrap.pypa.io/get-pip.py -O get-pip.py && \
USER precice
RUN pip3 install --user cython mpi4py numpy enum34

ARG branch=develop

# Builds the precice python bindings for python3
WORKDIR $PRECICE_ROOT/src/precice/bindings/python
RUN pip3 install --user .
RUN pip3 install --user https://github.com/precice/python-bindings/archive/$branch.zip

# Runs the python solverdummy with python3
WORKDIR $PRECICE_ROOT/tools/solverdummies/python
Expand Down

0 comments on commit 10d4079

Please sign in to comment.