Assignment 2#

The goal of this assignment is to work with Conda, Docker and JupyterLab.

You should submit this assignment to your existing geog313-assignments GitHub repository under a new directory named assignment-2.

Create a Dockerized Conda Environment#

In this part, you will develop a Dockerfile that creates a conda environment using an environment.yml file. Your Dockerfile should:

  1. Start from a miniconda parent image.

  2. Create a new conda environment named a2-env using an environment.yml file and install the following packages: numpy=1.25.2, scipy=1.11.1, matplotlib=3.7.2, and jupyterlab=3.6.3.

  3. Activate the a2-env, and launch JupyterLab from /home/assignment/ when the container is run.

Make a new commit, and push this part of the assignment to your GitHub repository.

Create a Notebook#

In this part, you will create a Jupyter notebook that visualizes some data. Your Jupyter notebook should run inside a container based on the Dockerfile from the previous section (the notebook should be accessed using the mount option, and should not be included in the Docker image)

  1. Create a Jupyter notebook.

  2. Write appropriate code in this notebook to do the following:

  • Generate array x that contains a sequence of numbers from -100 to 100 (inclusive) with steps of 0.5

  • Generate array y that is the cosine of x

  • Generate array z that is the sine of x

  1. Create a new plot with the following:

  • Plot both z and y vs x on the same axis

  • Add a legend to the plot to name z and y

  • Add appropriate x- and y-axes labels

Make a new commit, and push this part of the assignment to your GitHub repository. Make sure you run all cells in your notebook, and save it before committing it so that the plot is included in your commit and its rendered on GitHub.

Documentation#

Finally, create a README.md file inside the assignment-2 directory that provides a step-by-step guide on how to run a container using your Dockerfile and execute the notebook you created. Commit and push this file to GitHub.