devzone 7.4.0 → 7.5.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 (48) hide show
  1. package/.devcontainer/devzone +18 -63
  2. package/.devcontainer/devzone-modules.sh +8 -3
  3. package/.devcontainer/devzone-repair.sh +7 -7
  4. package/.devcontainer/devzone-services.sh +21 -21
  5. package/.devcontainer/devzone-status.sh +12 -9
  6. package/.devcontainer/help.sh +5 -1
  7. package/.devcontainer/versions.env +8 -0
  8. package/.devcontainer/workspace-init.sh +8 -9
  9. package/.gitattributes +8 -0
  10. package/README.md +2 -2
  11. package/bin/SHA256SUMS +6 -6
  12. package/bin/devzone-darwin-amd64 +0 -0
  13. package/bin/devzone-darwin-arm64 +0 -0
  14. package/bin/devzone-linux-amd64 +0 -0
  15. package/bin/devzone-linux-arm64 +0 -0
  16. package/bin/devzone-windows-amd64.exe +0 -0
  17. package/bin/devzone-windows-arm64.exe +0 -0
  18. package/charts/devzone-mysql/values.yaml +1 -1
  19. package/charts/devzone-postgres/values.yaml +1 -1
  20. package/manage/devzone +6 -3
  21. package/manage/scripts/create-mode.sh +3 -3
  22. package/manage/scripts/uninstall.sh +4 -5
  23. package/manage/scripts/workspace/argocd-workspace.sh +2 -2
  24. package/manage/workspace.sh +1 -1
  25. package/package.json +1 -1
  26. package/.devcontainer/ai/host-check.sh +0 -173
  27. package/.devcontainer/ai/host-models.sh +0 -200
  28. package/.devcontainer/catalog/app.sh +0 -202
  29. package/.devcontainer/catalog/catalog-watcher.sh +0 -127
  30. package/.devcontainer/catalog.sh +0 -208
  31. package/.devcontainer/chart-direct.sh +0 -49
  32. package/.devcontainer/cluster.sh +0 -388
  33. package/.devcontainer/clusters.sh +0 -86
  34. package/.devcontainer/devzone-ai-guard.sh +0 -98
  35. package/.devcontainer/devzone-ai.sh +0 -201
  36. package/.devcontainer/devzone-cluster.sh +0 -209
  37. package/.devcontainer/devzone-skill.sh +0 -97
  38. package/.devcontainer/isolation.sh +0 -65
  39. package/.devcontainer/kube-account.sh +0 -107
  40. package/.devcontainer/kube-prompt.sh +0 -42
  41. package/.devcontainer/memory.sh +0 -113
  42. package/.devcontainer/metrics-server.sh +0 -100
  43. package/.devcontainer/packages.sh +0 -228
  44. package/.devcontainer/password.sh +0 -148
  45. package/.devcontainer/ports-json.sh +0 -31
  46. package/.devcontainer/ports.sh +0 -132
  47. package/manage/scripts/create-cluster.sh +0 -107
  48. package/manage/scripts/docker.sh +0 -43
@@ -46,9 +46,8 @@ RACINE="${DEVZONE_ROOT:-$(dirname "$ICI")}"
46
46
  # Default state of the instance; DEVZONE_STATE takes precedence (tests, CI)
47
47
  ETAT="${DEVZONE_STATE:-$RACINE/.devzone.modules}"
48
48
  MODULES=(ai kubernetes gitlab postgres argocd mysql)
49
- # shellcheck source=SCRIPTDIR/cluster.sh
50
- # shellcheck disable=SC1091
51
- . "$ICI/cluster.sh"
49
+ INSTANCE_SUFFIX=""
50
+ [ "${DEVZONE_INSTANCE:-devzone}" = devzone ] || INSTANCE_SUFFIX="-${DEVZONE_INSTANCE}"
52
51
  # .argocd.conf of the instance: the GitOps repository designation (#539)
53
52
  # shellcheck source=SCRIPTDIR/argocd/conf.sh
54
53
  # shellcheck disable=SC1091
@@ -58,14 +57,7 @@ if [ -f "$ICI/argocd/conf.sh" ]; then
58
57
  . "$ICI/argocd/conf.sh"
59
58
  fi
60
59
  # GitOps repository line in the Kubernetes workspace pod (#639)
61
- # Detection of the host (Ollama) models and the devzone-host opencode provider (#665).
62
- # shellcheck source=SCRIPTDIR/ai/host-models.sh
63
- # shellcheck disable=SC1091
64
- . "$ICI/ai/host-models.sh"
65
- # Update check and report for the host (Ollama) models (#668).
66
- # shellcheck source=SCRIPTDIR/ai/host-check.sh
67
- # shellcheck disable=SC1091
68
- . "$ICI/ai/host-check.sh"
60
+ # Host models and assistants are handled by the Go command of the pod (#882).
69
61
 
70
62
  # AI assistants, pinned versions: update here, then devzone apply (or Rebuild
71
63
  # Container). One line per package, separated by a line that does not change:
@@ -94,21 +86,10 @@ GITLAB_URL_MODULE=http://gitlab.localhost:8929
94
86
  # shellcheck source=SCRIPTDIR/devzone-modules.sh
95
87
  # shellcheck disable=SC1091
96
88
  . "$ICI/devzone-modules.sh"
97
- # shellcheck source=SCRIPTDIR/devzone-ai.sh
98
- # shellcheck disable=SC1091
99
- . "$ICI/devzone-ai.sh"
100
- # shellcheck source=SCRIPTDIR/devzone-ai-guard.sh
101
- # shellcheck disable=SC1091
102
- . "$ICI/devzone-ai-guard.sh"
103
- # shellcheck source=SCRIPTDIR/devzone-skill.sh
104
- # shellcheck disable=SC1091
105
- . "$ICI/devzone-skill.sh"
89
+ # The AI module and its guard are handled by the Go command of the pod (#882).
106
90
  # shellcheck source=SCRIPTDIR/devzone-services.sh
