devzone 0.42.1 → 0.44.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/.devcontainer/Dockerfile +1 -1
  2. package/.devcontainer/agent-local.sh +45 -0
  3. package/.devcontainer/agent-workspace.sh +2 -2
  4. package/.devcontainer/agent.sh +10 -10
  5. package/.devcontainer/argocd/catalogue-argocd.sh +4 -0
  6. package/.devcontainer/argocd/gitops-gitlab.sh +127 -0
  7. package/.devcontainer/argocd/gitops.sh +12 -2
  8. package/.devcontainer/argocd/services-hook.sh +211 -0
  9. package/.devcontainer/catalogue/app.sh +7 -8
  10. package/.devcontainer/catalogue/mysql/installer.sh +9 -8
  11. package/.devcontainer/catalogue/mysql/mysql.sh +2 -2
  12. package/.devcontainer/catalogue.sh +1 -1
  13. package/.devcontainer/chart-direct.sh +49 -0
  14. package/.devcontainer/devzone +22 -16
  15. package/.devcontainer/etat-json.sh +3 -3
  16. package/.devcontainer/gitlab/argocd.sh +54 -0
  17. package/.devcontainer/gitlab/chart.sh +39 -0
  18. package/.devcontainer/gitlab/gitlab.sh +11 -168
  19. package/.devcontainer/gitlab/installation.sh +25 -38
  20. package/.devcontainer/gitlab/seed.sh +204 -0
  21. package/.devcontainer/help.sh +2 -0
  22. package/.devcontainer/llm/llm.sh +250 -0
  23. package/.devcontainer/llm/opencode.sh +56 -0
  24. package/.devcontainer/llm/presets.sh +43 -0
  25. package/.devcontainer/postgres/postgres.sh +5 -3
  26. package/.devcontainer/services-admin.sh +19 -6
  27. package/.devcontainer/versions.env +1 -1
  28. package/README.md +57 -23
  29. package/charts/devzone-gitlab/Chart.lock +9 -0
  30. package/charts/devzone-gitlab/Chart.yaml +15 -0
  31. package/charts/devzone-gitlab/values.yaml +94 -0
  32. package/charts/devzone-llm/Chart.yaml +6 -0
  33. package/charts/devzone-llm/templates/deployment.yaml +97 -0
  34. package/charts/devzone-llm/templates/pvc.yaml +19 -0
  35. package/charts/devzone-llm/templates/service.yaml +18 -0
  36. package/charts/devzone-llm/values.yaml +46 -0
  37. package/charts/devzone-mysql/values.yaml +3 -3
  38. package/charts/devzone-postgres/values.yaml +2 -2
  39. package/manage/devzone +1 -1
  40. package/manage/scripts/check-charts.sh +67 -19
  41. package/manage/scripts/check-utf8-vars.sh +67 -0
  42. package/manage/scripts/services-workspace.sh +16 -6
  43. package/package.json +1 -1
  44. package/.devcontainer/catalogue/mysql/manifeste.yaml +0 -81
  45. package/.devcontainer/gitlab/runner-values.yaml +0 -27
  46. package/.devcontainer/gitlab/values.yaml +0 -83
  47. package/.devcontainer/postgres/postgres.yaml +0 -84
