FdAI - Fondamenti di Intelligenza Artificiale presso l'Università degli Studi di Parma (6 CFU).
This project sets up a development environment using Jupyter Notebook on Docker. The container is based on jupyter/minimal-notebook
image, and, has some useful packages (check REQUIREMENTS
), allowing you to develop quantum programs locally and execute them inside the container.
Make sure you have the following tools installed on your system:
To build the Docker image and set up the container without running it immediately, use the following command:
MacOS users may have to use the command
docker-compose
.
docker compose up --build --no-start
This command will create the container but will not start it automatically.
Once the build is complete, you can start the container using:
docker compose up -d
This command will start the container in the background, and share sessions with the host on port
8888
.
When you're done, you can stop the running container with:
docker compose stop
To completely remove the container (but keep the image), you can run:
docker compose down
This will stop and remove the container and the associated network. All notebooks and data won't be lost because they are stored in the shared folder (
src/
).
To use the installed environment, you can access the Jupiter Notebook server by opening the following URL in your web browser:
http://localhost:8888
If you are using VScode, you can install the Jupiter extension to edit .ipynb
files, without interacting with the web browser interface.
Then, you can change the Jupiter kernel setting localhost:8888
as the new one. This allows you to execute the Jupiter file locally.
!!!IMPORTANT!!! You might encounter issues with file paths. To resolve this problem, you need to set the file path relative to the directory containing the notebook. To do this, insert the following code as the first cell of the notebook:
%cd ~/{path to the notebook directory as seen from vscode}
es. for first lab:
%cd ~/src/laboratori/00
If you wish use some notebooks please create a directory named personal
inside src/
.
This folder will be automatically shared with the container and will not be tracked by git.