Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(helm): add value to customise interactive session images (#795) #795

Merged
merged 1 commit into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions helm/reana/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,5 +134,7 @@ This Helm automatically prefixes all names using the release name to avoid colli
| `workspaces.retention_rules.cronjob_schedule` | Cron format string describing how often pending retention rules should be applied. | "0 2 * * *" |
| `workspaces.paths` | List of additional workspace paths as strings. Each mount string is composed by a key `hostPath`(path to the directory to be mounted from the Kubernetes nodes) and a cluster_pod_mountpath (path inside the cluster containers where the `mountPath` will be mounted) e.g. `hostPath:mountPath`. The first value listed will be the default workspace root path. Any POSIX filesystem mounted on cluster nodes is supported | None |
| `interactive_sessions.cronjob_schedule` | Cron format string describing how often interactive session cleanup should be performed. | "0 3 * * *" |
| `interactive_sessions.environments.jupyter.recommended` | List of recommended environments (container images) for Jupyter notebooks. Each environment is composed of a `name` and an `image`. The first environment in the list is the default one. | `[{"image": "docker.io/jupyter/scipy-notebook:notebook-6.4.5", "name": "Jupyter SciPy Notebook 6.4.5"}]` |
| `interactive_sessions.environments.jupyter.allow_custom` | Allow users to specify custom docker images for Jupyter notebooks. | false |
| `interactive_sessions.maximum_inactivity_period` | Set a limit in days for the maximum inactivity period of interactive sessions. After this period interactive sessions will be automatically closed. To disable autoclosure and allow interactive sessions to run forever, use value "forever". | forever |
| `components.reana_ui.launcher_examples` | Array of demo examples to show in the launch page in the UI. Each demo repository is composed of `name`, `url`, `image_url`; you can also optionally specify a `description` and the `specification` filename. | [] |
3 changes: 3 additions & 0 deletions helm/reana/templates/reana-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,6 @@ data:
image_url: {{ .image_url | quote }}
specification: {{ .specification | quote }}
{{- end }}
interactive_sessions:
environments:
{{- .Values.interactive_sessions.environments | toYaml | nindent 8 }}
2 changes: 2 additions & 0 deletions helm/reana/templates/reana-workflow-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ spec:
# Environment variables for job controller
- name: REANA_JOB_CONTROLLER_ENV_VARS
value: {{ .Values.components.reana_job_controller.environment | toJson | quote }}
- name: REANA_INTERACTIVE_SESSIONS_ENVIRONMENTS
value: {{ .Values.interactive_sessions.environments | toJson | quote }}
{{- if .Values.reana_hostname }}
- name: REANA_HOSTNAME
value: {{ .Values.reana_hostname }}
Expand Down
6 changes: 6 additions & 0 deletions helm/reana/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ workspaces:

interactive_sessions:
cronjob_schedule: "0 3 * * *" # everyday at 3am
environments:
jupyter:
recommended:
- image: "docker.io/jupyter/scipy-notebook:notebook-6.4.5"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be perhaps good to have also an alias (or a list of aliases) for an image, because currently we would allow opening of docker.io/jupyter/scipy-notebook:notebook-6.4.5 but not the opening of jupyter/scipy-notebook:notebook-6.4.5 which is essentially the same image. Motivation: people often leave out docker.io from the fully-qualified image names.

This could be an issue during the use case of opening a session from the reana-client, such as:

$ rc open -w root6-roofit-snakemake-kubernetes -i jupyter/scipy-notebook:notebook-6.4.5
==> ERROR: Interactive session could not be opened:
Custom container image jupyter/scipy-notebook:notebook-6.4.5 is not allowed.

Since the docker.io prefix is kind of unique, due to Docker history, there may not be many more examplees calling for image aliases out there... So perhaps the best solution is not to alter the YAML configuration file with aliases after all, but rather to solve this command-line use case on the application level, e.g. try to add leading docker.io/ if the image name supplied by the user does not start with it, when trying to match the user-supplied value against the list of available images.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in reana-workflow-controller, the alias prefixes I have considered are:

  • docker.io/
  • docker.io/library/
  • library/

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This means that ubuntu:24.04, library/ubuntu:24.04, docker.io/library/ubuntu:24.04 are all going to work well

name: "Jupyter SciPy Notebook 6.4.5"
allow_custom: false
maximum_inactivity_period: forever

compute_backends:
Expand Down
Loading