@@ -0,0 +1,67 @@
1
+ #!/usr/bin/env bash
2
+ # CI check: in the shell scripts tracked by git, a variable name immediately
3
+ # followed by a non-ASCII byte must be written ${NAME}. Under the macOS locale
4
+ # bash reads the multi-byte character as part of the name, so $NAME followed by
5
+ # an accented letter or an ellipsis breaks (#591). Scripts checked: *.sh,
6
+ # *.bash, .devcontainer/devzone, manage/devzone, and any tracked file whose
7
+ # first line is a bash shebang. A fault is printed as "path:line: text" and the
8
+ # run exits 1; otherwise it prints "utf8 vars check: N files ok" and exits 0.
9
+ # bash 3.2 (macOS).
10
+
11
+ set -u
12
+
13
+ ICI="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
14
+ ROOT="$(cd "$ICI/../.." && pwd)"
15
+
16
+ # Byte matching only. The class is every byte outside printable ASCII, minus
17
+ # the tab (a tab after a name is not a fault). Built from a printf so this
18
+ # file holds no literal non-ASCII byte and never matches its own rule.
19
+ TAB="$(printf '\t')"
20
+ PATTERN='\$[A-Za-z_][A-Za-z_0-9]*[^ -~'"$TAB"']'
21
+
22
+ LC_ALL=C
23
+ export LC_ALL
24
+
25
+ # True when the tracked file $1 (relative to ROOT) is a bash script
26
+ is_bash_script() {
27
+ local first
28
+ case "$1" in
29
+ *.sh | *.bash | .devcontainer/devzone | manage/devzone) return 0 ;;
30
+ esac
31
+ first="$(head -n 1 "$ROOT/$1" 2>/dev/null)"
32
+ case "$first" in
33
+ '#!'*bash*) return 0 ;;
34
+ esac
35
+ return 1
36
+ }
37
+
38
+ files="$(git -C "$ROOT" ls-files)" || {
39
+ echo "check-utf8-vars: git ls-files fails in $ROOT" >&2
40
+ exit 1
41
+ }
42
+
43
+ fails=0
44
+ count=0
45
+ while IFS= read -r f; do
46
+ [ -n "$f" ] || continue
47
+ [ -f "$ROOT/$f" ] || continue
48
+ is_bash_script "$f" || continue
49
+ count=$((count + 1))
50
+ matches="$(grep -naE -- "$PATTERN" "$ROOT/$f")" || matches=""
51
+ while IFS= read -r m; do
52
+ [ -n "$m" ] || continue
53
+ n="${m%%:*}"
54
+ printf '%s:%s: %s\n' "$f" "$n" "${m#*:}"
55
+ fails=1
56
+ done <<EOF
57
+ $matches
58
+ EOF
59
+ done <<EOF
60
+ $files
61
+ EOF
62
+
63
+ if [ "$fails" -ne 0 ]; then
64
+ echo "check-utf8-vars: write \${NAME} instead of \$NAME before a non-ASCII byte" >&2
65
+ exit 1
66
+ fi
67
+ echo "utf8 vars check: $count files ok"
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env bash
2
2
  # devzone workspace services (#528): installs or removes the devzone services
3
- # (gitlab, postgres, mysql, argocd) of a Kubernetes workspace from the workstation.
3
+ # (gitlab, postgres, mysql, argocd, llm) of a Kubernetes workspace from the workstation.
4
4
  # Sourced by manage/workspace.sh (drapeau_kubectl, POD, NAMESPACE).
5
5
  # devzone workspace services enable <service> [options]
6
6
  # devzone workspace services disable <service> [--yes]
@@ -19,12 +19,12 @@ SERVICES_ADMIN_SCRIPT="${DEVZONE_SERVICES_ADMIN_SCRIPT:-/usr/local/share/devzone
19
19
  SERVICES_TOKEN_DURATION="${DEVZONE_SERVICES_TOKEN_DURATION:-1h}"
20
20
 
21
21
  services_usage() {
22
- echo "devzone workspace services enable|disable <gitlab|postgres|mysql|argocd> [options] | status"
22
+ echo "devzone workspace services enable|disable <gitlab|postgres|mysql|argocd|llm> [options] | seed gitlab | status"
23
23
  }
24
24
 
25
25
  services_known() {
26
26
  case "${1:-}" in
27
- gitlab | postgres | mysql | argocd) return 0 ;;
27
+ gitlab | postgres | mysql | argocd | llm) return 0 ;;
28
28
  esac
29
29
  return 1
30
30
  }
@@ -36,6 +36,7 @@ services_namespace() {
36
36
  postgres) echo devzone-postgres ;;
37
37
  mysql) echo devzone-mysql ;;
38
38
  argocd) echo devzone-argocd ;;
39
+ llm) echo devzone-llm ;;
39
40
  esac
40
41
  }
41
42
 
@@ -99,7 +100,7 @@ services_run() {
99
100
  return
100
101
  fi
101
102
  case "$service" in
102
- postgres | mysql)
103
+ postgres | mysql | llm)
103
104
  if argocd_holds_charts; then
