devzone 7.4.1 → 7.5.1

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 (39) hide show
  1. package/.devcontainer/devzone +18 -60
  2. package/.devcontainer/devzone-modules.sh +8 -3
  3. package/.devcontainer/devzone-services.sh +20 -20
  4. package/.devcontainer/devzone-status.sh +14 -11
  5. package/.devcontainer/services-admin.sh +1 -1
  6. package/.devcontainer/versions.env +5 -0
  7. package/README.md +2 -2
  8. package/bin/SHA256SUMS +6 -6
  9. package/bin/devzone-darwin-amd64 +0 -0
  10. package/bin/devzone-darwin-arm64 +0 -0
  11. package/bin/devzone-linux-amd64 +0 -0
  12. package/bin/devzone-linux-arm64 +0 -0
  13. package/bin/devzone-windows-amd64.exe +0 -0
  14. package/bin/devzone-windows-arm64.exe +0 -0
  15. package/manage/devzone +8 -7
  16. package/manage/scripts/create-mode.sh +3 -3
  17. package/manage/scripts/uninstall.sh +3 -4
  18. package/manage/scripts/workspace/argocd-services.sh +1 -1
  19. package/manage/workspace.sh +11 -25
  20. package/package.json +1 -1
  21. package/.devcontainer/ai/host-check.sh +0 -173
  22. package/.devcontainer/ai/host-models.sh +0 -200
  23. package/.devcontainer/devzone-ai-guard.sh +0 -98
  24. package/.devcontainer/devzone-ai.sh +0 -201
  25. package/.devcontainer/devzone-repair.sh +0 -85
  26. package/.devcontainer/devzone-skill.sh +0 -97
  27. package/.devcontainer/devzone-version.sh +0 -78
  28. package/.devcontainer/help.sh +0 -44
  29. package/manage/scripts/create-cluster.sh +0 -107
  30. package/manage/scripts/devzone-update.sh +0 -237
  31. package/manage/scripts/docker.sh +0 -43
  32. package/manage/scripts/workspace/ports-apps.sh +0 -156
  33. package/manage/scripts/workspace/ports-workspace.sh +0 -235
  34. package/manage/scripts/workspace/services-workspace.sh +0 -193
  35. package/manage/scripts/workspace/workspace-clone.sh +0 -12
  36. package/manage/scripts/workspace/workspace-copies.sh +0 -44
  37. package/manage/scripts/workspace/workspace-egress.sh +0 -184
  38. package/manage/scripts/workspace/workspace-update.sh +0 -106
  39. package/manage/scripts/workspace/workspace-wait.sh +0 -56
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env bash
2
2
  # shellcheck disable=SC2034 # shared variables, read by the sourced devzone-*.sh
3
- # devzone help (devzone --help): .devcontainer/help.sh, sourced below.
3
+ # devzone help (devzone --help): the Go command of the pod, below.
4
4
  #
5
5
  # Per-instance state: $RACINE/.devzone.modules (a folder mounted from the host,
6
6
  # survives rebuilds), one line "module=on|off"; the chosen platform is kept
@@ -20,7 +20,9 @@ while [ -L "$SOURCE" ]; do
20
20
  esac
21
21
  done
22
22
  ICI="$(cd -P "$(dirname "$SOURCE")" && pwd)"
23
+ export DEVZONE_POD_SCRIPT="${DEVZONE_POD_SCRIPT:-$ICI/devzone}"
23
24
  # Go first (#754): a command ported to Go runs in the devzone-pod binary of the image.
25
+ # DEVZONE_HOST_BIN also names that binary when a test builds it outside the image.
24
26
  # DEVZONE_NO_GO=1 forces the shell, DEVZONE_FROM_GO=1 avoids loops.
25
27
  # DEVZONE_FROM_GO only concerns this call: not inherited, so that a "devzone …"
26
28
  # run by this script reaches the Go command again (#864).
@@ -33,18 +35,23 @@ if [ -z "${DEVZONE_NO_GO:-}" ] && [ -z "$FROM_GO" ]; then
33
35
  *) POD_GO_ARCH="" ;;
34
36
  esac
35
37
  POD_GO="$ICI/bin/devzone-pod-$(uname -s | tr '[:upper:]' '[:lower:]')-$POD_GO_ARCH"
