-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Doc: Instructions for AMICI with singularity (#1964)
* how to create a container * make Dockerfile compatible with spython/singularity * mv docker/ container/
- Loading branch information
Showing
5 changed files
with
79 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
FROM ubuntu:22.04 | ||
|
||
# install dependencies | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
g++ \ | ||
libatlas-base-dev \ | ||
python-is-python3 \ | ||
python3 \ | ||
python3-dev \ | ||
python3-pip \ | ||
python3-venv \ | ||
swig | ||
|
||
# prepare python install | ||
|
||
COPY amici.tar.gz /from_host/ | ||
|
||
RUN pip3 install --upgrade pip build && \ | ||
mkdir -p /from_host/amici/ && \ | ||
cd /from_host/amici && \ | ||
tar -xzf ../amici.tar.gz && cd python/sdist && \ | ||
python3 -m build --sdist && \ | ||
pip3 install -v $(ls -t dist/amici-*.tar.gz | head -1)[petab] && \ | ||
rm -rf /from_host |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Using AMICI inside containers | ||
|
||
AMICI docker images are regularly published to | ||
https://hub.docker.com/r/dweindl/amici. | ||
|
||
## Docker / Podman | ||
|
||
The commands below are for use with Docker. When using Podman, just replace | ||
`docker` by `podman`. | ||
|
||
### Create an image | ||
|
||
In the AMICI base directory run: | ||
|
||
```bash | ||
git archive -o container/amici.tar.gz --format=tar.gz HEAD | ||
cd container && docker build -t $USER/amici:latest . | ||
``` | ||
Note that this will include files from the last commit, but no uncommitted | ||
changes. | ||
|
||
### Pull published image | ||
|
||
```bash | ||
docker pull dweindl/amici:latest | ||
``` | ||
|
||
## Singularity / Apptainer | ||
|
||
### Create an image | ||
|
||
In the AMICI base directory run: | ||
|
||
```bash | ||
# prepare amici files to be copied to the image | ||
# Note that this will include files from the last commit, but no uncommitted | ||
# changes. | ||
git archive -o container/amici.tar.gz --format=tar.gz HEAD | ||
# install spython if necessary | ||
test -x "$(command -v spython)" || pip install spython | ||
# convert Dockerfile to singularity/apptainer definition using spython | ||
(cd container/ && spython recipe Dockerfile amici.def) | ||
# build image | ||
(cd container/ && singularity build amici.sif amici.def) | ||
``` | ||
|
||
### Pull published image | ||
|
||
```bash | ||
singularity pull docker://dweindl/amici:latest | ||
``` |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.