104
105
  services_argocd_toggle "$service" "$action" "$@"
105
106
  return
@@ -124,7 +125,7 @@ services_run() {
124
125
  trap - EXIT
125
126
  return 1
126
127
  fi
127
- echo "▶ $action $service in the pod $POD…"
128
+ echo "▶ $action $service in the pod ${POD}…"
128
129
  # The installer of the pod takes --yes (#557) : no translation, no warning
129
130
  # shellcheck disable=SC2046
130
131
  printf '%s\n' "$token" | kubectl $(drapeau_kubectl) exec -i "$POD" --namespace "$NAMESPACE" \
@@ -141,7 +142,7 @@ services_run() {
141
142
  # One line per service: installed (namespace present) or not
142
143
  services_status() {
143
144
  local s ns
144
- for s in gitlab postgres mysql argocd; do
145
+ for s in gitlab postgres mysql argocd llm; do
145
146
  ns="$(services_namespace "$s")"
146
147
  # shellcheck disable=SC2046
147
148
  if kubectl $(drapeau_kubectl) get namespace "$ns" >/dev/null 2>&1; then
@@ -157,6 +158,15 @@ services() {
157
158
  case "$sub" in
158
159
  enable | activer) services_run enable "${2:-}" "${@:3}" ;;
159
160
  disable | desactiver) services_run disable "${2:-}" "${@:3}" ;;
161
+ # The data of gitlab (group, demo project, dev user, runner) seeded
162
+ # again, in the pod (#538): the only seed of the services
163
+ seed)
164
+ if [ "${2:-}" != gitlab ]; then
165
+ echo "✖ seed: only gitlab ($(services_usage))" >&2
166
+ return 1
167
+ fi
168
+ services_run seed gitlab
169
+ ;;
160
170
  status | etat | '') services_status ;;
161
171
  *)
162
172
  echo "✖ unknown subcommand: $sub ($(services_usage))" >&2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "devzone",
3
- "version": "0.42.1",
3
+ "version": "0.44.0",
4
4
  "description": "Ton poste de développement Linux, prêt en une commande, identique sur Mac, Windows et Linux.",
5
5
  "license": "GPL-3.0-only",
