devzone 7.1.0 → 7.2.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.
- package/.devcontainer/Dockerfile +15 -22
- package/.devcontainer/ai/host-check.message +12 -12
- package/.devcontainer/ai/host-check.sh +1 -1
- package/.devcontainer/catalog/app.sh +5 -12
- package/.devcontainer/catalog/catalog-watcher.sh +7 -7
- package/.devcontainer/catalog.sh +1 -1
- package/.devcontainer/cluster.sh +1 -11
- package/.devcontainer/devcontainer.json +1 -11
- package/.devcontainer/devzone +19 -23
- package/.devcontainer/devzone-ai.sh +1 -1
- package/.devcontainer/devzone-cluster.sh +2 -3
- package/.devcontainer/devzone-modules.sh +7 -2
- package/.devcontainer/devzone-repair.sh +11 -21
- package/.devcontainer/devzone-services.sh +21 -20
- package/.devcontainer/devzone-status.sh +4 -12
- package/.devcontainer/gitlab/demo/.gitlab-ci.yml +1 -1
- package/.devcontainer/help.sh +3 -5
- package/.devcontainer/isolation.sh +1 -1
- package/.devcontainer/kube-account.sh +12 -173
- package/.devcontainer/metrics-server.sh +1 -1
- package/.devcontainer/packages.sh +3 -3
- package/.devcontainer/password.sh +5 -6
- package/.devcontainer/ports-json.sh +0 -4
- package/.devcontainer/ports.sh +7 -103
- package/.devcontainer/services-admin.sh +2 -2
- package/.devcontainer/state-json.sh +4 -14
- package/.devcontainer/versions.env +2 -2
- package/.devcontainer/workspace-init.sh +1 -9
- package/Makefile +6 -6
- package/README.md +14 -33
- package/bin/SHA256SUMS +6 -6
- package/bin/devzone-darwin-amd64 +0 -0
- package/bin/devzone-darwin-arm64 +0 -0
- package/bin/devzone-linux-amd64 +0 -0
- package/bin/devzone-linux-arm64 +0 -0
- package/bin/devzone-windows-amd64.exe +0 -0
- package/bin/devzone-windows-arm64.exe +0 -0
- package/manage/devzone +7 -20
- package/manage/scripts/ci/check-names.sh +5 -6
- package/manage/scripts/ci/ticket-protocol.txt +7 -0
- package/manage/scripts/ci/versions-tools-plan.sh +1 -1
- package/manage/scripts/devzone-create.sh +4 -4
- package/manage/scripts/devzone-update.sh +18 -22
- package/manage/scripts/workspace/argocd-services.sh +1 -1
- package/manage/scripts/workspace/argocd-workspace.sh +2 -2
- package/manage/scripts/workspace/ports-workspace.sh +5 -5
- package/manage/scripts/workspace/services-workspace.sh +3 -3
- package/manage/scripts/workspace/workspace-update.sh +0 -3
- package/manage/workspace.sh +0 -14
- package/package.json +1 -1
- package/.devcontainer/argocd/argocd.sh +0 -222
- package/.devcontainer/argocd/catalog-argocd.sh +0 -119
- package/.devcontainer/argocd/services-hook.sh +0 -181
- package/.devcontainer/catalog/mysql/install.sh +0 -87
- package/.devcontainer/catalog/mysql/mysql.sh +0 -262
- package/.devcontainer/catalog/mysql/volume.sh +0 -71
- package/.devcontainer/command-aliases.sh +0 -234
- package/.devcontainer/git-identity.sh +0 -28
- package/.devcontainer/gitlab/argocd.sh +0 -54
- package/.devcontainer/gitlab/chart.sh +0 -39
- package/.devcontainer/gitlab/gitlab.sh +0 -168
- package/.devcontainer/gitlab/installation.sh +0 -193
- package/.devcontainer/gitlab/secrets.sh +0 -95
- package/.devcontainer/gitlab/seed.sh +0 -204
- package/.devcontainer/gitlab/test-gitlab-restes.sh +0 -16
- package/.devcontainer/gitlab/test-gitlab.sh +0 -489
- package/.devcontainer/kind-wrapper.sh +0 -45
- package/.devcontainer/kube-config.sh +0 -78
- package/.devcontainer/kube-reachable.sh +0 -64
- package/.devcontainer/ports-auto.sh +0 -247
- package/.devcontainer/post-create.sh +0 -91
- package/.devcontainer/postgres/postgres.sh +0 -309
- package/.devcontainer/rename-legacy-files.sh +0 -172
- package/.devcontainer/rename-legacy-ports.sh +0 -119
- package/.devcontainer/startup.sh +0 -65
- package/manage/scripts/ci/check-english.sh +0 -57
package/.devcontainer/Dockerfile
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
# Java, Node, Python,
|
|
1
|
+
# devzone base image: tools without an official feature, pinned versions.
|
|
2
|
+
# Java, Node, Python, kubectl, helm and gh are added by the features
|
|
3
3
|
# de devcontainer.json, par-dessus cette image.
|
|
4
4
|
|
|
5
5
|
# uv : binaire de l'image officielle (pas de script curl | sh)
|
|
@@ -8,7 +8,7 @@ FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv
|
|
|
8
8
|
|
|
9
9
|
FROM mcr.microsoft.com/devcontainers/base:ubuntu-24.04
|
|
10
10
|
|
|
11
|
-
# Versions
|
|
11
|
+
# Versions: to update, change the version AND the sha256 checksum,
|
|
12
12
|
# puis Rebuild Container
|
|
13
13
|
ARG K9S_VERSION=0.51.0
|
|
14
14
|
ARG ACTIONLINT_VERSION=1.7.12
|
|
@@ -17,7 +17,7 @@ ARG KIND_VERSION=0.33.0
|
|
|
17
17
|
ARG KUBECTX_VERSION=0.11.0
|
|
18
18
|
ARG RUFF_VERSION=0.17.0
|
|
19
19
|
ARG VULTURE_VERSION=2.16
|
|
20
|
-
# pytest
|
|
20
|
+
# pytest: same version as the repowarden CI (ci/requirements/e2e-python.in)
|
|
21
21
|
ARG PYTEST_VERSION=9.1.1
|
|
22
22
|
# BuildKit client (buildctl) for the Kubernetes workspace pod (#514). Pinned to
|
|
23
23
|
# the buildkitd sidecar version; checksums from the moby/buildkit v0.34.2 release
|
|
@@ -34,16 +34,16 @@ ARG GO_SHA256_ARM64=3392582988a273a87ab5043ee1b2c9c17a2c3c00580bf9326c47a2e0aaae
|
|
|
34
34
|
|
|
35
35
|
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
|
36
36
|
|
|
37
|
-
#
|
|
38
|
-
# (repowarden guard, module
|
|
39
|
-
# Python 3.12
|
|
37
|
+
# Shell checks of repowarden; jq: read by its guard for AI agents
|
|
38
|
+
# (repowarden guard, ai module), which checks nothing without it
|
|
39
|
+
# Python 3.12 of Ubuntu 24.04, packages signed by apt, no key server (#464)
|
|
40
40
|
RUN apt-get -o Acquire::Retries=5 update \
|
|
41
41
|
&& apt-get -o Acquire::Retries=5 install -y --no-install-recommends shellcheck bats jq python3 python3-venv python3-pip python-is-python3 \
|
|
42
42
|
&& rm -rf /var/lib/apt/lists/*
|
|
43
43
|
|
|
44
|
-
# k9s, actionlint (
|
|
45
|
-
#
|
|
46
|
-
# (kind
|
|
44
|
+
# k9s, actionlint (same versions as the repowarden CI), gitleaks, kind:
|
|
45
|
+
# install <name> <url> <sha256>: checksum verified before installing anything into /usr/local/bin
|
|
46
|
+
# (kind is a single binary, without an archive: installed separately, same check)
|
|
47
47
|
RUN set -eu; \
|
|
48
48
|
arch="$(dpkg --print-architecture)"; \
|
|
49
49
|
case "$arch" in \
|
|
@@ -75,7 +75,7 @@ RUN set -eu; \
|
|
|
75
75
|
install -m 0755 /tmp/kind /usr/local/bin/kind-reel; \
|
|
76
76
|
rm -f /tmp/kind
|
|
77
77
|
|
|
78
|
-
# kubectx
|
|
78
|
+
# kubectx and kubens: official ahmetb/kubectx binaries, versions pinned with
|
|
79
79
|
# empreinte sha256 par architecture (comme k9s)
|
|
80
80
|
RUN set -eu; \
|
|
81
81
|
arch="$(dpkg --print-architecture)"; \
|
|
@@ -140,17 +140,11 @@ ENV PATH="/usr/local/go/bin:${PATH}" \
|
|
|
140
140
|
GOCACHE=/home/vscode/.cache/go-build \
|
|
141
141
|
GOPATH=/home/vscode/go
|
|
142
142
|
|
|
143
|
-
# kind passe par une enveloppe (#291) : avec le Docker de l'hôte, un cluster
|
|
144
|
-
# créé à la main doit être rendu joignable depuis le conteneur (kube-reachable.sh)
|
|
145
|
-
COPY kube-reachable.sh /usr/local/lib/devzone/kube-reachable.sh
|
|
146
|
-
COPY kind-wrapper.sh /usr/local/bin/kind
|
|
147
|
-
RUN chmod 0644 /usr/local/lib/devzone/kube-reachable.sh && chmod 0755 /usr/local/bin/kind
|
|
148
|
-
|
|
149
143
|
COPY --from=uv /uv /uvx /usr/local/bin/
|
|
150
144
|
|
|
151
|
-
# ruff, vulture (
|
|
152
|
-
#
|
|
153
|
-
# (
|
|
145
|
+
# ruff, vulture (both needed by repowarden dead-code checks) and pytest, installed
|
|
146
|
+
# for every user, with a Python managed by uv outside the home
|
|
147
|
+
# (build-only variables: uv tool install stays in ~/.local for vscode)
|
|
154
148
|
RUN export UV_TOOL_DIR=/opt/uv/tools UV_TOOL_BIN_DIR=/usr/local/bin \
|
|
155
149
|
UV_PYTHON_INSTALL_DIR=/opt/uv/python \
|
|
156
150
|
&& uv tool install "ruff==${RUFF_VERSION}" \
|
|
@@ -166,7 +160,6 @@ RUN export UV_TOOL_DIR=/opt/uv/tools UV_TOOL_BIN_DIR=/usr/local/bin \
|
|
|
166
160
|
RUN install -d -o 1000 -g 1000 /home/vscode/.local /home/vscode/.local/bin /home/vscode/.local/state /home/vscode/.local/share /home/vscode/.config
|
|
167
161
|
|
|
168
162
|
# devzone scripts inside the image: the Kubernetes workspace pod has no
|
|
169
|
-
# /workspaces/devzone checkout (#503).
|
|
170
|
-
# /usr/local/bin/devzone to the mounted repository in post-create.sh.
|
|
163
|
+
# /workspaces/devzone checkout (#503).
|
|
171
164
|
COPY . /usr/local/share/devzone/.devcontainer
|
|
172
165
|
RUN ln -sf /usr/local/share/devzone/.devcontainer/devzone /usr/local/bin/devzone
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
MSG_TITRE="
|
|
2
|
-
MSG_AUCUN="devzone
|
|
3
|
-
MSG_TAILLE="
|
|
4
|
-
MSG_A_JOUR="
|
|
5
|
-
MSG_MAJ="
|
|
6
|
-
MSG_NON="
|
|
7
|
-
MSG_PULL="
|
|
8
|
-
MSG_MESURE="
|
|
9
|
-
MSG_RETENU="
|
|
10
|
-
MSG_RAISON_VAR="
|
|
11
|
-
MSG_RAISON_MESURE="
|
|
12
|
-
MSG_RAISON_REGLE="
|
|
1
|
+
MSG_TITRE="host (Ollama) models detected:"
|
|
2
|
+
MSG_AUCUN="devzone: no Ollama model detected on {url} (answer on /api/tags)"
|
|
3
|
+
MSG_TAILLE="size"
|
|
4
|
+
MSG_A_JOUR="up to date"
|
|
5
|
+
MSG_MAJ="update available"
|
|
6
|
+
MSG_NON="not verifiable"
|
|
7
|
+
MSG_PULL="on the host: ollama pull {modele}"
|
|
8
|
+
MSG_MESURE="measurement reussite {reussite}, tok_s {tok_s}"
|
|
9
|
+
MSG_RETENU="chosen model: {modele} ({raison})"
|
|
10
|
+
MSG_RAISON_VAR="DEVZONE_HOST_MODEL"
|
|
11
|
+
MSG_RAISON_MESURE="measurement"
|
|
12
|
+
MSG_RAISON_REGLE="rule"
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
# printed for the host). The registry is DEVZONE_OLLAMA_REGISTRY, else
|
|
10
10
|
# https://registry.ollama.ai.
|
|
11
11
|
# bash 3.2 (macOS). Code and comments in English; the user messages are French
|
|
12
|
-
# and live in host-check.message
|
|
12
|
+
# and live in host-check.message, a data file outside the code check.
|
|
13
13
|
set -euo pipefail
|
|
14
14
|
|
|
15
15
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
@@ -6,9 +6,6 @@
|
|
|
6
6
|
|
|
7
7
|
WAIT_SECONDS="${DEVZONE_CATALOG_WAIT:-300}"
|
|
8
8
|
|
|
9
|
-
# shellcheck source=SCRIPTDIR/argocd/catalog-argocd.sh
|
|
10
|
-
# shellcheck disable=SC1091
|
|
11
|
-
. "$ICI/argocd/catalog-argocd.sh"
|
|
12
9
|
# shellcheck source=SCRIPTDIR/chart-direct.sh
|
|
13
10
|
# shellcheck disable=SC1091
|
|
14
11
|
. "$ICI/chart-direct.sh"
|
|
@@ -89,17 +86,13 @@ app_install() {
|
|
|
89
86
|
app_secret "$app" "$ns"
|
|
90
87
|
local claim=donnees
|
|
91
88
|
if [ "$app" = mysql ]; then
|
|
92
|
-
|
|
93
|
-
# shellcheck disable=SC1091
|
|
94
|
-
. "$(catalog_dir)/mysql/volume.sh"
|
|
95
|
-
claim="$(mysql_claim_choose "$ns")" || return 2
|
|
89
|
+
claim="$(devzone mysql claim "$ns")" || return 2
|
|
96
90
|
[ "$claim" = donnees ] || extra="claim=$claim"
|
|
97
91
|
fi
|
|
98
|
-
if
|
|
92
|
+
if "$ICI/devzone" argocd catalog-active "$app"; then
|
|
99
93
|
argo=1
|
|
100
94
|
echo "▶ Application $app through Argo CD (chart charts/devzone-$app)…"
|
|
101
|
-
|
|
102
|
-
"$(app_read "$app" memoire)" "$(app_read "$app" taille)" "$extra" || return 1
|
|
95
|
+
"$ICI/devzone" argocd catalog-apply "$app" "$ns" "$image" "$port" "$(app_read "$app" memoire)" "$(app_read "$app" taille)" "$extra" || return 1
|
|
103
96
|
else
|
|
104
97
|
# Direct helm: the chart charts/devzone-<app>, the one definition (#559)
|
|
105
98
|
chart_install "$app" "$ns" "image=$image" "port=$port" \
|
|
@@ -127,8 +120,8 @@ app_remove() {
|
|
|
127
120
|
fi
|
|
128
121
|
claim="$(kubectl --context devzone -n "$ns" get statefulset "$app" \
|
|
129
122
|
-o jsonpath='{.spec.volumeClaimTemplates[0].metadata.name}' 2>/dev/null || true)"
|
|
130
|
-
if
|
|
131
|
-
|
|
123
|
+
if "$ICI/devzone" argocd catalog-application-exists "$app"; then
|
|
124
|
+
"$ICI/devzone" argocd catalog-delete "$app" >/dev/null 2>&1 || true
|
|
132
125
|
kubectl --context devzone -n "$ns" delete "secret/$app-admin" >/dev/null 2>&1 || true
|
|
133
126
|
pvc="${claim:-donnees}-$app-0"
|
|
134
127
|
echo "✔ $app removed: Application deleted; volume $pvc and databases kept: devzone $app volume"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# Catalog hot detection (#414): when .devzone.modules changes, catalog.sh apply
|
|
3
3
|
# runs. A single instance (lock, as #394).
|
|
4
|
-
# catalog-watcher.sh
|
|
4
|
+
# catalog-watcher.sh loop | start | stop | tick
|
|
5
5
|
set -euo pipefail
|
|
6
6
|
|
|
7
7
|
ICI="$(cd "$(dirname "$0")" && pwd)"
|
|
@@ -86,7 +86,7 @@ start_detached() {
|
|
|
86
86
|
mkdir -p "$BASE"
|
|
87
87
|
# Same detachment as relay_start: setsid when present, else nohup.
|
|
88
88
|
command -v setsid >/dev/null 2>&1 && detache=(setsid)
|
|
89
|
-
${detache[@]+"${detache[@]}"} nohup env DEVZONE_CATALOG_REAL=yes bash "$0"
|
|
89
|
+
${detache[@]+"${detache[@]}"} nohup env DEVZONE_CATALOG_REAL=yes bash "$0" loop >"$BASE/veilleur.log" 2>&1 &
|
|
90
90
|
i=0
|
|
91
91
|
while [ "$i" -lt 20 ]; do
|
|
92
92
|
pid="$(cat "$LOCK_DIR/pid" 2>/dev/null || true)"
|
|
@@ -112,8 +112,8 @@ stop_watcher() {
|
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
case "${1:-}" in
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
loop) if ! guard_watcher; then exit 2; fi; loop ;;
|
|
116
|
+
start)
|
|
117
117
|
if ! guard_watcher; then exit 2; fi
|
|
118
118
|
if [ -f "$LOCK_DIR/pid" ] && kill -0 "$(cat "$LOCK_DIR/pid")" 2>/dev/null; then
|
|
119
119
|
echo "already running"
|
|
@@ -121,10 +121,10 @@ case "${1:-}" in
|
|
|
121
121
|
start_detached || exit 1
|
|
122
122
|
fi
|
|
123
123
|
;;
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
stop) stop_watcher ; echo "stopped" ;;
|
|
125
|
+
tick) tick ;;
|
|
126
126
|
*)
|
|
127
|
-
echo "devzone : catalog-watcher :
|
|
127
|
+
echo "devzone : catalog-watcher : loop | start | stop | tick" >&2
|
|
128
128
|
exit 2
|
|
129
129
|
;;
|
|
130
130
|
esac
|
package/.devcontainer/catalog.sh
CHANGED
|
@@ -223,7 +223,7 @@ case "${1:-}" in
|
|
|
223
223
|
json) catalog_json ;;
|
|
224
224
|
# Removal of an application: StatefulSet and service, volume kept (#441)
|
|
225
225
|
remove) app_remove "$2" ;;
|
|
226
|
-
-h | --help
|
|
226
|
+
-h | --help) sed -n '2,6p' "$0" | sed 's/^# \{0,1\}//' ;;
|
|
227
227
|
*)
|
|
228
228
|
echo "devzone : catalog : sync | apply | list | resume | json | remove <app>" >&2
|
|
229
229
|
exit 1
|
package/.devcontainer/cluster.sh
CHANGED
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
# (terminal only), otherwise local default
|
|
15
15
|
# cluster_prepare CTX creates the dedicated kind cluster if missing
|
|
16
16
|
# cluster_release CTX deletes the dedicated kind cluster once empty
|
|
17
|
-
# kube_reachable_from_container FILE rewrites 127.0.0.1/localhost
|
|
18
17
|
# relay_start NAME CTX NS TARGET PORTS… port-forward kept alive
|
|
19
18
|
# relay_active NAME / relay_stop NAME
|
|
20
19
|
# account_* (kube-account.sh #430) limited account and admin context
|
|
@@ -29,7 +28,7 @@ export KUBECONFIG
|
|
|
29
28
|
: "${ETAT:=${DEVZONE_STATE:-$HOME/.devzone.modules}}"
|
|
30
29
|
|
|
31
30
|
# Safe state write (#417): lock, temporary file in the state folder, backup copy
|
|
32
|
-
# .prev — shared by devzone, ports
|
|
31
|
+
# .prev — shared by devzone, ports
|
|
33
32
|
# shellcheck source=SCRIPTDIR/state.sh
|
|
34
33
|
# shellcheck disable=SC1091
|
|
35
34
|
. "$(dirname "${BASH_SOURCE[0]}")/state.sh"
|
|
@@ -47,11 +46,6 @@ CLUSTER_DEDICATED=kind-devzone${INSTANCE_SUFFIX}
|
|
|
47
46
|
# labelled namespace has no use left and can be deleted
|
|
48
47
|
CLUSTER_LABEL=app.kubernetes.io/managed-by=devzone
|
|
49
48
|
|
|
50
|
-
# Rewrite 127.0.0.1 → host.docker.internal (#291): shared with the kind wrapper,
|
|
51
|
-
# which applies it too to clusters created by hand
|
|
52
|
-
# shellcheck source=SCRIPTDIR/kube-reachable.sh
|
|
53
|
-
. "$(dirname "${BASH_SOURCE[0]}")/kube-reachable.sh"
|
|
54
|
-
|
|
55
49
|
# Limited Kubernetes account (#430): account_setup, account_allow,
|
|
56
50
|
# account_remove, account_token, account_admin (admin context); the installers
|
|
57
51
|
# use it, cluster_release too
|
|
@@ -294,9 +288,6 @@ cluster_prepare() {
|
|
|
294
288
|
if [ "$ctx" = "$CLUSTER_DEDICATED" ]; then
|
|
295
289
|
if ! kind get clusters 2>/dev/null | grep -qx "devzone${INSTANCE_SUFFIX}"; then
|
|
296
290
|
echo "▶ Creating the kind devzone cluster (about 1 min)…"
|
|
297
|
-
# On the host Docker, the API listens on the workstation's 127.0.0.1:
|
|
298
|
-
# kube_reachable_from_container makes it reachable from the container
|
|
299
|
-
# (host.docker.internal), without exposing it on the local network.
|
|
300
291
|
# Busy host Docker (its Kubernetes, other clusters): the node API can
|
|
301
292
|
# restart during initialization and kind gives up within seconds. A
|
|
302
293
|
# second attempt, on a fresh cluster.
|
|
@@ -305,7 +296,6 @@ cluster_prepare() {
|
|
|
305
296
|
kind delete cluster --name "devzone${INSTANCE_SUFFIX}" >/dev/null 2>&1 || true
|
|
306
297
|
kind_create_keep_context --name "devzone${INSTANCE_SUFFIX}" --wait 120s || return 1
|
|
307
298
|
fi
|
|
308
|
-
kube_reachable_from_container "$HOME/.kube/config"
|
|
309
299
|
fi
|
|
310
300
|
elif ! cluster_reachable "$ctx"; then
|
|
311
301
|
echo "devzone : cluster $ctx unreachable (kubernetes module enabled? cluster started?)" >&2
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
"version": "lts",
|
|
22
22
|
"pnpmVersion": "latest"
|
|
23
23
|
},
|
|
24
|
-
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {},
|
|
25
24
|
"ghcr.io/devcontainers/features/kubectl-helm-minikube:1": {
|
|
26
25
|
"minikube": "none"
|
|
27
26
|
},
|
|
@@ -57,19 +56,11 @@
|
|
|
57
56
|
],
|
|
58
57
|
|
|
59
58
|
"runArgs": [
|
|
60
|
-
// Cluster Kubernetes de l'hôte : sa config en lecture seule, adaptée au
|
|
61
|
-
// conteneur par kube-config.sh. HOME (Mac, Linux) ou USERPROFILE (Windows) ;
|
|
62
|
-
// -v plutôt que mounts : crée ~/.kube s'il manque au lieu d'échouer
|
|
63
|
-
"-v", "${localEnv:HOME}${localEnv:USERPROFILE}/.kube:/home/vscode/.kube-host:ro",
|
|
64
59
|
// host.docker.internal existe d'office avec Docker Desktop, pas sous Linux
|
|
65
60
|
"--add-host=host.docker.internal:host-gateway"
|
|
66
61
|
],
|
|
67
62
|
|
|
68
|
-
|
|
69
|
-
// Identité git, clusters, puis récapitulatif de ce qui reste à faire
|
|
70
|
-
"postStartCommand": "bash .devcontainer/startup.sh",
|
|
71
|
-
// Clusters kind du conteneur (config) + cluster de l'hôte (hote.config,
|
|
72
|
-
// refait à chaque démarrage par kube-config.sh)
|
|
63
|
+
// Clusters kind du conteneur (config)
|
|
73
64
|
"remoteEnv": {
|
|
74
65
|
// Chemin du projet SUR L'HÔTE : nécessaire pour `docker run -v`, car les
|
|
75
66
|
// chemins du conteneur n'existent pas pour le Docker de l'hôte
|
|
@@ -82,7 +73,6 @@
|
|
|
82
73
|
// clusters kind. Permet à desinstalleur.sh de cibler uniquement les
|
|
83
74
|
// ressources de l'instance courante.
|
|
84
75
|
"DEVZONE_INSTANCE": "${localEnv:DEVZONE_VOLUMES:devzone}",
|
|
85
|
-
"KUBECONFIG": "/home/vscode/.kube/config:/home/vscode/.kube/hote.config",
|
|
86
76
|
// Claude Code range aussi .claude.json (connexion, réglages) dans ce
|
|
87
77
|
// dossier, donc dans son volume, au lieu de ~/.claude.json
|
|
88
78
|
"CLAUDE_CONFIG_DIR": "/home/vscode/.claude"
|
package/.devcontainer/devzone
CHANGED
|
@@ -22,7 +22,11 @@ done
|
|
|
22
22
|
ICI="$(cd -P "$(dirname "$SOURCE")" && pwd)"
|
|
23
23
|
# Go first (#754): a command ported to Go runs in the devzone-pod binary of the image.
|
|
24
24
|
# DEVZONE_NO_GO=1 forces the shell, DEVZONE_FROM_GO=1 avoids loops.
|
|
25
|
-
|
|
25
|
+
# DEVZONE_FROM_GO only concerns this call: not inherited, so that a "devzone …"
|
|
26
|
+
# run by this script reaches the Go command again (#864).
|
|
27
|
+
FROM_GO="${DEVZONE_FROM_GO:-}"
|
|
28
|
+
unset DEVZONE_FROM_GO
|
|
29
|
+
if [ -z "${DEVZONE_NO_GO:-}" ] && [ -z "$FROM_GO" ]; then
|
|
26
30
|
case "$(uname -m)" in
|
|
27
31
|
x86_64) POD_GO_ARCH=amd64 ;;
|
|
28
32
|
aarch64 | arm64) POD_GO_ARCH=arm64 ;;
|
|
@@ -45,12 +49,6 @@ MODULES=(ai kubernetes gitlab postgres argocd mysql)
|
|
|
45
49
|
# shellcheck source=SCRIPTDIR/cluster.sh
|
|
46
50
|
# shellcheck disable=SC1091
|
|
47
51
|
. "$ICI/cluster.sh"
|
|
48
|
-
# English command names are accepted (#502); a copied devzone may miss the file
|
|
49
|
-
# shellcheck source=SCRIPTDIR/command-aliases.sh
|
|
50
|
-
# shellcheck disable=SC1091
|
|
51
|
-
if [ -f "$ICI/command-aliases.sh" ]; then
|
|
52
|
-
. "$ICI/command-aliases.sh"
|
|
53
|
-
fi
|
|
54
52
|
# .argocd.conf of the instance: the GitOps repository designation (#539)
|
|
55
53
|
# shellcheck source=SCRIPTDIR/argocd/conf.sh
|
|
56
54
|
# shellcheck disable=SC1091
|
|
@@ -133,12 +131,6 @@ if [ -f "$ICI/state-json.sh" ]; then
|
|
|
133
131
|
. "$ICI/state-json.sh"
|
|
134
132
|
fi
|
|
135
133
|
|
|
136
|
-
# Renamed names (#695): an old French name is refused with its new name, before
|
|
137
|
-
# anything runs (exit 1). Without the aliases file (copied devzone): no check.
|
|
138
|
-
if command -v reject_renamed >/dev/null 2>&1; then
|
|
139
|
-
reject_renamed "$@" || exit 1
|
|
140
|
-
fi
|
|
141
|
-
|
|
142
134
|
case "${1:-}" in
|
|
143
135
|
"" | status | modules) if [ "${2:-}" = "--json" ]; then state_json; else show_state; fi ;;
|
|
144
136
|
enable) change_module on "${2:-}" "${@:3}" ;;
|
|
@@ -159,8 +151,8 @@ case "${1:-}" in
|
|
|
159
151
|
;;
|
|
160
152
|
is-enabled)
|
|
161
153
|
is_known "${2:-}" || { echo "devzone : unknown module : ${2:-(none)}" >&2; exit 2; }
|
|
162
|
-
# Silent test
|
|
163
|
-
#
|
|
154
|
+
# Silent test: code 0 if the module is active, 1 otherwise, without
|
|
155
|
+
# writing anything
|
|
164
156
|
[ "$(value_of "$2")" = on ]
|
|
165
157
|
;;
|
|
166
158
|
agent)
|
|
@@ -196,26 +188,30 @@ case "${1:-}" in
|
|
|
196
188
|
bash "$ICI/workspace-build.sh" "${@:2}"
|
|
197
189
|
;;
|
|
198
190
|
repair) repair_workstation ;;
|
|
199
|
-
start) bash "$ICI/startup.sh" ;;
|
|
200
191
|
metrics) bash "$ICI/metrics-server.sh" "${@:2}" ;;
|
|
201
192
|
use) use_cluster "${@:2}" ;;
|
|
202
193
|
clusters) DEVZONE_STATE="$ETAT" bash "$ICI/clusters.sh" "${@:2}" ;;
|
|
203
194
|
cluster) change_cluster "${@:2}" ;;
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
195
|
+
# Go only: reached when the binary did not take the call. Never call
|
|
196
|
+
# "devzone" again from here, it would loop forever, see #864
|
|
197
|
+
postgres | mysql | gitlab | test-gitlab)
|
|
198
|
+
echo "devzone $1: Go binary of the pod unavailable (.devcontainer/bin)" >&2
|
|
199
|
+
exit 1
|
|
200
|
+
;;
|
|
207
201
|
catalog) DEVZONE_STATE="$ETAT" bash "$ICI/catalog.sh" list ;;
|
|
208
|
-
argocd)
|
|
202
|
+
argocd)
|
|
203
|
+
echo "devzone argocd: Go binary of the pod unavailable (.devcontainer/bin)" >&2
|
|
204
|
+
exit 1
|
|
205
|
+
;;
|
|
209
206
|
port) DEVZONE_STATE="$ETAT" bash "$ICI/ports.sh" "${@:2}" ;;
|
|
210
207
|
packages) bash "$ICI/packages.sh" "${@:2}" ;;
|
|
211
208
|
passwords)
|
|
212
|
-
bash "$ICI/password.sh"
|
|
209
|
+
bash "$ICI/password.sh" regenerate ||
|
|
213
210
|
echo "devzone : grouped credentials not updated" >&2
|
|
214
|
-
bash "$ICI/password.sh"
|
|
211
|
+
bash "$ICI/password.sh" path
|
|
215
212
|
;;
|
|
216
213
|
-h | --help | help) devzone_aide ;;
|
|
217
214
|
test-bash32) bash "$RACINE/manage/test/bash32.sh" ;;
|
|
218
|
-
test-gitlab) DEVZONE_STATE="$ETAT" bash "$ICI/gitlab/test-gitlab.sh" "${@:2}" ;;
|
|
219
215
|
platform)
|
|
220
216
|
if [ -n "${2:-}" ]; then
|
|
221
217
|
change_platform "${@:2}"
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Marker of the default configuration: first line of opencode.jsonc. The former
|
|
8
8
|
# wording (French, before #722) is still recognised. Byte escapes keep the accent
|
|
9
|
-
# out of the source (check
|
|
9
|
+
# out of the source (English code check).
|
|
10
10
|
OPENCODE_MARKER='// devzone : default opencode configuration'
|
|
11
11
|
|
|
12
12
|
# True if the file carries the default-configuration marker
|
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# All the databases disappear: confirmation in the terminal (without a terminal,
|
|
8
8
|
# the command is explicit); a yes or --yes sets DELETE_DATA, read by
|
|
9
|
-
# apply_mysql to run delete-data (#441)
|
|
10
|
-
# --oui is refused before reaching here, only --yes passes (#695).
|
|
9
|
+
# apply_mysql to run delete-data (#441); only --yes reaches this function.
|
|
11
10
|
confirm_removal() {
|
|
12
11
|
local app="$1" answer arg
|
|
13
12
|
DELETE_DATA=""
|
|
@@ -112,7 +111,7 @@ change_cluster() {
|
|
|
112
111
|
return 1
|
|
113
112
|
fi
|
|
114
113
|
# Installs PostgreSQL on the new cluster (via --context devzone which now points to it)
|
|
115
|
-
|
|
114
|
+
devzone postgres install
|
|
116
115
|
else
|
|
117
116
|
cluster_save "$ctx_new"
|
|
118
117
|
# Sets the devzone context on the new cluster (cluster + user:
|
|
@@ -120,7 +120,12 @@ change_module() {
|
|
|
120
120
|
confirm_removal "$m" "${@:3}" || return 0
|
|
121
121
|
fi
|
|
122
122
|
write_value "$m" "$1"
|
|
123
|
-
# Services held by Argo CD (#559):
|
|
124
|
-
|
|
123
|
+
# Services held by Argo CD (#559): postgres and mysql, plus the release
|
|
124
|
+
# of the Applications when argocd is turned off. gitlab has its own path,
|
|
125
|
+
# the other modules go straight to their installer (hook exit 3).
|
|
126
|
+
if [ "$m" = postgres ] || [ "$m" = mysql ] || { [ "$m" = argocd ] && [ "$1" = off ]; }; then
|
|
127
|
+
# 0 done by Argo CD, 3 helm direct as before, else failed
|
|
128
|
+
if DEVZONE_STATE="$ETAT" devzone argocd services-hook "$m" "$1" "${@:3}"; then return 0; elif [ $? -ne 3 ]; then return 1; fi
|
|
129
|
+
fi
|
|
125
130
|
"apply_$m" "$1" "${@:3}"
|
|
126
131
|
}
|
|
@@ -11,8 +11,8 @@ outdated_tools() {
|
|
|
11
11
|
bash "$VERSIONS" --installees 2>/dev/null
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
# Sets repowarden back to the pinned version if it differs
|
|
15
|
-
#
|
|
14
|
+
# Sets repowarden back to the pinned version if it differs (it installs the
|
|
15
|
+
# global git hooks)
|
|
16
16
|
apply_repowarden() {
|
|
17
17
|
local line pinned installed package=repowarden
|
|
18
18
|
[ -f "$VERSIONS" ] || return 0
|
|
@@ -45,8 +45,8 @@ missing_worktrees() {
|
|
|
45
45
|
done || true
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
# Repair (#341):
|
|
49
|
-
#
|
|
48
|
+
# Repair (#341): repairs the workstation: relays, watchers, credentials.
|
|
49
|
+
# Each item is really repaired; ✔ or ✖ with the reason.
|
|
50
50
|
repair_item() {
|
|
51
51
|
local name="$1" output code reason
|
|
52
52
|
shift
|
|
@@ -65,31 +65,21 @@ repair_item() {
|
|
|
65
65
|
# does not stop the following ones.
|
|
66
66
|
repair_workstation() {
|
|
67
67
|
repair_failed=0
|
|
68
|
-
# Limited Kubernetes account token (#430): 24 h, renewed here; without the
|
|
69
|
-
# kubernetes module and without a services cluster, nothing to do
|
|
70
|
-
if [ "$(value_of kubernetes)" = on ] || [ -n "$(cluster_saved)" ]; then
|
|
71
|
-
repair_item "kubernetes account" bash "$ICI/kube-account.sh" jeton
|
|
72
|
-
fi
|
|
73
68
|
if [ "$(value_of gitlab)" = on ]; then
|
|
74
|
-
repair_item "gitlab name"
|
|
75
|
-
repair_item "gitlab relay"
|
|
69
|
+
repair_item "gitlab name" devzone gitlab host-set
|
|
70
|
+
repair_item "gitlab relay" devzone gitlab relay-start
|
|
76
71
|
fi
|
|
77
72
|
if [ "$(value_of postgres)" = on ]; then
|
|
78
|
-
repair_item "postgres relay"
|
|
73
|
+
repair_item "postgres relay" devzone postgres relay-start
|
|
79
74
|
fi
|
|
80
75
|
if [ "$(value_of argocd)" = on ]; then
|
|
81
|
-
repair_item "argocd relay"
|
|
76
|
+
repair_item "argocd relay" "$ICI/devzone" argocd relay-start
|
|
82
77
|
fi
|
|
83
78
|
if [ "$(value_of mysql)" = on ]; then
|
|
84
|
-
repair_item "mysql relay"
|
|
85
|
-
fi
|
|
86
|
-
repair_item "ports relay" bash "$ICI/ports.sh" restart
|
|
87
|
-
# Kubernetes workspace (#517): no automatic port watcher
|
|
88
|
-
if ! in_pod; then
|
|
89
|
-
repair_item "ports auto watcher" env DEVZONE_PORTS_AUTO_REAL=yes bash "$ICI/ports-auto.sh" demarrer
|
|
79
|
+
repair_item "mysql relay" devzone mysql relay-start
|
|
90
80
|
fi
|
|
91
|
-
repair_item "catalog watcher" env DEVZONE_CATALOG_REAL=yes bash "$ICI/catalog/catalog-watcher.sh"
|
|
92
|
-
repair_item "credentials" bash "$ICI/password.sh"
|
|
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
|
|
93
83
|
devzone cluster clean || true
|
|
94
84
|
return "$repair_failed"
|
|
95
85
|
}
|
|
@@ -82,7 +82,8 @@ apply_service() {
|
|
|
82
82
|
|
|
83
83
|
apply_kubernetes() {
|
|
84
84
|
if [ "$1" = on ]; then
|
|
85
|
-
|
|
85
|
+
# Clusters are connected from the workstation; no script to run here.
|
|
86
|
+
return 0
|
|
86
87
|
else
|
|
87
88
|
rm -f "$HOME/.kube/hote.config"
|
|
88
89
|
# metrics-server removed from the clusters where devzone installed it
|
|
@@ -96,16 +97,16 @@ apply_gitlab() {
|
|
|
96
97
|
local current_state
|
|
97
98
|
if [ "$1" = on ]; then
|
|
98
99
|
# Skip if the state is ready and the runner online; otherwise install resumes
|
|
99
|
-
current_state="$(
|
|
100
|
+
current_state="$(devzone gitlab status)"
|
|
100
101
|
if [[ "$current_state" == *"ready"* && "$current_state" == *"runner online"* ]]; then
|
|
101
102
|
echo "devzone : gitlab already active, nothing to do."
|
|
102
103
|
# /etc/hosts regenerated by Docker: gitlab.localhost is set again here too
|
|
103
|
-
|
|
104
|
+
devzone gitlab host-set
|
|
104
105
|
# Failure of an old run cleared: gitlab is ready (#366)
|
|
105
106
|
rm -f "$(failure_marker_file gitlab)"
|
|
106
107
|
else
|
|
107
108
|
echo "devzone : activating gitlab via its installer…"
|
|
108
|
-
if !
|
|
109
|
+
if ! devzone gitlab install; then
|
|
109
110
|
echo "gitlab" > "$(failure_marker_file gitlab)"
|
|
110
111
|
return 1
|
|
111
112
|
fi
|
|
@@ -113,12 +114,12 @@ apply_gitlab() {
|
|
|
113
114
|
fi
|
|
114
115
|
else
|
|
115
116
|
# Disable gitlab only if its namespace still exists
|
|
116
|
-
if
|
|
117
|
+
if devzone gitlab installed; then
|
|
117
118
|
echo "devzone : deactivating gitlab…"
|
|
118
119
|
if [ -n "${DELETE_DATA:-}" ]; then
|
|
119
|
-
|
|
120
|
+
devzone gitlab uninstall --yes
|
|
120
121
|
else
|
|
121
|
-
|
|
122
|
+
devzone gitlab uninstall
|
|
122
123
|
fi
|
|
123
124
|
else
|
|
124
125
|
echo "devzone : gitlab already deactivated (no devzone-gitlab namespace)."
|
|
@@ -164,20 +165,20 @@ apply_postgres() {
|
|
|
164
165
|
fi
|
|
165
166
|
# Choice kept before the installation: a resume targets the same cluster
|
|
166
167
|
cluster_save "$ctx"
|
|
167
|
-
current_state="$(
|
|
168
|
+
current_state="$(devzone postgres status)"
|
|
168
169
|
# "relay stopped" first: this line also starts with "ready on"
|
|
169
170
|
if [[ "$current_state" == *"relay stopped"* ]]; then
|
|
170
|
-
|
|
171
|
+
devzone postgres relay-start
|
|
171
172
|
echo "devzone : postgres : relay restarted"
|
|
172
173
|
elif [[ "$current_state" == "ready on"* ]]; then
|
|
173
174
|
echo "devzone : postgres already active, nothing to do."
|
|
174
|
-
elif !
|
|
175
|
+
elif ! devzone postgres install; then
|
|
175
176
|
echo "postgres" >"$(failure_marker_file postgres)"
|
|
176
177
|
return 1
|
|
177
178
|
fi
|
|
178
179
|
rm -f "$(failure_marker_file postgres)"
|
|
179
180
|
else
|
|
180
|
-
|
|
181
|
+
devzone postgres uninstall
|
|
181
182
|
rm -f "$(failure_marker_file postgres)"
|
|
182
183
|
fi
|
|
183
184
|
}
|
|
@@ -187,26 +188,26 @@ apply_postgres() {
|
|
|
187
188
|
apply_argocd() {
|
|
188
189
|
local current_state
|
|
189
190
|
if [ "$1" = on ]; then
|
|
190
|
-
current_state="$(
|
|
191
|
+
current_state="$("$ICI/devzone" argocd status)"
|
|
191
192
|
# "relay stopped" first: this line also starts with "ready"
|
|
192
193
|
if [[ "$current_state" == *"relay stopped"* ]]; then
|
|
193
|
-
|
|
194
|
+
"$ICI/devzone" argocd relay-start
|
|
194
195
|
echo "devzone : argocd : relay restarted"
|
|
195
196
|
elif [[ "$current_state" == "ready"* ]]; then
|
|
196
197
|
echo "devzone : argocd already active, nothing to do."
|
|
197
|
-
elif !
|
|
198
|
+
elif ! "$ICI/devzone" argocd install; then
|
|
198
199
|
echo "argocd" >"$(failure_marker_file argocd)"
|
|
199
200
|
return 1
|
|
200
201
|
fi
|
|
201
202
|
rm -f "$(failure_marker_file argocd)"
|
|
202
203
|
else
|
|
203
|
-
|
|
204
|
+
"$ICI/devzone" argocd uninstall
|
|
204
205
|
rm -f "$(failure_marker_file argocd)"
|
|
205
206
|
fi
|
|
206
207
|
}
|
|
207
208
|
|
|
208
209
|
# Catalog MySQL (#414): same logic as postgres (relay restarted if stopped),
|
|
209
|
-
# installation delegated to
|
|
210
|
+
# installation delegated to the Go module
|
|
210
211
|
apply_mysql() {
|
|
211
212
|
local current_state ctx
|
|
212
213
|
if [ "$1" = on ]; then
|
|
@@ -217,14 +218,14 @@ apply_mysql() {
|
|
|
217
218
|
echo mysql >"$(failure_marker_file mysql)"
|
|
218
219
|
return 2
|
|
219
220
|
fi
|
|
220
|
-
current_state="$(
|
|
221
|
+
current_state="$(devzone mysql status)"
|
|
221
222
|
# "relay stopped" first: this line also starts with "ready on"
|
|
222
223
|
if [[ "$current_state" == *"relay stopped"* ]]; then
|
|
223
|
-
|
|
224
|
+
devzone mysql relay-start
|
|
224
225
|
echo "devzone : mysql: relay restarted"
|
|
225
226
|
elif [[ "$current_state" == "ready on"* ]]; then
|
|
226
227
|
echo "devzone : mysql already active, nothing to do."
|
|
227
|
-
elif !
|
|
228
|
+
elif ! devzone mysql install; then
|
|
228
229
|
echo mysql >"$(failure_marker_file mysql)"
|
|
229
230
|
return 1
|
|
230
231
|
fi
|
|
@@ -234,7 +235,7 @@ apply_mysql() {
|
|
|
234
235
|
# only leave with a yes (confirm_removal)
|
|
235
236
|
bash "$ICI/catalog.sh" remove mysql
|
|
236
237
|
if [ -n "${DELETE_DATA:-}" ]; then
|
|
237
|
-
|
|
238
|
+
devzone mysql delete-data --yes
|
|
238
239
|
fi
|
|
239
240
|
rm -f "$(failure_marker_file mysql)"
|
|
240
241
|
fi
|