Question 2. Virtualization and Containerization (20 points)
Assume you want to set up two isolated Jupyter notebook environments and you are going to use container technology to implement that. The images you will use are: jupyter/r-notebook and jupyter/pyspark-notebook. You have designated directory on host file system for each container and would like to save notebooks developed inside containers on those directories. You should make assumptions on the actual directory you want to use for each container. Assume all required images have been pulled and stored locally. The basic command to run a container with bind mount option is as follows:
docker run --rm -p 10000:8888 -v "$PWD":/home/jovyan/work jupyter/r- notebook
You can use the –-name option to give a name to your container. You can also replace the "$PWD" option with an absolute path in your file system such as "/home/xyz123/c1".
1. [2 points] Show the command to run a container based on jupyter/r-notebook, you should give the container a name and bind mounts a local directory into the container.
2. [2 points] Describe how you can access the jupyter notebook server running on this container.
3. [2 points] Show the command to list all processes running in this container.
4. [4 points] Assume the first container is running, show the command to run a second container based on jupyter/pyspark-notebook. You should give the second container a different name and bind mounts a different local directory into the container.
5. [2 points] Describe how you can access the jupyter notebook server on the second container.
6. [2 points] Assume you create a new folder called "project" under "/home/jovyan" and develope a few notebooks in this folder inside this container, where can you locate those notebooks on your local file system?
7. [6 points] Describe how you may achieve the isolated environment using virtualization techniques and highlight the difference between the two techniques using your own words.