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

[ALL] #173 Expose multiple custom user-specified ports #174

Merged
merged 3 commits into from
Nov 26, 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
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
101 changes: 68 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,48 @@
{{- 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).enabled
(or .Values.networking.user.ports .Values.networking.user.port)
(or (.Values.ingress).enabled (.Values.route).enabled)
}}
{{ $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 +70,41 @@ 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).enabled
(or .Values.networking.user.ports .Values.networking.user.port)
(or (.Values.ingress).enabled (.Values.route).enabled)
}}
{{ $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 -}}
21 changes: 19 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,28 @@
"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",
"uniqueItems": true,
"default": 5000
},
"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
98 changes: 72 additions & 26 deletions charts/jupyter-python/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,53 +1,99 @@
{{- 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).enabled
(or .Values.networking.user.ports .Values.networking.user.port)
(or (.Values.ingress).enabled (.Values.route).enabled)
}}
{{ $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).enabled
(or .Values.networking.user.ports .Values.networking.user.port)
(or (.Values.ingress).enabled (.Values.route).enabled)
}}
{{ $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 -}}
21 changes: 19 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,28 @@
"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",
"uniqueItems": true,
"default": 5000
},
"default": [],
"x-onyxia": {
"hidden": true
}
}
}
}
Expand Down
Loading