Hi everyone, we have added some features recently that may not be directly obvious to everyone. These features allow users to select and fix (i.e. pin) the image that will be used to launch the Jupyterhub server(s). This way if the Docker image for your server does not change often or it takes a long time to build you can pin it so that you do not have to wait for the image to build on every commit.
This can be useful if you are sharing a project with many users who will fork it and not change the Docker image but just test out your code. It can be also useful for anyone who is using Renku to teach a class.
The easiest way to achieve this is as follows:
- Create a new renku project as usual, modify the Dockerfile as required, add code and allow gitlab to build the image. Skip this step if you already have an existing renku project.
- Go to the gitlab page of your project. This can be easily done by clicking the gitlab icon in the top right of the renkulab web page.
- On the gitlab project page navigate to Packages β Container Registry and find the docker image you would like to use and pin. Copy the path to this image using the little clipboard icon right next to the image name.
- Start a Jupyterhub session, and in the terminal run the command
renku config set interactive.image "registry.renkulab.io/image_name/that_i_copied_from_previous_step"
. Optionally you can also directly edit the image field in the.renku/renku.ini
file in your project repository. If the image field does not exist in your renku.ini file then add it like so in a new lineimage = registry.renkulab.io/image_name/that_i_copied_from_previous_step
. The safest and recommended way to do this however is to use the renku cli command and not edit the file directly. - Optionally if you would like to prevent new docker images being built on every commit you can edit the
.gitlab.ci.yml
file at the root of your repository and comment out the last two lines of theimage_build
step by adding a#
sign at the beginning. If you have no other automated actions in thegitlab.ci.yml
that you have added yourself you can also just fully remove this file. You can always look at a new renku project template or the history of your own repository to revert to the original file you started with.
With these changes even after adding new commits you will always use the same image and a new image will not be built on every new commit.
Here is an example public project which incorporates these changes if you are curious.
https://renkulab.io/projects/tasko.olevski/pin-image-example