Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker with examples #245

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions Docker/simex/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
# [email protected] - Daniel Webster
FROM chuckie82/centos_env
LABEL maintainer="Chunhong Yoon <[email protected]>"
LABEL maintainer="Carsten Fortmann-Grote [email protected] github:CFGrote dockerhub:cfgrote"

ADD requirements.txt /opt/requirements.txt
ADD python_install.sh /opt/python_install.sh
RUN yum remove -y cmake && yum install -y cmake3 hdf5-devel flex bison && \
RUN yum remove -y cmake && yum install -y cmake3 hdf5-devel flex sudo bison git && \
yum clean all && rm -rf /var/cache/yum && \
update-alternatives --install /usr/bin/cmake cmake /usr/bin/cmake3 3 && \
/opt/python_install.sh
update-alternatives --install /usr/bin/cmake cmake /usr/bin/cmake3 3

RUN ["chmod", "a+x", "/opt/python_install.sh"]
RUN "/opt/python_install.sh"
ENV PATH /opt/miniconda/bin:$PATH

ARG simex_script=simex_install.sh
ADD $simex_script /opt/simex_install.sh

RUN ["bash", "/opt/simex_install.sh"]
RUN ["sudo", "bash", "/opt/simex_install.sh"]

ENV MKLROOT=/opt/miniconda
ENV MKL_ROOT=/opt/miniconda
Expand All @@ -25,4 +27,14 @@ ENV PYTHONPATH=$SIMEX_ROOT/Sources/python:$SIMEX_ROOT/lib/python3.7:$PYTHONPATH:
ENV SIMEX_TESTS=$SIMEX_ROOT/Tests
ENV PYFAI_TESTIMAGES=/tmp

RUN ["pip3", "install", "jupyter"]

RUN useradd -m jovyan

RUN ["git", "clone", "--depth", "1", "https://github.com/PaNOSC-ViNYL/SimEx-notebooks.git", "/home/jovyan/simex_notebooks"]

WORKDIR /home/jovyan/simex_notebooks

CMD ["jupyter", "notebook", "--port=24306", "--no-browser", "--ip=0.0.0.0", "--allow-root"]


22 changes: 22 additions & 0 deletions Docker/simex/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Instructions for building, tagging, pushing, and running the simex docker container
## Building
```
./build_image.sh
```

## Tag
```
docker tag simex cfgrote/simex
```

## Push
```
docker push cfgrote/simex
```

## Run container and start jupyter to be accessed from host or remote client on port `HOSTPORT`.
```
docker run -p HOSTPORT:24306 cfgrote/simex
```


2 changes: 1 addition & 1 deletion Docker/simex/build_image
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cp ../../requirements.txt .

buildah bud -t cloudbusting/simex -f Dockerfile .
docker build -t cfgrote/simex .

16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,22 @@ git clone --depth 1 -b develop https://github.com/PaNOSC-ViNYL/SimEx.git
Now the TestFiles are hosted at [Zenodo](https://zenodo.org/record/3750541#.X2R9DZMzZE5).
The files can be downloaded with [this script](get_testdata.sh).

## Docker
Our docker image `cfgrote/simex` provides a complete runtime environment including
* The SimEx python library
* All dependencies and backengines
* jupyter lab
* Example jupyter notebooks from [simex_notebooks](https://github.com/PaNOSC-ViNYL/SimEx-notebooks).

### Running the container
In the terminal, run
```
docker run --port HOSTPORT:24306 cfgrote/simex
```
If the docker image is not found on the host system, it will first be `pull`ed from dockerhub.

Then, navigate to http://host:HOSTPORT and find yourself in a running jupyter notebook environment.


## Acknowledgements
This project has received funding from the European Union’s Horizon 2020 research
Expand Down