Other useful docs:
-
Install Docker, configure Docker to work without sudo and install OpenShift
- For Docker, enable experimental features
-
Update the Python environment with required packages
-
Run build.sh (within the course folder) that will create the Docker container
- If the image is large, try to make it smaller (5 GB limit) with these tricks. Take a look at spatial-analytics.dockerfile for inspiration.
- Test running the docker locally by executing (an example for
csc/spatial-analytics
-image):docker run --rm -ti -p 8888:8888 -v ${PWD}:/home/jovyan/work csc/spatial-analytics
-
Make a dedicated project for the course if it does not exist yet at https://registry-console.rahti.csc.fi/
- Access policy should be
Anonymous: Allow all unauthenticated users to pull images
- Access policy should be
-
Push to docker image to Rahti (replace
<image-name>
and<project-name>
below to correspond your settings):-
Declare environment variables:
export OSO_PROJECT=<project-name>
(<-- this should match with the course project name that you created in step 4)export OSO_REGISTRY=docker-registry.rahti.csc.fi
-
Login to the Rahti docker image registry from docker and oc (get the tokens from Rahti registry web pages)
sudo docker login -p <DOCKER-LOGIN-TOKEN-HERE> -u unused docker-registry.rahti.csc.fi
oc login --token <OpenShift-LOGIN-TOKEN-HERE> rahti.csc.fi:8443
- Switch to correct project (if needed) by:
oc project <project name>
-
Tag the image you want to send to the registry
docker tag csc/<image-name> docker-registry.rahti.csc.fi/<project-name>/<image-name>:latest
- Sustainability course:
docker tag csc/sds-sustainability docker-registry.rahti.csc.fi/sds-sustainability/sds-sustainability:latest
- Spatial Analytics course:
docker tag csc/spatial-analytics docker-registry.rahti.csc.fi/spatial-analytics-course/spatial-analytics:latest
- Sustainability course:
-
Push the image to Rahti image registry
docker push docker-registry.rahti.csc.fi/<project-name>/<image-name>:latest
- Sustainability course:
sudo docker push docker-registry.rahti.csc.fi/sds-sustainability/sds-sustainability:latest
- Spatial analytics course:
sudo docker push docker-registry.rahti.csc.fi/spatial-analytics-course/spatial-analytics:latest
- Sustainability course:
-
Deploy the pushed image to Rahti
-
Go to https://rahti.csc.fi -> Web user interface -> Choose your project
-
"Add to project" (top right) -> Deploy image -> Choose your image -> Deploy
-
Add route for the object (make the application publicly available/visible)
- Applications (left) -> Routes -> Create Route (top right) -> Fill only "Name" and "Service"
-
Add persistent storage
-
Create persistent storage (this is the storage allocated for the whole project):
- Storage (left) -> Create Storage (top right) -> Storage Class: glusterfs, Name: unique name, Access Mode: RWO, Size: 5GB
-
Attach it to the deployment:
-
Applications -> deployment -> click the name of the deployment -> Configuration -> Under "Volumes" Add Storage
- Choose the storage you created and add the mounting point (path) where this storage is to be added. In the CSC notebooks it should be
/home/jovyan/work
- Choose the storage you created and add the mounting point (path) where this storage is to be added. In the CSC notebooks it should be
-
-
Make the notebook container loads faster for the students by preloading the image to Rahti pods
-
In Rahti web console:
- Applications -> Deployments -> The version number of your current deployment (e.g #28) (you might need to wait for the image building to stop before continuing)
- Replicas -> Edit (pen symbol) -> increase to the number of students
- After the pods have started succesfully, bring them down again to 1
-
-
Running the container in notebooks.csc.fi
-
If you don't have group owner rights at CSC Notebooks, apply for those by sending email to servicedesk@csc.fi
-
Login to https://notebooks.csc.fi
-
Create a new Group for the course (under the "Groups" -tab) which will be used to invite students to the course CSC Notebook
-
Create a new Blueprint in Notebooks (under Blueprints tab) by using a template that uses Rahti, e.g.
Rahti Jupyter Minimal
-
Fill the name and description as you see best.
-
Specify the source for the Blueprint from Rahti registry:
docker-registry.rahti.csc.fi/<project-name>/<image-name>:latest
-
Specify the memory limit as
8000M
(remember to ask permission from CSC guys for larger instances, e.g. for 16GB)
-
-
Activate the Blueprint under the
Deactive Blueprints
section. After this, the blueprint will be available under the "Dashboard" tab.
If you need to update the docker image in Rahti, make a new image and push it to Rahti Docker registry (steps 2-5 above). After you have pushed a new image to the registry, the environment will be updated to Notebooks after repeating step 9 above (i.e. increase the number of pods and bring them down).
After a "clean" Docker/JupyterLab environment has been created for your course, you want to configure which materials will be used as source in your course Notebook environment. As a starting point, please check this CSC Pebbles guide.
To specify which repository should always be cloned for your programming environment (i.e when the students use CSC Notebooks), you need to:
- Create a dedicated repository for your course notebooks OR add a new branch to AaltoGIS/notebooks repository with your materials.
- In this repository you should add all the notebooks that you want the students to be able to see and run during the lessons. Typically you want to update this repo for each week (so that the students don't see all materials at once).
- Create a configuration file for your course into AaltoGIS/CSC-notebooks-env-config following the instructions in that repo.