107
91
  # shellcheck disable=SC1091
108
92
  . "$ICI/devzone-services.sh"
109
- # shellcheck source=SCRIPTDIR/devzone-cluster.sh
110
- # shellcheck disable=SC1091
111
- . "$ICI/devzone-cluster.sh"
112
93
  # shellcheck source=SCRIPTDIR/devzone-repair.sh
113
94
  # shellcheck disable=SC1091
114
95
  . "$ICI/devzone-repair.sh"
@@ -128,11 +109,11 @@ case "${1:-}" in
128
109
  state)
129
110
  export DEVZONE_STATE="$ETAT"
130
111
  case "${2:-}" in
131
- write|remove|replace|init|recovery-mark|recovery-wait|recovery-pending|recovery-confirm|catalog-sync|gitops-line|json)
112
+ write|remove|replace|init|recovery-mark|recovery-wait|recovery-pending|recovery-confirm|catalog-sync|gitops-line|held|json)
132
113
  # shellcheck disable=SC2034 # DEVZONE_STATE used by state helpers
133
114
  ETAT="$DEVZONE_STATE"
134
115
  ;;
135
- *) echo "devzone state: write|remove|replace|init|recovery-mark|recovery-wait|recovery-pending|recovery-confirm|catalog-sync|gitops-line|json" >&2; exit 1 ;;
116
+ *) echo "devzone state: write|remove|replace|init|recovery-mark|recovery-wait|recovery-pending|recovery-confirm|catalog-sync|gitops-line|held|json" >&2; exit 1 ;;
136
117
  esac
137
118
  ici_state="$ICI"
138
119
  pod_state=""
@@ -155,7 +136,7 @@ case "${1:-}" in
155
136
  # may uninstall again
156
137
  DEVZONE_STATE="$ETAT" bash "$ICI/devzone" state recovery-confirm
157
138
  apply_repowarden
158
- [ "$(value_of ai)" = off ] || apply_ai on
139
+ [ "$(value_of ai)" = off ] || DEVZONE_STATE="$ETAT" "$ICI/devzone" ai apply on
159
140
  # gitlab, postgres, argocd: installed from the workstation in the
160
141
  # Kubernetes workspace pod (#528), by their installer elsewhere
161
142
  [ "$(value_of gitlab)" = off ] || apply_service gitlab
@@ -169,57 +150,31 @@ case "${1:-}" in
169
150
  # writing anything
170
151
  [ "$(value_of "$2")" = on ]
171
152
  ;;
172
- ai)
173
- case "${2:-}" in
174
- check)
175
- # Read-only: update state of each detected host model (#668).
176
- check
177
- ;;
178
- rapport)
179
- # Read-only: sizes, update state, measurements, chosen model (#668).
180
- rapport
181
- ;;
182
- *)
183
- # Read-only: lists the host (Ollama) models detected and the default model.
184
- models_list="$(modeles)"
185
- default_model="$(premier)"
186
- if [ -z "$models_list" ]; then
187
- echo "devzone : no Ollama model detected on ${URL} (answer on /api/tags)"
188
- else
189
- echo "devzone : models detected on the host (Ollama):"
190
- while IFS= read -r m; do
191
- [ -n "$m" ] && printf ' %s\n' "$m"
192
- done <<<"$models_list"
193
- echo "default model: ${default_model:-none}"
194
- fi
195
- ;;
196
- esac
197
- ;;
198
153
  build)
199
154
  bash "$ICI/workspace-build.sh" "${@:2}"
200
155
  ;;
201
156
  repair) repair_workstation ;;
202
- metrics) bash "$ICI/metrics-server.sh" "${@:2}" ;;
203
- use) use_cluster "${@:2}" ;;
204
- clusters) DEVZONE_STATE="$ETAT" bash "$ICI/clusters.sh" "${@:2}" ;;
205
- cluster) change_cluster "${@:2}" ;;
206
157
  # Go only: reached when the binary did not take the call. Never call
207
158
  # "devzone" again from here, it would loop forever, see #864
208
- agent | postgres | mysql | gitlab | test-gitlab)
159
+ cluster | clusters | metrics | use | kube | ai | agent | postgres | mysql | gitlab | test-gitlab | catalog | catalog-watcher)
209
160
  echo "devzone $1: Go binary of the pod unavailable (.devcontainer/bin)" >&2
210
161
  exit 1
211
162
  ;;
212
- catalog) DEVZONE_STATE="$ETAT" bash "$ICI/catalog.sh" list ;;
213
163
  argocd)
214
164
  echo "devzone argocd: Go binary of the pod unavailable (.devcontainer/bin)" >&2
215
165
  exit 1
216
166
  ;;
217
- port) DEVZONE_STATE="$ETAT" bash "$ICI/ports.sh" "${@:2}" ;;
218
- packages) bash "$ICI/packages.sh" "${@:2}" ;;
167
+ port)
168
+ echo "devzone port: Go binary of the pod unavailable (.devcontainer/bin)" >&2
169
+ exit 1
170
+ ;;
171
+ packages)
172
+ echo "devzone packages: Go binary of the pod unavailable (.devcontainer/bin)" >&2
173
+ exit 1
174
+ ;;
219
175
  passwords)
220
- bash "$ICI/password.sh" regenerate ||
221
- echo "devzone : grouped credentials not updated" >&2
222
- bash "$ICI/password.sh" path
176
+ echo "devzone passwords: Go binary of the pod unavailable (.devcontainer/bin)" >&2
177
+ exit 1
223
178
  ;;