6
6
  "repository": {
@@ -1,81 +0,0 @@
1
- # namespace __NS__
2
- # Application MySQL du catalogue (#414) : manifeste simple (pas de chart,
3
- # kubectl apply suffit, comme postgres.yaml) appliqué par catalogue.sh avec
4
- # les variables suivantes remplacées :
5
- # __APP__ __NS__ __IMAGE__ __PORT__ __MEMOIRE__ __TAILLE__
6
- # Secret __APP__-admin créé avant (mot de passe root, jamais écrit ici).
7
- apiVersion: v1
8
- kind: Service
9
- metadata:
10
- name: __APP__
11
- namespace: __NS__
12
- labels:
13
- app: __APP__
14
- app.kubernetes.io/name: __APP__
15
- app.kubernetes.io/part-of: devzone
16
- app.kubernetes.io/managed-by: devzone
17
- spec:
18
- selector:
19
- app: __APP__
20
- ports:
21
- - name: __APP__
22
- port: __PORT__
23
- targetPort: 3306
24
- ---
25
- apiVersion: apps/v1
26
- kind: StatefulSet
27
- metadata:
28
- name: __APP__
29
- namespace: __NS__
30
- labels:
31
- app: __APP__
32
- app.kubernetes.io/name: __APP__
33
- app.kubernetes.io/part-of: devzone
34
- app.kubernetes.io/managed-by: devzone
35
- spec:
36
- serviceName: __APP__
37
- replicas: 1
38
- selector:
39
- matchLabels:
40
- app: __APP__
41
- template:
42
- metadata:
43
- labels:
44
- app: __APP__
45
- app.kubernetes.io/managed-by: devzone
46
- spec:
47
- containers:
48
- - name: __APP__
49
- # Version figée : mettre à jour ici (même majeure : données gardées)
50
- image: __IMAGE__
51
- env:
52
- - name: MYSQL_ROOT_PASSWORD
53
- valueFrom:
54
- secretKeyRef:
55
- name: __APP__-admin
56
- key: password
57
- ports:
58
- - containerPort: 3306
59
- name: __APP__
60
- readinessProbe:
61
- exec:
62
- command: ["/bin/sh", "-c", "mysql -uroot -p\"$MYSQL_ROOT_PASSWORD\" -e 'SELECT 1'"]
63
- initialDelaySeconds: 10
64
- periodSeconds: 5
65
- resources:
66
- requests:
67
- cpu: 100m
68
- memory: __MEMOIRE__
69
- volumeMounts:
70
- - name: __CLAIM__
71
- mountPath: /var/lib/mysql
72
- volumeClaimTemplates:
73
- - metadata:
74
- name: __CLAIM__
75
- labels:
76
- app.kubernetes.io/managed-by: devzone
77
- spec:
78
- accessModes: ["ReadWriteOnce"]
79
- resources:
80
- requests:
81
- storage: __TAILLE__
@@ -1,27 +0,0 @@
1
- # Valeurs du chart GitLab Runner gitlab/gitlab-runner (version figée dans
2
- # installation.sh). Jeton du runner passé par --set runnerToken à l'installation.
3
- # __NAMESPACE__ est remplacé par le namespace de l'instance (devzone-gitlab…).
4
- gitlabUrl: http://gitlab-webservice-default.__NAMESPACE__.svc:8181 # service interne
5
-
6
- runners:
7
- executor: kubernetes
8
- # Image auxiliaire du runner à l'architecture du nœud : sans ce réglage,
9
- # l'exécuteur Kubernetes prend x86_64 et les jobs échouent sur un poste
10
- # arm64 (Mac Apple Silicon : « no match for platform in manifest »)
11
- # clone_url : dans le pod d'un job, gitlab.localhost désigne le pod
12
- # lui-même ; le dépôt est cloné par le service interne au cluster
13
- config: |
14
- [[runners]]
15
- clone_url = "http://gitlab-webservice-default.__NAMESPACE__.svc:8181"
16
- [runners.kubernetes]
17
- namespace = "{{.Release.Namespace}}"
18
- image = "alpine"
19
- helper_image_autoset_arch_and_os = true
20
-
21
- rbac:
22
- create: true
23
-
24
- serviceAccount:
25
- create: true
26
-
27
- concurrent: 2
@@ -1,83 +0,0 @@
1
- # valeurs pour le chart GitLab gitlab/gitlab (fixé à la v9.11.16)
2
- # Éditions et configuration globale
3
- global:
4
- edition: ce # édition communautaire (Free)
5
- extraEnv:
6
- # GitLab refuse un host avec port ; il lit son port externe ici (URL web, clone HTTP, API)
7
- GITLAB_PORT: "8929"
8
- hosts:
9
- domain: localhost # domaine de base
10
- https: false # HTTPS désactivé pour le test
11
- gitlab:
12
- name: gitlab.localhost # hostname GitLab
13
- ingress:
14
- enabled: false # aucun Ingress : accès uniquement par relais port-forward
15
- configureCertmanager: false # cert-manager non configuré
16
- tls:
17
- enabled: false # TLS désactivé
18
- gatewayApi:
19
- configureCertmanager: false
20
- kas:
21
- enabled: false # KAS non activé
22
- prometheus:
23
- install: false # prometheus non installé (top-level aussi)
24
- registry:
25
- enabled: false # registry non activé
26
- shell:
27
- port: 2224 # port SSH annoncé par GitLab pour le clone (ssh://git@gitlab.localhost:2224/...)
28
-
29
- # cert-manager : désactivé
30
- installCertmanager: false
31
- prometheus:
32
- install: false
33
- registry:
34
- enabled: false
35
-
36
- # GitLab Runner : installé séparément (chart gitlab-runner)
37
- gitlab-runner:
38
- install: false
39
-
40
- # Aucun contrôleur d'Ingress ni port publié sur le nœud : les services
41
- # restent en ClusterIP dans devzone-gitlab, joignables par relais port-forward
42
- nginx-ingress:
43
- enabled: false
44
-
45
- # Réplicas à 1 et ressources réduites
46
- # Sans minReplicas/maxReplicas, les HPA du chart montent jusqu'à 10 pods (#490)
47
- gitlab:
48
- # Metriques pour Prometheus : exporter desactive (inutile pour un test de
49
- # GitLab, pouvait provoquer un echec de helm --wait)
50
- gitlab-exporter:
51
- enabled: false
52
- webservice:
53
- service:
54
- type: ClusterIP
55
- minReplicas: 1
56
- maxReplicas: 1
57
- resources:
58
- requests:
59
- cpu: 100m
60
- memory: 128Mi
61
- sidekiq:
62
- minReplicas: 1
63
- maxReplicas: 1
64
- resources:
65
- requests:
66
- cpu: 250m
67
- memory: 256Mi
68
- gitaly:
69
- resources:
70
- requests:
71
- cpu: 250m
72
- memory: 256Mi
73
- gitlab-shell:
74
- service:
75
- type: ClusterIP
76
- minReplicas: 1
77
- maxReplicas: 1
78
- resources:
79
- requests:
80
- cpu: 50m
81
- memory: 64Mi
82
-
83
- certmanager-issuer: {}
@@ -1,84 +0,0 @@
1
- # Module postgres (#280) : PostgreSQL partagé de devzone, une base par projet.
2
- # Manifestes simples (pas de chart ni d'image Bitnami) appliqués par
3
- # postgres.sh dans le namespace devzone-postgres, après le secret
4
- # postgres-admin (mot de passe du superutilisateur, jamais écrit ici).
5
- # __TAILLE__ : remplacé par POSTGRES_TAILLE (5Gi par défaut).
6
- apiVersion: v1
7
- kind: Service
8
- metadata:
9
- name: postgres
10
- namespace: devzone-postgres
11
- labels:
12
- app: postgres
13
- app.kubernetes.io/name: postgres
14
- app.kubernetes.io/part-of: devzone
15
- app.kubernetes.io/managed-by: devzone
16
- spec:
17
- selector:
18
- app: postgres
19
- ports:
20
- - name: postgres
21
- port: 5432
22
- targetPort: 5432
23
- ---
24
- apiVersion: apps/v1
25
- kind: StatefulSet
26
- metadata:
27
- name: postgres
28
- namespace: devzone-postgres
29
- labels:
30
- app: postgres
31
- app.kubernetes.io/name: postgres
32
- app.kubernetes.io/part-of: devzone
33
- app.kubernetes.io/managed-by: devzone
34
- spec:
35
- serviceName: postgres
36
- replicas: 1
37
- selector:
38
- matchLabels:
39
- app: postgres
40
- template:
41
- metadata:
42
- labels:
43
- app: postgres
44
- app.kubernetes.io/managed-by: devzone
45
- spec:
46
- containers:
47
- - name: postgres
48
- # Version figée : mettre à jour ici (même majeure : données gardées)
49
- image: postgres:16.15-alpine
50
- env:
51
- - name: POSTGRES_PASSWORD
52
- valueFrom:
53
- secretKeyRef:
54
- name: postgres-admin
55
- key: password
56
- # Sous-dossier : la racine d'un volume peut contenir lost+found,
57
- # qu'initdb refuse
58
- - name: PGDATA
59
- value: /var/lib/postgresql/data/pgdata
60
- ports:
61
- - containerPort: 5432
62
- name: postgres
63
- readinessProbe:
64
- exec:
65
- command: ["pg_isready", "-U", "postgres"]
66
- initialDelaySeconds: 5
67
- periodSeconds: 5
68
- resources:
69
- requests:
70
- cpu: 100m
71
- memory: 256Mi
72
- volumeMounts:
73
- - name: donnees
74
- mountPath: /var/lib/postgresql/data
75
- volumeClaimTemplates:
76
- - metadata:
77
- name: donnees
78
- labels:
79
- app.kubernetes.io/managed-by: devzone
80
- spec:
81
- accessModes: ["ReadWriteOnce"]
82
- resources:
83
- requests:
84
- storage: __TAILLE__