Container Architecture lab types are in general release. Please contact support@vocareum.com to set up a compatible course.

Creating a JupyterLab Assignment

Select "Edit Labs" and "New Lab" below.

Create a name for the lab and save.

Adding your new lab to a new or existing group is optional

Next create a part for the new lab. Selecting "+" under Parts.

Give the part a name and hit Save Part.

Remember to always Save Part after naming and before making any further changes to your lab

Set your lab type to JupyterLab and hit Save Part again.

Configure Workspace and File System

Select Configure Workspace to launch JupyterLab.

The JupyterLab IDE will open first for instructors and learners. Switch to Jupyter Notebook by clicking the 'Jupyter View' dropdown on the top of the IDE and Selecting 'Jupyter Notebook View'.

Navigate to /voc/. This is the file system for your JupyterLab.

Jupyter Notebook View:

Container file system

While configuring the container, there is a file system mounted in the container. These files are not a part of the docker image. The purpose of these files are multifold -

  • /voc/course/private - this directory is common to the entire course and is available only to the grading script.

  • /voc/data - Makes data available to the learners. For large data sets, it is a more efficient way to deliver data than make it a part of the image. Every lab gets access to a readonly copy of the data and it can be updated by just modifying the content of the directory and hitting “Update”. Rather than building a new image and releasing it.

  • /voc/docs - For adding README.md files.

  • /voc/private - this directory is specific to the “part” and is available only to the grading script

  • /voc/public - Makes data available to the learners. For large data sets, it is a more efficient way to deliver data than make it a part of the image. Every lab gets access to a readonly copy of the data and it can be updated by just modifying the content of the directory and hitting “Update”. Rather than building a new image and releasing it.

  • /voc/scripts/grade.sh - This script is run when the learner clicks “submit”. This script is automatically generated when a nbgrader annotated notebook is “released”.

  • /voc/startercode - Initializes the student environment. All the content of this directory is copied to /home/labsuser directory when the learner launches the lab.

  • /home/labsuser - This directory can also be used to develop and test startercode, scripts, etc. Can be used for creating quiz.md before running "Generate Quiz" operation.

Uploading A Notebook

From the Jupyterlab IDE navigate to /home/labsuser

Select the upload icon and select your notebook.

Once you have uploaded the notebook select "Update*" to apply this change across the learner work environments.

nbgrader

Vocareum supports nbgrader for Jupyter. Details on how to release a graded notebook here

Installing Packages

To install packages that will be available globally, across all learner environments, instructors will need to create a new image. Enter Configure Workspace and open the terminal in your JupyterLab. Install your package with the sudo command.

sudo pip3 install <package>

Instructors can install packages locally for testing. Learners can install to their local directory as well. Enter Configure Workspace and open the terminal in your JupyterLab. Install package with the pip command.

pip3 install <package>

Install Julia packages globally

sudo su
export JULIA_DEPOT_PATH="/opt/julia"
julia -e "using Pkg; Pkg.add([\"Combinatorics\", \"LightGraphs\"])"

To make the new packages available in learner environments select Save Image.

Name your container image and Save.

Return to the Part settings, adjust the lab type to the newly created image and select 'Save Part'.

The package is now available for all learners.

Changing the Kernel Version

Jupyterlab containers come with Python 3.10 installed. If your coursework requires a notebook to run on a different version of Python you will need to run the following script in the Jupyterlab terminal:

sudo su
apt-get update
apt-get -y install python3-pip
python3.8 -m pip install ipykernel
python3.8 -m ipykernel install --name=Python3.8
mv /usr/local/share/jupyter/kernels/python3.8 /usr/local/venvs/jupyter/share/jupyter/kernels/

In this example we are using Python3.8

It may take a couple minutes to render but you will now be able to change the Kernel from the Jupyter tool bar.

Did this answer your question?