devzone 0.55.0 → 0.57.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/agent-local.sh +17 -27
- package/.devcontainer/argocd/services-hook.sh +9 -39
- package/.devcontainer/devzone +46 -10
- package/.devcontainer/ia/host-models.sh +3 -3
- package/.devcontainer/services-admin.sh +5 -10
- package/README.md +3 -7
- package/manage/scripts/migrer-retour.sh +2 -0
- package/manage/scripts/services-workspace.sh +7 -17
- package/manage/workspace.sh +1 -1
- package/package.json +1 -1
- package/.devcontainer/llm/bench.sh +0 -171
- package/.devcontainer/llm/llm.sh +0 -262
- package/.devcontainer/llm/opencode.sh +0 -56
- package/.devcontainer/llm/presets.sh +0 -43
- package/charts/devzone-llm/Chart.yaml +0 -6
- package/charts/devzone-llm/templates/bench-job.yaml +0 -65
- package/charts/devzone-llm/templates/deployment.yaml +0 -113
- package/charts/devzone-llm/templates/pvc.yaml +0 -19
- package/charts/devzone-llm/templates/service.yaml +0 -18
- package/charts/devzone-llm/values.yaml +0 -72
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# Local model in the rotation of devzone agent (#586), sourced by agent.sh.
|
|
3
|
-
# The local slot is
|
|
4
|
-
#
|
|
5
|
-
#
|
|
6
|
-
#
|
|
7
|
-
# file is written for it); opencode gets the reference.
|
|
8
|
-
LOCAL_NOM=devzone-llm-local
|
|
3
|
+
# The local slot is the host model when Ollama answers /api/tags with at least
|
|
4
|
+
# one model (reference devzone-host/<model>). It always comes after every online
|
|
5
|
+
# model; its internal name has no slash (an ecart-<name> file is written for it);
|
|
6
|
+
# opencode gets the reference.
|
|
9
7
|
# Real host model name (Ollama) chosen for this attempt, empty otherwise.
|
|
10
8
|
LOCAL_HOTE_REEL=""
|
|
11
9
|
# Internal (slash-free) name of the host model chosen for this attempt.
|
|
@@ -26,37 +24,29 @@ nom_interne() {
|
|
|
26
24
|
# Sets LOCAL_MODELE for this attempt, read by modele_au_rang and
|
|
27
25
|
# modeles_total. Also records the real host model name when the host is chosen.
|
|
28
26
|
local_charge() {
|
|
29
|
-
local nom
|
|
27
|
+
local nom
|
|
28
|
+
LOCAL_MODELE=""
|
|
30
29
|
LOCAL_HOTE_REEL=""
|
|
31
30
|
LOCAL_HOTE_INTERNE=""
|
|
32
31
|
nom="$(premier 2>/dev/null || true)"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return 0
|
|
38
|
-
fi
|
|
39
|
-
# Fallback: the llm module local model (cluster / relay).
|
|
40
|
-
LOCAL_MODELE=""
|
|
41
|
-
if [ "${DEVZONE_WORKSPACE:-}" != kubernetes ]; then
|
|
42
|
-
bash "$ICI/devzone" is-enabled llm >/dev/null 2>&1 || return 0
|
|
43
|
-
fi
|
|
44
|
-
url="$(bash "$ICI/llm/opencode.sh" url)" || return 0
|
|
45
|
-
if curl -fsS --max-time 3 "${url%/v1}/health" >/dev/null 2>&1; then
|
|
46
|
-
LOCAL_MODELE="$LOCAL_NOM"
|
|
47
|
-
fi
|
|
32
|
+
[ -n "$nom" ] || return 0
|
|
33
|
+
LOCAL_HOTE_REEL="$nom"
|
|
34
|
+
LOCAL_HOTE_INTERNE="$(nom_interne "$nom")"
|
|
35
|
+
LOCAL_MODELE="$LOCAL_HOTE_INTERNE"
|
|
48
36
|
return 0
|
|
49
37
|
}
|
|
50
38
|
|
|
51
39
|
# Model reference given to opencode -m
|
|
52
40
|
modele_ref() {
|
|
53
|
-
if [ "$1" = "$
|
|
54
|
-
|
|
55
|
-
else
|
|
41
|
+
if [ -n "$LOCAL_HOTE_INTERNE" ] && [ "$1" = "$LOCAL_HOTE_INTERNE" ]; then
|
|
42
|
+
echo "devzone-host/$LOCAL_HOTE_REEL"
|
|
43
|
+
else
|
|
44
|
+
echo "opencode/$1"
|
|
45
|
+
fi
|
|
56
46
|
}
|
|
57
47
|
|
|
58
48
|
# Model of rank $1 in the attempt that starts at $2: online ones in rotation,
|
|
59
|
-
# then the local
|
|
49
|
+
# then the local host model
|
|
60
50
|
modele_au_rang() {
|
|
61
51
|
if [ "$1" -lt "${#FREE_MODELS[@]}" ]; then
|
|
62
52
|
echo "${FREE_MODELS[$(( ($2 + $1) % ${#FREE_MODELS[@]} ))]}"
|
|
@@ -65,7 +55,7 @@ modele_au_rang() {
|
|
|
65
55
|
fi
|
|
66
56
|
}
|
|
67
57
|
|
|
68
|
-
# Number of models to try: the online ones, plus the local
|
|
58
|
+
# Number of models to try: the online ones, plus the local host model if ready
|
|
69
59
|
modeles_total() {
|
|
70
60
|
local total="${#FREE_MODELS[@]}"
|
|
71
61
|
[ -n "$LOCAL_MODELE" ] && total=$((total + 1))
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Services of the container held by Argo CD (#559, step 5). Called by devzone
|
|
3
3
|
# (changer) after the state line is written, before the helm-direct path:
|
|
4
4
|
# services-hook.sh <svc> <on|off>
|
|
5
|
-
# postgres
|
|
5
|
+
# postgres and mysql with the module argocd installed and held: enable writes
|
|
6
6
|
# [services] <svc> = on and reconciles it (services_reconcile, services.sh),
|
|
7
7
|
# then waits for the pods and starts the relay; disable removes the
|
|
8
8
|
# Application (its resources leave with it, namespace and volumes stay).
|
|
@@ -22,7 +22,7 @@ STATE_RACINE="${DEVZONE_RACINE:-$RACINE}"
|
|
|
22
22
|
# shellcheck disable=SC2034 # read by catalogue-argocd.sh
|
|
23
23
|
ETAT="${DEVZONE_ETAT:-$STATE_RACINE/.devzone.modules}"
|
|
24
24
|
APP_CONF="$RACINE/.devcontainer/catalogue/mysql/app.conf"
|
|
25
|
-
HOOK_SERVICES="postgres mysql
|
|
25
|
+
HOOK_SERVICES="postgres mysql"
|
|
26
26
|
|
|
27
27
|
# shellcheck source=SCRIPTDIR/../cluster.sh
|
|
28
28
|
# shellcheck disable=SC1091
|
|
@@ -46,19 +46,16 @@ hook_script() {
|
|
|
46
46
|
case "$1" in
|
|
47
47
|
postgres) printf '%s' "$ICI/../postgres/postgres.sh" ;;
|
|
48
48
|
mysql) printf '%s' "$ICI/../catalogue/mysql/mysql.sh" ;;
|
|
49
|
-
llm) printf '%s' "$ICI/../llm/llm.sh" ;;
|
|
50
49
|
esac
|
|
51
50
|
}
|
|
52
51
|
|
|
53
52
|
# Waits for the pods of devzone-<svc> to be ready (the Application syncs
|
|
54
|
-
# within a few minutes); the relay needs a ready pod to forward to
|
|
55
|
-
# of llm is downloaded on its first start: LLM_ATTENTE seconds (1800)
|
|
53
|
+
# within a few minutes); the relay needs a ready pod to forward to
|
|
56
54
|
hook_wait() {
|
|
57
|
-
local ns="devzone-$1" tour=0
|
|
58
|
-
[ "$1" != llm ] || limit="${LLM_ATTENTE:-1800}"
|
|
55
|
+
local ns="devzone-$1" tour=0
|
|
59
56
|
while [ "$tour" -lt 60 ]; do
|
|
60
57
|
if argocd_kubectl -n "$ns" get pods -o name 2>/dev/null | grep -q .; then
|
|
61
|
-
argocd_kubectl -n "$ns" wait --for=condition=Ready pod --all --timeout=
|
|
58
|
+
argocd_kubectl -n "$ns" wait --for=condition=Ready pod --all --timeout=300s >/dev/null 2>&1 && return 0
|
|
62
59
|
fi
|
|
63
60
|
tour=$((tour + 1))
|
|
64
61
|
sleep 5
|
|
@@ -67,12 +64,6 @@ hook_wait() {
|
|
|
67
64
|
return 1
|
|
68
65
|
}
|
|
69
66
|
|
|
70
|
-
# The llm.sh subcommands used by enable (preset, policy); a function so the
|
|
71
|
-
# tests replace it
|
|
72
|
-
hook_llm() {
|
|
73
|
-
DEVZONE_RACINE="$STATE_RACINE" bash "$ICI/../llm/llm.sh" "$@"
|
|
74
|
-
}
|
|
75
|
-
|
|
76
67
|
# Starts the relay of the service, after the pods are ready
|
|
77
68
|
hook_relay() {
|
|
78
69
|
bash "$(hook_script "$1")" relay-start
|
|
@@ -104,20 +95,6 @@ services_secret_postgres() { services_secret_admin postgres devzone-postgres pos
|
|
|
104
95
|
# The superuser secret of MySQL, the same way
|
|
105
96
|
services_secret_mysql() { services_secret_admin mysql devzone-mysql mysql-admin; }
|
|
106
97
|
|
|
107
|
-
# The llm secret hook: the chart has no Secret, nothing to create
|
|
108
|
-
services_secret_llm() { :; }
|
|
109
|
-
|
|
110
|
-
# Parameters of the llm chart: the stored preset (devzone enable llm --preset
|
|
111
|
-
# light), the model and the memory it needs
|
|
112
|
-
services_chart_llm() {
|
|
113
|
-
local preset
|
|
114
|
-
# shellcheck source=SCRIPTDIR/../llm/presets.sh
|
|
115
|
-
# shellcheck disable=SC1091
|
|
116
|
-
. "$ICI/../llm/presets.sh"
|
|
117
|
-
preset="$(cat "$STATE_RACINE/workspace/.llm/preset" 2>/dev/null || true)"
|
|
118
|
-
llm_preset_sets "$preset"
|
|
119
|
-
}
|
|
120
|
-
|
|
121
98
|
# Value of a key of the MySQL application file (app.conf, read as text)
|
|
122
99
|
app_value() { sed -n "s/^$1=//p" "$APP_CONF" 2>/dev/null | tail -1; }
|
|
123
100
|
|
|
@@ -147,16 +124,9 @@ services_chart_mysql() {
|
|
|
147
124
|
hook_on() {
|
|
148
125
|
local svc="$1"
|
|
149
126
|
catalogue_argocd_active "$svc" || return 3
|
|
150
|
-
# llm: the preset of the command line, then the ingress of the workspace
|
|
151
|
-
if [ "$svc" = llm ]; then
|
|
152
|
-
hook_llm preset "${@:2}" || return 1
|
|
153
|
-
fi
|
|
154
127
|
services_note "$svc" on || return 1
|
|
155
128
|
services_reconcile || return 1
|
|
156
129
|
echo "▶ $svc as an Argo CD Application (charts/devzone-$svc at $(argocd_revision))…"
|
|
157
|
-
if [ "$svc" = llm ]; then
|
|
158
|
-
hook_llm policy || return 1
|
|
159
|
-
fi
|
|
160
130
|
hook_wait "$svc" || return 1
|
|
161
131
|
hook_relay "$svc" || return 1
|
|
162
132
|
echo "✔ $svc held by Argo CD ([services] $svc = on in .argocd.conf)"
|
|
@@ -180,14 +150,14 @@ hook_off() {
|
|
|
180
150
|
# is on the Application itself, not on the module state.
|
|
181
151
|
hook_release() {
|
|
182
152
|
local svc app
|
|
183
|
-
for svc in postgres mysql gitlab
|
|
153
|
+
for svc in postgres mysql gitlab; do
|
|
184
154
|
app="devzone-$svc"
|
|
185
155
|
argocd_kubectl -n devzone-argocd get application.argoproj.io "$app" >/dev/null 2>&1 || continue
|
|
186
156
|
argocd_kubectl -n devzone-argocd patch application.argoproj.io "$app" --type merge \
|
|
187
157
|
-p '{"metadata":{"finalizers":null}}' >/dev/null 2>&1 || true
|
|
188
158
|
gitops_delete_application "$app" keep || return 1
|
|
189
159
|
case "$svc" in
|
|
190
|
-
postgres | mysql
|
|
160
|
+
postgres | mysql) services_note "$svc" off || return 1 ;;
|
|
191
161
|
esac
|
|
192
162
|
echo "✔ Application $app released: its resources stay for the helm-direct path"
|
|
193
163
|
done
|
|
@@ -199,8 +169,8 @@ hook_main() {
|
|
|
199
169
|
local svc="${1:-}" action="${2:-}"
|
|
200
170
|
case "$svc:$action" in
|
|
201
171
|
argocd:off) hook_load && hook_release ;;
|
|
202
|
-
postgres:on | mysql:on
|
|
203
|
-
postgres:off | mysql:off
|
|
172
|
+
postgres:on | mysql:on) hook_load && hook_on "$svc" "${@:3}" ;;
|
|
173
|
+
postgres:off | mysql:off) hook_load && hook_off "$svc" ;;
|
|
204
174
|
*) return 3 ;;
|
|
205
175
|
esac
|
|
206
176
|
}
|
package/.devcontainer/devzone
CHANGED
|
@@ -28,7 +28,7 @@ VERSIONS="$ICI/../manage/scripts/versions.sh"
|
|
|
28
28
|
RACINE="${DEVZONE_RACINE:-$(dirname "$ICI")}"
|
|
29
29
|
# État par défaut de l'instance ; DEVZONE_ETAT garde la priorité (tests, CI)
|
|
30
30
|
ETAT="${DEVZONE_ETAT:-$RACINE/.devzone.modules}"
|
|
31
|
-
MODULES=(ia kubernetes gitlab postgres argocd mysql
|
|
31
|
+
MODULES=(ia kubernetes gitlab postgres argocd mysql)
|
|
32
32
|
# shellcheck source=SCRIPTDIR/cluster.sh
|
|
33
33
|
# shellcheck disable=SC1091
|
|
34
34
|
. "$ICI/cluster.sh"
|
|
@@ -90,7 +90,6 @@ description() {
|
|
|
90
90
|
postgres) echo "PostgreSQL partagé, une base par projet" ;;
|
|
91
91
|
argocd) echo "Argo CD, interface de déploiement du cluster des services" ;;
|
|
92
92
|
mysql) echo "MySQL partagé, une base par projet" ;;
|
|
93
|
-
llm) echo "modèle de code local (llama.cpp) dans le cluster des services" ;;
|
|
94
93
|
esac
|
|
95
94
|
}
|
|
96
95
|
|
|
@@ -314,8 +313,8 @@ fichier_echec() {
|
|
|
314
313
|
echo "$ETAT-echec-$1"
|
|
315
314
|
}
|
|
316
315
|
|
|
317
|
-
# Services in the Kubernetes workspace pod (#528): gitlab, postgres
|
|
318
|
-
#
|
|
316
|
+
# Services in the Kubernetes workspace pod (#528): gitlab, postgres and argocd
|
|
317
|
+
# live in the cluster, installed from the workstation (devzone workspace
|
|
319
318
|
# services). The pod has no kubeconfig and a limited account (#430): their
|
|
320
319
|
# presence is the cluster DNS (like #515), never an installer failure marker.
|
|
321
320
|
dans_pod() {
|
|
@@ -324,7 +323,7 @@ dans_pod() {
|
|
|
324
323
|
|
|
325
324
|
service_module() {
|
|
326
325
|
case "$1" in
|
|
327
|
-
gitlab | postgres | argocd
|
|
326
|
+
gitlab | postgres | argocd) return 0 ;;
|
|
328
327
|
esac
|
|
329
328
|
return 1
|
|
330
329
|
}
|
|
@@ -335,7 +334,6 @@ service_dns() {
|
|
|
335
334
|
gitlab) echo "gitlab-webservice-default.devzone-gitlab${INSTANCE_SUFFIX}.svc" ;;
|
|
336
335
|
postgres) echo "postgres.devzone-postgres.svc" ;;
|
|
337
336
|
argocd) echo "argocd-server.devzone-argocd.svc" ;;
|
|
338
|
-
llm) echo "llm.devzone-llm.svc" ;;
|
|
339
337
|
esac
|
|
340
338
|
}
|
|
341
339
|
|
|
@@ -498,6 +496,21 @@ appliquer_ia() {
|
|
|
498
496
|
fi
|
|
499
497
|
poser_garde_docker
|
|
500
498
|
config_opencode
|
|
499
|
+
# Remove the provider of the removed llm module from old configs (#669).
|
|
500
|
+
if [ -f "$HOME/.config/opencode/config.json" ] && command -v jq >/dev/null 2>&1; then
|
|
501
|
+
tmp="$(mktemp)"
|
|
502
|
+
if jq '
|
|
503
|
+
if .provider then del(.provider["devzone-llm"]) | (if .provider == {} then del(.provider) else . end) else . end
|
|
504
|
+
' "$HOME/.config/opencode/config.json" >"$tmp" 2>/dev/null; then
|
|
505
|
+
if [ "$(cat "$tmp")" = "{}" ] || [ "$(jq -c 'del(."$schema") | length' "$tmp" 2>/dev/null)" = 0 ]; then
|
|
506
|
+
rm -f "$tmp" "$HOME/.config/opencode/config.json"
|
|
507
|
+
else
|
|
508
|
+
mv "$tmp" "$HOME/.config/opencode/config.json"
|
|
509
|
+
fi
|
|
510
|
+
else
|
|
511
|
+
rm -f "$tmp"
|
|
512
|
+
fi
|
|
513
|
+
fi
|
|
501
514
|
# Provider opencode des modèles de l'hôte (Ollama), détection à chaud :
|
|
502
515
|
# silencieux et sans effet si Ollama ne répond pas.
|
|
503
516
|
set_provider || true
|
|
@@ -664,7 +677,6 @@ appliquer_postgres() {
|
|
|
664
677
|
fi
|
|
665
678
|
}
|
|
666
679
|
|
|
667
|
-
appliquer_llm() { bash "$ICI/llm/llm.sh" apply "$@"; }
|
|
668
680
|
# Argo CD (#411) : installé dans le cluster des services, accès par le relais
|
|
669
681
|
# 127.0.0.1:8443 ; un échec est marqué dans l'état et repris par devzone apply
|
|
670
682
|
appliquer_argocd() {
|
|
@@ -1335,7 +1347,7 @@ etat() {
|
|
|
1335
1347
|
elif [ "$(valeur "$m")" = on ] && [ "$m" = gitlab ]; then
|
|
1336
1348
|
# GitLab actif : son état réel (prêt, runner, en échec)
|
|
1337
1349
|
printf ' ✔ module %-10s %s\n' "$m" "$(bash "$ICI/gitlab/gitlab.sh" status)"
|
|
1338
|
-
elif [ "$(valeur "$m")" = on ] &&
|
|
1350
|
+
elif [ "$(valeur "$m")" = on ] && [ "$m" = postgres ]; then
|
|
1339
1351
|
printf ' ✔ module %-10s %s\n' "$m" "$(bash "$ICI/$m/$m.sh" status)"
|
|
1340
1352
|
elif [ "$(valeur "$m")" = on ] && [ "$m" = argocd ]; then
|
|
1341
1353
|
printf ' ✔ module %-10s %s\n' "$m" "$(bash "$ICI/argocd/argocd.sh" status)"
|
|
@@ -1433,12 +1445,35 @@ etat() {
|
|
|
1433
1445
|
fi
|
|
1434
1446
|
}
|
|
1435
1447
|
|
|
1448
|
+
# Message for the removed llm module (migration, #669).
|
|
1449
|
+
llm_retire_msg() {
|
|
1450
|
+
echo "devzone : module llm retiré : devzone n'héberge plus de modèle ; les modèles de l'hôte (Ollama) sont détectés à la place (devzone ai). Pour libérer le disque : kubectl delete namespace devzone-llm"
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
# Drops the llm= state line when present and reports the removal once (#669).
|
|
1454
|
+
migrer_llm() {
|
|
1455
|
+
[ -f "$ETAT" ] || return 0
|
|
1456
|
+
grep -qE '^llm=' "$ETAT" 2>/dev/null || return 0
|
|
1457
|
+
etat_retirer llm
|
|
1458
|
+
llm_retire_msg
|
|
1459
|
+
}
|
|
1460
|
+
|
|
1436
1461
|
changer() {
|
|
1437
1462
|
local m="${2:-}"
|
|
1438
1463
|
if [ -z "$m" ]; then
|
|
1439
1464
|
echo "devzone : module inconnu : (aucun) ; modules : ${MODULES[*]}" >&2
|
|
1440
1465
|
exit 1
|
|
1441
1466
|
fi
|
|
1467
|
+
# llm removed (#669): migration message, never unknown module.
|
|
1468
|
+
if [ "$m" = llm ]; then
|
|
1469
|
+
initialiser 2>/dev/null || true
|
|
1470
|
+
if [ -f "$ETAT" ] && grep -qE '^llm=' "$ETAT" 2>/dev/null; then
|
|
1471
|
+
etat_retirer llm
|
|
1472
|
+
fi
|
|
1473
|
+
llm_retire_msg
|
|
1474
|
+
return 1
|
|
1475
|
+
fi
|
|
1476
|
+
migrer_llm
|
|
1442
1477
|
# Option docker-hote (#432) : le socket de l'hôte, partagé par défaut.
|
|
1443
1478
|
# Le choix ne s'applique qu'à la création du conteneur ; sans rebuild,
|
|
1444
1479
|
# le conteneur courant garde son montage.
|
|
@@ -1514,6 +1549,7 @@ case "${1:-}" in
|
|
|
1514
1549
|
activer) changer on "${2:-}" "${@:3}" ;;
|
|
1515
1550
|
desactiver) changer off "${2:-}" "${@:3}" ;;
|
|
1516
1551
|
appliquer)
|
|
1552
|
+
migrer_llm
|
|
1517
1553
|
# L'utilisateur confirme l'état courant (#417, étape 4) : les
|
|
1518
1554
|
# veilleurs peuvent de nouveau désinstaller
|
|
1519
1555
|
etat_recouvrement_confirmer
|
|
@@ -1522,7 +1558,7 @@ case "${1:-}" in
|
|
|
1522
1558
|
# gitlab, postgres, argocd: installed from the workstation in the
|
|
1523
1559
|
# Kubernetes workspace pod (#528), by their installer elsewhere
|
|
1524
1560
|
[ "$(valeur gitlab)" = off ] || appliquer_service gitlab
|
|
1525
|
-
|
|
1561
|
+
[ "$(valeur postgres)" = off ] || appliquer_service postgres
|
|
1526
1562
|
[ "$(valeur mysql)" = off ] || appliquer_mysql on
|
|
1527
1563
|
[ "$(valeur argocd)" = off ] || appliquer_service argocd
|
|
1528
1564
|
;;
|
|
@@ -1571,7 +1607,7 @@ case "${1:-}" in
|
|
|
1571
1607
|
utiliser) utiliser "${@:2}" ;;
|
|
1572
1608
|
clusters) DEVZONE_ETAT="$ETAT" bash "$ICI/clusters.sh" "${@:2}" ;;
|
|
1573
1609
|
cluster) changer_cluster "${@:2}" ;;
|
|
1574
|
-
postgres
|
|
1610
|
+
postgres) DEVZONE_ETAT="$ETAT" bash "$ICI/postgres/postgres.sh" "${@:2}" ;;
|
|
1575
1611
|
mysql) DEVZONE_ETAT="$ETAT" bash "$ICI/catalogue/mysql/mysql.sh" "${@:2}" ;;
|
|
1576
1612
|
gitlab) DEVZONE_ETAT="$ETAT" bash "$ICI/gitlab/gitlab.sh" "${@:2}" ;;
|
|
1577
1613
|
catalogue) DEVZONE_ETAT="$ETAT" bash "$ICI/catalogue.sh" list ;;
|
|
@@ -179,11 +179,11 @@ set_provider() {
|
|
|
179
179
|
fi
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
-
# Removes the devzone-host
|
|
183
|
-
# keeping everything else. No error when the file is absent.
|
|
182
|
+
# Removes the devzone-host and devzone-llm providers from the opencode
|
|
183
|
+
# configuration file, keeping everything else. No error when the file is absent.
|
|
184
184
|
unset_provider() {
|
|
185
185
|
[ ! -f "$FILE" ] && return 0
|
|
186
|
-
rewrite 'if .provider then del(.provider["devzone-host"]) | (if .provider == {} then del(.provider) else . end) else . end'
|
|
186
|
+
rewrite 'if .provider then del(.provider["devzone-host"]) | del(.provider["devzone-llm"]) | (if .provider == {} then del(.provider) else . end) else . end'
|
|
187
187
|
}
|
|
188
188
|
|
|
189
189
|
# When run directly (not sourced): dispatch the subcommands.
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
# Installs or removes a devzone service (gitlab, postgres, argocd
|
|
2
|
+
# Installs or removes a devzone service (gitlab, postgres, argocd) from inside
|
|
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
|
-
# services-admin.sh bench llm [options] speed of the model (#593)
|
|
7
6
|
# Run by the workstation (manage/scripts/services-workspace.sh) through
|
|
8
7
|
# kubectl exec -i: the token comes on stdin, is never printed and lives only
|
|
9
8
|
# in a temporary kubeconfig removed at the end.
|
|
@@ -44,20 +43,17 @@ service="${2:-}"
|
|
|
44
43
|
case "$action" in
|
|
45
44
|
enable | activer) action=enable ;;
|
|
46
45
|
disable | desactiver) action=disable ;;
|
|
47
|
-
seed
|
|
48
|
-
*) refuse "usage: services-admin.sh enable|disable|seed
|
|
46
|
+
seed) ;;
|
|
47
|
+
*) refuse "usage: services-admin.sh enable|disable|seed gitlab|postgres|argocd [options]" ;;
|
|
49
48
|
esac
|
|
50
49
|
case "$service" in
|
|
51
|
-
gitlab | postgres | argocd
|
|
52
|
-
*) refuse "unknown service: ${service:-(none)} (gitlab, postgres, argocd
|
|
50
|
+
gitlab | postgres | argocd) ;;
|
|
51
|
+
*) refuse "unknown service: ${service:-(none)} (gitlab, postgres, argocd)" ;;
|
|
53
52
|
esac
|
|
54
53
|
# The seed of the data (group, demo project, dev user, runner) is gitlab's (#538)
|
|
55
54
|
if [ "$action" = seed ] && [ "$service" != gitlab ]; then
|
|
56
55
|
refuse "seed: only gitlab"
|
|
57
56
|
fi
|
|
58
|
-
if [ "$action" = bench ] && [ "$service" != llm ]; then
|
|
59
|
-
refuse "bench: only llm"
|
|
60
|
-
fi
|
|
61
57
|
[ "${DEVZONE_WORKSPACE:-}" = kubernetes ] || refuse "only in the Kubernetes workspace pod"
|
|
62
58
|
[ -f "$SA_DIR/ca.crt" ] || refuse "cluster CA not found: $SA_DIR/ca.crt"
|
|
63
59
|
if [ -t 0 ]; then
|
|
@@ -118,6 +114,5 @@ echo "devzone services: $action $service in the cluster of the pod (temporary ad
|
|
|
118
114
|
case "$action" in
|
|
119
115
|
# The seed is a module command: devzone gitlab seed (#538)
|
|
120
116
|
seed) "$DEVZONE_CMD" gitlab seed "${@:3}" ;;
|
|
121
|
-
bench) "$DEVZONE_CMD" llm bench "${@:3}" ;;
|
|
122
117
|
*) "$DEVZONE_CMD" "$action" "$service" "${@:3}" ;;
|
|
123
118
|
esac
|
package/README.md
CHANGED
|
@@ -49,7 +49,7 @@ Sous Windows : il est recommandé de cloner avec Git for Windows (les scripts re
|
|
|
49
49
|
|
|
50
50
|
#### Mémoire minimale par module
|
|
51
51
|
|
|
52
|
-
Mesures du 16/11/2026.
|
|
52
|
+
Mesures du 16/11/2026.
|
|
53
53
|
|
|
54
54
|
| Module | Consommation mesurée | Mémoire allouable exigée par devzone |
|
|
55
55
|
|---|---|---|
|
|
@@ -57,8 +57,6 @@ Mesures du 16/11/2026. Le chiffre LLM vient des valeurs du chart (non mesuré en
|
|
|
57
57
|
| GitLab | ~3,6 Go | 8 Go |
|
|
58
58
|
| MySQL | ~0,5 Go | aucune |
|
|
59
59
|
| Argo CD | ~0,6 Go | 1 Go |
|
|
60
|
-
| LLM modèle 7B (7 milliards de paramètres, fichier Q4_K_M) | 6 Gi | 12 Go |
|
|
61
|
-
| LLM --preset light (modèle 3B) | 3 Gi demandés, 4 Gi en limite | 8 Go |
|
|
62
60
|
|
|
63
61
|
Sur Docker Desktop (kind), le contrôle compare le minimum à la mémoire d'un seul nœud, donc à la VM ; sur un cluster de vraies machines, à la somme des nœuds.
|
|
64
62
|
|
|
@@ -203,7 +201,7 @@ La liste vit dans `.devzone.paquets` à la racine du dossier devzone, hors du d
|
|
|
203
201
|
| État | — | `make status` | — |
|
|
204
202
|
| **Désinstaller** (tout ce que devzone a créé, après confirmation) | — | `make uninstall` | `npx devzone uninstall` |
|
|
205
203
|
|
|
206
|
-
Dans le mode Kubernetes (poste créé alors que le cluster répondait, ou après `devzone workspace migrate`), le même tableau s'applique au pod `devzone-workspace-0` : `make up`, `make shell` et `make stop` le pilotent, et `make rebuild` est refusé, car rien n'est à reconstruire sur la machine. `devzone workspace revert` rend le poste Docker. Les services GitLab, PostgreSQL et Argo CD s'installent depuis le poste : `devzone workspace services enable postgres` (voir [la référence](manage/docs/reference.md#services-de-devzone-dans-le-workspace-kubernetes)). Tu peux aussi y développer : `devzone workspace clone <url>` fait un clone de travail dans le pod, `devzone ticket <n>` y crée le worktree d'un ticket et `devzone agent` y lance opencode sans copie ([développer dans le pod](manage/docs/reference.md#développer-devzone-et-repowarden-dans-le-pod)). Argo CD y est installé d'office et tient les déploiements : interface sur https://localhost:8443 (mot de passe `admin` dans `.password`), dépôt GitOps `<login>/devzone-argocd` créé sur ton GitHub, projets déclarés dans `.argocd.conf` (`devzone workspace argocd app add <dépôt>`) ; voir [Argo CD dans le workspace Kubernetes](manage/docs/reference.md#argo-cd-dans-le-workspace-kubernetes).
|
|
204
|
+
Dans le mode Kubernetes (poste créé alors que le cluster répondait, ou après `devzone workspace migrate`), le même tableau s'applique au pod `devzone-workspace-0` : `make up`, `make shell` et `make stop` le pilotent, et `make rebuild` est refusé, car rien n'est à reconstruire sur la machine. `devzone workspace revert` rend le poste Docker (déprécié : un avertissement s'affiche, retrait prévu). Les services GitLab, PostgreSQL et Argo CD s'installent depuis le poste : `devzone workspace services enable postgres` (voir [la référence](manage/docs/reference.md#services-de-devzone-dans-le-workspace-kubernetes)). Tu peux aussi y développer : `devzone workspace clone <url>` fait un clone de travail dans le pod, `devzone ticket <n>` y crée le worktree d'un ticket et `devzone agent` y lance opencode sans copie ([développer dans le pod](manage/docs/reference.md#développer-devzone-et-repowarden-dans-le-pod)). Argo CD y est installé d'office et tient les déploiements : interface sur https://localhost:8443 (mot de passe `admin` dans `.password`), dépôt GitOps `<login>/devzone-argocd` créé sur ton GitHub, projets déclarés dans `.argocd.conf` (`devzone workspace argocd app add <dépôt>`) ; voir [Argo CD dans le workspace Kubernetes](manage/docs/reference.md#argo-cd-dans-le-workspace-kubernetes).
|
|
207
205
|
|
|
208
206
|
Dans le conteneur, `devzone --help` liste toutes les commandes. Extrait :
|
|
209
207
|
|
|
@@ -245,7 +243,7 @@ Dans le conteneur, le récapitulatif `devzone` signale une version publiée plus
|
|
|
245
243
|
|
|
246
244
|
**Module `ia`** : active Claude Code et opencode (versions figées), avec le garde-fou repowarden qui les arrête avant de modifier `main` ou `develop` ou de commiter sans `repowarden cc` (voir [manage/docs/reference.md](manage/docs/reference.md#garde-fou-des-assistants-ia)). Pour l'activer : `devzone enable ia`. Ils sont désinstallés quand le module est désactivé, mais tes connexions restent dans leurs volumes. Le module pose aussi un garde-fou qui arrête les commandes `docker` des agents : devzone est Kubernetes d'abord, seuls les pods sont des conteneurs (`kubectl`, ou un pod jetable, à la place).
|
|
247
245
|
|
|
248
|
-
**Modèles de ton ordinateur** : devzone n'héberge aucun modèle. Si Ollama tourne sur ta machine, `devzone enable ia` détecte ses modèles et les branche à opencode (rien n'est installé ni téléchargé). `devzone ai` les liste avec le modèle par défaut, `devzone ai check` dit si chacun est à jour sans rien télécharger, et `devzone ai rapport` détaille le modèle retenu et pourquoi (la variable `DEVZONE_HOST_MODEL`, une mesure, ou la règle « un modèle de code d'abord, puis le plus petit »). Détails dans [manage/docs/reference.md](manage/docs/reference.md#configuration-dopencode).
|
|
246
|
+
**Modèles de ton ordinateur** : devzone n'héberge aucun modèle. Si Ollama tourne sur ta machine, `devzone enable ia` détecte ses modèles et les branche à opencode (rien n'est installé ni téléchargé). `devzone ai` les liste avec le modèle par défaut, `devzone ai check` dit si chacun est à jour sans rien télécharger, et `devzone ai rapport` détaille le modèle retenu et pourquoi (la variable `DEVZONE_HOST_MODEL`, une mesure, ou la règle « un modèle de code d'abord, puis le plus petit »). Détails dans [manage/docs/reference.md](manage/docs/reference.md#configuration-dopencode). Le module `llm` (modèle hébergé dans le cluster) a été retiré : devzone n'héberge aucun modèle.
|
|
249
247
|
|
|
250
248
|
**Module `kubernetes`** : active à chaque démarrage la connexion au cluster de l'hôte et l'installation de metrics-server sur les clusters locaux (pour voir le CPU et la RAM dans k9s). Pour l'activer : `devzone enable kubernetes`. Sans ce module, kubectl, helm, k9s et kind restent installés.
|
|
251
249
|
|
|
@@ -253,8 +251,6 @@ Dans le conteneur, le récapitulatif `devzone` signale une version publiée plus
|
|
|
253
251
|
|
|
254
252
|
**Module `postgres`** : un PostgreSQL partagé, une base par projet (voir [Accéder à PostgreSQL](#accéder-à-postgresql)). Pour l'activer : `devzone enable postgres`.
|
|
255
253
|
|
|
256
|
-
**Module `llm`** : un modèle de code local (Qwen2.5-Coder, sur CPU) dans le cluster de devzone, utilisé par opencode quand les modèles en ligne sont épuisés ou injoignables ; premier téléchargement de plusieurs Go (voir [manage/docs/reference.md](manage/docs/reference.md#modèle-de-code-local)). Pour l'activer : `devzone enable llm` (`--preset light` sur une machine juste en mémoire).
|
|
257
|
-
|
|
258
254
|
**Module `argocd`** : Argo CD sur le cluster de devzone, interface sur https://127.0.0.1:8443 dans le conteneur (voir [Argo CD](manage/docs/reference.md#argo-cd)). Pour l'activer : `devzone enable argocd`.
|
|
259
255
|
|
|
260
256
|
**Option `devzone agent --pod`** : lance une session agent dans un pod éphémère isolé (ticket #222). Le pod est créé avec des ressources limitées (2 CPU, 4 Gi mémoire), des montages restreints du workspace et de l'état, et une affinité obligatoire vers le pod workspace. Isole : worktree du ticket au même chemin que dans le workspace, .git du dépôt, et sous-dossiers d'état (.config/opencode, .local/share/opencode, .local/state/oc-lancer, .local/npm en lecture seule). N'isole pas : le réseau (non filtré, c'est #220), le kubeconfig de l'hôte, `~/.config/gh`, `~/.claude`, les autres worktrees, et, comme le `.git` du dépôt est monté, les références git des autres branches y restent lisibles et modifiables. Sans `--pod`, le comportement `devzone agent` actuel est strictement inchangé.
|
|
@@ -38,6 +38,8 @@ bring_back_project() {
|
|
|
38
38
|
revert_workspace() {
|
|
39
39
|
local bring_back p list backup
|
|
40
40
|
bring_back="$(read_flag --bring-back "revert [--bring-back]" "$@")" || return 1
|
|
41
|
+
# Deprecated with the Docker workstation (#671, #682): still works, but it will be removed.
|
|
42
|
+
echo "⚠ devzone workspace revert is deprecated: the Docker workstation will be removed (two minor versions and 30 days at least after this release). devzone workspace migrate stays." >&2
|
|
41
43
|
if [ "$bring_back" = 1 ]; then
|
|
42
44
|
echo "▶ bring-back: projects from pod to ./workspace (workstation version is saved first)"
|
|
43
45
|
list="$(kc exec "$POD" -c workspace -- ls -1 "$PROJECTS_DIR")" || { fail "cannot read project list from pod"; return 1; }
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# devzone workspace services (#528): installs or removes the devzone services
|
|
3
|
-
# (gitlab, postgres, mysql, argocd
|
|
3
|
+
# (gitlab, postgres, mysql, argocd) of a Kubernetes workspace from the workstation.
|
|
4
4
|
# Sourced by manage/workspace.sh (drapeau_kubectl, POD, NAMESPACE).
|
|
5
5
|
# devzone workspace services enable <service> [options]
|
|
6
6
|
# devzone workspace services disable <service> [--yes]
|
|
7
|
-
# devzone workspace services bench llm [--apply] [--threads …] [--prompt …] [--gen …]
|
|
8
7
|
# devzone workspace services status
|
|
9
8
|
# Why: the pod has no administrator access to the cluster (#430), while the
|
|
10
9
|
# installers need one. The workstation creates a ServiceAccount bound to
|
|
@@ -20,12 +19,12 @@ SERVICES_ADMIN_SCRIPT="${DEVZONE_SERVICES_ADMIN_SCRIPT:-/usr/local/share/devzone
|
|
|
20
19
|
SERVICES_TOKEN_DURATION="${DEVZONE_SERVICES_TOKEN_DURATION:-1h}"
|
|
21
20
|
|
|
22
21
|
services_usage() {
|
|
23
|
-
echo "devzone workspace services enable|disable <gitlab|postgres|mysql|argocd
|
|
22
|
+
echo "devzone workspace services enable|disable <gitlab|postgres|mysql|argocd> [options] | seed gitlab | status"
|
|
24
23
|
}
|
|
25
24
|
|
|
26
25
|
services_known() {
|
|
27
26
|
case "${1:-}" in
|
|
28
|
-
gitlab | postgres | mysql | argocd
|
|
27
|
+
gitlab | postgres | mysql | argocd) return 0 ;;
|
|
29
28
|
esac
|
|
30
29
|
return 1
|
|
31
30
|
}
|
|
@@ -47,7 +46,6 @@ services_namespace() {
|
|
|
47
46
|
postgres) echo devzone-postgres ;;
|
|
48
47
|
mysql) echo devzone-mysql ;;
|
|
49
48
|
argocd) echo devzone-argocd ;;
|
|
50
|
-
llm) echo devzone-llm ;;
|
|
51
49
|
esac
|
|
52
50
|
}
|
|
53
51
|
|
|
@@ -113,10 +111,10 @@ services_run() {
|
|
|
113
111
|
services_state_note "$action" "$service"
|
|
114
112
|
return 0
|
|
115
113
|
fi
|
|
116
|
-
#
|
|
114
|
+
# postgres and mysql are held by Argo CD when it holds the charts
|
|
117
115
|
case "$service" in
|
|
118
|
-
postgres | mysql
|
|
119
|
-
if
|
|
116
|
+
postgres | mysql)
|
|
117
|
+
if argocd_holds_charts; then
|
|
120
118
|
services_argocd_toggle "$service" "$action" "$@"
|
|
121
119
|
code=$?
|
|
122
120
|
[ "$code" -eq 0 ] || return "$code"
|
|
@@ -161,7 +159,7 @@ services_run() {
|
|
|
161
159
|
# One line per service: installed (namespace present) or not
|
|
162
160
|
services_status() {
|
|
163
161
|
local s ns
|
|
164
|
-
for s in gitlab postgres mysql argocd
|
|
162
|
+
for s in gitlab postgres mysql argocd; do
|
|
165
163
|
ns="$(services_namespace "$s")"
|
|
166
164
|
# shellcheck disable=SC2046
|
|
167
165
|
if kubectl $(drapeau_kubectl) get namespace "$ns" >/dev/null 2>&1; then
|
|
@@ -186,14 +184,6 @@ services() {
|
|
|
186
184
|
fi
|
|
187
185
|
services_run seed gitlab
|
|
188
186
|
;;
|
|
189
|
-
# The speed of the model measured from the workstation, in the pod (#593)
|
|
190
|
-
bench)
|
|
191
|
-
if [ "${2:-}" != llm ]; then
|
|
192
|
-
echo "✖ bench: only llm ($(services_usage))" >&2
|
|
193
|
-
return 1
|
|
194
|
-
fi
|
|
195
|
-
services_run bench llm "${@:3}"
|
|
196
|
-
;;
|
|
197
187
|
status | etat | '') services_status ;;
|
|
198
188
|
*)
|
|
199
189
|
echo "✖ unknown subcommand: $sub ($(services_usage))" >&2
|
package/manage/workspace.sh
CHANGED
|
@@ -239,7 +239,7 @@ case "${1:-}" in
|
|
|
239
239
|
echo " argocd status | init [--repo <url>|--none] | apply | app add <repo url> [path] [--name N] [--revision R] | app list | app remove <N>"
|
|
240
240
|
echo " Argo CD of the workspace: .argocd.conf, GitOps repository, your projects as Applications"
|
|
241
241
|
echo " migrate [--yes] copy Docker workstation to Kubernetes workspace (nothing is deleted)"
|
|
242
|
-
echo " revert [--bring-back] back to Docker workstation; --bring-back: copy pod projects first"
|
|
242
|
+
echo " revert [--bring-back] back to Docker workstation (deprecated, will be removed); --bring-back: copy pod projects first"
|
|
243
243
|
echo " clean-docker remove devzone-* Docker volumes, after confirmation [y/N] (--yes)"
|
|
244
244
|
echo " egress observation|strict|off|status|allow <domain>|deny <domain> egress proxy of the agent sessions (--pod)"
|
|
245
245
|
;;
|