224
179
  -h | --help | help) devzone_aide ;;
225
180
  test-bash32) bash "$RACINE/manage/test/bash32.sh" ;;
@@ -88,7 +88,7 @@ change_module() {
88
88
  # An application of the catalog: the line is written, then applied
89
89
  if [ -f "$ICI/catalog/$m/app.conf" ]; then
90
90
  write_value "$m" "$1"
91
- bash "$ICI/catalog.sh" apply
91
+ DEVZONE_STATE="$ETAT" "$ICI/devzone" catalog apply
92
92
  return
93
93
  fi
94
94
  echo "devzone : unknown module : $m ; modules : ${MODULES[*]}" >&2
@@ -114,7 +114,12 @@ change_module() {
114
114
  # the other modules go straight to their installer (hook exit 3).
115
115
  if [ "$m" = postgres ] || [ "$m" = mysql ] || { [ "$m" = argocd ] && [ "$1" = off ]; }; then
116
116
  # 0 done by Argo CD, 3 helm direct as before, else failed
117
- if DEVZONE_STATE="$ETAT" devzone argocd services-hook "$m" "$1" "${@:3}"; then return 0; elif [ $? -ne 3 ]; then return 1; fi
117
+ if DEVZONE_STATE="$ETAT" "$ICI/devzone" argocd services-hook "$m" "$1" "${@:3}"; then return 0; elif [ $? -ne 3 ]; then return 1; fi
118
+ fi
119
+ # The assistant part of enable/disable ai runs in the Go command (#882).
120
+ if [ "$m" = ai ]; then
121
+ DEVZONE_STATE="$ETAT" "$ICI/devzone" ai apply "$1" "${@:3}"
122
+ else
123
+ "apply_$m" "$1" "${@:3}"
118
124
  fi
119
- "apply_$m" "$1" "${@:3}"
120
125
  }
@@ -66,20 +66,20 @@ repair_item() {
66
66
  repair_workstation() {
67
67
  repair_failed=0
68
68
  if [ "$(value_of gitlab)" = on ]; then
69
- repair_item "gitlab name" devzone gitlab host-set
70
- repair_item "gitlab relay" devzone gitlab relay-start
69
+ repair_item "gitlab name" "$ICI/devzone" gitlab host-set
70
+ repair_item "gitlab relay" "$ICI/devzone" gitlab relay-start
71
71
  fi
72
72
  if [ "$(value_of postgres)" = on ]; then
73
- repair_item "postgres relay" devzone postgres relay-start
73
+ repair_item "postgres relay" "$ICI/devzone" postgres relay-start
74
74
  fi
75
75
  if [ "$(value_of argocd)" = on ]; then
76
76
  repair_item "argocd relay" "$ICI/devzone" argocd relay-start
77
77
  fi
78
78
  if [ "$(value_of mysql)" = on ]; then
79
- repair_item "mysql relay" devzone mysql relay-start
79
+ repair_item "mysql relay" "$ICI/devzone" mysql relay-start
80
80
  fi
81
- repair_item "catalog watcher" env DEVZONE_CATALOG_REAL=yes bash "$ICI/catalog/catalog-watcher.sh" start
82
- repair_item "credentials" bash "$ICI/password.sh" regenerate
83
- devzone cluster clean || true
81
+ repair_item "catalog watcher" env DEVZONE_STATE="$ETAT" DEVZONE_CATALOG_REAL=yes "$ICI/devzone" catalog-watcher start
82
+ repair_item "credentials" "$ICI/devzone" passwords regenerate
83
+ "$ICI/devzone" cluster clean || true
84
84
  return "$repair_failed"
85
85
  }
@@ -87,8 +87,8 @@ apply_kubernetes() {
87
87
  else
88
88
  rm -f "$HOME/.kube/hote.config"
89
89
  # metrics-server removed from the clusters where devzone installed it
90
- # (devzone=installe marker set by metrics-server.sh); via its subcommand
91
- bash "$ICI/metrics-server.sh" retirer || true
90
+ # (devzone=installe marker set by the Go command); via its subcommand
91
+ "$ICI/devzone" metrics remove || true
92
92
  echo "devzone : kubernetes disabled"
93
93
  fi
94
94
  }
@@ -97,16 +97,16 @@ apply_gitlab() {
97
97
  local current_state
98
98
  if [ "$1" = on ]; then
99
99
  # Skip if the state is ready and the runner online; otherwise install resumes
100
- current_state="$(devzone gitlab status)"
100
+ current_state="$("$ICI/devzone" gitlab status)"
101
101
  if [[ "$current_state" == *"ready"* && "$current_state" == *"runner online"* ]]; then
102
102
  echo "devzone : gitlab already active, nothing to do."
103
103
  # /etc/hosts regenerated by Docker: gitlab.localhost is set again here too
104
- devzone gitlab host-set
104
+ "$ICI/devzone" gitlab host-set
105
105
  # Failure of an old run cleared: gitlab is ready (#366)
106
106
  rm -f "$(failure_marker_file gitlab)"
107
107
  else
108
108
  echo "devzone : activating gitlab via its installer…"
109
- if ! devzone gitlab install; then
109
+ if ! "$ICI/devzone" gitlab install; then
110
110
  echo "gitlab" > "$(failure_marker_file gitlab)"
111
111
  return 1
112
112
  fi
@@ -114,12 +114,12 @@ apply_gitlab() {
114
114
  fi
115
115
  else
116
116
  # Disable gitlab only if its namespace still exists
117
- if devzone gitlab installed; then
117
+ if "$ICI/devzone" gitlab installed; then
118
118
  echo "devzone : deactivating gitlab…"
119
119
  if [ -n "${DELETE_DATA:-}" ]; then
120
- devzone gitlab uninstall --yes
120
+ "$ICI/devzone" gitlab uninstall --yes
121
121
  else
122
- devzone gitlab uninstall
122
+ "$ICI/devzone" gitlab uninstall
123
123
  fi
124
124
  else
125
125
  echo "devzone : gitlab already deactivated (no devzone-gitlab namespace)."
@@ -152,33 +152,33 @@ apply_postgres() {
152
152
  write_value postgres off
153
153
  return 2
154
154
  fi
155
- actual="$(cluster_saved)"
155
+ actual="$("$ICI/devzone" kube saved)"
156
156
  if [ -n "$wanted" ] && [ -n "$actual" ] && [ "$wanted" != "$actual" ]; then
157
157
  echo "devzone : devzone services are on $actual; to change: devzone cluster $wanted" >&2
158
158
  write_value postgres off
159
159
  return 2
160
160
  fi
161
161
  if [ -n "$confirm_ctx" ]; then
162
- ctx="$(cluster_choose "$wanted" --confirm "$confirm_ctx")" || { write_value postgres off; return 2; }
162
+ ctx="$("$ICI/devzone" kube choose "$wanted" --confirm "$confirm_ctx")" || { write_value postgres off; return 2; }
163
163
  else
164
- ctx="$(cluster_choose "$wanted")" || { write_value postgres off; return 2; }
164
+ ctx="$("$ICI/devzone" kube choose "$wanted")" || { write_value postgres off; return 2; }
165
165
  fi
166
166
  # Choice kept before the installation: a resume targets the same cluster
167
- cluster_save "$ctx"
168
- current_state="$(devzone postgres status)"
167
+ "$ICI/devzone" kube save "$ctx"
168
+ current_state="$("$ICI/devzone" postgres status)"
169
169
  # "relay stopped" first: this line also starts with "ready on"
170
170
  if [[ "$current_state" == *"relay stopped"* ]]; then
171
- devzone postgres relay-start
171
+ "$ICI/devzone" postgres relay-start
172
172
  echo "devzone : postgres : relay restarted"
173
173
  elif [[ "$current_state" == "ready on"* ]]; then
174
174
  echo "devzone : postgres already active, nothing to do."
175
- elif ! devzone postgres install; then
175
+ elif ! "$ICI/devzone" postgres install; then
176
176
  echo "postgres" >"$(failure_marker_file postgres)"
177
177
  return 1
178
178
  fi
179
179
  rm -f "$(failure_marker_file postgres)"
180
180
  else
181
- devzone postgres uninstall
181
+ "$ICI/devzone" postgres uninstall
182
182
  rm -f "$(failure_marker_file postgres)"
183
183
  fi
184
184
  }
@@ -218,14 +218,14 @@ apply_mysql() {
218
218
  echo mysql >"$(failure_marker_file mysql)"
219
219
  return 2
220
220
  fi
221
- current_state="$(devzone mysql status)"
221
+ current_state="$("$ICI/devzone" mysql status)"
222
222
  # "relay stopped" first: this line also starts with "ready on"
223
223
  if [[ "$current_state" == *"relay stopped"* ]]; then
224
- devzone mysql relay-start
224
+ "$ICI/devzone" mysql relay-start
225
225
  echo "devzone : mysql: relay restarted"
226
226
  elif [[ "$current_state" == "ready on"* ]]; then
227
227
  echo "devzone : mysql already active, nothing to do."
228
- elif ! devzone mysql install; then
228
+ elif ! "$ICI/devzone" mysql install; then
229
229
  echo mysql >"$(failure_marker_file mysql)"
230
230
  return 1
231
231
  fi
@@ -233,9 +233,9 @@ apply_mysql() {
233
233
  else
234
234
  # Removal without deleting the data: volume kept (#441); the databases
235
235
  # only leave with a yes (confirm_removal)
236
- bash "$ICI/catalog.sh" remove mysql
236
+ DEVZONE_STATE="$ETAT" "$ICI/devzone" catalog remove mysql
237
237
  if [ -n "${DELETE_DATA:-}" ]; then
238
- devzone mysql delete-data --yes
238
+ "$ICI/devzone" mysql delete-data --yes
239
239
  fi
240
240
  rm -f "$(failure_marker_file mysql)"
241
241
  fi
@@ -63,18 +63,21 @@ show_state() {
63
63
  printf ' ✖ module %-10s failed: incomplete install (%s): devzone apply\n' "$m" "$(cat "$(failure_marker_file "$m")")"
64
64
  elif [ "$(value_of "$m")" = on ] && [ "$m" = gitlab ]; then
65
65
  # gitlab active: its real state (ready, runner, failed)
66
- printf ' ✔ module %-10s %s\n' "$m" "$(devzone gitlab status)"
66
+ printf ' ✔ module %-10s %s\n' "$m" "$("$ICI/devzone" gitlab status)"
67
67
  elif [ "$(value_of "$m")" = on ] && [ "$m" = postgres ]; then
68
- printf ' ✔ module %-10s %s\n' "$m" "$(devzone postgres status)"
68
+ printf ' ✔ module %-10s %s\n' "$m" "$("$ICI/devzone" postgres status)"
69
69
  elif [ "$(value_of "$m")" = on ] && [ "$m" = argocd ]; then
70
70
  printf ' ✔ module %-10s %s\n' "$m" "$("$ICI/devzone" argocd status)"
71
71
  elif [ "$(value_of "$m")" = on ] && [ "$m" = mysql ]; then
72
- printf ' ✔ module %-10s %s\n' "$m" "$(devzone mysql status)"
72
+ printf ' ✔ module %-10s %s\n' "$m" "$("$ICI/devzone" mysql status)"
73
73
  elif [ "$(value_of "$m")" = on ]; then
74
74
  printf ' ✔ module %-10s active: %s\n' "$m" "$(description "$m")"
75
75
  else
76
76
  printf ' ○ module %-10s optional, %s: devzone enable %s\n' "$m" "$(description "$m")" "$m"
77
77
  fi
78
+ # Service held by an Argo CD Application (#916): the line is printed by devzone state held
79
+ held="$(DEVZONE_STATE="$ETAT" bash "$ICI/devzone" state held "$m" 2>/dev/null || true)"
80
+ [ -z "$held" ] || printf ' %s\n' "$held"
78
81
  done
79
82
  # GitOps repository of the instance (#539): the designation of .argocd.conf
80
83
  argocd_repo="$(conf_get argocd repo)"
@@ -87,18 +90,18 @@ show_state() {
87
90
  fi
88
91
  # Catalog applications (#414)
89
92
  if [ -d "$ICI/catalog" ]; then
90
- bash "$ICI/catalog.sh" resume
93
+ DEVZONE_STATE="$ETAT" "$ICI/devzone" catalog resume
91
94
  fi
92
95
  # GitLab Rails secret (#347): warning if the secrets were lost
93
96
  if [ "$(value_of gitlab)" = on ] && [ ! -f "$RACINE/workspace/.gitlab/rails-secret.yaml" ]; then
94
97
  echo " ⚠ gitlab GitLab reinstalled: if the browser shows 422, delete the site data of gitlab.localhost"
95
98
  fi
96
99
  # Remote devzone cluster: warning in the summary
97
- current_cluster="$(cluster_saved)"
98
- if [ -n "$current_cluster" ] && ! cluster_is_local "$current_cluster"; then
100
+ current_cluster="$("$ICI/devzone" kube saved)"
101
+ if [ -n "$current_cluster" ] && ! "$ICI/devzone" kube local "$current_cluster"; then
99
102
  printf ' ⚠ cluster remote: %s — services on a remote cluster\n' "$current_cluster"
100
103
  fi
101
- devzone cluster clean --quiet || true
104
+ "$ICI/devzone" cluster clean --quiet || true
102
105
  # Old kind-gitlab cluster still present: invite to migrate (#396)
103
106
  if kind get clusters 2>/dev/null | grep -qx "gitlab${INSTANCE_SUFFIX}"; then
104
107
  printf ' ⚠ old kind-gitlab cluster%s: devzone gitlab migrate\n' "$INSTANCE_SUFFIX"
@@ -108,7 +111,7 @@ show_state() {
108
111
  case "$ctx_work" in
109
112
  kind-gitlab* | kind-devzone*)
110
113
  ctx_host="$(KUBECONFIG="${DEVZONE_KUBE_HOST:-$HOME/.kube/hote.config}" kubectl config current-context 2>/dev/null || true)"
111
- if [ -n "$ctx_host" ] && cluster_reachable "$ctx_host"; then
114
+ if [ -n "$ctx_host" ] && "$ICI/devzone" kube reachable "$ctx_host"; then
112
115
  printf ' ⚠ working cluster: %s (devzone internal cluster); go back: devzone use %s\n' "$ctx_work" "$ctx_host"
113
116
  fi
114
117
  ;;
@@ -118,7 +121,7 @@ show_state() {
118
121
  if [ "$ctx_rbac" = "yes" ]; then
119
122
  printf ' ⚠ rbac : access to devzone-postgres secrets not restricted\n'
120
123
  fi
121
- ports_state="$(bash "$ICI/ports.sh" resume 2>/dev/null || true)"
124
+ ports_state="$(DEVZONE_STATE="$ETAT" devzone port resume 2>/dev/null || echo none)"
122
125
  case "$ports_state" in
123
126
  none*) printf ' ○ ports to the workstation %s\n' "$ports_state" ;;
124
127
  *) printf ' ✔ ports to the workstation %s\n' "$ports_state" ;;
@@ -14,14 +14,18 @@ devzone_aide() {
14
14
  devzone disable <module> [--yes] disable and apply at once (--yes: also deletes the data)
15
15
  devzone apply install what is enabled
16
16
  devzone repair repair gitlab, postgres, ports, passwords
17
- devzone metrics [context…] install metrics-server (kubectl top, k9s)
17
+ devzone catalog [list|apply|sync|resume|json|remove <app>] applications of the catalog
18
+ devzone metrics [context…] | remove [context…] install or remove metrics-server (kubectl top, k9s)
18
19
  devzone use CTX [--confirm CTX] switch the kubectl working cluster
19
20
  devzone clusters view of the connected clusters (work and services)
21
+ devzone kube saved|choose|save|local|reachable|prompt cluster helpers, in Go
20
22
  devzone is-enabled <module> code 0 if enabled
21
23
  devzone test-bash32 run the bats tests under bash 3.2 (Docker container)
22
24
  devzone test-gitlab end-to-end test of the GitLab module and platform
23
25
  devzone agent <folder> <instructions> drive opencode with the instructions file
24
26
  devzone ai list the host (Ollama) models detected and the default model
27
+ devzone ai check|rapport update state of each model | sizes, choices and reasons
28
+ devzone ai guard [--format claude] check one tool call on standard input (agent guard)
25
29
  devzone ticket <n> [--repo devzone|repowarden] ticket worktree (ticket done <n> removes it)
26
30
  devzone build <folder> [--tag <name>] build an image in the Kubernetes workspace (BuildKit)
27
31
  devzone enable postgres [--context CTX] [--confirm CTX] shared PostgreSQL, cluster of choice
@@ -1,6 +1,14 @@
1
1
  # Single source for the repowarden version used by workspace-init.sh and manage/scripts/ci/versions.sh.
2
2
  REPOWARDEN_VERSION=4.18.1
3
3
 
4
+ # Pinned metrics-server release installed on the local clusters by devzone.
5
+ METRICS_SERVER_VERSION=v0.9.0
6
+
4
7
  # BuildKit client version installed in the workspace image (#514). Must match
5
8
  # buildkit.image in charts/devzone-workspace/values.yaml.
6
9
  BUILDKIT_VERSION=0.34.2
10
+
11
+ # metrics-server, dependency of Argo CD: the official chart pinned here (3.14.0
12
+ # ships the application METRICS_SERVER_VERSION above). Read by internal/domain/argocd;
13
+ # the chart and the application move together.
14
+ METRICS_SERVER_CHART_VERSION=3.14.0
@@ -63,12 +63,13 @@ init_prompt() {
63
63
  log "prompt: cannot write $bashrc"
64
64
  return 0
65
65
  fi
66
- # Block written before the rename invite-kube.sh -> kube-prompt.sh: the file
67
- # no longer exists, every prompt would fail (migration, idempotent)
68
- if grep -qE 'invite-kube\.sh|devzone_invite_kube' "$bashrc" 2>/dev/null; then
69
- sed -i -e 's#/\.devcontainer/invite-kube\.sh#/.devcontainer/kube-prompt.sh#' \
70
- -e 's#devzone_invite_kube#devzone_kube_prompt#' "$bashrc"
71
- log "prompt block migrated to kube-prompt.sh"
66
+ # Blocks written before the Go prompt sourced a shell library that no longer
67
+ # exists: drop them, the new block below takes over (migration, idempotent)
68
+ if grep -qE 'invite-kube\.sh|kube-prompt\.sh' "$bashrc" 2>/dev/null; then
69
+ sed -i -e '/devzone prompt >>>/d' -e '/devzone prompt <</d' \
70
+ -e '/invite-kube\.sh/d' -e '/kube-prompt\.sh/d' \
71
+ -e '/devzone_invite_kube/d' -e '/devzone_kube_prompt/d' "$bashrc"
72
+ log "prompt block migrated to the Go command"
72
73
  fi
73
74
  if grep -qF "$PROMPT_START" "$bashrc" 2>/dev/null; then
74
75
  log "prompt block already present"
@@ -76,9 +77,7 @@ init_prompt() {
76
77
  fi
77
78
  cat >>"$bashrc" <<'PROMPT'
78
79
  # >>> devzone prompt >>>
79
- # shellcheck source=/dev/null
80
- . /usr/local/share/devzone/.devcontainer/kube-prompt.sh
81
- PS1='$(devzone_kube_prompt) '"$PS1"
80
+ PS1='$(devzone kube prompt) '"$PS1"
82
81
  # <<< devzone prompt <<<
83
82
  PROMPT
84
83
  log "prompt block added to $bashrc"
package/.gitattributes CHANGED
@@ -14,3 +14,11 @@ manage/devzone text eol=lf
14
14
  *.yml text eol=lf
15
15
  *.md text eol=lf
16
16
  charts/** text eol=lf
17
+ # Reference files keep LF bytes on every workstation: with core.autocrlf a
18
+ # CRLF reference no longer matches the LF text from the program, and embedded
19
+ # CRLF data is baked into binaries built on Windows.
20
+ **/testdata/** text eol=lf
21
+ **/golden/** text eol=lf
22
+ **/goldens/** text eol=lf
23
+ *.golden text eol=lf
24
+ *.txt text eol=lf
package/README.md CHANGED
@@ -246,7 +246,7 @@ In the workspace pod, the `devzone` summary reports a more recent published vers
246
246
 
247
247
  **`postgres` module**: a shared PostgreSQL, one database per project (see [Connecting to PostgreSQL](#connecting-to-postgresql)). To enable it: `devzone enable postgres`.
248
248
 
249
- **`argocd` module**: Argo CD on the devzone cluster, interface at https://127.0.0.1:8443 in the container (see [Argo CD](manage/docs/reference.md#argo-cd)). To enable it: `devzone enable argocd`.
249
+ **`argocd` module**: Argo CD on the devzone cluster, interface at https://127.0.0.1:8443 in the container (see [Argo CD](manage/docs/reference.md#argo-cd)). To enable it: `devzone enable argocd`. With the module on, GitLab, PostgreSQL, MySQL, the workspace and the catalogue applications are Applications, development clones included; an existing installation is adopted without losing data, and without a usable revision the command fails instead of installing directly. Argo CD itself is the only exception.
250
250
 
251
251
  **`devzone agent --pod` option**: launches an agent session in an isolated disposable pod (ticket #222). The pod is created with limited resources (2 CPU, 4 Gi memory), restricted mounts of the workspace and the state, and a mandatory affinity to the workspace pod. It isolates: the ticket's worktree at the same path as in the workspace, the repository's `.git`, and state subfolders (.config/opencode, .local/share/opencode, .local/state/oc-lancer, .local/npm read-only). It does NOT isolate: the network (unfiltered, that is #220), the host kubeconfig, `~/.config/gh`, `~/.claude`, the other worktrees, and, since the repository's `.git` is mounted, the git references of the other branches remain readable and writable there. Without `--pod`, the current `devzone agent` behavior is strictly unchanged.
252
252
 
@@ -357,7 +357,7 @@ A project's user owns **its** database (it creates tables, indexes, data in it)
357
357
 
358
358
  ## See my application in the browser
359
359
 
360
- On the Kubernetes workstation, `devzone workspace start` starts a port watcher: each TCP port ≥ 1024 that listens in the pod is relayed to `127.0.0.1` of the workstation, at the same number, by `kubectl port-forward`. A server started in the pod (`npm run dev`, port 5173) therefore answers at `http://localhost:5173`, without a command. The enabled services (PostgreSQL, MySQL, Argo CD) are relayed too, on their usual port. The Services of applications deployed in the cluster are relayed the same way, each on a local port (80 → 8080; a port already taken elsewhere becomes another port): `devzone workspace ports status` shows their URL `http://127.0.0.1:<port>`. A Service can be excluded with the annotation `devzone.io/relay: "false"`. The watcher is driven with `devzone workspace ports start|stop|status`; details in the [reference](manage/docs/reference.md#applications-and-services-on-the-workstations-localhost). Its automatic start needs no command: the Go program installs or repairs it after a folder creation, an update or any successful devzone command from a devzone folder, silently once it is current. `devzone workspace ports disable` and `devzone uninstall` remember the refusal in `.devzone.ports-disabled` in that folder; `devzone workspace ports enable` removes the marker.
360
+ On the Kubernetes workstation, `devzone workspace start` starts a port watcher: each TCP port ≥ 1024 that listens in the pod is relayed to `127.0.0.1` of the workstation, at the same number, by `kubectl port-forward`. A server started in the pod (`npm run dev`, port 5173) therefore answers at `http://localhost:5173`, without a command. The enabled services (PostgreSQL, MySQL, Argo CD) are relayed too, on their usual port. The Services of applications deployed in the cluster are relayed the same way, each on a local port (80 → 8080; a port already taken elsewhere becomes another port): `devzone workspace ports status` shows their URL `http://127.0.0.1:<port>`. A Service can be excluded with the annotation `devzone.io/relay: "false"`. The watcher is driven with `devzone workspace ports start|stop|status`; details in the [reference](manage/docs/reference.md#applications-and-services-on-the-workstations-localhost). Its automatic start needs no command: the Go program installs or repairs it after a folder creation, an update or any successful devzone command from a devzone folder, silently once it is current. `devzone workspace ports disable` and `devzone uninstall` remember the refusal in `.devzone.ports-disabled` in that folder; `devzone workspace ports enable` removes the marker. On Windows, the automatic start is a scheduled task of the user (#903); it has not yet been tried on a real Windows workstation, only with Go tests.
361
361
 
362
362
  The relays kept in the state of a workstation instance are listed and closed with `devzone port`:
363
363
 
package/bin/SHA256SUMS CHANGED
@@ -1,6 +1,6 @@
1
- 9b7d99ffa3a8420bca697c1c568f04ae4a282a71ea3d9f37202a02fc46601050 devzone-linux-amd64
2
- d2e87e6498668026ad8591475cb0336af72a8aef845f235fb5466ca121cd50ff devzone-linux-arm64
3
- c2a71b049e542c41ec627cd773f5ebdea676c4d2a5e3f02271fe04610245e3b9 devzone-darwin-amd64
4
- e615af41aba2eb1e4b3d4a9d7bd7e7423f793bb72319c5fe7e96ff0e3221eb2d devzone-darwin-arm64
5
- d6a3251e678bd5a35239d175ef7024be585602118cb85dc78d91ba3e94d74224 devzone-windows-amd64.exe
6
- e82d667af1d00c9e8eebc96fa1a039b8032fa0d20ab51eea95dbc8abf75328e9 devzone-windows-arm64.exe
1
+ a6d69bbf0722bb5d9f68cadf1e4840c0e10049930c32116bc2b85884928b1653 devzone-linux-amd64
2
+ df0b379983c3ec6aa816beddd2ea92e5c08cc8f7fc4f963f5e96f4e691e455b7 devzone-linux-arm64
3
+ f71e26ac6ca27d75c3577fb373729edf6544cbdb12e9228c621d6480a2502c95 devzone-darwin-amd64
4
+ e047de3b934eb6fa76f683b49e2ce061923eae7d9a9b9cecbb73eda61a8078d8 devzone-darwin-arm64
5
+ 6441bdd505cacb674ec91aa5c971eede8a9e13addc90f6a4d99664b5eae20903 devzone-windows-amd64.exe
6
+ 4574d4d451ee11f97297273bb035f3eb8339bf046f53d95393ab4747556847d4 devzone-windows-arm64.exe
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1,5 +1,5 @@
1
1
  # The one definition of MySQL: the helm-direct path of the catalogue (#414)
2
- # installs this chart (.devcontainer/chart-direct.sh). The secret <name>-admin
2
+ # installs this chart (internal/platform/helm). The secret <name>-admin
3
3
  # (root password) is created apart by
4
4
  # devzone, never by the chart (#538: secrets out of Git).
5
5
  # Name of the application (Service, StatefulSet and secret ref): mysql of the
@@ -1,5 +1,5 @@
1
1
  # The one definition of PostgreSQL: the helm-direct path installs this chart
2
- # (.devcontainer/chart-direct.sh) as the release postgres. The
2
+ # (internal/platform/helm) as the release postgres. The
3
3
  # secret postgres-admin (superuser password) is created apart by devzone,
4
4
  # never by the chart (#516: secrets out of Git).
5
5
  image: postgres:16.15-alpine
package/manage/devzone CHANGED
@@ -138,6 +138,8 @@ go_launch() {
138
138
  fi
139
139
  # The Go binary finds the bash command (and the package.json) from here, even
140
140
  # copied into the cache; Git Bash gives it a Windows path
141
+ # The shell scripts still run here call the Go program for their checks (#884)
142
+ export DEVZONE_HOST_BIN="$target"
141
143
  DEVZONE_BASH_ENTRY="$PAQUET/manage/devzone"
142
144
  case "$platform" in
143
145
  windows-*) DEVZONE_BASH_ENTRY="$(cygpath -m "$DEVZONE_BASH_ENTRY" 2>/dev/null || echo "$DEVZONE_BASH_ENTRY")" ;;
@@ -165,7 +167,8 @@ devzone $(version): development workspace in a Kubernetes cluster
165
167
  in a devzone folder: removes Kubernetes objects of this devzone
166
168
  instance (namespaces, Argo CD Applications, temporary accounts,
167
169
  .devzone.* files); workspace/ is kept; asks for confirmation
168
- devzone workspace start|stop|status|shell|update
170
+ devzone ai [check|rapport|guard] host models, update report or tool-call guard
171
+ devzone workspace start|stop|status|shell|update|deploy
169
172
  devzone workspace vscode|copy-to|copy-from|clone
170
173
  Kubernetes workspace: drives the devzone-workspace chart
171
174
  (start installs it, stop removes it from the cluster)
@@ -183,8 +186,8 @@ EOT
183
186
  # of .devcontainer/devzone (consistency test in manage/test/cli.bats)
184
187
  container_command() {
185
188
  case "$1" in
186
- ai | agent | apply | argocd | build | catalog | cluster | clusters | disable | \
187
- enable | gitlab | is-enabled | llm | metrics | modules | mysql | packages | \
189
+ ai | agent | apply | argocd | build | catalog | catalog-watcher | cluster | clusters | disable | \
190
+ enable | gitlab | is-enabled | kube | llm | metrics | modules | mysql | packages | \
188
191
  passwords | platform | port | postgres | repair | start | state | status | \
189
192
  test-bash32 | test-gitlab | ticket | use) return 0 ;;
190
193
  *) return 1 ;;
@@ -9,8 +9,6 @@
9
9
  # shellcheck disable=SC2034 # CREATE_MODE is read by manage/devzone (creer)
10
10
  # shellcheck source=manage/scripts/kube-ready.sh
11
11
  . "$(dirname "${BASH_SOURCE[0]}")/kube-ready.sh"
12
- # shellcheck source=manage/scripts/create-cluster.sh
13
- . "$(dirname "${BASH_SOURCE[0]}")/create-cluster.sh"
14
12
 
15
13
  # Context shown to the user: devzone if declared, otherwise the current one.
16
14
  kube_context() {
@@ -50,7 +48,9 @@ create_mode_choose() {
50
48
  fi
51
49
  # No option, in a terminal: a menu (remote cluster, minikube) instead of a
52
50
  # failure (#653); the choice is accepted only if the cluster then answers.
53
- if [ -z "$option" ] && create_cluster_offer && reason="$(kube_ready_reason)"; then
51
+ # The menu is the Go program's (#884), found through DEVZONE_HOST_BIN; without
52
+ # it no menu is offered (false), and the failure below lists the ways to get a cluster
53
+ if [ -z "$option" ] && "${DEVZONE_HOST_BIN:-false}" cluster-offer && reason="$(kube_ready_reason)"; then
54
54
  CREATE_MODE=kubernetes
55
55
  echo "✔ Kubernetes ready ($(kube_context)): workspace in the cluster"
56
56
  create_mode_existing
@@ -26,10 +26,9 @@ case "$KEEP" in "" | logins | connexions) ;; *)
26
26
  ;;
27
27
  esac
28
28
 
29
- # Docker first: without it every docker call would show its raw error
30
- # shellcheck source=SCRIPTDIR/docker.sh
31
- . "$(dirname "${BASH_SOURCE[0]}")/docker.sh"
32
- docker_ready "${DEVZONE_COMMAND:-make desinstaller}" || exit 1
29
+ # Host engine first: without it every call would show its raw error. The check
30
+ # is the Go program's (#884), found through DEVZONE_HOST_BIN, exported by manage/devzone
31
+ "${DEVZONE_HOST_BIN:?devzone: Go program not found (DEVZONE_HOST_BIN), run it through manage/devzone}" host-check "${DEVZONE_COMMAND:-make desinstaller}" || exit 1
33
32
 
34
33
  # .argocd.conf of the devzone folder: the GitOps repository is never removed
35
34
  # with the devzone, only its designation can be changed later
@@ -185,7 +184,7 @@ else
185
184
  for i in ${images[@]+"${images[@]}"}; do docker rmi "$i" >/dev/null && echo "✔ image removed: $i"; done
186
185
  for v in ${dind[@]+"${dind[@]}"} ${volumes[@]+"${volumes[@]}"}; do docker volume rm "$v" >/dev/null && echo "✔ volume removed: $v"; done
187
186
  if [ "${#metrics[@]}" -gt 0 ]; then
188
- version="$(sed -n 's/^VERSION=//p' "$HERE/.devcontainer/metrics-server.sh")"
187
+ version="$(sed -n 's/^METRICS_SERVER_VERSION=//p' "$HERE/.devcontainer/versions.env" | head -1)"
189
188
  manifest="https://github.com/kubernetes-sigs/metrics-server/releases/download/${version}/components.yaml"
190
189
  for ctx in "${metrics[@]}"; do
191
190
  kubectl --context "$ctx" delete -f "$manifest" --ignore-not-found >/dev/null &&
@@ -131,8 +131,8 @@ argocd_save_admin_password() {
131
131
 
132
132
  # .password of the workstation regenerated from workspace/.*/ (password.sh of the package)
133
133
  argocd_passwords_refresh() {
134
- DEVZONE_ROOT="$PWD" bash "$RACINE/.devcontainer/password.sh" regenerate 2>/dev/null ||
135
- echo "⚠ .password not updated (bash .devcontainer/password.sh regenerate)" >&2
134
+ DEVZONE_ROOT="$PWD" devzone passwords regenerate 2>/dev/null ||
135
+ echo "⚠ .password not updated (devzone passwords regenerate)" >&2
136
136
  }
137
137
 
138
138
  # Installs Argo CD (pinned chart and values), idempotent (upgrade --install)