devzone 0.43.0 → 0.45.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.
@@ -0,0 +1,72 @@
1
+ # The one definition of the local model: the helm-direct path installs this
2
+ # chart (.devcontainer/llm/llm.sh) as the release llm. No Secret: the model is
3
+ # public and checked by its sha256.
4
+ # Official llama.cpp image repository (CPU). The tag is derived from llamaBuild:
5
+ # server-<llamaBuild> runs the model, full-<llamaBuild> (llama-bench, only for
6
+ # the bench Job) comes from the same build.
7
+ image: ghcr.io/ggml-org/llama.cpp
8
+ # The one pinned llama.cpp build, shared by the server and the bench images
9
+ llamaBuild: b12407
10
+ # Image of the init container that downloads and checks the model
11
+ fetchImage: curlimages/curl:8.11.1
12
+ # Port of the Service and of llama-server
13
+ port: 8080
14
+ # Memory request of the container (the limit is resources.limits.memory)
15
+ memory: 6Gi
16
+ # Name of the volume claim holding the models; kept when the release goes
17
+ claim: llm-models
18
+ # Size of the models volume
19
+ size: 8Gi
20
+ # Context size (-c) of llama-server. 32768 is the native window of Qwen2.5; the
21
+ # light preset uses 16384 (--set contextSize=16384).
22
+ contextSize: 32768
23
+ # KV cache type for K and V (--cache-type-k / --cache-type-v): q8_0 costs about
24
+ # 1 GB at 32k for the 7B (f16 about 1.9 GB). A quantized V cache needs flash
25
+ # attention.
26
+ cacheType: q8_0
27
+ # Flash attention (--flash-attn on|off|auto in server-b12407)
28
+ flashAttention: "on"
29
+ # Threads (-t and --threads-batch): auto = the CPUs seen by the container
30
+ # (nproc), capped by maxThreads; a number is used as is.
31
+ threads: auto
32
+ maxThreads: 8
33
+ # The model: downloaded only when the file is missing, then its sha256 is
34
+ # checked (the file is removed and the pod fails when it differs). The URL is
35
+ # pinned to a Hugging Face commit (resolve/<commit>).
36
+ # Preset "qwen2.5-coder-7b-instruct-q4_k_m" (default, 4.7 GB):
37
+ # url: https://huggingface.co/Qwen/Qwen2.5-Coder-7B-Instruct-GGUF/resolve/13fb94bfda8c8cf22497dc57b78f391a9acb426a/qwen2.5-coder-7b-instruct-q4_k_m.gguf
38
+ # file: qwen2.5-coder-7b-instruct-q4_k_m.gguf
39
+ # sha256: 509287f78cb4d4cf6b3843734733b914b2c158e43e22a7f4bf5e963800894d3c
40
+ # Preset "qwen2.5-coder-3b-instruct-q4_k_m" (light, 2.1 GB; memory=3Gi,
41
+ # resources.limits.memory=4Gi and contextSize=16384):
42
+ # url: https://huggingface.co/Qwen/Qwen2.5-Coder-3B-Instruct-GGUF/resolve/f74adce6aa16316c625447af059dbebe4983757c/qwen2.5-coder-3b-instruct-q4_k_m.gguf
43
+ # file: qwen2.5-coder-3b-instruct-q4_k_m.gguf
44
+ # sha256: 724fb256bec1ff062b2f65e4569e871ad2e95ab2a3989723d1769c54294730b7
45
+ model:
46
+ url: https://huggingface.co/Qwen/Qwen2.5-Coder-7B-Instruct-GGUF/resolve/13fb94bfda8c8cf22497dc57b78f391a9acb426a/qwen2.5-coder-7b-instruct-q4_k_m.gguf
47
+ file: qwen2.5-coder-7b-instruct-q4_k_m.gguf
48
+ sha256: 509287f78cb4d4cf6b3843734733b914b2c158e43e22a7f4bf5e963800894d3c
49
+ # CPU: a request only (no CPU limit, so the threads are not throttled)
50
+ resources:
51
+ requests:
52
+ cpu: "2"
53
+ limits:
54
+ memory: 7Gi
55
+ # llama-bench Job (templates/bench-job.yaml), rendered only when enabled=true,
56
+ # which `devzone llm bench` sets. It runs the image full-<llamaBuild> (larger
57
+ # than the server image, pulled only for the bench) on the node of the server
58
+ # pod, with the models volume read-only, and is removed after ttl seconds.
59
+ bench:
60
+ enabled: false
61
+ # Prompt tokens (-p), generated tokens (-n), repetitions of each test (-r;
62
+ # llama-bench defaults to 5) and the thread counts tried (-t). Small values:
63
+ # the whole bench takes a few minutes, even on a slow machine.
64
+ prompt: 128
65
+ gen: 32
66
+ repetitions: 1
67
+ threads: "4,8"
68
+ # Seconds before the finished Job is garbage collected
69
+ ttl: 600
70
+ # Seconds before a stuck Job is stopped (activeDeadlineSeconds: the Job does
71
+ # not run forever if the call that started it is interrupted)
72
+ deadline: 1800
package/manage/devzone CHANGED
@@ -582,7 +582,7 @@ commande_du_conteneur() {
582
582
  case "$1" in
583
583
  actif | activer | agent | appliquer | argocd | build | catalogue | cluster | clusters | \
584
584
  demarrer | desactiver | etat | gitlab | metrics | modules | mots-de-passe | \
585
- mysql | paquets | plateforme | port | postgres | reparer | test-bash32 | \
585
+ llm | mysql | paquets | plateforme | port | postgres | reparer | test-bash32 | \
586
586
  test-gitlab | ticket | utiliser) return 0 ;;
