|
|
%!s(int64=6) %!d(string=hai) anos | |
|---|---|---|
| .. | ||
| notes | %!s(int64=6) %!d(string=hai) anos | |
| DockerfileTutorials123567 | %!s(int64=6) %!d(string=hai) anos | |
| DockerfileTutorials4 | %!s(int64=6) %!d(string=hai) anos | |
| README.md | %!s(int64=6) %!d(string=hai) anos | |
| deploy_tutorial.sh | %!s(int64=6) %!d(string=hai) anos | |
| generate_exercises.ps1 | %!s(int64=6) %!d(string=hai) anos | |
| generate_exercises.py | %!s(int64=6) %!d(string=hai) anos | |
| test_bondgraphs.py | %!s(int64=6) %!d(string=hai) anos | |
This repository contains the materials that are used in the MoDELS tutorial of physical systems modelling for software engineers, in 2019.
Install Docker.
Using docker's console, navigate to materials folder in this repository.
Build the corresponding docker image (each requires about 5GB of disk space):
docker build -f DockerfileTutorials123567 -t tutorials123567 .
or
docker build -f DockerfileTutorials4 -t tutorials4 .
This will download all dependencies you need to run the examples. You might need root access. It is advised to build both docker images before starting. This will ensure that any problem will be detected and solved early.
Note the host's ip address by running:
docker-machine ip
Let us denote it by MACHINE_IP
Run the docker container:
docker run --name jupyterrun -p 8888:8888 -ti tutorials123567
or
docker run --name jupyterrun -p 8888:8888 -ti tutorials4
This will start a container with name jupyterrun of the image tagged with jupyter and will forward any traffic going into port 8888 (in the host machine) to the same port in the virtual machine.
Fetch the tutorial exercises, run the following inside the container:
git clone http://msdl.uantwerpen.be/git/claudio/2019.Models.TutorialExercises.git .
Start Jupyter by running the following inside the container:
/opt/conda/bin/jupyter notebook --notebook-dir=/opt/notebooks --ip=0.0.0.0 --port=8888 --no-browser --allow-root
If a token is given, copy it so that you can later access the jupyter notebook from your browser. Let TOKEN denote the token given.
Open your browser and navigate to http://MACHINE_IP:8888/. If asked for a token, insert TOKEN.
Explore the examples.
Any changes made in the notebooks affect only the files inside the container. To retrieve them, either use the notebook interface to download them to your computer (File -> Download As -> Notebook), or detach from the jupyterrun container (typing Ctrl+Q,CTRL+P simultaneously on docker's console), and use the following command on docker's console:
docker cp jupyterrun:/opt/notebooks/ mynotebooks
Which will copy all files under the tutorial folder to the mytutorial folder in the repository.
To terminate and clean up, detach from the jupyterrun container (Ctrl+Q,CTRL+P simultaneously on docker's console) and type the following commands
docker stop jupyterrun && docker rm jupyterrun
docker save tutorials123567 | gzip > tutorials123567.tar.gz
docker save tutorials4 | gzip > tutorials4.tar.gz
This is usually caused by having pre-existing docker images in your pc. Since docker allocates a virtual hard disk for them, this disk may be full.
One solution is to run, in the docker terminal:
docker image prune
Which should reclaim some space.