Skip to content

Commit

Permalink
update docker image (#288)
Browse files Browse the repository at this point in the history
* update docker image

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* update docker permission issues description

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* jupyter support

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
PythonFZ and pre-commit-ci[bot] authored Apr 19, 2024
1 parent dbe01d8 commit cb7aab7
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 34 deletions.
19 changes: 9 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
FROM pytorch/pytorch:2.1.2-cuda11.8-cudnn8-runtime
RUN conda install git
FROM python:3.11
RUN apt update && apt install -y git

COPY . /workspace/ipsuite
# RUN python3 -m pip config set global.break-system-packages true

COPY . /workspace/ipsuite
WORKDIR /workspace/ipsuite
RUN pip install .[comparison,gap,nequip,apax,allegro,mace]
RUN pip install --upgrade torch --extra-index-url https://download.pytorch.org/whl/cu116
RUN pip install --upgrade "jax[cuda11_pip]" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html

RUN pip install .[comparison,gap,apax,mace]
RUN pip install --upgrade torch torchvision torchaudio
RUN pip install --upgrade "jax[cuda12_pip]" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html
RUN pip install git+https://github.com/PythonFZ/torch-dftd.git@patch-2
RUN pip install dvc-s3

COPY entrypoint.sh entrypoint.sh
RUN chmod +x entrypoint.sh
RUN pip install --no-cache-dir notebook jupyterlab

WORKDIR /app
ENTRYPOINT ["/workspace/ipsuite/entrypoint.sh"]
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,31 @@ Examples can be found at:

# Docker Image

You can use IPSuite directly from within docker by calling it e.g. like:
We provide an IPSuite docker image for Linux that includes the `apax`, `mace`
and `gap` MLPs. You can use IPSuite directly from within the image by calling:

```sh
docker run -it -v "$(pwd):/app" --gpus all pythonf/ipsuite dvc repro
docker run -it -v "$(pwd):/app" --gpus all pythonf/ipsuite python
docker run -it -v "$(pwd):/app" --gpus all pythonf/ipsuite zntrack list
docker run -it -v "$(pwd):/app" --gpus all --rm -p 8888:8888 pythonf/ipsuite jupyter lab --ip=0.0.0.0 --port=8888 --allow-root
```

## Fix Permission Issues

Running `dvc repro` via the docker container will create files owned by
`root:root`. If you solely use docker this will not cause any issues. If you
switch between docker and a `dvc` version on your host system, you might
encounter permission errors. You can resolve them, by changing the ownership of
the files. You can do this via the host `chown "$(id -u):$(id -g)" -R .` or from
inside the docker container:

```sh
echo $(id -u):$(id -g)
docker run -it -v "$(pwd):/app" pythonf/ipsuite /bin/bash
addgroup --gid $GROUP_ID user
adduser --disabled-password --gecos '' --uid $USER_ID --gid $GROUP_ID user
chown user:user -R .
```

# References
Expand Down
23 changes: 0 additions & 23 deletions entrypoint.sh

This file was deleted.

0 comments on commit cb7aab7

Please sign in to comment.