38
+ if [ -n "${DEVZONE_HOST_BIN:-}" ] && [ -x "$DEVZONE_HOST_BIN" ]; then
39
+ POD_GO="$DEVZONE_HOST_BIN"
40
+ fi
41
+ if [ -x "$POD_GO" ]; then
42
+ # Shell helpers still in use call the Go program by this variable.
43
+ export DEVZONE_HOST_BIN="$POD_GO"
44
+ fi
36
45
  if [ -n "$POD_GO_ARCH" ] && [ -x "$POD_GO" ] && "$POD_GO" handles "${1:-}" >/dev/null 2>&1; then
37
46
  DEVZONE_POD_SCRIPT="$ICI/devzone" exec "$POD_GO" "$@"
38
47
  fi
39
48
  fi
40
- # shellcheck source=SCRIPTDIR/help.sh
41
- # shellcheck disable=SC1091
42
- . "$ICI/help.sh"
43
49
  VERSIONS="$ICI/../manage/scripts/ci/versions.sh"
44
50
  # devzone folder (/workspaces/devzone); DEVZONE_ROOT for the tests
45
51
  RACINE="${DEVZONE_ROOT:-$(dirname "$ICI")}"
46
52
  # Default state of the instance; DEVZONE_STATE takes precedence (tests, CI)
47
53
  ETAT="${DEVZONE_STATE:-$RACINE/.devzone.modules}"
54
+ export DEVZONE_STATE="$ETAT"
48
55
  MODULES=(ai kubernetes gitlab postgres argocd mysql)
49
56
  INSTANCE_SUFFIX=""
50
57
  [ "${DEVZONE_INSTANCE:-devzone}" = devzone ] || INSTANCE_SUFFIX="-${DEVZONE_INSTANCE}"
@@ -57,14 +64,7 @@ if [ -f "$ICI/argocd/conf.sh" ]; then
57
64
  . "$ICI/argocd/conf.sh"
58
65
  fi
59
66
  # GitOps repository line in the Kubernetes workspace pod (#639)
60
- # Detection of the host (Ollama) models and the devzone-host opencode provider (#665).
61
- # shellcheck source=SCRIPTDIR/ai/host-models.sh
62
- # shellcheck disable=SC1091
63
- . "$ICI/ai/host-models.sh"
64
- # Update check and report for the host (Ollama) models (#668).
65
- # shellcheck source=SCRIPTDIR/ai/host-check.sh
66
- # shellcheck disable=SC1091
67
- . "$ICI/ai/host-check.sh"
67
+ # Host models and assistants are handled by the Go command of the pod (#882).
68
68
 
69
69
  # AI assistants, pinned versions: update here, then devzone apply (or Rebuild
70
70
  # Container). One line per package, separated by a line that does not change:
@@ -93,27 +93,13 @@ GITLAB_URL_MODULE=http://gitlab.localhost:8929
93
93
  # shellcheck source=SCRIPTDIR/devzone-modules.sh
94
94
  # shellcheck disable=SC1091
95
95
  . "$ICI/devzone-modules.sh"
96
- # shellcheck source=SCRIPTDIR/devzone-ai.sh
97
- # shellcheck disable=SC1091
98
- . "$ICI/devzone-ai.sh"
99
- # shellcheck source=SCRIPTDIR/devzone-ai-guard.sh
100
- # shellcheck disable=SC1091
101
- . "$ICI/devzone-ai-guard.sh"
102
- # shellcheck source=SCRIPTDIR/devzone-skill.sh
103
- # shellcheck disable=SC1091
104
- . "$ICI/devzone-skill.sh"
96
+ # The AI module and its guard are handled by the Go command of the pod (#882).
105
97
  # shellcheck source=SCRIPTDIR/devzone-services.sh
106
98
  # shellcheck disable=SC1091
107
99
  . "$ICI/devzone-services.sh"
108
- # shellcheck source=SCRIPTDIR/devzone-repair.sh
109
- # shellcheck disable=SC1091
110
- . "$ICI/devzone-repair.sh"
111
100
  # shellcheck source=SCRIPTDIR/devzone-platform.sh
112
101
  # shellcheck disable=SC1091
113
102
  . "$ICI/devzone-platform.sh"
114
- # shellcheck source=SCRIPTDIR/devzone-version.sh
115
- # shellcheck disable=SC1091
116
- . "$ICI/devzone-version.sh"
117
103
  # shellcheck source=SCRIPTDIR/devzone-status.sh
