A comprehensive modelling framework for complex and evolving systems. More info: utopia-project.org
5.8K
utopia-project.orggitlab.com/utopia-project/utopiadocs.utopia-project.orgThis image contains a ready-to-run instance of Utopia with all its models.
It is built on top of the ccees/utopia-base image.
For further information and usage guides, have a look at the Utopia documentation. For the source code, visit the project page. Please open issues there, if you detect any problems with this docker image.
Only the latest tag is maintained for this docker image.
It refers to the most recent version of Utopia and is updated upon each merge into the master branch of the source code repository.
The corresponding Dockerfile can be found here.
latest tag
docker pull ccees/utopia:latest
docker run -v $PWD:/home/utopia/io -it ccees/utopia:latest
$PWD; in Windows PowerShell you will need to use ${PWD} instead!) into the Docker container at /home/utopia/io. By default, all output of Utopia will be placed into /home/utopia/io/output/. Therefore, the output directory will be persistently available on your host system via the file mount. Inversely, you can place configuration files into the mounted directory on your host system to use them inside the container.exit)utopia command line interface, which is made available upon starting a container of this image. For example, to run a model with its default settings, execute
utopia run {model_name}
utopia --help
You can also use your container to work interactively with Utopia. The image already includes the latest installation of IPython and Jupyter Notebook. The following steps will show how you can setup a notebook server running inside the docker container and then attach to it on your host machine:
docker run command: As the notebook is by default hosted on port 8888, we want to map that port through from the container to your host:
docker run -v $PWD:/home/utopia/io -p 8888:8888 -it ccees/utopia:latest
jupyter notebook --ip 0.0.0.0 --port=8888 --no-browser
http://localhost:8888/?token=.... Copy that address and use the browser of your host machine to navigate there.
http://(container_name or 127.0.0.1):8888/..., where container name are some random alphanumeric characters, don't despair. This just gives you options on how to open the container. The only viable option from outside the container is localhost, which is the same as 127.0.0.1./home/utopia/io directory and can create a notebook there. Congratulations! :)For more information on how to work with models inside the notebook, have a look at the corresponding documentation.
Permission Denied on Linux hostsIf you get a Permission Denied error when running a simulation, the mounted directory probably does not have proper access rights; this frequently happens when the host system is a Linux distribution.
To resolve this, you can allow global write access via chmod -R 777 path/to/mounted/directory, which allows the container to write data. Alternatively, consult the docker run documentation regarding how to align the user ID within the container with the user ID on your host system.
apt installTo install packages, first update the package index by running:
apt update
After this, you can install packages as usual, e.g. apt install vim.
You can also use this docker image to develop Utopia models. This can be useful if you are not working on a system that Utopia can be installed on from source.
The basic idea is:
Effectively, the docker container serves as an Utopia-specific development environment. This also pertains to custom repositories that hold further Utopia models.
Note: These procedures are not suitable for development of the Utopia framework itself.
For development, we suggest the following folder structure. The table shows the equivalent paths on host and container side.
| Path on Host | Path within container | Description |
|---|---|---|
~/utopia/io | /home/utopia/io | Input/Output, mainly for running simulations |
~/utopia/MyModels | /home/utopia/MyModels | A repository with further Utopia models |
The ~/utopia/MyModels directory is the cloned git repository you want to make source code changes on.
Throughout this guide, MyModels is a place holder; replace it by the name of the repository you want to work on.
Enter the ~/utopia directory or the corresponding directory on your host system.
To create and enter a new container, the command is as follows (make sure to adjust the MyModels place holder):
docker run -v $PWD/io:/home/utopia/io -v $PWD/MyModels:/home/utopia/MyModels --name MyUtopiaModels -it ccees/utopia:latest
By specifying a container name, you can later run the existing container again using the following command:
docker start -ia MyUtopiaModels
Remarks:
After entering the container with the above command, you can make changes to the source code in the mounted directories. You can perform these changes both from within the container or on your host system; the mounted directories are mirrored between the two.
To compile code, first enter the docker container using one of the ways described above. Inside the container, navigate to the build directory of the project you made changes to and invoke the respective configuration and build commands. For more information on available commands, refer to the Utopia README.
cd /utopia/build
cmake ..
make dummy
To update the source code of an existing container, you can use the same procedure as you would outside the container:
cd /home/utopia/MyModels
git checkout master
git pull
cd build
cmake ..
To update the Utopia framework, navigate to the /utopia directory and use the same commands.
Note: If there are significant changes to the Utopia framework (i.e. the ccees/utopia image the containers are based on), the more advisable approach is to docker pull the updated image and create a new container using the procedure described above.
Important: Before removing a container, make sure that you have any source code changes committed and pushed or otherwise stored!
Via the directory mounts, the data in io and MyModels will persist; for the framework repository at /utopia that is not the case.
Content type
Image
Digest
sha256:c85f91987…
Size
1.6 GB
Last updated
over 1 year ago
docker pull ccees/utopia