Skip to content

Commit

Permalink
Merge pull request #1 from simphony/fix/Dockerfile
Browse files Browse the repository at this point in the history
fix installation procedure
  • Loading branch information
MBueschelberger authored Aug 24, 2023
2 parents 91753ef + 3abb06c commit 7e2f1fc
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 14 deletions.
3 changes: 3 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ GITHUB_ACCESS_TOKEN=

BUILD_VERSION=v1.0.0

WRAPPER_DEPS_INSTALL=https://github.com/SCM-NV/pyZacros/archive/refs/tags/v.1.2.zip https://github.com/mbracconi/adaptiveDesignProcedure/archive/refs/tags/v1.4.0.zip
WRAPPER_DEPS_EXTRA=git+https://github.com/SCM-NV/PLAMS@7661960a9db53249a0b77935dacc8a7668c2489b

CATALYTIC_FOAM_REPO=https://oauth2:${GITHUB_ACCESS_TOKEN}@github.com/MBueschelberger/catalyticFoam_ReaxPro.git
EIGEN_REPO=https://gitlab.com/libeigen/eigen/-/archive/3.3.9/eigen-3.3.9.tar.gz

Expand Down
22 changes: 13 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@ RUN apt-get update && apt-get install -y \

# retrieve build args
ARG GITHUB_ACCESS_TOKEN
ARG GITLAB_ACCESS_TOKEN
ARG EIGEN_REPO
ARG CATALYTIC_FOAM_REPO


# make code base in homedir read-/write-/executable to USER
RUN chmod -R 0777 /home/openfoam
# update .profile and add .local/bin to PATH
Expand All @@ -46,7 +44,7 @@ COPY .compile mybashrc
RUN source /opt/openfoam8/etc/bashrc && source mybashrc && ./Allwmake

# add code base
WORKDIR /home/openfoam/reaxpro_wrappers
WORKDIR /home/openfoam/simphony-catalytic
COPY osp osp
COPY tests tests
COPY examples examples
Expand All @@ -64,12 +62,15 @@ RUN \
################################## target: dev ##################################
from base as develop

WORKDIR /home/openfoam/reaxpro_wrappers
ARG WRAPPER_DEPS_INSTALL
ARG WRAPPER_DEPS_EXTRA

WORKDIR /home/openfoam/simphony-catalytic

# # install deps for pytests
RUN pip install --upgrade pip
RUN pip install osp-core
RUN pip install .[dev,pre_commit,tests]
RUN pip install osp-core $WRAPPER_DEPS_INSTALL
RUN pip install .[dev,pre_commit,tests] $WRAPPER_DEPS_EXTRA

# go /app dir
WORKDIR /app
Expand All @@ -82,10 +83,13 @@ RUN chown openfoam:openfoam /tmp

from base as production

WORKDIR /home/openfoam/reaxpro_wrappers
ARG WRAPPER_DEPS_INSTALL
ARG WRAPPER_DEPS_EXTRA

WORKDIR /home/openfoam/simphony-catalytic
USER openfoam

# # install wrappers and their python-dependencies
RUN pip install --upgrade pip
RUN pip install osp-core
RUN pip install .
RUN pip install osp-core $WRAPPER_DEPS_INSTALL
RUN pip install . $WRAPPER_DEPS_EXTRA
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ More important, make sure that you have the catalyticFOAM-solver installed on yo

### Python dependencies

First of all, you will need to install OSP-core
First of all, you will need to install OSP-core, plams, AdaptiveDesignProcedure and pyZacros (all except osp-core are not on PyPI yet unfortunately):

```shell
(env) user@computer:~/reaxpro-wrappers$ pip install osp-core
(env) user@computer:~/reaxpro-wrappers$ pip install osp-core https://github.com/SCM-NV/pyZacros/archive/refs/tags/v.1.2.zip https://github.com/mbracconi/adaptiveDesignProcedure/archive/refs/tags/v1.4.0.zip git+https://github.com/SCM-NV/PLAMS@7661960a9db53249a0b77935dacc8a7668c2489b
```

Then, install the wrapper. Simply type:
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ services:
context: "."
args:
- GITHUB_ACCESS_TOKEN=$GITHUB_ACCESS_TOKEN
- GITLAB_ACCESS_TOKEN=$GITLAB_ACCESS_TOKEN
- CATALYTIC_FOAM_REPO=$CATALYTIC_FOAM_REPO
- EIGEN_REPO=$EIGEN_REPO
- WRAPPER_DEPS_EXTRA=$WRAPPER_DEPS_EXTRA
- WRAPPER_DEPS_INSTALL=$WRAPPER_DEPS_INSTALL
target: "${DOCKER_BUILD_TARGET:-develop}"
tty: True
entrypoint: /bin/bash
environment:
GITLAB_ACCESS_TOKEN: ${GITLAB_ACCESS_TOKEN}
REAXPRO_MINIO_ENDPOINT: minio:9000
REAXPRO_MINIO_USER: ${REAXPRO_MINIO_USER}
REAXPRO_MINIO_PASSWORD: ${REAXPRO_MINIO_PASSWORD}
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ install_requires =
parsimonious
arcp>=0.2.1
minio>=7.1.15
reaxpro-wrappers>=1.6.1
reaxpro-wrappers>=1.6.2
python_requires = >3.7, <3.11
include_package_data = True
package_dir =
Expand Down

0 comments on commit 7e2f1fc

Please sign in to comment.