Skip to content

Commit

Permalink
#173 Using library-chart multiple ports exposition mechanism in all i…
Browse files Browse the repository at this point in the history
…nteractive services
  • Loading branch information
Gaspi committed Nov 13, 2024
1 parent 157bb1a commit b6e04b4
Show file tree
Hide file tree
Showing 24 changed files with 518 additions and 258 deletions.
4 changes: 2 additions & 2 deletions charts/jupyter-pyspark/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
93 changes: 60 additions & 33 deletions charts/jupyter-pyspark/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -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 }})
Expand All @@ -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 }})
Expand All @@ -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 -}}
19 changes: 17 additions & 2 deletions charts/jupyter-pyspark/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,9 @@
"type": "object",
"form": true,
"title": "Networking detail",
"x-onyxia": {
"overwriteSchemaWith": "ide/networking.json"
},
"properties": {
"user": {
"type": "object",
Expand All @@ -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
}
}
}
}
Expand Down
9 changes: 7 additions & 2 deletions charts/jupyter-pyspark/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions charts/jupyter-python/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
90 changes: 64 additions & 26 deletions charts/jupyter-python/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,53 +1,91 @@
{{- 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) }}
- Le volume associé au chemin suivant **/home/{{ .Values.environment.user }}/work** sera supprimé.
- 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 -}}
19 changes: 17 additions & 2 deletions charts/jupyter-python/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,9 @@
"type": "object",
"form": true,
"title": "Networking detail",
"x-onyxia": {
"overwriteSchemaWith": "ide/networking.json"
},
"properties": {
"user": {
"type": "object",
Expand All @@ -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
}
}
}
}
Expand Down
9 changes: 7 additions & 2 deletions charts/jupyter-python/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions charts/rstudio-sparkr/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading

0 comments on commit b6e04b4

Please sign in to comment.