Configuring custom lab
You can provide students a pre-configured environment for their projects. These "labs" are delivered as docker containers. First go to Workspace tab of the part and select "Custom Lab" to ON
At this point when you select "Configure Workspace", there should be a "Build Lab" button.
Build Lab can be used to specify a collection of containers which will run on a local network. Student can ssh into the container and that point they can only access the containers within the network. This can be used to present a network of systems to students for their cybersecurity or any class which needs access to isolated machines for the students.
This docker file is built on top of the Ubuntu base image provided by Vocareum. Currently, the following tools are installed in the image - openssh-server, sudo, unzip, build-essential, gcc-multilib, execstack, nano, vim, emacs.
Please note that the docker file should only include commands that you need to run. Platform will add its own commands to specify the base image as well as other changes that are needed. For example, the following is a docker file to build an image
RUN sudo apt-get -y install postgresql postgresql-contrib
#open ports HTTP(80) HTTPS(443)
- Configuration - this is the path to docker command for that instane. The path name is relative to $ASNLIB directory.
- Hostname - this is the symbolic name for the host.
- Port - the port which learner will use to access the container
- Access method - select SSH or HTTP
- Persistent workarea - if you select it then the work area for the assignment is mounted as /home/labsuser/work. Also, the resource directory of the assignment is mounted as read-only file system at /home/labsuser/resource.
Selecting the button will initiate a build of the images for selected instances. As this may take a few minutes, you can come back and see the status of the build by selecting "Build Lab" again. If there was an error encountered, click on the link in the Status column to see the error message. These are messages generated by docker build commands.
Once you successfully build the image, you are ready to now test it by going to "Student View". When the student view is launched, Vocareum will launch a container for the student. Under Details button you should see a lab option with "Launch" and "Show" option.
Student does not need to manually launch the container. However "Launch" button is there in case student needs to re-launch the container. Launching the container should take one to two seconds. By selecting "Show" the student can now see the IP address of the container that was launched under Show as well as the SSH credential. This IP is not accessible from outside the student environment.
Student can use the SSH credential to log into the container as a user "labuser" or access any other services that runs on the container using one of the open ports.