From b6e04b4b449f00ca83e56e08a5326788efa8027d Mon Sep 17 00:00:00 2001 From: Gaspard FEREY Date: Wed, 13 Nov 2024 14:57:21 +0100 Subject: [PATCH] #173 Using library-chart multiple ports exposition mechanism in all interactive services --- charts/jupyter-pyspark/Chart.yaml | 4 +- charts/jupyter-pyspark/templates/NOTES.txt | 93 ++++++++++++-------- charts/jupyter-pyspark/values.schema.json | 19 ++++- charts/jupyter-pyspark/values.yaml | 9 +- charts/jupyter-python/Chart.yaml | 4 +- charts/jupyter-python/templates/NOTES.txt | 90 ++++++++++++++------ charts/jupyter-python/values.schema.json | 19 ++++- charts/jupyter-python/values.yaml | 9 +- charts/rstudio-sparkr/Chart.yaml | 4 +- charts/rstudio-sparkr/templates/NOTES.txt | 91 +++++++++++++------- charts/rstudio-sparkr/values.schema.json | 60 ++++--------- charts/rstudio-sparkr/values.yaml | 9 +- charts/rstudio/Chart.yaml | 4 +- charts/rstudio/templates/NOTES.txt | 99 ++++++++++++++-------- charts/rstudio/values.schema.json | 19 ++++- charts/rstudio/values.yaml | 9 +- charts/vscode-pyspark/Chart.yaml | 4 +- charts/vscode-pyspark/templates/NOTES.txt | 93 ++++++++++++-------- charts/vscode-pyspark/values.schema.json | 19 ++++- charts/vscode-pyspark/values.yaml | 9 +- charts/vscode-python/Chart.yaml | 4 +- charts/vscode-python/templates/NOTES.txt | 81 +++++++++++++----- charts/vscode-python/values.schema.json | 19 ++++- charts/vscode-python/values.yaml | 5 ++ 24 files changed, 518 insertions(+), 258 deletions(-) diff --git a/charts/jupyter-pyspark/Chart.yaml b/charts/jupyter-pyspark/Chart.yaml index 4cdc31e1..b7ea71df 100644 --- a/charts/jupyter-pyspark/Chart.yaml +++ b/charts/jupyter-pyspark/Chart.yaml @@ -24,9 +24,9 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 2.1.14 +version: 2.1.15 dependencies: - name: library-chart - version: 1.5.30 + version: 1.5.31 repository: https://inseefrlab.github.io/helm-charts-interactive-services diff --git a/charts/jupyter-pyspark/templates/NOTES.txt b/charts/jupyter-pyspark/templates/NOTES.txt index 4f06e182..b5ef968e 100644 --- a/charts/jupyter-pyspark/templates/NOTES.txt +++ b/charts/jupyter-pyspark/templates/NOTES.txt @@ -1,6 +1,7 @@ -{{- if eq .Values.userPreferences.language "fr"}} -{{ (.Values.message).fr }} -{{- if .Values.ingress.enabled }} +{{- if eq .Values.userPreferences.language "fr" -}} +{{ (.Values.message).fr }} + +{{ if .Values.ingress.enabled -}} - Vous pouvez vous connecter à ce Jupyter avec votre navigateur en utilisant ce [lien](http{{ if $.Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.hostname }}) {{- if .Values.spark.sparkui }} - Lorsque le driver Spark est en cours d'exécution, vous pouvez vous connecter à l'interface Spark-UI avec votre navigateur en utilisant ce [lien](http{{ if $.Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.sparkHostname }}) @@ -14,30 +15,44 @@ {{- end }} - Votre password: {{ .Values.security.password }} -{{- if .Values.ingress.enabled }} -{{- if .Values.networking.user.enabled }} -- Vous pouvez vous connecter à votre port personnalisé en utilisant ce [lien](http{{ if $.Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.userHostname }}) -Si vous ne lancez pas votre service personnalisé, vous obtiendrez une erreur 502 Bad Gateway. -{{- end }} -{{- end }} -{{- if .Values.route.enabled }} -{{- if .Values.networking.user.enabled }} -- Vous pouvez vous connecter à votre port personnalisé en utilisant ce [lien](https://{{ .Values.route.userHostname }}) -Si vous ne lancez pas votre service personnalisé, vous obtiendrez une erreur 502 Bad Gateway. -{{- end }} +{{- if and .Values.networking.user .Values.networking.user.enabled (or .Values.networking.user.ports .Values.networking.user.port) }} +{{ $userPorts := .Values.networking.user.ports | default (list .Values.networking.user.port) -}} +{{- if eq (len $userPorts) 1 -}} + {{- if .Values.ingress.enabled }} +Vous pouvez vous connecter à votre port personnalisé ({{ first $userPorts }}) en utilisant [ce lien](http{{ if .Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.userHostname }}). + {{- end -}} + {{- if .Values.route.enabled }} +Vous pouvez vous connecter à votre port personnalisé ({{ first $userPorts }}) en utilisant [ce lien](https://{{ .Values.route.userHostname }}). + {{- end -}} +{{- else }} +Vous pouvez vous connecter à vos services personnalisés en utilisant les liens ci-dessous : + {{- range $userPort := $userPorts -}} + {{- if $.Values.ingress.enabled -}} + {{- $hostname := (regexReplaceAll "([^\\.]+)\\.(.*)" $.Values.ingress.userHostname (printf "${1}-%d.${2}" (int $userPort))) }} +- [Port {{ $userPort }}](http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $hostname }}) + {{- end -}} + {{- if $.Values.route.enabled -}} + {{- $hostname := (regexReplaceAll "([^\\.]+)\\.(.*)" $.Values.route.userHostname (printf "${1}-%d.${2}" (int $userPort))) }} +- [Port {{ $userPort }}](https://{{ $hostname }}) + {{- end -}} + {{- end -}} +{{- end }} +Si vous accédez ces URL sans démarrer vos services personnalisés, vous obtiendrez une erreur 502 Bad Gateway. {{- end }} *REMARQUES concernant la suppression :* - {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }} - Le volume associé au chemin suivant **/home/{{ .Values.environment.user }}/work** sera supprimé - Par conséquent, vous devriez sauvegarder votre code dans un dépôt Git externe - Vous devriez également sauvegarder vos données dans un référentiel de données externe tel que S3 - Vous pouvez facilement créer un nouveau service {{ .Chart.Name }}, cloner votre code et réinstaller les bibliothèques dont vous avez besoin -{{- end }} -{{- else }} -{{ (.Values.message).en }} -{{- if .Values.ingress.enabled }} +{{- end -}} + + +{{- else -}} +{{ (.Values.message).en }} + +{{ if .Values.ingress.enabled -}} - You can connect to this jupyter with your browser on this [link](http{{ if $.Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.hostname }}) {{- if .Values.spark.sparkui }} - When the spark driver is running, you can connect to the spark-ui with your browser on this [link](http{{ if $.Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.sparkHostname }}) @@ -51,25 +66,37 @@ Si vous ne lancez pas votre service personnalisé, vous obtiendrez une erreur 50 {{- end }} - Your password: {{ .Values.security.password }} -{{- if .Values.ingress.enabled }} -{{- if .Values.networking.user.enabled }} -- You can connect to your custom port on this [link](http{{ if $.Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.userHostname }}) -If you don't run your custom service you will get a 502 bad gateway error. -{{- end }} -{{- end }} -{{- if .Values.route.enabled }} -{{- if .Values.networking.user.enabled }} -- You can connect to your custom port on this [link](https://{{ .Values.route.userHostname }}) -If you don't run your custom service you will get a 502 bad gateway error. -{{- end }} +{{- if and .Values.networking.user .Values.networking.user.enabled (or .Values.networking.user.ports .Values.networking.user.port) }} +{{ $userPorts := .Values.networking.user.ports | default (list .Values.networking.user.port) -}} +{{- if eq (len $userPorts) 1 -}} + {{- if .Values.ingress.enabled }} +You can connect to your custom port ({{ first $userPorts }}) using [this link](http{{ if .Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.userHostname }}). + {{- end -}} + {{- if .Values.route.enabled }} +You can connect to your custom port ({{ first $userPorts }}) using [this link](https://{{ .Values.route.userHostname }}). + {{- end -}} +{{- else }} +You can connect to your custom services using the following links: + {{- range $userPort := $userPorts -}} + {{- if $.Values.ingress.enabled -}} + {{- $hostname := (regexReplaceAll "([^\\.]+)\\.(.*)" $.Values.ingress.userHostname (printf "${1}-%d.${2}" (int $userPort))) }} +- [Port {{ $userPort }}](http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $hostname }}) + {{- end -}} + {{- if $.Values.route.enabled -}} + {{- $hostname := (regexReplaceAll "([^\\.]+)\\.(.*)" $.Values.route.userHostname (printf "${1}-%d.${2}" (int $userPort))) }} +- [Port {{ $userPort }}](https://{{ $hostname }}) + {{- end -}} + {{- end -}} +{{- end }} +If you access these URL without starting the corresponding services you will get a 502 bad gateway error. {{- end }} *NOTES about deletion :* - {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }} - The volume associated with the following path **/home/{{ .Values.environment.user }}/work** will be deleted - So, you should save your code to an external git repository - So, You should save your data to an external data repository like S3 - You can easily create a new {{ .Chart.Name }} service, clone your code and install again some librairies you need -{{- end }} -{{- end }} +{{- end -}} + +{{- end -}} diff --git a/charts/jupyter-pyspark/values.schema.json b/charts/jupyter-pyspark/values.schema.json index b9b1778e..b8480d41 100644 --- a/charts/jupyter-pyspark/values.schema.json +++ b/charts/jupyter-pyspark/values.schema.json @@ -543,6 +543,9 @@ "type": "object", "form": true, "title": "Networking detail", + "x-onyxia": { + "overwriteSchemaWith": "ide/networking.json" + }, "properties": { "user": { "type": "object", @@ -555,14 +558,26 @@ "default": false }, "port": { - "type": "integer", - "description": "port of the custom service", "title": "Custom service port", + "description": "Port number of a single custom service to expose", + "type": "integer", "hidden": { "value": false, "path": "networking/user/enabled" }, "default": 5000 + }, + "ports": { + "title": "Custom service ports", + "description": "Port numbers of custom services to expose", + "type": "array", + "items": { + "type": "integer" + }, + "default": [], + "x-onyxia": { + "hidden": true + } } } } diff --git a/charts/jupyter-pyspark/values.yaml b/charts/jupyter-pyspark/values.yaml index 6fbf4142..f625c15c 100644 --- a/charts/jupyter-pyspark/values.yaml +++ b/charts/jupyter-pyspark/values.yaml @@ -167,11 +167,16 @@ networking: clusterIP: None service: port: 8888 + sparkui: + port: 4040 + # Custom user-specified extra ports exposition. + # If ingress or route is enabled, the exposed ports are also made available at the + # {ingress,route}.userHostname URL (or variations, in case several ports are provided). + # Note: a non-empty networking.user.ports overrides networking.user.port user: enabled: false port: 5000 - sparkui: - port: 4040 + ports: [] ingress: enabled: false diff --git a/charts/jupyter-python/Chart.yaml b/charts/jupyter-python/Chart.yaml index 0dbe5b4f..8c07b8ed 100644 --- a/charts/jupyter-python/Chart.yaml +++ b/charts/jupyter-python/Chart.yaml @@ -22,9 +22,9 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 2.1.13 +version: 2.1.14 dependencies: - name: library-chart - version: 1.5.30 + version: 1.5.31 repository: https://inseefrlab.github.io/helm-charts-interactive-services diff --git a/charts/jupyter-python/templates/NOTES.txt b/charts/jupyter-python/templates/NOTES.txt index eb254195..f368db61 100644 --- a/charts/jupyter-python/templates/NOTES.txt +++ b/charts/jupyter-python/templates/NOTES.txt @@ -1,21 +1,39 @@ -{{- if eq .Values.userPreferences.language "fr" }} -{{ (.Values.message).fr }} -{{- if .Values.ingress.enabled }} +{{- if eq .Values.userPreferences.language "fr" -}} +{{ (.Values.message).fr }} + +{{ if .Values.ingress.enabled -}} - Vous pouvez vous connecter à ce Jupyter avec votre navigateur en utilisant ce [lien](http{{ if $.Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.hostname }}). -{{- if .Values.networking.user.enabled }} -- Vous pouvez vous connecter à votre port personnalisé en utilisant ce [lien](http{{ if $.Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.userHostname }}). -Si vous ne lancez pas votre service personnalisé, vous obtiendrez une erreur 502 Bad Gateway. -{{- end }} {{- end }} {{- if .Values.route.enabled }} - Vous pouvez vous connecter à ce Jupyter avec votre navigateur en utilisant ce [lien](https://{{ .Values.route.hostname }}). -{{- if .Values.networking.user.enabled }} -- Vous pouvez vous connecter à votre port personnalisé en utilisant ce [lien](https://{{ .Values.route.userHostname }}) -Si vous ne lancez pas votre service personnalisé, vous obtiendrez une erreur 502 Bad Gateway. -{{- end }} {{- end }} - Votre password: {{ .Values.security.password }} +{{- if and .Values.networking.user .Values.networking.user.enabled (or .Values.networking.user.ports .Values.networking.user.port) }} +{{ $userPorts := .Values.networking.user.ports | default (list .Values.networking.user.port) -}} +{{- if eq (len $userPorts) 1 -}} + {{- if .Values.ingress.enabled }} +Vous pouvez vous connecter à votre port personnalisé ({{ first $userPorts }}) en utilisant [ce lien](http{{ if .Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.userHostname }}). + {{- end -}} + {{- if .Values.route.enabled }} +Vous pouvez vous connecter à votre port personnalisé ({{ first $userPorts }}) en utilisant [ce lien](https://{{ .Values.route.userHostname }}). + {{- end -}} +{{- else }} +Vous pouvez vous connecter à vos services personnalisés en utilisant les liens ci-dessous : + {{- range $userPort := $userPorts -}} + {{- if $.Values.ingress.enabled -}} + {{- $hostname := (regexReplaceAll "([^\\.]+)\\.(.*)" $.Values.ingress.userHostname (printf "${1}-%d.${2}" (int $userPort))) }} +- [Port {{ $userPort }}](http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $hostname }}) + {{- end -}} + {{- if $.Values.route.enabled -}} + {{- $hostname := (regexReplaceAll "([^\\.]+)\\.(.*)" $.Values.route.userHostname (printf "${1}-%d.${2}" (int $userPort))) }} +- [Port {{ $userPort }}](https://{{ $hostname }}) + {{- end -}} + {{- end -}} +{{- end }} +Si vous accédez ces URL sans démarrer vos services personnalisés, vous obtiendrez une erreur 502 Bad Gateway. +{{- end }} + *NOTES concernant la suppression :* {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }} @@ -23,31 +41,51 @@ Si vous ne lancez pas votre service personnalisé, vous obtiendrez une erreur 50 - Par conséquent, vous devriez sauvegarder votre code dans un référentiel Git externe. - Vous devriez également sauvegarder vos données dans un référentiel de données externe tel que S3. - Vous pouvez facilement créer un nouveau service {{ .Chart.Name }}, cloner votre code et réinstaller les bibliothèques dont vous avez besoin. -{{- end }} -{{- else }} -{{ (.Values.message).en }} -{{- if .Values.ingress.enabled }} +{{- end -}} + + +{{- else -}} +{{ (.Values.message).en }} + +{{ if .Values.ingress.enabled -}} - You can connect to this jupyter with your browser on this [link](http{{ if $.Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.hostname }}) -{{- if .Values.networking.user.enabled }} -- You can connect to your custom port on this [link](http{{ if $.Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.userHostname }}) -If you don't run your custom service you will get a 502 bad gateway error. -{{- end }} {{- end }} {{- if .Values.route.enabled }} - You can connect to this jupyter with your browser on this [link](https://{{ .Values.route.hostname }}) -{{- if .Values.networking.user.enabled }} -- You can connect to your custom port on this [link](https://{{ .Values.route.userHostname }}) -If you don't run your custom service you will get a 502 bad gateway error. -{{- end }} {{- end }} - Your password: {{ .Values.security.password }} -*NOTES about deletion :* +{{- if and .Values.networking.user .Values.networking.user.enabled (or .Values.networking.user.ports .Values.networking.user.port) }} +{{ $userPorts := .Values.networking.user.ports | default (list .Values.networking.user.port) -}} +{{- if eq (len $userPorts) 1 -}} + {{- if .Values.ingress.enabled }} +You can connect to your custom port ({{ first $userPorts }}) using [this link](http{{ if .Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.userHostname }}). + {{- end -}} + {{- if .Values.route.enabled }} +You can connect to your custom port ({{ first $userPorts }}) using [this link](https://{{ .Values.route.userHostname }}). + {{- end -}} +{{- else }} +You can connect to your custom services using the following links: + {{- range $userPort := $userPorts -}} + {{- if $.Values.ingress.enabled -}} + {{- $hostname := (regexReplaceAll "([^\\.]+)\\.(.*)" $.Values.ingress.userHostname (printf "${1}-%d.${2}" (int $userPort))) }} +- [Port {{ $userPort }}](http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $hostname }}) + {{- end -}} + {{- if $.Values.route.enabled -}} + {{- $hostname := (regexReplaceAll "([^\\.]+)\\.(.*)" $.Values.route.userHostname (printf "${1}-%d.${2}" (int $userPort))) }} +- [Port {{ $userPort }}](https://{{ $hostname }}) + {{- end -}} + {{- end -}} +{{- end }} +If you access these URL without starting the corresponding services you will get a 502 bad gateway error. +{{- end }} +*NOTES about deletion :* {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }} - The volume associated with the following path **/home/{{ .Values.environment.user }}/work** will be deleted - So, you should save your code to an external git repository - So, You should save your data to an external data repository like S3 - You can easily create a new {{ .Chart.Name }} service, clone your code and install again some librairies you need -{{- end }} -{{- end }} +{{- end -}} + +{{- end -}} diff --git a/charts/jupyter-python/values.schema.json b/charts/jupyter-python/values.schema.json index 8930b068..bf97a4c9 100644 --- a/charts/jupyter-python/values.schema.json +++ b/charts/jupyter-python/values.schema.json @@ -496,6 +496,9 @@ "type": "object", "form": true, "title": "Networking detail", + "x-onyxia": { + "overwriteSchemaWith": "ide/networking.json" + }, "properties": { "user": { "type": "object", @@ -508,14 +511,26 @@ "default": false }, "port": { - "type": "integer", - "description": "port of the custom service", "title": "Custom service port", + "description": "Port number of a single custom service to expose", + "type": "integer", "hidden": { "value": false, "path": "networking/user/enabled" }, "default": 5000 + }, + "ports": { + "title": "Custom service ports", + "description": "Port numbers of custom services to expose", + "type": "array", + "items": { + "type": "integer" + }, + "default": [], + "x-onyxia": { + "hidden": true + } } } } diff --git a/charts/jupyter-python/values.yaml b/charts/jupyter-python/values.yaml index cc8b3951..09032557 100644 --- a/charts/jupyter-python/values.yaml +++ b/charts/jupyter-python/values.yaml @@ -136,11 +136,16 @@ networking: clusterIP: None service: port: 8888 + sparkui: + port: 4040 + # Custom user-specified extra ports exposition. + # If ingress or route is enabled, the exposed ports are also made available at the + # {ingress,route}.userHostname URL (or variations, in case several ports are provided). + # Note: a non-empty networking.user.ports overrides networking.user.port user: enabled: false port: 5000 - sparkui: - port: 4040 + ports: [] ingress: enabled: false diff --git a/charts/rstudio-sparkr/Chart.yaml b/charts/rstudio-sparkr/Chart.yaml index b249f7bd..aa27df12 100644 --- a/charts/rstudio-sparkr/Chart.yaml +++ b/charts/rstudio-sparkr/Chart.yaml @@ -23,8 +23,8 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 2.1.13 +version: 2.1.14 dependencies: - name: library-chart - version: 1.5.30 + version: 1.5.31 repository: https://inseefrlab.github.io/helm-charts-interactive-services diff --git a/charts/rstudio-sparkr/templates/NOTES.txt b/charts/rstudio-sparkr/templates/NOTES.txt index 43bbc0da..07802cf1 100644 --- a/charts/rstudio-sparkr/templates/NOTES.txt +++ b/charts/rstudio-sparkr/templates/NOTES.txt @@ -1,6 +1,7 @@ -{{- if eq .Values.userPreferences.language "fr"}} -{{ (.Values.message).fr }} -{{- if .Values.ingress.enabled }} +{{- if eq .Values.userPreferences.language "fr" -}} +{{ (.Values.message).fr }} + +{{ if .Values.ingress.enabled -}} - Vous pouvez vous connecter à cet RStudio avec votre navigateur sur ce [lien](http{{ if $.Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.hostname }}) {{- if .Values.spark.sparkui }} - Lorsque le pilote Spark est en cours d'exécution, vous pouvez vous connecter à l'interface Spark avec votre navigateur en utilisant ce [lien](http{{ if $.Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.sparkHostname }}) @@ -15,30 +16,44 @@ - Le nom d'utilisateur est **{{ .Values.environment.user }}** - Votre password: {{ .Values.security.password }} -{{- if .Values.ingress.enabled }} -{{- if .Values.networking.user.enabled }} -- Vous pouvez vous connecter à votre port personnalisé en utilisant ce [lien](http{{ if $.Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.userHostname }}) -Si vous n'exécutez pas votre service personnalisé, vous obtiendrez une erreur 502 Bad Gateway. -{{- end }} -{{- end }} -{{- if .Values.route.enabled }} -{{- if .Values.networking.user.enabled }} -- Vous pouvez vous connecter à votre port personnalisé en utilisant ce [lien](https://{{ .Values.route.userHostname }}) -Si vous n'exécutez pas votre service personnalisé, vous obtiendrez une erreur 502 Bad Gateway. -{{- end }} +{{- if and .Values.networking.user .Values.networking.user.enabled (or .Values.networking.user.ports .Values.networking.user.port) }} +{{ $userPorts := .Values.networking.user.ports | default (list .Values.networking.user.port) -}} +{{- if eq (len $userPorts) 1 -}} + {{- if .Values.ingress.enabled }} +Vous pouvez vous connecter à votre port personnalisé ({{ first $userPorts }}) en utilisant [ce lien](http{{ if .Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.userHostname }}). + {{- end -}} + {{- if .Values.route.enabled }} +Vous pouvez vous connecter à votre port personnalisé ({{ first $userPorts }}) en utilisant [ce lien](https://{{ .Values.route.userHostname }}). + {{- end -}} +{{- else }} +Vous pouvez vous connecter à vos services personnalisés en utilisant les liens ci-dessous : + {{- range $userPort := $userPorts -}} + {{- if $.Values.ingress.enabled -}} + {{- $hostname := (regexReplaceAll "([^\\.]+)\\.(.*)" $.Values.ingress.userHostname (printf "${1}-%d.${2}" (int $userPort))) }} +- [Port {{ $userPort }}](http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $hostname }}) + {{- end -}} + {{- if $.Values.route.enabled -}} + {{- $hostname := (regexReplaceAll "([^\\.]+)\\.(.*)" $.Values.route.userHostname (printf "${1}-%d.${2}" (int $userPort))) }} +- [Port {{ $userPort }}](https://{{ $hostname }}) + {{- end -}} + {{- end -}} +{{- end }} +Si vous accédez ces URL sans démarrer vos services personnalisés, vous obtiendrez une erreur 502 Bad Gateway. {{- end }} *REMARQUES sur la suppression :* - {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }} - Le volume associé au chemin suivant **/home/{{ .Values.environment.user }}/work** sera supprimé - Vous devriez donc sauvegarder votre code dans un dépôt Git externe - Vous devriez aussi sauvegarder vos données dans un référentiel de données externe tel que S3 - Vous pouvez facilement créer un nouveau service {{ .Chart.Name }}, cloner votre code et réinstaller les bibliothèques dont vous avez besoin -{{- end }} +{{- end -}} + + {{- else}} -{{ (.Values.message).en }} -{{- if .Values.ingress.enabled }} +{{ (.Values.message).en }} + +{{ if .Values.ingress.enabled -}} - You can connect to this rstudio with your browser on this [link](http{{ if $.Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.hostname }}) {{- if .Values.spark.sparkui }} - When the spark driver is running, you can connect to the spark-ui with your browser on this [link](http{{ if $.Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.sparkHostname }}) @@ -53,25 +68,37 @@ Si vous n'exécutez pas votre service personnalisé, vous obtiendrez une erreur - The login is **{{ .Values.environment.user }}** - Your password: {{ .Values.security.password }} -{{- if .Values.ingress.enabled }} -{{- if .Values.networking.user.enabled }} -- You can connect to your custom port on this [link](http{{ if $.Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.userHostname }}) -If you don't run your custom service you will get a 502 bad gateway error. -{{- end }} -{{- end }} -{{- if .Values.route.enabled }} -{{- if .Values.networking.user.enabled }} -- You can connect to your custom port on this [link](https://{{ .Values.route.userHostname }}) -If you don't run your custom service you will get a 502 bad gateway error. -{{- end }} +{{- if and .Values.networking.user .Values.networking.user.enabled (or .Values.networking.user.ports .Values.networking.user.port) }} +{{ $userPorts := .Values.networking.user.ports | default (list .Values.networking.user.port) -}} +{{- if eq (len $userPorts) 1 -}} + {{- if .Values.ingress.enabled }} +You can connect to your custom port ({{ first $userPorts }}) using [this link](http{{ if .Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.userHostname }}). + {{- end -}} + {{- if .Values.route.enabled }} +You can connect to your custom port ({{ first $userPorts }}) using [this link](https://{{ .Values.route.userHostname }}). + {{- end -}} +{{- else }} +You can connect to your custom services using the following links: + {{- range $userPort := $userPorts -}} + {{- if $.Values.ingress.enabled -}} + {{- $hostname := (regexReplaceAll "([^\\.]+)\\.(.*)" $.Values.ingress.userHostname (printf "${1}-%d.${2}" (int $userPort))) }} +- [Port {{ $userPort }}](http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $hostname }}) + {{- end -}} + {{- if $.Values.route.enabled -}} + {{- $hostname := (regexReplaceAll "([^\\.]+)\\.(.*)" $.Values.route.userHostname (printf "${1}-%d.${2}" (int $userPort))) }} +- [Port {{ $userPort }}](https://{{ $hostname }}) + {{- end -}} + {{- end -}} +{{- end }} +If you access these URL without starting the corresponding services you will get a 502 bad gateway error. {{- end }} *NOTES about deletion :* - {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }} - The volume associated with the following path **/home/{{ .Values.environment.user }}/work** will be deleted - So, you should save your code to an external git repository - So, You should save your data to an external data repository like S3 - You can easily create a new {{ .Chart.Name }} service, clone your code and install again some librairies you need -{{- end }} -{{- end }} \ No newline at end of file +{{- end -}} + +{{- end -}} diff --git a/charts/rstudio-sparkr/values.schema.json b/charts/rstudio-sparkr/values.schema.json index 3e0be2b7..2b5adc56 100644 --- a/charts/rstudio-sparkr/values.schema.json +++ b/charts/rstudio-sparkr/values.schema.json @@ -501,6 +501,9 @@ "type": "object", "form": true, "title": "Networking detail", + "x-onyxia": { + "overwriteSchemaWith": "ide/networking.json" + }, "properties": { "user": { "type": "object", @@ -513,14 +516,26 @@ "default": false }, "port": { - "type": "integer", - "description": "port of the custom service", "title": "Custom service port", + "description": "Port number of a single custom service to expose", + "type": "integer", "hidden": { "value": false, "path": "networking/user/enabled" }, "default": 5000 + }, + "ports": { + "title": "Custom service ports", + "description": "Port numbers of custom services to expose", + "type": "array", + "items": { + "type": "integer" + }, + "default": [], + "x-onyxia": { + "hidden": true + } } } } @@ -738,47 +753,6 @@ } } }, - "proxy": { - "description": "It can be used to inject proxy settings in the services", - "type": "object", - "x-onyxia": { - "overwriteSchemaWith": "proxy.json" - }, - "properties": { - "enabled": { - "type": "boolean", - "description": "Inject proxy settings", - "default": false - }, - "httpProxy": { - "type": "string", - "description": "URL of the enterprise proxy for the region for HTTP.", - "default": "", - "hidden": { - "value": false, - "path": "proxy/enabled" - } - }, - "httpsProxy": { - "type": "string", - "description": "URL of the enterprise proxy for the region for HTTPS.", - "default": "", - "hidden": { - "value": false, - "path": "proxy/enabled" - } - }, - "noProxy": { - "type": "string", - "description": "enterprise local domain that should not take proxy comma separated", - "default": "", - "hidden": { - "value": false, - "path": "proxy/enabled" - } - } - } - }, "startupProbe": { "type": "object", "description": "Startup probe", diff --git a/charts/rstudio-sparkr/values.yaml b/charts/rstudio-sparkr/values.yaml index 4e007ac2..b4b2b712 100644 --- a/charts/rstudio-sparkr/values.yaml +++ b/charts/rstudio-sparkr/values.yaml @@ -154,11 +154,16 @@ networking: clusterIP: None service: port: 8787 + sparkui: + port: 4040 + # Custom user-specified extra ports exposition. + # If ingress or route is enabled, the exposed ports are also made available at the + # {ingress,route}.userHostname URL (or variations, in case several ports are provided). + # Note: a non-empty networking.user.ports overrides networking.user.port user: enabled: false port: 5000 - sparkui: - port: 4040 + ports: [] ingress: enabled: false diff --git a/charts/rstudio/Chart.yaml b/charts/rstudio/Chart.yaml index 397266e4..d21d6c23 100644 --- a/charts/rstudio/Chart.yaml +++ b/charts/rstudio/Chart.yaml @@ -22,8 +22,8 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 2.1.10 +version: 2.1.11 dependencies: - name: library-chart - version: 1.5.30 + version: 1.5.31 repository: https://inseefrlab.github.io/helm-charts-interactive-services diff --git a/charts/rstudio/templates/NOTES.txt b/charts/rstudio/templates/NOTES.txt index 753b3af6..31c550b2 100644 --- a/charts/rstudio/templates/NOTES.txt +++ b/charts/rstudio/templates/NOTES.txt @@ -1,65 +1,92 @@ -{{- if eq .Values.userPreferences.language "fr"}} -{{ (.Values.message).fr }} -{{- if .Values.ingress.enabled }} +{{- if eq .Values.userPreferences.language "fr" -}} +{{ (.Values.message).fr }} + +{{ if .Values.ingress.enabled -}} - Vous pouvez vous connecter à ce RStudio avec votre navigateur sur ce [lien](http{{ if $.Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.hostname }}) {{- end }} {{- if .Values.route.enabled }} - Vous pouvez vous connecter à ce RStudio avec votre navigateur sur ce [lien](https://{{ .Values.route.hostname }}) {{- end }} - Le nom d'utilisateur est {{ .Values.environment.user }} -- votre password: {{ .Values.security.password }} +- Votre mot de passe : {{ .Values.security.password }} -{{- if .Values.ingress.enabled }} -{{- if .Values.networking.user.enabled }} -- Vous pouvez vous connecter à votre port personnalisé sur ce [lien](http{{ if $.Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.userHostname }}) -- Si vous n'exécutez pas votre service personnalisé, vous obtiendrez une erreur 502 Bad Gateway. -{{- end }} -{{- end }} -{{- if .Values.route.enabled }} -{{- if .Values.networking.user.enabled }} -- Vous pouvez vous connecter à votre port personnalisé sur ce [lien](https://{{ .Values.route.userHostname }}) -- Si vous n'exécutez pas votre service personnalisé, vous obtiendrez une erreur 502 Bad Gateway. +{{- if and .Values.networking.user .Values.networking.user.enabled (or .Values.networking.user.ports .Values.networking.user.port) }} +{{ $userPorts := .Values.networking.user.ports | default (list .Values.networking.user.port) -}} +{{- if eq (len $userPorts) 1 -}} + {{- if .Values.ingress.enabled }} +Vous pouvez vous connecter à votre port personnalisé ({{ first $userPorts }}) en utilisant [ce lien](http{{ if .Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.userHostname }}). + {{- end -}} + {{- if .Values.route.enabled }} +Vous pouvez vous connecter à votre port personnalisé ({{ first $userPorts }}) en utilisant [ce lien](https://{{ .Values.route.userHostname }}). + {{- end -}} +{{- else }} +Vous pouvez vous connecter à vos services personnalisés en utilisant les liens ci-dessous : + {{- range $userPort := $userPorts -}} + {{- if $.Values.ingress.enabled -}} + {{- $hostname := (regexReplaceAll "([^\\.]+)\\.(.*)" $.Values.ingress.userHostname (printf "${1}-%d.${2}" (int $userPort))) }} +- [Port {{ $userPort }}](http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $hostname }}) + {{- end -}} + {{- if $.Values.route.enabled -}} + {{- $hostname := (regexReplaceAll "([^\\.]+)\\.(.*)" $.Values.route.userHostname (printf "${1}-%d.${2}" (int $userPort))) }} +- [Port {{ $userPort }}](https://{{ $hostname }}) + {{- end -}} + {{- end -}} {{- end }} +Si vous accédez ces URL sans démarrer vos services personnalisés, vous obtiendrez une erreur 502 Bad Gateway. {{- end }} *REMARQUES sur la suppression :* - {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }} - Le volume associé au chemin suivant **/home/{{ .Values.environment.user }}/work** sera supprimé - Vous devriez donc sauvegarder votre code dans un dépôt Git externe - Vous devriez aussi sauvegarder vos données dans un référentiel de données externe tel que S3 - Vous pouvez facilement créer un nouveau service {{ .Chart.Name }}, cloner votre code et réinstaller les bibliothèques dont vous avez besoin. -{{- end }} -{{- else }} -{{ (.Values.message).en }} -{{- if .Values.ingress.enabled }} -- You can connect to this rstudio with your browser on this [link](http{{ if $.Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.hostname }}) -{{- end }} -{{- if .Values.route.enabled }} -- You can connect to this rstudio with your browser on this [link](https://{{ .Values.route.hostname }}) +{{- end -}} + + +{{- else -}} +{{ (.Values.message).en }} + +{{ if .Values.ingress.enabled -}} +- You can connect to this rstudio with your browser using [this link](http{{ if $.Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.hostname }}) +{{- end -}} +{{- if .Values.route.enabled -}} +- You can connect to this rstudio with your browser using [this link](https://{{ .Values.route.hostname }}) {{- end }} - The login is **{{ .Values.environment.user }}** - Your password: {{ .Values.security.password }} -{{- if .Values.ingress.enabled }} -{{- if .Values.networking.user.enabled }} -- You can connect to your custom port on this [link](http{{ if $.Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.userHostname }}) -If you don't run your custom service you will get a 502 bad gateway error. -{{- end }} -{{- end }} -{{- if .Values.route.enabled }} -{{- if .Values.networking.user.enabled }} -- You can connect to your custom port on this [link](https://{{ .Values.route.userHostname }}) -If you don't run your custom service you will get a 502 bad gateway error. +{{- if and .Values.networking.user .Values.networking.user.enabled (or .Values.networking.user.ports .Values.networking.user.port) }} +{{ $userPorts := .Values.networking.user.ports | default (list .Values.networking.user.port) -}} +{{- if eq (len $userPorts) 1 -}} + {{- if .Values.ingress.enabled }} +You can connect to your custom port ({{ first $userPorts }}) using [this link](http{{ if .Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.userHostname }}). + {{- end -}} + {{- if .Values.route.enabled }} +You can connect to your custom port ({{ first $userPorts }}) using [this link](https://{{ .Values.route.userHostname }}). + {{- end -}} +{{- else }} +You can connect to your custom services using the following links: + {{- range $userPort := $userPorts -}} + {{- if $.Values.ingress.enabled -}} + {{- $hostname := (regexReplaceAll "([^\\.]+)\\.(.*)" $.Values.ingress.userHostname (printf "${1}-%d.${2}" (int $userPort))) }} +- [Port {{ $userPort }}](http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $hostname }}) + {{- end -}} + {{- if $.Values.route.enabled -}} + {{- $hostname := (regexReplaceAll "([^\\.]+)\\.(.*)" $.Values.route.userHostname (printf "${1}-%d.${2}" (int $userPort))) }} +- [Port {{ $userPort }}](https://{{ $hostname }}) + {{- end -}} + {{- end -}} {{- end }} +If you access these URL without starting the corresponding services you will get a 502 bad gateway error. {{- end }} *NOTES about deletion :* - {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }} - The volume associated with the following path **/home/{{ .Values.environment.user }}/work** will be deleted - So, you should save your code to an external git repository - So, You should save your data to an external data repository like S3 - You can easily create a new {{ .Chart.Name }} service, clone your code and install again some librairies you need -{{- end }} -{{- end }} +{{- end -}} + +{{- end -}} diff --git a/charts/rstudio/values.schema.json b/charts/rstudio/values.schema.json index 2b9de146..6439461d 100644 --- a/charts/rstudio/values.schema.json +++ b/charts/rstudio/values.schema.json @@ -496,6 +496,9 @@ "type": "object", "form": true, "title": "Networking detail", + "x-onyxia": { + "overwriteSchemaWith": "ide/networking.json" + }, "properties": { "user": { "type": "object", @@ -508,14 +511,26 @@ "default": false }, "port": { - "type": "integer", - "description": "port of the custom service", "title": "Custom service port", + "description": "Port number of a single custom service to expose", + "type": "integer", "hidden": { "value": false, "path": "networking/user/enabled" }, "default": 5000 + }, + "ports": { + "title": "Custom service ports", + "description": "Port numbers of custom services to expose", + "type": "array", + "items": { + "type": "integer" + }, + "default": [], + "x-onyxia": { + "hidden": true + } } } } diff --git a/charts/rstudio/values.yaml b/charts/rstudio/values.yaml index b2fc2ea8..335f6cab 100644 --- a/charts/rstudio/values.yaml +++ b/charts/rstudio/values.yaml @@ -112,11 +112,16 @@ networking: clusterIP: None service: port: 8787 + sparkui: + port: 4040 + # Custom user-specified extra ports exposition. + # If ingress or route is enabled, the exposed ports are also made available at the + # {ingress,route}.userHostname URL (or variations, in case several ports are provided). + # Note: a non-empty networking.user.ports overrides networking.user.port user: enabled: false port: 5000 - sparkui: - port: 4040 + ports: [] ingress: enabled: false diff --git a/charts/vscode-pyspark/Chart.yaml b/charts/vscode-pyspark/Chart.yaml index e5ac3171..61f78546 100644 --- a/charts/vscode-pyspark/Chart.yaml +++ b/charts/vscode-pyspark/Chart.yaml @@ -24,9 +24,9 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 2.1.15 +version: 2.1.16 dependencies: - name: library-chart - version: 1.5.30 + version: 1.5.31 repository: https://inseefrlab.github.io/helm-charts-interactive-services diff --git a/charts/vscode-pyspark/templates/NOTES.txt b/charts/vscode-pyspark/templates/NOTES.txt index 1a140ec7..7f153958 100644 --- a/charts/vscode-pyspark/templates/NOTES.txt +++ b/charts/vscode-pyspark/templates/NOTES.txt @@ -1,6 +1,7 @@ -{{- if eq .Values.userPreferences.language "fr"}} -{{ (.Values.message).fr }} -{{- if .Values.ingress.enabled }} +{{- if eq .Values.userPreferences.language "fr" -}} +{{ (.Values.message).fr }} + +{{ if .Values.ingress.enabled -}} - Vous pouvez vous connecter à cet RStudio avec votre navigateur sur ce [lien](http{{ if $.Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.hostname }}) {{- if .Values.spark.sparkui }} - Lorsque le pilote Spark est en cours d'exécution, vous pouvez vous connecter à l'interface Spark avec votre navigateur en utilisant ce [lien](http{{ if $.Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.sparkHostname }}) @@ -15,30 +16,44 @@ - Le nom d'utilisateur est **{{ .Values.environment.user }}** - Votre password: {{ .Values.security.password }} -{{- if .Values.ingress.enabled }} -{{- if .Values.networking.user.enabled }} -- Vous pouvez vous connecter à votre port personnalisé en utilisant ce [lien](http{{ if $.Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.userHostname }}) -Si vous n'exécutez pas votre service personnalisé, vous obtiendrez une erreur 502 Bad Gateway. -{{- end }} -{{- end }} -{{- if .Values.route.enabled }} -{{- if .Values.networking.user.enabled }} -- Vous pouvez vous connecter à votre port personnalisé en utilisant ce [lien](https://{{ .Values.route.userHostname }}) -Si vous n'exécutez pas votre service personnalisé, vous obtiendrez une erreur 502 Bad Gateway. -{{- end }} +{{- if and .Values.networking.user .Values.networking.user.enabled (or .Values.networking.user.ports .Values.networking.user.port) }} +{{ $userPorts := .Values.networking.user.ports | default (list .Values.networking.user.port) -}} +{{- if eq (len $userPorts) 1 -}} + {{- if .Values.ingress.enabled }} +Vous pouvez vous connecter à votre port personnalisé ({{ first $userPorts }}) en utilisant [ce lien](http{{ if .Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.userHostname }}). + {{- end -}} + {{- if .Values.route.enabled }} +Vous pouvez vous connecter à votre port personnalisé ({{ first $userPorts }}) en utilisant [ce lien](https://{{ .Values.route.userHostname }}). + {{- end -}} +{{- else }} +Vous pouvez vous connecter à vos services personnalisés en utilisant les liens ci-dessous : + {{- range $userPort := $userPorts -}} + {{- if $.Values.ingress.enabled -}} + {{- $hostname := (regexReplaceAll "([^\\.]+)\\.(.*)" $.Values.ingress.userHostname (printf "${1}-%d.${2}" (int $userPort))) }} +- [Port {{ $userPort }}](http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $hostname }}) + {{- end -}} + {{- if $.Values.route.enabled -}} + {{- $hostname := (regexReplaceAll "([^\\.]+)\\.(.*)" $.Values.route.userHostname (printf "${1}-%d.${2}" (int $userPort))) }} +- [Port {{ $userPort }}](https://{{ $hostname }}) + {{- end -}} + {{- end -}} +{{- end }} +Si vous accédez ces URL sans démarrer vos services personnalisés, vous obtiendrez une erreur 502 Bad Gateway. {{- end }} *REMARQUES sur la suppression :* - {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }} - Le volume associé au chemin suivant **/home/{{ .Values.environment.user }}/work** sera supprimé - Vous devriez donc sauvegarder votre code dans un dépôt Git externe - Vous devriez aussi sauvegarder vos données dans un référentiel de données externe tel que S3 - Vous pouvez facilement créer un nouveau service {{ .Chart.Name }}, cloner votre code et réinstaller les bibliothèques dont vous avez besoin -{{- end }} -{{- else}} -{{ (.Values.message).en }} -{{- if .Values.ingress.enabled }} +{{- end -}} + + +{{- else -}} +{{ (.Values.message).en }} + +{{ if .Values.ingress.enabled -}} - You can connect to this rstudio with your browser on this [link](http{{ if $.Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.hostname }}) {{- if .Values.spark.sparkui }} - When the spark driver is running, you can connect to the spark-ui with your browser on this [link](http{{ if $.Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.sparkHostname }}) @@ -53,25 +68,37 @@ Si vous n'exécutez pas votre service personnalisé, vous obtiendrez une erreur - The login is **{{ .Values.environment.user }}** - Your password: {{ .Values.security.password }} -{{- if .Values.ingress.enabled }} -{{- if .Values.networking.user.enabled }} -- You can connect to your custom port on this [link](http{{ if $.Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.userHostname }}) -If you don't run your custom service you will get a 502 bad gateway error. -{{- end }} -{{- end }} -{{- if .Values.route.enabled }} -{{- if .Values.networking.user.enabled }} -- You can connect to your custom port on this [link](https://{{ .Values.route.userHostname }}) -If you don't run your custom service you will get a 502 bad gateway error. -{{- end }} +{{- if and .Values.networking.user .Values.networking.user.enabled (or .Values.networking.user.ports .Values.networking.user.port) }} +{{ $userPorts := .Values.networking.user.ports | default (list .Values.networking.user.port) -}} +{{- if eq (len $userPorts) 1 -}} + {{- if .Values.ingress.enabled }} +You can connect to your custom port ({{ first $userPorts }}) using [this link](http{{ if .Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.userHostname }}). + {{- end -}} + {{- if .Values.route.enabled }} +You can connect to your custom port ({{ first $userPorts }}) using [this link](https://{{ .Values.route.userHostname }}). + {{- end -}} +{{- else }} +You can connect to your custom services using the following links: + {{- range $userPort := $userPorts -}} + {{- if $.Values.ingress.enabled -}} + {{- $hostname := (regexReplaceAll "([^\\.]+)\\.(.*)" $.Values.ingress.userHostname (printf "${1}-%d.${2}" (int $userPort))) }} +- [Port {{ $userPort }}](http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $hostname }}) + {{- end -}} + {{- if $.Values.route.enabled -}} + {{- $hostname := (regexReplaceAll "([^\\.]+)\\.(.*)" $.Values.route.userHostname (printf "${1}-%d.${2}" (int $userPort))) }} +- [Port {{ $userPort }}](https://{{ $hostname }}) + {{- end -}} + {{- end -}} +{{- end }} +If you access these URL without starting the corresponding services you will get a 502 bad gateway error. {{- end }} *NOTES about deletion :* - {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }} - The volume associated with the following path **/home/{{ .Values.environment.user }}/work** will be deleted - So, you should save your code to an external git repository - So, You should save your data to an external data repository like S3 - You can easily create a new {{ .Chart.Name }} service, clone your code and install again some librairies you need -{{- end }} -{{- end }} +{{- end -}} + +{{- end -}} diff --git a/charts/vscode-pyspark/values.schema.json b/charts/vscode-pyspark/values.schema.json index f438a5e6..a94faa1c 100644 --- a/charts/vscode-pyspark/values.schema.json +++ b/charts/vscode-pyspark/values.schema.json @@ -527,6 +527,9 @@ "type": "object", "form": true, "title": "Networking detail", + "x-onyxia": { + "overwriteSchemaWith": "ide/networking.json" + }, "properties": { "user": { "type": "object", @@ -539,14 +542,26 @@ "default": false }, "port": { - "type": "integer", - "description": "port of the custom service", "title": "Custom service port", + "description": "Port number of a single custom service to expose", + "type": "integer", "hidden": { "value": false, "path": "networking/user/enabled" }, "default": 5000 + }, + "ports": { + "title": "Custom service ports", + "description": "Port numbers of custom services to expose", + "type": "array", + "items": { + "type": "integer" + }, + "default": [], + "x-onyxia": { + "hidden": true + } } } } diff --git a/charts/vscode-pyspark/values.yaml b/charts/vscode-pyspark/values.yaml index fc61a839..487f0562 100644 --- a/charts/vscode-pyspark/values.yaml +++ b/charts/vscode-pyspark/values.yaml @@ -167,11 +167,16 @@ networking: clusterIP: None service: port: 8080 + sparkui: + port: 4040 + # Custom user-specified extra ports exposition. + # If ingress or route is enabled, the exposed ports are also made available at the + # {ingress,route}.userHostname URL (or variations, in case several ports are provided). + # Note: a non-empty networking.user.ports overrides networking.user.port user: enabled: false port: 5000 - sparkui: - port: 4040 + ports: [] ingress: enabled: false diff --git a/charts/vscode-python/Chart.yaml b/charts/vscode-python/Chart.yaml index 3712c33d..619a9495 100644 --- a/charts/vscode-python/Chart.yaml +++ b/charts/vscode-python/Chart.yaml @@ -22,9 +22,9 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 2.1.14 +version: 2.1.15 dependencies: - name: library-chart - version: 1.5.30 + version: 1.5.31 repository: https://inseefrlab.github.io/helm-charts-interactive-services diff --git a/charts/vscode-python/templates/NOTES.txt b/charts/vscode-python/templates/NOTES.txt index 44e9685d..45d58f5a 100644 --- a/charts/vscode-python/templates/NOTES.txt +++ b/charts/vscode-python/templates/NOTES.txt @@ -1,21 +1,39 @@ -{{- if eq .Values.userPreferences.language "fr"}} -{{ (.Values.message).fr }} -{{- if .Values.ingress.enabled }} +{{- if eq .Values.userPreferences.language "fr" -}} +{{ (.Values.message).fr }} + +{{ if .Values.ingress.enabled -}} - Vous pouvez vous connecter à ce Visual Studio Code avec votre navigateur en utilisant ce [lien](http{{ if $.Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.hostname }}) -{{- if .Values.networking.user.enabled }} -- Vous pouvez vous connecter à votre port personnalisé en utilisant ce [lien](http{{ if $.Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.userHostname }}) -Si vous n'exécutez pas votre service personnalisé, vous obtiendrez une erreur 502 Bad Gateway. -{{- end }} {{- end }} {{- if .Values.route.enabled }} - Vous pouvez vous connecter à ce Visual Studio Code avec votre navigateur en utilisant ce [lien](https://{{ .Values.route.hostname }}) -{{- if .Values.networking.user.enabled }} -- Vous pouvez vous connecter à votre port personnalisé en utilisant ce [lien](https://{{ .Values.route.userHostname }}) -Si vous n'exécutez pas votre service personnalisé, vous obtiendrez une erreur 502 Bad Gateway. -{{- end }} {{- end }} - Votre password: {{ .Values.security.password }} +{{- if and .Values.networking.user .Values.networking.user.enabled (or .Values.networking.user.ports .Values.networking.user.port) }} +{{ $userPorts := .Values.networking.user.ports | default (list .Values.networking.user.port) -}} +{{- if eq (len $userPorts) 1 -}} + {{- if .Values.ingress.enabled }} +Vous pouvez vous connecter à votre port personnalisé ({{ first $userPorts }}) en utilisant [ce lien](http{{ if .Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.userHostname }}). + {{- end -}} + {{- if .Values.route.enabled }} +Vous pouvez vous connecter à votre port personnalisé ({{ first $userPorts }}) en utilisant [ce lien](https://{{ .Values.route.userHostname }}). + {{- end -}} +{{- else }} +Vous pouvez vous connecter à vos services personnalisés en utilisant les liens ci-dessous : + {{- range $userPort := $userPorts -}} + {{- if $.Values.ingress.enabled -}} + {{- $hostname := (regexReplaceAll "([^\\.]+)\\.(.*)" $.Values.ingress.userHostname (printf "${1}-%d.${2}" (int $userPort))) }} +- [Port {{ $userPort }}](http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $hostname }}) + {{- end -}} + {{- if $.Values.route.enabled -}} + {{- $hostname := (regexReplaceAll "([^\\.]+)\\.(.*)" $.Values.route.userHostname (printf "${1}-%d.${2}" (int $userPort))) }} +- [Port {{ $userPort }}](https://{{ $hostname }}) + {{- end -}} + {{- end -}} +{{- end }} +Si vous accédez ces URL sans démarrer vos services personnalisés, vous obtiendrez une erreur 502 Bad Gateway. +{{- end }} + *REMARQUES concernant la suppression :* {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }} @@ -25,29 +43,46 @@ Si vous n'exécutez pas votre service personnalisé, vous obtiendrez une erreur - Vous pouvez facilement créer un nouveau service {{ .Chart.Name }}, cloner votre code et réinstaller les bibliothèques dont vous avez besoin {{- end }} {{- else }} -{{ (.Values.message).en }} +{{ (.Values.message).en }} {{- if .Values.ingress.enabled }} - You can connect to this vscode with your browser on this [link](http{{ if $.Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.hostname }}) -{{- if .Values.networking.user.enabled }} -- You can connect to your custom port on this [link](http{{ if $.Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.userHostname }}) -If you don't run your custom service you will get a 502 bad gateway error. -{{- end }} {{- end }} {{- if .Values.route.enabled }} - You can connect to this vscode with your browser on this [link](https://{{ .Values.route.hostname }}) -{{- if .Values.networking.user.enabled }} -- You can connect to your custom port on this [link](https://{{ .Values.route.userHostname }}) -If you don't run your custom service you will get a 502 bad gateway error. -{{- end }} {{- end }} - Your password: {{ .Values.security.password }} -*NOTES about deletion :* +{{- if and .Values.networking.user .Values.networking.user.enabled (or .Values.networking.user.ports .Values.networking.user.port) }} +{{ $userPorts := .Values.networking.user.ports | default (list .Values.networking.user.port) -}} +{{- if eq (len $userPorts) 1 -}} + {{- if .Values.ingress.enabled }} +You can connect to your custom port ({{ first $userPorts }}) using [this link](http{{ if .Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.userHostname }}). + {{- end -}} + {{- if .Values.route.enabled }} +You can connect to your custom port ({{ first $userPorts }}) using [this link](https://{{ .Values.route.userHostname }}). + {{- end -}} +{{- else }} +You can connect to your custom services using the following links: + {{- range $userPort := $userPorts -}} + {{- if $.Values.ingress.enabled -}} + {{- $hostname := (regexReplaceAll "([^\\.]+)\\.(.*)" $.Values.ingress.userHostname (printf "${1}-%d.${2}" (int $userPort))) }} +- [Port {{ $userPort }}](http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $hostname }}) + {{- end -}} + {{- if $.Values.route.enabled -}} + {{- $hostname := (regexReplaceAll "([^\\.]+)\\.(.*)" $.Values.route.userHostname (printf "${1}-%d.${2}" (int $userPort))) }} +- [Port {{ $userPort }}](https://{{ $hostname }}) + {{- end -}} + {{- end -}} +{{- end }} +If you access these URL without starting the corresponding services you will get a 502 bad gateway error. +{{- end }} +*NOTES about deletion :* {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }} - The volume associated with the following path **/home/{{ .Values.environment.user }}/work** will be deleted - So, you should save your code to an external git repository - So, You should save your data to an external data repository like S3 - You can easily create a new {{ .Chart.Name }} service, clone your code and install again some librairies you need -{{- end }} -{{- end }} \ No newline at end of file +{{- end -}} + +{{- end -}} diff --git a/charts/vscode-python/values.schema.json b/charts/vscode-python/values.schema.json index c6f196cb..4eaa18bc 100644 --- a/charts/vscode-python/values.schema.json +++ b/charts/vscode-python/values.schema.json @@ -532,6 +532,9 @@ "type": "object", "form": true, "title": "Networking detail", + "x-onyxia": { + "overwriteSchemaWith": "ide/networking.json" + }, "properties": { "user": { "type": "object", @@ -544,14 +547,26 @@ "default": false }, "port": { - "type": "integer", - "description": "port of the custom service", "title": "Custom service port", + "description": "Port number of a single custom service to expose", + "type": "integer", "hidden": { "value": false, "path": "networking/user/enabled" }, "default": 5000 + }, + "ports": { + "title": "Custom service ports", + "description": "Port numbers of custom services to expose", + "type": "array", + "items": { + "type": "integer" + }, + "default": [], + "x-onyxia": { + "hidden": true + } } } } diff --git a/charts/vscode-python/values.yaml b/charts/vscode-python/values.yaml index 1e447688..83755e34 100644 --- a/charts/vscode-python/values.yaml +++ b/charts/vscode-python/values.yaml @@ -134,9 +134,14 @@ networking: clusterIP: None service: port: 8080 + # Custom user-specified extra ports exposition. + # If ingress or route is enabled, the exposed ports are also made available at the + # {ingress,route}.userHostname URL (or variations, in case several ports are provided). + # Note: a non-empty networking.user.ports overrides networking.user.port user: enabled: false port: 5000 + ports: [] ingress: enabled: false