118
104
  # shellcheck disable=SC1091
119
105
  . "$ICI/devzone-status.sh"
@@ -124,11 +110,11 @@ case "${1:-}" in
124
110
  state)
125
111
  export DEVZONE_STATE="$ETAT"
126
112
  case "${2:-}" in
127
- write|remove|replace|init|recovery-mark|recovery-wait|recovery-pending|recovery-confirm|catalog-sync|gitops-line|json)
113
+ write|remove|replace|init|recovery-mark|recovery-wait|recovery-pending|recovery-confirm|catalog-sync|gitops-line|held|outdated-tools|missing-worktrees|json)
128
114
  # shellcheck disable=SC2034 # DEVZONE_STATE used by state helpers
129
115
  ETAT="$DEVZONE_STATE"
130
116
  ;;
131
- *) echo "devzone state: write|remove|replace|init|recovery-mark|recovery-wait|recovery-pending|recovery-confirm|catalog-sync|gitops-line|json" >&2; exit 1 ;;
117
+ *) echo "devzone state: write|remove|replace|init|recovery-mark|recovery-wait|recovery-pending|recovery-confirm|catalog-sync|gitops-line|held|outdated-tools|missing-worktrees|json" >&2; exit 1 ;;
132
118
  esac
133
119
  ici_state="$ICI"
134
120
  pod_state=""
@@ -150,8 +136,8 @@ case "${1:-}" in
150
136
  # The user confirms the current state (#417, step 4): the watchers
151
137
  # may uninstall again
152
138
  DEVZONE_STATE="$ETAT" bash "$ICI/devzone" state recovery-confirm
153
- apply_repowarden
154
- [ "$(value_of ai)" = off ] || apply_ai on
139
+ "${DEVZONE_HOST_BIN:?devzone: Go pod binary unavailable}" apply-repowarden
140
+ [ "$(value_of ai)" = off ] || DEVZONE_STATE="$ETAT" "$ICI/devzone" ai apply on
155
141
  # gitlab, postgres, argocd: installed from the workstation in the
156
142
  # Kubernetes workspace pod (#528), by their installer elsewhere
157
143
  [ "$(value_of gitlab)" = off ] || apply_service gitlab
@@ -165,39 +151,12 @@ case "${1:-}" in
165
151
  # writing anything
166
152
  [ "$(value_of "$2")" = on ]
167
153
  ;;
168
- ai)
169
- case "${2:-}" in
170
- check)
171
- # Read-only: update state of each detected host model (#668).
172
- check
173
- ;;
174
- rapport)
175
- # Read-only: sizes, update state, measurements, chosen model (#668).
176
- rapport
177
- ;;
178
- *)
179
- # Read-only: lists the host (Ollama) models detected and the default model.
180
- models_list="$(modeles)"
181
- default_model="$(premier)"
182
- if [ -z "$models_list" ]; then
183
- echo "devzone : no Ollama model detected on ${URL} (answer on /api/tags)"
184
- else
185
- echo "devzone : models detected on the host (Ollama):"
186
- while IFS= read -r m; do
187
- [ -n "$m" ] && printf ' %s\n' "$m"
188
- done <<<"$models_list"
189
- echo "default model: ${default_model:-none}"
190
- fi
191
- ;;
192
- esac
193
- ;;
194
154
  build)
195
155
  bash "$ICI/workspace-build.sh" "${@:2}"
196
156
  ;;
197
- repair) repair_workstation ;;
198
157
  # Go only: reached when the binary did not take the call. Never call
199
158
  # "devzone" again from here, it would loop forever, see #864
200
- cluster | clusters | metrics | use | kube | agent | postgres | mysql | gitlab | test-gitlab | catalog | catalog-watcher)
159
+ -h | --help | help | repair | apply-repowarden | cluster | clusters | metrics | use | kube | ai | agent | postgres | mysql | gitlab | test-gitlab | catalog | catalog-watcher)
201
160
  echo "devzone $1: Go binary of the pod unavailable (.devcontainer/bin)" >&2
202
161
  exit 1
203
162
  ;;
@@ -217,7 +176,6 @@ case "${1:-}" in
217
176
  echo "devzone passwords: Go binary of the pod unavailable (.devcontainer/bin)" >&2
218
177
  exit 1
219
178
  ;;
220
- -h | --help | help) devzone_aide ;;
221
179
  test-bash32) bash "$RACINE/manage/test/bash32.sh" ;;
