From f57a3b5d3cd97c12af1b8a1e4e11b99f1edd2866 Mon Sep 17 00:00:00 2001 From: Gaspard FEREY Date: Fri, 21 Mar 2025 14:26:59 +0100 Subject: [PATCH] Copied json sub-schemas over from interactive-services --- .../resources/schemas/ide/customImage.json | 8 +- .../main/resources/schemas/ide/extraenv.json | 37 ++-- .../src/main/resources/schemas/ide/git.json | 175 +++++++++--------- .../main/resources/schemas/ide/ingress.json | 132 ++++++------- .../src/main/resources/schemas/ide/init.json | 58 +++--- .../main/resources/schemas/ide/message.json | 37 ++-- .../resources/schemas/ide/openshiftSCC.json | 42 ++--- .../main/resources/schemas/ide/password.json | 18 +- .../resources/schemas/ide/persistence.json | 57 +++--- .../resources/schemas/ide/resources-gpu.json | 174 +++++++++-------- .../main/resources/schemas/ide/resources.json | 157 +++++++++------- .../src/main/resources/schemas/ide/role.json | 50 ++--- .../src/main/resources/schemas/ide/route.json | 66 +++---- .../src/main/resources/schemas/ide/s3.json | 49 +++-- .../resources/schemas/ide/startupProbe.json | 24 ++- .../src/main/resources/schemas/ide/vault.json | 140 +++++++------- .../resources/schemas/network-policy.json | 47 ++--- .../resources/schemas/nodeSelector-gpu.json | 26 +-- .../main/resources/schemas/nodeSelector.json | 26 +-- .../src/main/resources/schemas/proxy.json | 69 ++++--- .../main/resources/schemas/role-spark.json | 49 ++--- .../src/main/resources/schemas/spark.json | 80 ++++---- .../main/resources/schemas/tolerations.json | 82 ++++---- 23 files changed, 856 insertions(+), 747 deletions(-) diff --git a/onyxia-api/src/main/resources/schemas/ide/customImage.json b/onyxia-api/src/main/resources/schemas/ide/customImage.json index 6abfa23d..b576c590 100644 --- a/onyxia-api/src/main/resources/schemas/ide/customImage.json +++ b/onyxia-api/src/main/resources/schemas/ide/customImage.json @@ -1,6 +1,6 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Use a custom image instead", - "type": "boolean", - "default": false + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Use a custom image instead", + "type": "boolean", + "default": false } diff --git a/onyxia-api/src/main/resources/schemas/ide/extraenv.json b/onyxia-api/src/main/resources/schemas/ide/extraenv.json index 66f28384..c84696d4 100644 --- a/onyxia-api/src/main/resources/schemas/ide/extraenv.json +++ b/onyxia-api/src/main/resources/schemas/ide/extraenv.json @@ -1,22 +1,21 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Environment variables", - "description": "environment variables available within your service", - "type": "array", - "default": [], - "items": { - "title": "", - "type": "object", - "properties": { - "name": { - "type": "string", - "default": "CHANGE_ME", - "pattern": "^[^ ]+$" - }, - "value": { - "type": "string", - "default": "" - } + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Environment variables available within your service", + "type": "array", + "default": [], + "items": { + "title": "", + "type": "object", + "properties": { + "name": { + "type": "string", + "default": "CHANGE_ME", + "pattern": "^[a-zA-Z0-9_]+$" + }, + "value": { + "type": "string", + "default": "" } } - } \ No newline at end of file + } +} diff --git a/onyxia-api/src/main/resources/schemas/ide/git.json b/onyxia-api/src/main/resources/schemas/ide/git.json index 419dfeb6..6a8893fc 100644 --- a/onyxia-api/src/main/resources/schemas/ide/git.json +++ b/onyxia-api/src/main/resources/schemas/ide/git.json @@ -1,89 +1,90 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "GIT", - "description": "Git user configuration", - "type": "object", - "properties": { - "enabled": { - "type": "boolean", - "description": "Add git config inside your environment", - "default": true - }, - "name": { - "type": "string", - "description": "user name for git", - "default": "", - "x-onyxia": { - "overwriteDefaultWith": "{{git.name}}" - }, - "hidden": { - "value": false, - "path": "enabled", - "isPathRelative": true - } - }, - "email": { - "type": "string", - "description": "user email for git", - "default": "", - "x-onyxia": { - "overwriteDefaultWith": "{{git.email}}" - }, - "hidden": { - "value": false, - "path": "enabled", - "isPathRelative": true - } - }, - "cache": { - "type": "string", - "description": "duration in seconds of the credentials cache duration", - "default": "", - "x-onyxia": { - "overwriteDefaultWith": "{{git.credentials_cache_duration}}" - }, - "hidden": { - "value": false, - "path": "enabled", - "isPathRelative": true - } - }, - "token": { - "type": "string", - "description": "personal access token", - "default": "", - "render": "password", - "x-onyxia": { - "overwriteDefaultWith": "{{git.token}}" - }, - "hidden": { - "value": false, - "path": "enabled", - "isPathRelative": true - } - }, - "repository": { - "type": "string", - "description": "Repository url", - "default": "", - "x-onyxia": { - "overwriteDefaultWith": "{{git.project}}" - }, - "hidden": { - "value": false, - "path": "enabled", - "isPathRelative": true - } - }, - "branch": { - "type": "string", - "description": "Branch automatically checked out", - "default": "", - "hidden": { - "value": false, - "path": "enabled", - "isPathRelative": true - } - } + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Git access", + "type": "object", + "properties": { + "enabled": { + "title": "Enable git access from within the service", + "type": "boolean", + "default": true + }, + "name": { + "title": "User name", + "type": "string", + "default": "", + "x-onyxia": { + "overwriteDefaultWith": "{{git.name}}" + }, + "hidden": { + "value": false, + "path": "enabled", + "isPathRelative": true + } + }, + "email": { + "title": "User email", + "type": "string", + "default": "", + "x-onyxia": { + "overwriteDefaultWith": "{{git.email}}" + }, + "hidden": { + "value": false, + "path": "enabled", + "isPathRelative": true + } + }, + "cache": { + "title": "Credentials caching duration", + "description": "(in seconds)", + "type": "string", + "default": "", + "x-onyxia": { + "overwriteDefaultWith": "{{git.credentials_cache_duration}}" + }, + "hidden": { + "value": false, + "path": "enabled", + "isPathRelative": true + } + }, + "token": { + "title": "Personal Access Token", + "type": "string", + "default": "", + "render": "password", + "x-onyxia": { + "overwriteDefaultWith": "{{git.token}}" + }, + "hidden": { + "value": false, + "path": "enabled", + "isPathRelative": true + } + }, + "repository": { + "title": "Project repository", + "description": "cloned in service", + "type": "string", + "default": "", + "x-onyxia": { + "overwriteDefaultWith": "{{git.project}}" + }, + "hidden": { + "value": false, + "path": "enabled", + "isPathRelative": true + } + }, + "branch": { + "title": "Specific branch to use", + "type": "string", + "default": "", + "hidden": { + "value": false, + "path": "enabled", + "isPathRelative": true + } } -} \ No newline at end of file + } +} diff --git a/onyxia-api/src/main/resources/schemas/ide/ingress.json b/onyxia-api/src/main/resources/schemas/ide/ingress.json index 83af0879..9e1928a7 100644 --- a/onyxia-api/src/main/resources/schemas/ide/ingress.json +++ b/onyxia-api/src/main/resources/schemas/ide/ingress.json @@ -1,64 +1,72 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Ingress", - "description": "Ingress parameters", - "type": "object", - "properties": { - "enabled": { - "description": "Enable Ingress", - "type": "boolean", - "default": true, - "x-onyxia": { - "hidden": true, - "overwriteDefaultWith": "k8s.ingress" - } - }, - "hostname": { - "type": "string", - "form": true, - "title": "Hostname", - "x-onyxia": { - "hidden": true, - "overwriteDefaultWith": "{{project.id}}-{{k8s.randomSubdomain}}-0.{{k8s.domain}}" - } - }, - "userHostname": { - "type": "string", - "form": true, - "title": "Hostname", - "x-onyxia": { - "hidden": true, - "overwriteDefaultWith": "{{project.id}}-{{k8s.randomSubdomain}}-user.{{k8s.domain}}" - } - }, - "ingressClassName": { - "type": "string", - "form": true, - "title": "ingressClassName", - "default": "", - "x-onyxia": { - "hidden": true, - "overwriteDefaultWith": "{{k8s.ingressClassName}}" - } - }, - "useCertManager": { - "type": "boolean", - "description": "Whether CertManager should be used to generate a certificate", - "default": false, - "x-onyxia": { - "hidden": true, - "overwriteDefaultWith": "k8s.useCertManager" - } - }, - "certManagerClusterIssuer":{ - "type": "string", - "description": "certManager cluster issuer", - "title": "CertManager Cluster Issuer", - "default": "", - "x-onyxia": { - "hidden": true, - "overwriteDefaultWith": "k8s.certManagerClusterIssuer" - } - } + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Ingress Details", + "type": "object", + "form": true, + "properties": { + "enabled": { + "description": "Enable Ingress", + "type": "boolean", + "default": true, + "x-onyxia": { + "hidden": true, + "overwriteDefaultWith": "k8s.ingress" + } + }, + "hostname": { + "type": "string", + "form": true, + "title": "Hostname", + "x-onyxia": { + "hidden": true, + "overwriteDefaultWith": "{{project.id}}-{{k8s.randomSubdomain}}-0.{{k8s.domain}}" + } + }, + "userHostname": { + "type": "string", + "form": true, + "title": "Hostname", + "x-onyxia": { + "hidden": true, + "overwriteDefaultWith": "{{project.id}}-{{k8s.randomSubdomain}}-user.{{k8s.domain}}" + } + }, + "ingressClassName": { + "type": "string", + "form": true, + "title": "ingressClassName", + "default": "", + "x-onyxia": { + "hidden": true, + "overwriteDefaultWith": "{{k8s.ingressClassName}}" + } + }, + "useCertManager": { + "type": "boolean", + "description": "Whether CertManager should be used to generate a certificate", + "default": false, + "x-onyxia": { + "hidden": true, + "overwriteDefaultWith": "k8s.useCertManager" + } + }, + "certManagerClusterIssuer": { + "type": "string", + "description": "certManager cluster issuer", + "title": "CertManager Cluster Issuer", + "default": "", + "x-onyxia": { + "hidden": true, + "overwriteDefaultWith": "k8s.certManagerClusterIssuer" + } + }, + "useTlsSecret": { + "type": "boolean", + "description": "Whether you want to use the specified secretName in ingress tls", + "default": false, + "x-onyxia": { + "hidden": true + } } -} \ No newline at end of file + } +} diff --git a/onyxia-api/src/main/resources/schemas/ide/init.json b/onyxia-api/src/main/resources/schemas/ide/init.json index 686cd406..0f41e305 100644 --- a/onyxia-api/src/main/resources/schemas/ide/init.json +++ b/onyxia-api/src/main/resources/schemas/ide/init.json @@ -1,27 +1,35 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Init", - "description": "Init parameters", - "type": "object", - "properties": { - "regionInit": { - "type": "string", - "description": "region initialization script", - "default": "", - "x-onyxia": { - "hidden": true, - "overwriteDefaultWith": "{{k8s.initScriptUrl}}" - } - }, - "personalInit": { - "type": "string", - "description": "user initialization script", - "default": "" - }, - "personalInitArgs": { - "type": "string", - "description": "args for user initialization script", - "default": "" - } + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Initialization scripts", + "type": "object", + "properties": { + "regionInit": { + "type": "string", + "description": "region initialization script", + "default": "", + "x-onyxia": { + "hidden": true, + "overwriteDefaultWith": "{{k8s.initScriptUrl}}" + } + }, + "regionInitCheckSum": { + "type": "string", + "description": "region initialization script", + "default": "", + "x-onyxia": { + "hidden": true, + "overwriteDefaultWith": "{{k8s.initScriptCheckSum}}" + } + }, + "personalInit": { + "title": "Use a custom script (URL)", + "type": "string", + "default": "" + }, + "personalInitArgs": { + "title": "Arguments for the custom script", + "type": "string", + "default": "" } -} \ No newline at end of file + } +} diff --git a/onyxia-api/src/main/resources/schemas/ide/message.json b/onyxia-api/src/main/resources/schemas/ide/message.json index e7c91d13..8a105c86 100644 --- a/onyxia-api/src/main/resources/schemas/ide/message.json +++ b/onyxia-api/src/main/resources/schemas/ide/message.json @@ -1,21 +1,20 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "message", - "type": "object", - "description": "add a message in the notes", - "x-onyxia":{ - "hidden": true - }, - "properties": { - "fr":{ - "type": "string", - "description":"message à ajouter dans les notes", - "default": "" - }, - "en":{ - "type": "string", - "description": "message to add in notes", - "default": "" - } - } + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "description": "Warning message", + "x-onyxia": { + "hidden": true + }, + "properties": { + "fr": { + "type": "string", + "description": "message à ajouter dans les notes", + "default": "" + }, + "en": { + "type": "string", + "description": "message to add in notes", + "default": "" + } + } } diff --git a/onyxia-api/src/main/resources/schemas/ide/openshiftSCC.json b/onyxia-api/src/main/resources/schemas/ide/openshiftSCC.json index fe94b0df..63b3f1db 100644 --- a/onyxia-api/src/main/resources/schemas/ide/openshiftSCC.json +++ b/onyxia-api/src/main/resources/schemas/ide/openshiftSCC.json @@ -1,24 +1,24 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Openshift SCC", - "description": "configuration for openshift compatibility", - "type": "object", - "properties": { - "enabled": { - "description": "enable rolebinding with openshift scc", - "type": "boolean", - "default": false, - "x-onyxia": { - "hidden": true - } - }, - "scc": { - "type": "string", - "description": "name of scc for rolebinding", - "default": "anyuid", - "x-onyxia": { - "hidden": true - } - } + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Openshift SCC", + "description": "configuration for openshift compatibility", + "type": "object", + "properties": { + "enabled": { + "description": "enable rolebinding with openshift scc", + "type": "boolean", + "default": false, + "x-onyxia": { + "hidden": true + } + }, + "scc": { + "type": "string", + "description": "name of scc for rolebinding", + "default": "anyuid", + "x-onyxia": { + "hidden": true + } } + } } diff --git a/onyxia-api/src/main/resources/schemas/ide/password.json b/onyxia-api/src/main/resources/schemas/ide/password.json index 613d0187..a75d952f 100644 --- a/onyxia-api/src/main/resources/schemas/ide/password.json +++ b/onyxia-api/src/main/resources/schemas/ide/password.json @@ -1,10 +1,10 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "string", - "description": "Password", - "default": "changeme", - "render": "password", - "x-onyxia": { - "overwriteDefaultWith": "{{service.oneTimePassword}}" - } -} \ No newline at end of file + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Service password", + "type": "string", + "default": "changeme", + "render": "password", + "x-onyxia": { + "overwriteDefaultWith": "{{service.oneTimePassword}}" + } +} diff --git a/onyxia-api/src/main/resources/schemas/ide/persistence.json b/onyxia-api/src/main/resources/schemas/ide/persistence.json index 70e925e2..4ce1cc1f 100644 --- a/onyxia-api/src/main/resources/schemas/ide/persistence.json +++ b/onyxia-api/src/main/resources/schemas/ide/persistence.json @@ -1,29 +1,32 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Configuration for persistence", - "type": "object", - "properties": { - "enabled": { - "type": "boolean", - "description": "Create a persistent volume", - "default": true - }, - "size": { - "type": "string", - "title": "Persistent volume size", - "description": "Size of the persistent volume", - "default": "10Gi", - "form": true, - "render": "slider", - "sliderMin": 1, - "sliderMax": 100, - "sliderStep": 1, - "sliderUnit": "Gi", - "hidden": { - "value": false, - "path": "enabled", - "isPathRelative": true - } - } + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Persistence", + "type": "object", + "properties": { + "enabled": { + "title": "Create a persistent volume", + "type": "boolean", + "default": true + }, + "size": { + "title": "Persistent volume size", + "type": "string", + "default": "10Gi", + "form": true, + "render": "slider", + "sliderMin": 1, + "sliderMax": 100, + "sliderStep": 1, + "sliderUnit": "Gi", + "x-onyxia": { + "overwriteDefaultWith": "region.resources.disk", + "useRegionSliderConfig": "disk" + }, + "hidden": { + "value": false, + "path": "enabled", + "isPathRelative": true + } } -} \ No newline at end of file + } +} diff --git a/onyxia-api/src/main/resources/schemas/ide/resources-gpu.json b/onyxia-api/src/main/resources/schemas/ide/resources-gpu.json index e60858f3..674ca18b 100644 --- a/onyxia-api/src/main/resources/schemas/ide/resources-gpu.json +++ b/onyxia-api/src/main/resources/schemas/ide/resources-gpu.json @@ -1,87 +1,101 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Resources", - "description": "Your service will have at least the requested resources and never more than its limits. No limit for a resource and you can consume everything left on the host machine.", - "type": "object", - "properties": { - "requests": { - "description": "Guaranteed resources", - "type": "object", - "properties": { - "cpu": { - "description": "The amount of cpu guaranteed", - "title": "CPU", - "type": "string", - "default": "100m", - "render": "slider", - "sliderMin": 50, - "sliderMax": 40000, - "sliderStep": 50, - "sliderUnit": "m", - "sliderExtremity": "down", - "sliderExtremitySemantic": "guaranteed", - "sliderRangeId": "cpu" - }, - "memory": { - "description": "The amount of memory guaranteed", - "title": "memory", - "type": "string", - "default": "2Gi", - "render": "slider", - "sliderMin": 1, - "sliderMax": 200, - "sliderStep": 1, - "sliderUnit": "Gi", - "sliderExtremity": "down", - "sliderExtremitySemantic": "guaranteed", - "sliderRangeId": "memory" - } + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Resources (CPU/RAM)", + "type": "object", + "properties": { + "requests": { + "description": "Guaranteed resources", + "type": "object", + "properties": { + "cpu": { + "description": "Guaranteed CPU allocation", + "title": "CPU", + "type": "string", + "default": "100m", + "render": "slider", + "sliderMin": 50, + "sliderMax": 40000, + "sliderStep": 50, + "sliderUnit": "m", + "sliderExtremity": "down", + "sliderExtremitySemantic": "guaranteed", + "sliderRangeId": "cpu", + "x-onyxia": { + "overwriteDefaultWith": "region.resources.cpuRequest", + "useRegionSliderConfig": "cpu" } }, - "limits": { - "description": "max resources", - "type": "object", - "properties": { - "cpu": { - "description": "The maximum amount of cpu", - "title": "CPU", - "type": "string", - "default": "30000m", - "render": "slider", - "sliderMin": 50, - "sliderMax": 40000, - "sliderStep": 50, - "sliderUnit": "m", - "sliderExtremity": "up", - "sliderExtremitySemantic": "Maximum", - "sliderRangeId": "cpu" - }, - "memory": { - "description": "The maximum amount of memory", - "title": "Memory", - "type": "string", - "default": "50Gi", - "render": "slider", - "sliderMin": 1, - "sliderMax": 200, - "sliderStep": 1, - "sliderUnit": "Gi", - "sliderExtremity": "up", - "sliderExtremitySemantic": "Maximum", - "sliderRangeId": "memory" - }, - "nvidia.com/gpu": { - "description": "GPU to allocate to this instance. This is also requested", - "type": "string", - "default": "1", - "render": "slider", - "sliderMin": 1, - "sliderMax": 3, - "sliderStep": 1, - "sliderUnit": "" - } + "memory": { + "description": "Guaranteed memory allocation", + "title": "memory", + "type": "string", + "default": "2Gi", + "render": "slider", + "sliderMin": 1, + "sliderMax": 200, + "sliderStep": 1, + "sliderUnit": "Gi", + "sliderExtremity": "down", + "sliderExtremitySemantic": "guaranteed", + "sliderRangeId": "memory", + "x-onyxia": { + "overwriteDefaultWith": "region.resources.memoryRequest", + "useRegionSliderConfig": "memory" } } + } + }, + "limits": { + "description": "max resources", + "type": "object", + "properties": { + "cpu": { + "description": "Maximum CPU allocation", + "title": "CPU", + "type": "string", + "default": "30000m", + "render": "slider", + "sliderMin": 50, + "sliderMax": 40000, + "sliderStep": 50, + "sliderUnit": "m", + "sliderExtremity": "up", + "sliderExtremitySemantic": "Maximum", + "sliderRangeId": "cpu", + "x-onyxia": { + "overwriteDefaultWith": "region.resources.cpuLimit", + "useRegionSliderConfig": "cpu" + } + }, + "memory": { + "description": "Maximum memory allocation", + "title": "Memory", + "type": "string", + "default": "50Gi", + "render": "slider", + "sliderMin": 1, + "sliderMax": 200, + "sliderStep": 1, + "sliderUnit": "Gi", + "sliderExtremity": "up", + "sliderExtremitySemantic": "Maximum", + "sliderRangeId": "memory", + "x-onyxia": { + "overwriteDefaultWith": "region.resources.memoryLimit", + "useRegionSliderConfig": "memory" + } + }, + "nvidia.com/gpu": { + "description": "GPU to allocate to this instance. This is also requested", + "type": "string", + "default": "1", + "render": "slider", + "sliderMin": 1, + "sliderMax": 3, + "sliderStep": 1, + "sliderUnit": "" + } + } } - + } } diff --git a/onyxia-api/src/main/resources/schemas/ide/resources.json b/onyxia-api/src/main/resources/schemas/ide/resources.json index a1805592..c29a98d5 100644 --- a/onyxia-api/src/main/resources/schemas/ide/resources.json +++ b/onyxia-api/src/main/resources/schemas/ide/resources.json @@ -1,76 +1,91 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Resources", - "description": "Your service will have at least the requested resources and never more than its limits. No limit for a resource and you can consume everything left on the host machine.", - "type": "object", - "properties": { - "requests": { - "description": "Guaranteed resources", - "type": "object", - "properties": { - "cpu": { - "description": "The amount of cpu guaranteed", - "title": "CPU", - "type": "string", - "default": "100m", - "render": "slider", - "sliderMin": 50, - "sliderMax": 40000, - "sliderStep": 50, - "sliderUnit": "m", - "sliderExtremity": "down", - "sliderExtremitySemantic": "guaranteed", - "sliderRangeId": "cpu" - }, - "memory": { - "description": "The amount of memory guaranteed", - "title": "memory", - "type": "string", - "default": "2Gi", - "render": "slider", - "sliderMin": 1, - "sliderMax": 200, - "sliderStep": 1, - "sliderUnit": "Gi", - "sliderExtremity": "down", - "sliderExtremitySemantic": "guaranteed", - "sliderRangeId": "memory" - } - } + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Resources (CPU/RAM)", + "type": "object", + "properties": { + "requests": { + "description": "Guaranteed resources", + "type": "object", + "properties": { + "cpu": { + "description": "Guaranteed CPU allocation", + "title": "CPU", + "type": "string", + "default": "100m", + "render": "slider", + "sliderMin": 50, + "sliderMax": 40000, + "sliderStep": 50, + "sliderUnit": "m", + "sliderExtremity": "down", + "sliderExtremitySemantic": "guaranteed", + "sliderRangeId": "cpu", + "x-onyxia": { + "overwriteDefaultWith": "region.resources.cpuRequest", + "useRegionSliderConfig": "cpu" + } }, - "limits": { - "description": "max resources", - "type": "object", - "properties": { - "cpu": { - "description": "The maximum amount of cpu", - "title": "CPU", - "type": "string", - "default": "30000m", - "render": "slider", - "sliderMin": 50, - "sliderMax": 40000, - "sliderStep": 50, - "sliderUnit": "m", - "sliderExtremity": "up", - "sliderExtremitySemantic": "Maximum", - "sliderRangeId": "cpu" - }, - "memory": { - "description": "The maximum amount of memory", - "title": "Memory", - "type": "string", - "default": "50Gi", - "render": "slider", - "sliderMin": 1, - "sliderMax": 200, - "sliderStep": 1, - "sliderUnit": "Gi", - "sliderExtremity": "up", - "sliderExtremitySemantic": "Maximum", - "sliderRangeId": "memory" - } - } + "memory": { + "description": "Guaranteed memory allocation", + "title": "memory", + "type": "string", + "default": "2Gi", + "render": "slider", + "sliderMin": 1, + "sliderMax": 200, + "sliderStep": 1, + "sliderUnit": "Gi", + "sliderExtremity": "down", + "sliderExtremitySemantic": "guaranteed", + "sliderRangeId": "memory", + "x-onyxia": { + "overwriteDefaultWith": "region.resources.memoryRequest", + "useRegionSliderConfig": "memory" + } } + } + }, + "limits": { + "description": "max resources", + "type": "object", + "properties": { + "cpu": { + "description": "Maximum CPU allocation", + "title": "CPU", + "type": "string", + "default": "30000m", + "render": "slider", + "sliderMin": 50, + "sliderMax": 40000, + "sliderStep": 50, + "sliderUnit": "m", + "sliderExtremity": "up", + "sliderExtremitySemantic": "Maximum", + "sliderRangeId": "cpu", + "x-onyxia": { + "overwriteDefaultWith": "region.resources.cpuLimit", + "useRegionSliderConfig": "cpu" + } + }, + "memory": { + "description": "Maximum memory allocation", + "title": "Memory", + "type": "string", + "default": "50Gi", + "render": "slider", + "sliderMin": 1, + "sliderMax": 200, + "sliderStep": 1, + "sliderUnit": "Gi", + "sliderExtremity": "up", + "sliderExtremitySemantic": "Maximum", + "sliderRangeId": "memory", + "x-onyxia": { + "overwriteDefaultWith": "region.resources.memoryLimit", + "useRegionSliderConfig": "memory" + } + } + } } + } } diff --git a/onyxia-api/src/main/resources/schemas/ide/role.json b/onyxia-api/src/main/resources/schemas/ide/role.json index e5832fb6..98f79b7f 100644 --- a/onyxia-api/src/main/resources/schemas/ide/role.json +++ b/onyxia-api/src/main/resources/schemas/ide/role.json @@ -1,26 +1,28 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Role", - "type": "object", - "properties": { - "enabled": { - "type": "boolean", - "description": "allow your service to access your namespace ressources", - "default": true - }, - "role": { - "type": "string", - "description": "bind your service account to this kubernetes default role", - "default": "view", - "hidden": { - "value": false, - "path": "kubernetes/enabled" - }, - "enum": [ - "view", - "edit", - "admin" - ] - } + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Kubernetes permissions", + "type": "object", + "properties": { + "enabled": { + "title": "Enable Kubernetes access from within the service", + "type": "boolean", + "default": true + }, + "role": { + "title": "Kubernetes role", + "description": "access is restricted to your own namespace", + "type": "string", + "default": "view", + "hidden": { + "value": false, + "path": "kubernetes/enabled" + }, + "listEnum": [ + "view", + "edit", + "admin" + ], + "render": "list" } -} \ No newline at end of file + } +} diff --git a/onyxia-api/src/main/resources/schemas/ide/route.json b/onyxia-api/src/main/resources/schemas/ide/route.json index c003c0a4..5274ab68 100644 --- a/onyxia-api/src/main/resources/schemas/ide/route.json +++ b/onyxia-api/src/main/resources/schemas/ide/route.json @@ -1,35 +1,35 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Route", - "description": "Route parameters", - "type": "object", - "properties": { - "enabled": { - "description": "Enable route", - "type": "boolean", - "default": false, - "x-onyxia": { - "hidden": true, - "overwriteDefaultWith": "k8s.route" - } - }, - "hostname": { - "type": "string", - "form": true, - "title": "Hostname", - "x-onyxia": { - "hidden": true, - "overwriteDefaultWith": "{{project.id}}-{{k8s.randomSubdomain}}-0.{{k8s.domain}}" - } - }, - "userHostname": { - "type": "string", - "form": true, - "title": "Hostname", - "x-onyxia": { - "hidden": true, - "overwriteDefaultWith": "{{project.id}}-{{k8s.randomSubdomain}}-user.{{k8s.domain}}" - } - } + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Route details", + "type": "object", + "form": true, + "properties": { + "enabled": { + "description": "Enable route", + "type": "boolean", + "default": false, + "x-onyxia": { + "hidden": true, + "overwriteDefaultWith": "k8s.route" + } + }, + "hostname": { + "type": "string", + "form": true, + "title": "Hostname", + "x-onyxia": { + "hidden": true, + "overwriteDefaultWith": "{{project.id}}-{{k8s.randomSubdomain}}-0.{{k8s.domain}}" + } + }, + "userHostname": { + "type": "string", + "form": true, + "title": "Hostname", + "x-onyxia": { + "hidden": true, + "overwriteDefaultWith": "{{project.id}}-{{k8s.randomSubdomain}}-user.{{k8s.domain}}" + } } -} \ No newline at end of file + } +} diff --git a/onyxia-api/src/main/resources/schemas/ide/s3.json b/onyxia-api/src/main/resources/schemas/ide/s3.json index d519eff5..7082f0c9 100644 --- a/onyxia-api/src/main/resources/schemas/ide/s3.json +++ b/onyxia-api/src/main/resources/schemas/ide/s3.json @@ -1,18 +1,18 @@ { - "title": "S3 Configuration", - "description": "Configuration of temporary identity for AWS S3", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "S3 object storage", "type": "object", "properties": { "enabled": { + "title": "Enable S3 access from within the service", "type": "boolean", - "description": "Add S3 temporary identity inside your environment", "default": true }, "accessKeyId": { - "description": "AWS Access Key", + "title": "Access Key ID", "type": "string", "x-onyxia": { - "overwriteDefaultWith": "{{s3.AWS_ACCESS_KEY_ID}}" + "overwriteDefaultWith": "s3.AWS_ACCESS_KEY_ID" }, "hidden": { "value": false, @@ -21,7 +21,7 @@ } }, "endpoint": { - "description": "AWS S3 Endpoint", + "title": "S3 endpoint URL", "type": "string", "x-onyxia": { "overwriteDefaultWith": "{{s3.AWS_S3_ENDPOINT}}" @@ -33,7 +33,7 @@ } }, "defaultRegion": { - "description": "AWS S3 default region", + "title": "Default region", "type": "string", "x-onyxia": { "overwriteDefaultWith": "{{s3.AWS_DEFAULT_REGION}}" @@ -45,7 +45,7 @@ } }, "secretAccessKey": { - "description": "AWS S3 secret access key", + "title": "Secret Access Key", "type": "string", "render": "password", "x-onyxia": { @@ -58,7 +58,7 @@ } }, "sessionToken": { - "description": "AWS S3 session Token", + "title": "Session token", "type": "string", "render": "password", "x-onyxia": { @@ -69,8 +69,35 @@ "path": "enabled", "isPathRelative": true } + }, + "pathStyleAccess": { + "title": "Path-style access", + "type": "boolean", + "default": false, + "x-onyxia": { + "overwriteDefaultWith": "{{s3.pathStyleAccess}}" + }, + "hidden": { + "value": false, + "path": "enabled", + "isPathRelative": true + } + }, + "workingDirectoryPath": { + "title": "Working directory path", + "type": "string", + "default": "", + "x-onyxia": { + "overwriteDefaultWith": "{{s3.workingDirectoryPath}}" + }, + "hidden": { + "value": false, + "path": "enabled", + "isPathRelative": true + } } }, - "required": ["enabled"] + "required": [ + "enabled" + ] } - diff --git a/onyxia-api/src/main/resources/schemas/ide/startupProbe.json b/onyxia-api/src/main/resources/schemas/ide/startupProbe.json index 5c99715d..4199abe8 100644 --- a/onyxia-api/src/main/resources/schemas/ide/startupProbe.json +++ b/onyxia-api/src/main/resources/schemas/ide/startupProbe.json @@ -1,8 +1,30 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Startup probe", + "description": "Startup probe", "type": "object", - "description": "Startup probes let kubelet know that a container application has started", + "properties": { + "failureThreshold": { + "type": "integer", + "default": 60 + }, + "initialDelaySeconds": { + "type": "integer", + "default": 10 + }, + "periodSeconds": { + "type": "integer", + "default": 10 + }, + "successThreshold": { + "type": "integer", + "default": 1 + }, + "timeoutSeconds": { + "type": "integer", + "default": 2 + } + }, "default": { "failureThreshold": 60, "initialDelaySeconds": 10, diff --git a/onyxia-api/src/main/resources/schemas/ide/vault.json b/onyxia-api/src/main/resources/schemas/ide/vault.json index 150e4a0e..e6c8ec00 100644 --- a/onyxia-api/src/main/resources/schemas/ide/vault.json +++ b/onyxia-api/src/main/resources/schemas/ide/vault.json @@ -1,72 +1,72 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Vault", - "description": "Configuration of vault client", - "type": "object", - "properties": { - "enabled": { - "type": "boolean", - "description": "Add vault temporary identity inside your environment", - "default": true - }, - "token": { - "description": "token vault", - "type": "string", - "render": "password", - "x-onyxia": { - "overwriteDefaultWith": "{{vault.VAULT_TOKEN}}" - }, - "hidden": { - "value": false, - "path": "enabled", - "isPathRelative": true - } - }, - "url": { - "description": "url of vault server", - "type": "string", - "x-onyxia": { - "overwriteDefaultWith": "{{vault.VAULT_ADDR}}" - }, - "hidden": { - "value": false, - "path": "enabled", - "isPathRelative": true - } - }, - "mount": { - "description": "mount of the v2 secret engine", - "type": "string", - "x-onyxia": { - "overwriteDefaultWith": "{{vault.VAULT_MOUNT}}" - }, - "hidden": { - "value": false, - "path": "enabled", - "isPathRelative": true - } - }, - "directory": { - "description": "top level directory", - "type": "string", - "x-onyxia": { - "overwriteDefaultWith": "{{vault.VAULT_TOP_DIR}}" - }, - "hidden": { - "value": false, - "path": "enabled", - "isPathRelative": true - } - }, - "secret": { - "description": "the path of the secret to convert into a list of environment variables", - "type": "string", - "default": "", - "hidden": { - "value": false, - "path": "enabled", - "isPathRelative": true - } - } + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Vault access", + "type": "object", + "properties": { + "enabled": { + "title": "Enable Vault access from within the service", + "type": "boolean", + "default": true + }, + "token": { + "title": "Vault token", + "type": "string", + "render": "password", + "x-onyxia": { + "overwriteDefaultWith": "{{vault.VAULT_TOKEN}}" + }, + "hidden": { + "value": false, + "path": "enabled", + "isPathRelative": true + } + }, + "url": { + "title": "Vault server URL", + "type": "string", + "x-onyxia": { + "overwriteDefaultWith": "{{vault.VAULT_ADDR}}" + }, + "hidden": { + "value": false, + "path": "enabled", + "isPathRelative": true + } + }, + "mount": { + "title": "Secret engine", + "type": "string", + "x-onyxia": { + "overwriteDefaultWith": "{{vault.VAULT_MOUNT}}" + }, + "hidden": { + "value": false, + "path": "enabled", + "isPathRelative": true + } + }, + "directory": { + "title": "Top-level directory", + "type": "string", + "x-onyxia": { + "overwriteDefaultWith": "{{vault.VAULT_TOP_DIR}}" + }, + "hidden": { + "value": false, + "path": "enabled", + "isPathRelative": true + } + }, + "secret": { + "title": "Path to the secret to load", + "description": "The secret will be converted into a list of environment variables", + "type": "string", + "default": "", + "hidden": { + "value": false, + "path": "enabled", + "isPathRelative": true + } } -} \ No newline at end of file + } +} diff --git a/onyxia-api/src/main/resources/schemas/network-policy.json b/onyxia-api/src/main/resources/schemas/network-policy.json index f5ab2e99..58e46f92 100644 --- a/onyxia-api/src/main/resources/schemas/network-policy.json +++ b/onyxia-api/src/main/resources/schemas/network-policy.json @@ -1,25 +1,28 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "title": "Network Policy", - "description": "Define access policy to the service", - "properties": { - "enabled": { - "type": "boolean", - "title": "Enable network policy", - "description": "Only pod from the same namespace will be allowed", - "default": false, - "x-onyxia": { - "hidden": true - } - }, - "from": { - "type": "array", - "description": "Array of source allowed to have network access to your service", - "default": [], - "x-onyxia": { - "hidden": true - } - } + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Network access policy", + "type": "object", + "properties": { + "enabled": { + "title": "Only allow access from the same namespace", + "type": "boolean", + "default": false, + "x-onyxia": { + "overwriteDefaultWith": "region.defaultNetworkPolicy" + } + }, + "from": { + "description": "Array of sources allowed to have network access to your service", + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + }, + "default": [], + "x-onyxia": { + "hidden": true, + "overwriteDefaultWith": "region.from" + } } + } } diff --git a/onyxia-api/src/main/resources/schemas/nodeSelector-gpu.json b/onyxia-api/src/main/resources/schemas/nodeSelector-gpu.json index 7817156f..4f49c3df 100644 --- a/onyxia-api/src/main/resources/schemas/nodeSelector-gpu.json +++ b/onyxia-api/src/main/resources/schemas/nodeSelector-gpu.json @@ -1,15 +1,15 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Node Selector", - "type": "object", - "default": {}, - "description": "Node selector constraints for the pod", - "additionalProperties": { - "type": "string", - "description": "Key-value pairs to select nodes" - }, - "x-onyxia": { - "hidden": true, - "overwriteDefaultWith": "region.nodeSelector" - } + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Node Selector", + "type": "object", + "default": {}, + "description": "Node selector constraints for the pod", + "additionalProperties": { + "type": "string", + "description": "Key-value pairs to select nodes" + }, + "x-onyxia": { + "hidden": true, + "overwriteDefaultWith": "region.nodeSelector" + } } diff --git a/onyxia-api/src/main/resources/schemas/nodeSelector.json b/onyxia-api/src/main/resources/schemas/nodeSelector.json index 20377863..fd957ac9 100644 --- a/onyxia-api/src/main/resources/schemas/nodeSelector.json +++ b/onyxia-api/src/main/resources/schemas/nodeSelector.json @@ -1,15 +1,15 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Node Selector", - "type": "object", - "default": {}, - "description": "Node selector constraints for the pod", - "additionalProperties": { - "type": "string", - "description": "Key-value pairs to select nodes" - }, - "x-onyxia": { - "hidden": true, - "overwriteDefaultWith": "region.nodeSelector" - } + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Node Selector", + "type": "object", + "default": {}, + "description": "Node selector constraints for the pod", + "additionalProperties": { + "type": "string", + "description": "Key-value pairs to select nodes" + }, + "x-onyxia": { + "hidden": true, + "overwriteDefaultWith": "region.nodeSelector" + } } diff --git a/onyxia-api/src/main/resources/schemas/proxy.json b/onyxia-api/src/main/resources/schemas/proxy.json index b8b49bd7..67b14c5b 100644 --- a/onyxia-api/src/main/resources/schemas/proxy.json +++ b/onyxia-api/src/main/resources/schemas/proxy.json @@ -1,39 +1,36 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Proxy", - "type": "object", - "properties": { - "enabled": { - "type": "boolean", - "description": "Inject proxy settings", - "default": false, - "x-onyxia": { - "hidden": true - } - }, - "httpProxy": { - "type": "string", - "description": "Proxy URL for HTTP requests", - "default": "", - "x-onyxia": { - "hidden": true - } - }, - "httpsProxy": { - "type": "string", - "description": "Proxy URL for HTTPS requests", - "default": "", - "x-onyxia": { - "hidden": true - } - }, - "noProxy": { - "type": "string", - "description": "Comma separated list of hosts for which proxy is bypassed", - "default": "", - "x-onyxia": { - "hidden": true - } - } + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Proxy", + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "Inject proxy settings", + "default": false, + "x-onyxia": { + "hidden": true + } + }, + "httpProxy": { + "type": "string", + "default": "", + "x-onyxia": { + "hidden": true + } + }, + "httpsProxy": { + "type": "string", + "default": "", + "x-onyxia": { + "hidden": true + } + }, + "noProxy": { + "type": "string", + "default": "", + "x-onyxia": { + "hidden": true + } } + } } diff --git a/onyxia-api/src/main/resources/schemas/role-spark.json b/onyxia-api/src/main/resources/schemas/role-spark.json index 3fd273bb..07e03809 100644 --- a/onyxia-api/src/main/resources/schemas/role-spark.json +++ b/onyxia-api/src/main/resources/schemas/role-spark.json @@ -1,26 +1,29 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Role", - "type": "object", - "properties": { - "enabled": { - "type": "boolean", - "description": "allow your service to access your namespace ressources", - "default": true - }, - "role": { - "type": "string", - "description": "bind your service account to this kubernetes default role", - "default": "admin", - "hidden": { - "value": false, - "path": "kubernetes/enabled" - }, - "enum": [ - "view", - "edit", - "admin" - ] - } + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Kubernetes permissions", + "type": "object", + "properties": { + "enabled": { + "title": "Enable Kubernetes access from within the service", + "type": "boolean", + "default": true + }, + "role": { + "title": "Kubernetes role", + "description": "access is restricted to your own namespace", + "type": "string", + "default": "admin", + "hidden": { + "value": false, + "path": "enabled", + "isPathRelative": true + }, + "listEnum": [ + "view", + "edit", + "admin" + ], + "render": "list" } + } } diff --git a/onyxia-api/src/main/resources/schemas/spark.json b/onyxia-api/src/main/resources/schemas/spark.json index 3200929d..47e6c742 100644 --- a/onyxia-api/src/main/resources/schemas/spark.json +++ b/onyxia-api/src/main/resources/schemas/spark.json @@ -1,47 +1,45 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Spark", - "type": "object", - "description": "spark specific configuration", - "properties": { - "sparkui": { - "type": "boolean", - "title": "SparkUI", - "description": "Enable Spark monitoring interface", - "default": true + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Spark", + "type": "object", + "properties": { + "sparkui": { + "title": "Enable monitoring interface", + "type": "boolean", + "default": true + }, + "default": { + "title": "Create a Spark configuration", + "type": "boolean", + "default": true + }, + "disabledCertChecking": { + "title": "Disable certificate checking for S3 storage", + "description": "(do not disable in production)", + "type": "boolean", + "default": false + }, + "userConfig": { + "title": "Spark configuration (spark-default.conf)", + "type": "object", + "additionalProperties": { + "type": "string" }, "default": { - "type": "boolean", - "title": "Create a spark config", - "description": "Create a default spark config in spark-default.conf", - "default": true + "spark.dynamicAllocation.enabled": "true", + "spark.dynamicAllocation.initialExecutors": "1", + "spark.dynamicAllocation.minExecutors": "1", + "spark.dynamicAllocation.maxExecutors": "10", + "spark.executor.memory": "2g", + "spark.driver.memory": "2g", + "spark.dynamicAllocation.executorAllocationRatio": "1", + "spark.dynamicAllocation.shuffleTracking.enabled": "true", + "spark.hadoop.fs.s3a.bucket.all.committer.magic.enabled": "true" }, - "disabledCertChecking": { - "title": "Disable certificate checking ", - "type": "boolean", - "description": "Disable certificate checking for your S3 storage, do not use it in production", - "default": false - }, - "userConfig": { - "type": "object", - "title": "Create a spark config", - "description": "Create a default spark config in spark-default.conf", - "default": { - "spark.dynamicAllocation.enabled": "true", - "spark.dynamicAllocation.initialExecutors": "1", - "spark.dynamicAllocation.minExecutors": "1", - "spark.dynamicAllocation.maxExecutors": "10", - "spark.executor.memory": "2g", - "spark.driver.memory": "2g", - "spark.dynamicAllocation.executorAllocationRatio": "1", - "spark.dynamicAllocation.shuffleTracking.enabled": "true", - "spark.hadoop.fs.s3a.bucket.all.committer.magic.enabled": "true" - }, - "hidden": { - "value": false, - "path": "default", - "isPathRelative": true - } + "hidden": { + "value": false, + "path": "spark/default" } } -} \ No newline at end of file + } +} diff --git a/onyxia-api/src/main/resources/schemas/tolerations.json b/onyxia-api/src/main/resources/schemas/tolerations.json index 502f4468..380246b8 100644 --- a/onyxia-api/src/main/resources/schemas/tolerations.json +++ b/onyxia-api/src/main/resources/schemas/tolerations.json @@ -1,39 +1,49 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Kubernetes Tolerations", - "type": "array", - "default": [], - "x-onyxia": { - "hidden": true - }, - "items": { - "type": "object", - "properties": { - "key": { - "type": "string", - "description": "The taint key that the toleration applies to." - }, - "operator": { - "type": "string", - "enum": ["Exists", "Equal"], - "description": "The operator indicates the relationship between the key and value." - }, - "value": { - "type": "string", - "description": "The taint value that the toleration matches to." - }, - "effect": { - "type": "string", - "enum": ["NoSchedule", "PreferNoSchedule", "NoExecute"], - "description": "The effect indicates what action should be taken when the toleration is matched." - }, - "tolerationSeconds": { - "type": "integer", - "description": "The period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. Represented in seconds." - } + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Kubernetes Tolerations", + "type": "array", + "default": [], + "x-onyxia": { + "hidden": true + }, + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "The taint key that the toleration applies to." + }, + "operator": { + "type": "string", + "enum": [ + "Exists", + "Equal" + ], + "description": "The operator indicates the relationship between the key and value." + }, + "value": { + "type": "string", + "description": "The taint value that the toleration matches to." }, - "required": ["key", "operator", "effect"], - "additionalProperties": false - } + "effect": { + "type": "string", + "enum": [ + "NoSchedule", + "PreferNoSchedule", + "NoExecute" + ], + "description": "The effect indicates what action should be taken when the toleration is matched." + }, + "tolerationSeconds": { + "type": "integer", + "description": "The period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. Represented in seconds." + } + }, + "required": [ + "key", + "operator", + "effect" + ], + "additionalProperties": false } - +}