587
587
  # English names of the container commands (#502)
588
588
  is-enabled | enable | disable | apply | catalog | start | status | \
@@ -0,0 +1,67 @@
1
+ #!/usr/bin/env bash
2
+ # CI check: in the shell scripts tracked by git, a variable name immediately
3
+ # followed by a non-ASCII byte must be written ${NAME}. Under the macOS locale
4
+ # bash reads the multi-byte character as part of the name, so $NAME followed by
5
+ # an accented letter or an ellipsis breaks (#591). Scripts checked: *.sh,
6
+ # *.bash, .devcontainer/devzone, manage/devzone, and any tracked file whose
7
+ # first line is a bash shebang. A fault is printed as "path:line: text" and the
8
+ # run exits 1; otherwise it prints "utf8 vars check: N files ok" and exits 0.
9
+ # bash 3.2 (macOS).
10
+
11
+ set -u
12
+
13
+ ICI="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
14
+ ROOT="$(cd "$ICI/../.." && pwd)"
15
+
16
+ # Byte matching only. The class is every byte outside printable ASCII, minus
17
+ # the tab (a tab after a name is not a fault). Built from a printf so this
18
+ # file holds no literal non-ASCII byte and never matches its own rule.
19
+ TAB="$(printf '\t')"
20
+ PATTERN='\$[A-Za-z_][A-Za-z_0-9]*[^ -~'"$TAB"']'
21
+
22
+ LC_ALL=C
23
+ export LC_ALL
24
+
25
+ # True when the tracked file $1 (relative to ROOT) is a bash script
26
+ is_bash_script() {
27
+ local first
28
+ case "$1" in
29
+ *.sh | *.bash | .devcontainer/devzone | manage/devzone) return 0 ;;
30
+ esac
31
+ first="$(head -n 1 "$ROOT/$1" 2>/dev/null)"
32
+ case "$first" in
33
+ '#!'*bash*) return 0 ;;
34
+ esac
35
+ return 1
36
+ }
37
+
38
+ files="$(git -C "$ROOT" ls-files)" || {
39
+ echo "check-utf8-vars: git ls-files fails in $ROOT" >&2
40
+ exit 1
41
+ }
42
+
43
+ fails=0
44
+ count=0
45
+ while IFS= read -r f; do
46
+ [ -n "$f" ] || continue
47
+ [ -f "$ROOT/$f" ] || continue
48
+ is_bash_script "$f" || continue
49
+ count=$((count + 1))
50
+ matches="$(grep -naE -- "$PATTERN" "$ROOT/$f")" || matches=""
51
+ while IFS= read -r m; do
52
+ [ -n "$m" ] || continue
53
+ n="${m%%:*}"
54
+ printf '%s:%s: %s\n' "$f" "$n" "${m#*:}"
55
+ fails=1
56
+ done <<EOF
57
+ $matches
58
+ EOF
59
+ done <<EOF
60
+ $files
61
+ EOF
62
+
63
+ if [ "$fails" -ne 0 ]; then
64
+ echo "check-utf8-vars: write \${NAME} instead of \$NAME before a non-ASCII byte" >&2
65
+ exit 1
66
+ fi
67
+ echo "utf8 vars check: $count files ok"
@@ -1,9 +1,10 @@
1
1
  #!/usr/bin/env bash
2
2
  # devzone workspace services (#528): installs or removes the devzone services
