Dépôt chart helm pour l'ajout d'un catalogue de service visible sur l'interface onyxia uniquement par les utilisateurs étant dans un groupe spécifique + ajout du service wordpress.
Un groupe de projet "datalab-onyxia-admin" a été créer sur l'AD dans le dossier datalab/onyxia
Concernant le chart helm wordpress, pour la personnalisation de l'UI et des valeurs que l'utilisateur pourra paramétrer lors ce qu'il lancera le service "wordpress" depuis le catalogue. Il va falloir modifier des valeurs dans le fichier "values.schema.json" du chart helm wordpress. Ceci est expliqué avec des exemples dans la partie "Onyxia Helm format extension" disponible sur https://github.com/InseeFrLab/onyxia-api/tree/main
**Code des helm chart repo** https://code.groupe-genes.fr/aguyot-ensae/helm-chart-genes/src/branch/main/charts
**Helm chart wordpress+valuesjson de VScode**
Plusieurs tentatives de mixer le values.schema. json pas du chart wordpress et celui du values.json du VScode de l’insee, pas d’erreur significatif sur l’api, le service depuis le catalog ne se lance pas (tourne en boucle + n’apparait pas dans « Mes services » + aucun pod de lancé).
**Helm chart du wordpress sans values.schema.json**
Erreur Pkg sur l’api :
```
2024-04-16T08:43:49.610Z ERROR 7 --- [nio-8080-exec-3] o.a.c.c.C.[.[.[.[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [/api] threw exception [Request processing failed: java.lang.NullPointerException: Cannot invoke "fr.insee.onyxia.model.catalog.Config.Config.getProperties()" because the return value of "fr.insee.onyxia.model.catalog.Pkg.getConfig()" is null] with root cause
java.lang.NullPointerException: Cannot invoke "fr.insee.onyxia.model.catalog.Config.Config.getProperties()" because the return value of "fr.insee.onyxia.model.catalog.Pkg.getConfig()" is null
at fr.insee.onyxia.api.controller.pub.CatalogController.addCustomOnyxiaProperties(CatalogController.java:148) ~[classes/:v2.5.0]
at fr.insee.onyxia.api.controller.pub.CatalogController.getChartByVersion(CatalogController.java:119) ~[classes/:v2.5.0]
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Unknown Source) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Unknown Source) ~[na:na]
```
**Helm chart du wordpress avec uniquement les values.schema.json du wordpress**
```
Caused by: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of `fr.insee.onyxia.model.catalog.Config.Property$Hidden` (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('mariadb/enabled')
Erreur dû au fichier values.schema.json du chart wordpress
L'erreur affiché est du côté de l'api dans le catalogcontroller: https://github.com/InseeFrLab/onyxia-api/blob/5bd597127bbeeb22d155494d9632dfcaf1c28d1d/onyxia-api/src/main/java/fr/insee/onyxia/api/controller/pub/CatalogController.java#L147
```
2024-04-15T13:44:00.432Z INFO 7 --- [Pool-worker-254] f.i.o.api.dao.universe.CatalogLoader : Refreshing package wordpress-copie-original version 20.1.2 in catalog Genes
2024-04-15T13:44:00.432Z INFO 7 --- [Pool-worker-268] f.i.o.api.dao.universe.CatalogLoader : Refreshing package kikik version 2.1 in catalog Genes
2024-04-15T13:44:00.461Z INFO 7 --- [Pool-worker-254] f.i.o.api.dao.universe.CatalogLoader : Exception occurred
fr.insee.onyxia.api.dao.universe.CatalogLoaderException: Exception occurred during loading resource: URL [https://code.groupe-genes.fr/api/packages/aguyot-ensae/helm/wordpress-copie-original-20.1.2.tgz]
at fr.insee.onyxia.api.dao.universe.CatalogLoader.refreshPackage(CatalogLoader.java:171) ~[classes/:v2.5.0]
at fr.insee.onyxia.api.dao.universe.CatalogLoader.lambda$refreshChartsList$3(CatalogLoader.java:133) ~[classes/:v2.5.0]
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source) ~[na:na]
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source) ~[na:na]
at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source) ~[na:na]
at java.base/java.util.stream.ForEachOps$ForEachTask.compute(Unknown Source) ~[na:na]
at java.base/java.util.concurrent.CountedCompleter.exec(Unknown Source) ~[na:na]
at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source) ~[na:na]
at java.base/java.util.concurrent.ForkJoinTask.invoke(Unknown Source) ~[na:na]
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateParallel(Unknown Source) ~[na:na]
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateParallel(Unknown Source) ~[na:na]
at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source) ~[na:na]
at java.base/java.util.stream.ReferencePipeline.forEach(Unknown Source) ~[na:na]
at java.base/java.util.stream.ReferencePipeline$Head.forEach(Unknown Source) ~[na:na]
at fr.insee.onyxia.api.dao.universe.CatalogLoader.refreshChartsList(CatalogLoader.java:130) ~[classes/:v2.5.0]
at fr.insee.onyxia.api.dao.universe.CatalogLoader.lambda$updateHelmRepository$2(CatalogLoader.java:83) ~[classes/:v2.5.0]
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source) ~[na:na]
at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Unknown Source) ~[na:na]
at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source) ~[na:na]
at java.base/java.util.stream.ForEachOps$ForEachTask.compute(Unknown Source) ~[na:na]
at java.base/java.util.concurrent.CountedCompleter.exec(Unknown Source) ~[na:na]
at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source) ~[na:na]
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source) ~[na:na]
at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source) ~[na:na]
at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source) ~[na:na]
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source) ~[na:na]
Caused by: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of `fr.insee.onyxia.model.catalog.Config.Property$Hidden` (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('mariadb/enabled')
Contenu du fichier values.schema.json du helm chart wordpress (j'ai repris le "values.schema.json" du chart original wordpress que j'ai modifié puis j'ai rajouté à la suite le contenue du fichier "values.schema.json" du fichier helm VScode de l'insee et l'ai également modifié. Vu qu'on ne peu pas ajouter de commentaire, j'ai laisser un gros espace vide entre les deux parties dans le values.schema.json):
```
{
"$schema": "http://json-schema.org/schema#",
"type": "object",
"properties": {
"wordpressUsername": {
"type": "string",
"title": "Username",
"form": true
},
"wordpressPassword": {
"type": "string",
"title": "Password",
"form": true,
"description": "Defaults to a random 10-character alphanumeric string if not set"
},
"wordpressEmail": {
"type": "string",
"title": "Admin email",
"form": true
},
"wordpressBlogName": {
"type": "string",
"title": "Blog Name",
"form": true
},
"persistence": {
"type": "object",
"properties": {
"size": {
"type": "string",
"title": "Persistent Volume Size",
"form": true,
"render": "slider",
"sliderMin": 1,
"sliderMax": 100,
"sliderUnit": "Gi"
}
}
},
"mariadb": {
"type": "object",
"title": "MariaDB Details",
"form": true,
"properties": {
"enabled": {
"type": "boolean",
"title": "Use a new MariaDB database hosted in the cluster",
"form": true,
"description": "Whether to deploy a mariadb server to satisfy the applications database requirements. To use an external database switch this off and configure the external database details"
},
"primary": {
"type": "object",
"properties": {
"persistence": {
"type": "object",
"properties": {
"size": {
"type": "string",
"title": "Volume Size",
"form": true,
"hidden": {
"value": false,
"path": "mariadb/primary/persistence/enabled"
},
"render": "slider",
"sliderMin": 1,
"sliderMax": 100,
"sliderUnit": "Gi"
}
}
}
}
}
}
},
"externalDatabase": {
"type": "object",
"title": "External Database Details",
"description": "If MariaDB is disabled. Use this section to specify the external database details",
"form": true,
"properties": {
"host": {
"type": "string",
"form": true,
"title": "Database Host",
"hidden": "mariadb/enabled"
},
"user": {
"type": "string",
"form": true,
"title": "Database Username",
"hidden": "mariadb/enabled"
},
"password": {
"type": "string",
"form": true,
"title": "Database Password",
"hidden": "mariadb/enabled"
},
"database": {
"type": "string",
"form": true,
"title": "Database Name",
"hidden": "mariadb/enabled"
},
"port": {
"type": "integer",
"form": true,
"title": "Database Port",
"hidden": "mariadb/enabled"
}
}
},
"ingress": {
"type": "object",
"form": true,
"title": "Ingress Configuration",
"properties": {
"enabled": {
"type": "boolean",
"form": true,
"title": "Use a custom hostname",
"description": "Enable the ingress resource that allows you to access the WordPress installation."
},
"hostname": {
"type": "string",
"form": true,
"title": "Hostname",
"hidden": {
"value": false,
"path": "ingress/enabled"
}
},
"tls": {
"type": "boolean",
"form": true,
"title": "Create a TLS secret",
"hidden": {
"value": false,
"path": "ingress/enabled"
}
}
}
},
"service": {
"type": "object",
"form": true,
"title": "Service Configuration",
"properties": {
"type": {
"type": "string",
"form": true,
"title": "Service Type",
"description": "Allowed values: \"ClusterIP\", \"NodePort\" and \"LoadBalancer\""
}
}
},
"resources": {
"type": "object",
"title": "Required 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.",