222
180
  platform)
223
181
  if [ -n "${2:-}" ]; then
@@ -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
- DEVZONE_STATE="$ETAT" devzone catalog 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
  }
@@ -88,7 +88,7 @@ apply_kubernetes() {
88
88
  rm -f "$HOME/.kube/hote.config"
89
89
  # metrics-server removed from the clusters where devzone installed it
90
90
  # (devzone=installe marker set by the Go command); via its subcommand
91
- devzone metrics remove || true
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="$(devzone kube 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="$(devzone kube 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="$(devzone kube 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
- devzone kube 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
- DEVZONE_STATE="$ETAT" devzone catalog 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
@@ -9,7 +9,7 @@
9
9
  show_state() {
10
10
  local name email status m late path ports_state ctx_work ctx_host packages_mark packages_names argocd_repo
11
11
  echo "devzone: state (devzone to show it again)"
12
- version_available_line
12
+ "${DEVZONE_HOST_BIN:?devzone: Go pod binary unavailable}" version-available-line
13
13
  name="$(git config --get user.name || true)"
14
14
  email="$(git config --get user.email || true)"
15
15
  if [ -n "$name" ] && [ -n "$email" ]; then
@@ -41,7 +41,7 @@ show_state() {
41
41
  echo " ✔ GitHub connected"
42
42
  fi
43
43
  fi
44
- if late="$(outdated_tools)"; then
44
+ if late="$("${DEVZONE_HOST_BIN:?devzone: Go pod binary unavailable}" state outdated-tools 2>/dev/null)"; then
45
45
  if [ -z "$late" ]; then
46
46
  echo " ✔ tools pinned versions"
47
47
  else
@@ -54,7 +54,7 @@ show_state() {
54
54
  while IFS= read -r path; do
55
55
  [ -n "$path" ] || continue
56
56
  echo " ⚠ worktree $path absent here (created outside the container?): manage it on that side, never git worktree prune here (manage/docs/reference.md, Git worktrees)"
57
- done < <(missing_worktrees)
57
+ done < <("${DEVZONE_HOST_BIN:?devzone: Go pod binary unavailable}" state missing-worktrees)
58
58
  for m in "${MODULES[@]}"; do
59
59
  if in_pod && service_module "$m"; then
60
60
  # Kubernetes workspace pod (#528): presence by the cluster DNS
@@ -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
- DEVZONE_STATE="$ETAT" devzone catalog 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="$(devzone kube saved)"
98
- if [ -n "$current_cluster" ] && ! devzone kube 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" ] && devzone kube 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
  ;;
@@ -3,7 +3,7 @@
3
3
  # the Kubernetes workspace pod, with a temporary administrator token (#528).
4
4
  # services-admin.sh enable|disable <service> [options of devzone enable]
5
5
  # services-admin.sh seed gitlab data of gitlab seeded again, in the pod (#538)
6
- # Run by the workstation (manage/scripts/workspace/services-workspace.sh) through
6
+ # Run by the workstation (devzone workspace services, Go) through
7
7
  # kubectl exec -i: the token comes on stdin, is never printed and lives only
8
8
  # in a temporary kubeconfig removed at the end.
9
9
  # Why: the pod has no kubeconfig and its service account is limited (#430),
@@ -7,3 +7,8 @@ METRICS_SERVER_VERSION=v0.9.0
7
7
  # BuildKit client version installed in the workspace image (#514). Must match
8
8
  # buildkit.image in charts/devzone-workspace/values.yaml.
9
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
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
- da866140afd70f74357e1873c55c5a376443fd6991d4afad92cf12afd08ec09c devzone-linux-amd64
2
- cb54b8971528165e10775e1cbe3622d4567d274854cb9378446bccdec11cbd36 devzone-linux-arm64
3
- 1b51f6136b3b5d53495a10d81ed4461d87bfbd15c91fb4a0be074c3defb5face devzone-darwin-amd64
4
- 0c062cfcd30734673a5c0572a41436e56bdde30b67fc5a80c33c14424d51b1ba devzone-darwin-arm64
5
- 6faab20cd349abc04711f0ed340304ad491eaf98f6bcbe83fe8747a0e40ed31e devzone-windows-amd64.exe
6
- 62b0a6eb4804a8afcb6b37662681c63ff218b2eb59021015100b8b1b620e2cbe devzone-windows-arm64.exe
1
+ a44ed44208d3045436bbae033079c1b45e41a4a9949d59d06a01462a2753ac69 devzone-linux-amd64
2
+ 25aaf6eae0830c0baa48152eec6a76b33747154fd242f7ab170672ea528a9dd0 devzone-linux-arm64
3
+ 58c272b0adaf0d1ccc943e79758f30647b150e8fc999aac62397c2fab835c8ae devzone-darwin-amd64
4
+ bbc4f4d84cebac8883756a1aaacb4145c35aea438bedc99381a86ecf0da62908 devzone-darwin-arm64
5
+ 72b505ea10261768ca224560b194b5a03a2595d06c5e85fd6a1b21f5247a2292 devzone-windows-amd64.exe
6
+ 7b11b7e77fac4fd403c69ff2178f8e0a508d33ce8973a9ee2c887958be6e237a devzone-windows-arm64.exe
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
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,7 +186,7 @@ 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 | catalog-watcher | cluster | clusters | disable | \
189
+ ai | agent | apply | apply-repowarden | argocd | build | catalog | catalog-watcher | cluster | clusters | disable | \
187
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 ;;
@@ -197,11 +200,9 @@ case "${1:-}" in
197
200
  "" | -h | --help | help) show_help ;;
198
201
  -v | --version) version ;;
199
202
  update)
200
- # shellcheck source=SCRIPTDIR/scripts/devzone-manifest.sh
201
- . "$PAQUET/manage/scripts/devzone-manifest.sh"
202
- # shellcheck source=SCRIPTDIR/scripts/devzone-update.sh
203
- . "$PAQUET/manage/scripts/devzone-update.sh"
204
- update_workstation "${@:2}"
203
+ # The update is the Go program's (#884); the package folder is passed through
204
+ # DEVZONE_BASH_ENTRY, as the launcher exports it when it runs the binary
205
+ DEVZONE_BASH_ENTRY="$PAQUET/manage/devzone" "${DEVZONE_HOST_BIN:?devzone: Go program not found (DEVZONE_HOST_BIN), run it through manage/devzone}" update "${@:2}"
205
206
  ;;
206
207
  uninstall)
207
208
  # Devzone folder (.devcontainer/); an older devzone has its uninstall.sh
@@ -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
@@ -110,7 +110,7 @@ workspace_deploy() {
110
110
  [ -z "$with_image" ] || params="$params image.repository=$repository"
111
111
  [ "$tag" != latest ] || params="$params image.pullPolicy=Always"
112
112
  # egress proxy settings of .devzone.modules (#633): replayed at each start and update
113
- params="$params $(egress_params)"
113
+ params="$params $("${DEVZONE_HOST_BIN:?devzone: Go program not found (DEVZONE_HOST_BIN), run it through manage/devzone}" workspace egress params)"
114
114
  chart_require workspace || return $?
115
115
  # GitOps repository created or designated first, with its root Application
116
116
  gitops_init || return 1
@@ -85,12 +85,12 @@ start_workspace() {
85
85
  image="$repo:$tag"
86
86
  # Argo CD first when wanted (#516): the workspace is then an Application
87
87
  argocd_ensure
88
- workspace_deploy "$repo" "$tag" "$with_image"
88
+ if [ -n "${DEVZONE_FROM_GO:-}" ] && argocd_active; then devzone workspace deploy "$repo" "$tag" "$with_image"; else workspace_deploy "$repo" "$tag" "$with_image"; fi
89
89
  # Projects of .argocd.conf held too (#516)
90
90
  argocd_reconcile || true
91
- wait_for_pod "$image" || return 1
92
- workspace_agents_guard || true
93
- ports_start silence
91
+ "${DEVZONE_HOST_BIN:?devzone: Go program not found (DEVZONE_HOST_BIN), run it through manage/devzone}" workspace wait "$image" || return 1
92
+ "${DEVZONE_HOST_BIN:-false}" workspace agents-guard || true
93
+ "${DEVZONE_HOST_BIN:?devzone: Go program not found (DEVZONE_HOST_BIN), run it through manage/devzone}" workspace ports start
94
94
  }
95
95
 
96
96
  # helm direct: the chart of the package, image set by the options
@@ -103,14 +103,14 @@ workspace_helm_deploy() {
103
103
  # the old one with IfNotPresent (#515)
104
104
  [ "$tag" != latest ] || args+=(--set "image.pullPolicy=Always")
105
105
  # egress proxy settings (#633), replayed at each start: commas escaped for helm
106
- for p in $(egress_params | sed 's/,/\\,/g'); do args+=(--set "$p"); done
106
+ for p in $("${DEVZONE_HOST_BIN:?devzone: Go program not found (DEVZONE_HOST_BIN), run it through manage/devzone}" workspace egress params | sed 's/,/\\,/g'); do args+=(--set "$p"); done
107
107
  # shellcheck disable=SC2046
108
108
  helm $(helm_flag) upgrade --install devzone-workspace "$(chart_path)" "${args[@]}"
109
109
  }
110
110
 
111
111
  # Uninstalls the workspace from the cluster (Argo CD Application or helm release).
112
112
  stop_workspace() {
113
- ports_stop
113
+ "${DEVZONE_HOST_BIN:?devzone: Go program not found (DEVZONE_HOST_BIN), run it through manage/devzone}" workspace ports stop || true
114
114
  workspace_undeploy
115
115
  }
116
116
 
@@ -122,35 +122,21 @@ shell_workspace() {
122
122
 
123
123
  # shellcheck source=manage/scripts/kube-ready.sh
124
124
  . "$HERE/scripts/kube-ready.sh"
125
- # shellcheck source=manage/scripts/workspace/workspace-wait.sh
126
- . "$HERE/scripts/workspace/workspace-wait.sh"
127
- # shellcheck source=manage/scripts/workspace/workspace-clone.sh
128
- . "$HERE/scripts/workspace/workspace-clone.sh"
129
- # shellcheck source=manage/scripts/workspace/workspace-copies.sh
130
- . "$HERE/scripts/workspace/workspace-copies.sh"
131
- # shellcheck source=manage/scripts/workspace/ports-workspace.sh
132
- . "$HERE/scripts/workspace/ports-workspace.sh"
133
- # shellcheck source=manage/scripts/workspace/services-workspace.sh
134
- . "$HERE/scripts/workspace/services-workspace.sh"
135
125
  # shellcheck source=manage/scripts/workspace/argocd-workspace.sh
136
126
  . "$HERE/scripts/workspace/argocd-workspace.sh"
137
127
  # shellcheck source=manage/scripts/workspace/argocd-services.sh
138
128
  . "$HERE/scripts/workspace/argocd-services.sh"
139
- # shellcheck source=manage/scripts/workspace/workspace-update.sh
140
- . "$HERE/scripts/workspace/workspace-update.sh"
141
- # shellcheck source=manage/scripts/workspace/workspace-egress.sh
142
- . "$HERE/scripts/workspace/workspace-egress.sh"
143
129
 
144
130
  case "${1:-}" in
145
131
  start) start_workspace "${@:2}" ;;
146
- update) update_workspace "${@:2}" ;;
132
+ update) "${DEVZONE_HOST_BIN:?devzone: Go program not found (DEVZONE_HOST_BIN), run it through manage/devzone}" workspace update "${@:2}" ;;
147
133
  stop) stop_workspace ;;
148
- status) status_workspace ;;
134
+ status) "${DEVZONE_HOST_BIN:?devzone: Go program not found (DEVZONE_HOST_BIN), run it through manage/devzone}" workspace status ;;
149
135
  shell) shell_workspace ;;
150
- ports) ports "${@:2}" ;;
151
- services) services "${@:2}" ;;
136
+ ports) "${DEVZONE_HOST_BIN:?devzone: Go program not found (DEVZONE_HOST_BIN), run it through manage/devzone}" workspace ports "${@:2}" ;;
137
+ services) "${DEVZONE_HOST_BIN:?devzone: Go program not found (DEVZONE_HOST_BIN), run it through manage/devzone}" workspace services "${@:2}" ;;
152
138
  argocd) argocd_cmd "${@:2}" ;;
153
- egress) egress_workspace "${@:2}" ;;
139
+ egress) "${DEVZONE_HOST_BIN:?devzone: Go program not found (DEVZONE_HOST_BIN), run it through manage/devzone}" workspace egress "${@:2}" ;;
154
140
  '' | -h | --help | help)
155
141
  echo "devzone workspace start|stop|status|shell|ports|services|argocd|update|egress"
156
142
  echo " start [--image repository:tag] install workspace (image for devzone version by default)"