3
- # (gitlab, postgres, mysql, argocd) of a Kubernetes workspace from the workstation.
3
+ # (gitlab, postgres, mysql, argocd, llm) of a Kubernetes workspace from the workstation.
4
4
  # Sourced by manage/workspace.sh (drapeau_kubectl, POD, NAMESPACE).
5
5
  # devzone workspace services enable <service> [options]
6
6
  # devzone workspace services disable <service> [--yes]
7
+ # devzone workspace services bench llm [--apply] [--threads …] [--prompt …] [--gen …]
7
8
  # devzone workspace services status
8
9
  # Why: the pod has no administrator access to the cluster (#430), while the
9
10
  # installers need one. The workstation creates a ServiceAccount bound to
@@ -19,12 +20,12 @@ SERVICES_ADMIN_SCRIPT="${DEVZONE_SERVICES_ADMIN_SCRIPT:-/usr/local/share/devzone
19
20
  SERVICES_TOKEN_DURATION="${DEVZONE_SERVICES_TOKEN_DURATION:-1h}"
20
21
 
21
22
  services_usage() {
22
- echo "devzone workspace services enable|disable <gitlab|postgres|mysql|argocd> [options] | seed gitlab | status"
23
+ echo "devzone workspace services enable|disable <gitlab|postgres|mysql|argocd|llm> [options] | seed gitlab | bench llm [--apply] [--threads …] [--prompt …] [--gen …] | status"
23
24
  }
24
25
 
25
26
  services_known() {
26
27
  case "${1:-}" in
27
- gitlab | postgres | mysql | argocd) return 0 ;;
28
+ gitlab | postgres | mysql | argocd | llm) return 0 ;;
28
29
  esac
29
30
  return 1
30
31
  }
@@ -36,6 +37,7 @@ services_namespace() {
36
37
  postgres) echo devzone-postgres ;;
37
38
  mysql) echo devzone-mysql ;;
38
39
  argocd) echo devzone-argocd ;;
40
+ llm) echo devzone-llm ;;
39
41
  esac
40
42
  }
41
43
 
@@ -98,9 +100,10 @@ services_run() {
98
100
  argocd_toggle "$action" "$@"
99
101
  return
100
102
  fi
103
+ # bench is a measure, not a change of state: never taken by Argo CD
101
104
  case "$service" in
102
- postgres | mysql)
103
- if argocd_holds_charts; then
105
+ postgres | mysql | llm)
106
+ if [ "$action" != bench ] && argocd_holds_charts; then
104
107
  services_argocd_toggle "$service" "$action" "$@"
105
108
  return
106
109
  fi
@@ -124,7 +127,7 @@ services_run() {
124
127
  trap - EXIT
125
128
  return 1
126
129
  fi
127
- echo "▶ $action $service in the pod $POD…"
130
+ echo "▶ $action $service in the pod ${POD}…"
128
131
  # The installer of the pod takes --yes (#557) : no translation, no warning
129
132
  # shellcheck disable=SC2046
130
133
  printf '%s\n' "$token" | kubectl $(drapeau_kubectl) exec -i "$POD" --namespace "$NAMESPACE" \
@@ -141,7 +144,7 @@ services_run() {
141
144
  # One line per service: installed (namespace present) or not
142
145
  services_status() {
143
146
  local s ns
144
- for s in gitlab postgres mysql argocd; do
147
+ for s in gitlab postgres mysql argocd llm; do
145
148
  ns="$(services_namespace "$s")"
146
149
  # shellcheck disable=SC2046
147
150
  if kubectl $(drapeau_kubectl) get namespace "$ns" >/dev/null 2>&1; then
@@ -166,6 +169,14 @@ services() {
166
169
  fi
167
170
  services_run seed gitlab
168
171
  ;;
172
+ # The speed of the model measured from the workstation, in the pod (#593)
173
+ bench)
174
+ if [ "${2:-}" != llm ]; then
175
+ echo "✖ bench: only llm ($(services_usage))" >&2
176
+ return 1
177
+ fi
178
+ services_run bench llm "${@:3}"
179
+ ;;
169
180
  status | etat | '') services_status ;;
170
181
  *)
171
182
  echo "✖ unknown subcommand: $sub ($(services_usage))" >&2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "devzone",
3
- "version": "0.43.0",
3
+ "version": "0.45.0",
4
4
  "description": "Ton poste de développement Linux, prêt en une commande, identique sur Mac, Windows et Linux.",
5
5
  "license": "GPL-3.0-only",
6
6
  "repository": {