devzone 1.0.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/.devcontainer/Dockerfile +4 -4
  2. package/.devcontainer/agent-errors.sh +154 -0
  3. package/.devcontainer/agent-local.sh +2 -2
  4. package/.devcontainer/{agent-modele.messages → agent-model.messages} +1 -1
  5. package/.devcontainer/{agent-modele.sh → agent-model.sh} +8 -8
  6. package/.devcontainer/{agent-droits.sh → agent-rights.sh} +2 -2
  7. package/.devcontainer/agent-session.sh +122 -125
  8. package/.devcontainer/agent-state-json.sh +117 -0
  9. package/.devcontainer/agent-workspace.sh +53 -53
  10. package/.devcontainer/agent.sh +113 -115
  11. package/.devcontainer/{ia/docker-garde.sh → ai/docker-guard.sh} +1 -1
  12. package/.devcontainer/{ia/plugins/devzone-garde-v2.js → ai/plugins/devzone-guard-v2.js} +4 -4
  13. package/.devcontainer/{ia/plugins/devzone-garde.js → ai/plugins/devzone-guard.js} +3 -3
  14. package/.devcontainer/argocd/argocd.sh +8 -8
  15. package/.devcontainer/argocd/{catalogue-argocd.sh → catalog-argocd.sh} +1 -1
  16. package/.devcontainer/argocd/services-hook.sh +5 -5
  17. package/.devcontainer/{catalogue → catalog}/app.sh +4 -4
  18. package/.devcontainer/{catalogue/catalogue-veilleur.sh → catalog/catalog-watcher.sh} +7 -7
  19. package/.devcontainer/{catalogue → catalog}/mysql/mysql.sh +7 -7
  20. package/.devcontainer/{catalogue.sh → catalog.sh} +13 -13
  21. package/.devcontainer/cluster.sh +8 -8
  22. package/.devcontainer/devcontainer.json +1 -1
  23. package/.devcontainer/devzone +55 -54
  24. package/.devcontainer/{docker-relais.sh → docker-relay.sh} +2 -2
  25. package/.devcontainer/gitlab/argocd.sh +2 -2
  26. package/.devcontainer/gitlab/gitlab.sh +4 -4
  27. package/.devcontainer/gitlab/installation.sh +5 -5
  28. package/.devcontainer/gitlab/secrets.sh +1 -1
  29. package/.devcontainer/help.sh +1 -0
  30. package/.devcontainer/{kind-enveloppe.sh → kind-wrapper.sh} +5 -5
  31. package/.devcontainer/{kube-compte.sh → kube-account.sh} +3 -3
  32. package/.devcontainer/{kube-joignable.sh → kube-reachable.sh} +1 -1
  33. package/.devcontainer/memory.sh +113 -0
  34. package/.devcontainer/metrics-server.sh +52 -51
  35. package/.devcontainer/{paquets.sh → packages.sh} +4 -4
  36. package/.devcontainer/password.sh +88 -87
  37. package/.devcontainer/ports-auto.sh +7 -7
  38. package/.devcontainer/ports.sh +4 -4
  39. package/.devcontainer/post-create.sh +2 -2
  40. package/.devcontainer/postgres/postgres.sh +3 -3
  41. package/.devcontainer/services-admin.sh +5 -5
  42. package/.devcontainer/skills/devzone/SKILL.md +1 -1
  43. package/.devcontainer/{demarrage.sh → startup.sh} +5 -5
  44. package/.devcontainer/state-json.sh +308 -0
  45. package/.devcontainer/state-lock.sh +53 -0
  46. package/.devcontainer/state.sh +219 -0
  47. package/.devcontainer/workspace-init.sh +1 -1
  48. package/Makefile +7 -7
  49. package/README.md +2 -2
  50. package/charts/devzone-workspace/templates/statefulset.yaml +3 -0
  51. package/manage/devzone +3 -3
  52. package/manage/scripts/check-go-layout.sh +40 -0
  53. package/manage/scripts/check-names.sh +60 -0
  54. package/manage/scripts/devzone-create.sh +2 -2
  55. package/manage/scripts/devzone-manifest.sh +2 -2
  56. package/manage/scripts/docker-workstation.sh +2 -2
  57. package/manage/scripts/docker.sh +2 -2
  58. package/manage/scripts/{lancer.sh → launch.sh} +3 -3
  59. package/manage/scripts/{migrer-retour.sh → migrate-revert.sh} +1 -1
  60. package/manage/scripts/{migrer.sh → migrate.sh} +1 -1
  61. package/manage/workspace.sh +4 -4
  62. package/package.json +1 -1
  63. package/.devcontainer/agent-erreurs.sh +0 -138
  64. package/.devcontainer/agent-etat-json.sh +0 -115
  65. package/.devcontainer/etat-json.sh +0 -308
  66. package/.devcontainer/etat-verrou.sh +0 -52
  67. package/.devcontainer/etat.sh +0 -220
  68. package/.devcontainer/memoire.sh +0 -113
  69. /package/.devcontainer/{ia/docker-garde.message → ai/docker-guard.message} +0 -0
  70. /package/.devcontainer/{ia → ai}/host-check.message +0 -0
  71. /package/.devcontainer/{ia → ai}/host-check.sh +0 -0
  72. /package/.devcontainer/{ia → ai}/host-models.sh +0 -0
  73. /package/.devcontainer/{catalogue → catalog}/mysql/app.conf +0 -0
  74. /package/.devcontainer/{catalogue/mysql/installer.sh → catalog/mysql/install.sh} +0 -0
  75. /package/.devcontainer/{catalogue → catalog}/mysql/volume.sh +0 -0
  76. /package/.devcontainer/{docker-sans-hote.sh → docker-without-host.sh} +0 -0
  77. /package/.devcontainer/{isolement.sh → isolation.sh} +0 -0
  78. /package/.devcontainer/{etat-gitops.sh → state-gitops.sh} +0 -0
  79. /package/manage/scripts/{desinstaller.sh → uninstall.sh} +0 -0
@@ -1,113 +0,0 @@
1
- #!/usr/bin/env bash
2
- # Memory check of the services cluster (#608, #612): a module refuses its
3
- # installation when the allocatable memory of the nodes is below its minimum.
4
- # Sourced by the modules (gitlab, llm) and by the tests; bash 3.2 (macOS).
5
- # quantite_ki <quantite> Kubernetes quantity in Ki
6
- # memoire_cluster_ki allocatable memory of the cluster, in Ki
7
- # verifier_memoire_module <module> <minimum_go> [astuce]
8
- # Messages in French. Return 0 when the memory is enough, 2 when it is not or
9
- # when the cluster is unreachable.
10
-
11
- # Globals written by memoire_cluster_ki (#612) and read by
12
- # verifier_memoire_module, which calls the function directly: a call written
13
- # memoire="$(memoire_cluster_ki)" would run it in a subshell and lose them.
14
- # Callers that only need the number keep using $(memoire_cluster_ki): the
15
- # value is still printed on stdout (argocd, gitlab, llm are unaffected).
16
- # MEMOIRE_KI same value as on stdout, in Ki
17
- # MEMOIRE_REGLE "maximum" when every node is a kind node (the nodes share
18
- # one VM), "somme" otherwise
19
- MEMOIRE_KI=""
20
- MEMOIRE_REGLE=""
21
-
22
- # Converts a Kubernetes memory quantity (Ki, Mi, Gi, Ti, K, M, G, bytes)
23
- # into Ki, to total the allocatable memory of the nodes.
24
- quantite_ki() {
25
- local q="${1:-}" nombre
26
- case "$q" in
27
- *Ki) nombre="${q%Ki}"; echo $((nombre)) ;;
28
- *Mi) nombre="${q%Mi}"; echo $((nombre * 1024)) ;;
29
- *Gi) nombre="${q%Gi}"; echo $((nombre * 1024 * 1024)) ;;
30
- *Ti) nombre="${q%Ti}"; echo $((nombre * 1024 * 1024 * 1024)) ;;
31
- *K | *k) nombre="${q%[Kk]}"; echo $((nombre * 1000 / 1024)) ;;
32
- *M) nombre="${q%M}"; echo $((nombre * 1000 * 1000 / 1024)) ;;
33
- *G) nombre="${q%G}"; echo $((nombre * 1000 * 1000 * 1000 / 1024)) ;;
34
- *)
35
- case "$q" in
36
- '' | *[!0-9]*) echo 0 ;;
37
- *) echo $((q / 1024)) ;;
38
- esac
39
- ;;
40
- esac
41
- }
42
-
43
- # Allocatable memory of the services cluster nodes, in Ki. Reading the nodes
44
- # is reserved to the administrator (#430). One kubectl call gives, per node,
45
- # its providerID and its allocatable memory on one "<providerID>|<memory>"
46
- # line (#612). A kind cluster runs on a single Docker daemon: its nodes share
47
- # the memory of one VM and each of them declares the whole VM, so adding them
48
- # up lies. When every providerID starts with "kind://" the greatest node
49
- # memory is returned (MEMOIRE_REGLE=maximum); as soon as one node has no such
50
- # prefix or an empty providerID the sum is returned (MEMOIRE_REGLE=somme), as
51
- # before. Known limit, documented: k3d and minikube in Docker mode share a VM
52
- # too but are not kind, they stay on the sum. A line without the separator
53
- # carries the memory alone, so it is a node without providerID (sum).
54
- memoire_cluster_ki() {
55
- local sortie ligne providerID memoire noeud total=0 max=0 n=0 tous_kind=1
56
- MEMOIRE_KI=""
57
- MEMOIRE_REGLE=""
58
- sortie="$(compte_admin "$(compte_ctx)" get nodes \
59
- -o jsonpath='{range .items[*]}{.spec.providerID}{"|"}{.status.allocatable.memory}{"\n"}{end}' 2>/dev/null)" || return 1
60
- [ -n "$sortie" ] || return 1
61
- while IFS= read -r ligne; do
62
- [ -n "$ligne" ] || continue
63
- case "$ligne" in
64
- *'|'*)
65
- providerID="${ligne%%|*}"
66
- memoire="${ligne#*|}"
67
- ;;
68
- *)
69
- providerID=""
70
- memoire="$ligne"
71
- ;;
72
- esac
73
- noeud="$(quantite_ki "$memoire")"
74
- total=$((total + noeud))
75
- if [ "$noeud" -gt "$max" ]; then max="$noeud"; fi
76
- case "$providerID" in
77
- kind://*) ;;
78
- *) tous_kind=0 ;;
79
- esac
80
- n=$((n + 1))
81
- done <<<"$sortie"
82
- if [ "$n" -gt 0 ] && [ "$tous_kind" -eq 1 ]; then
83
- MEMOIRE_REGLE="maximum"
84
- MEMOIRE_KI="$max"
85
- else
86
- MEMOIRE_REGLE="somme"
87
- MEMOIRE_KI="$total"
88
- fi
89
- echo "$MEMOIRE_KI"
90
- }
91
-
92
- # Refuses the installation of <module> under <minimum_go> GiB of allocatable
93
- # memory. The message says the minimum, the available memory and how to enlarge
94
- # the cluster; [astuce] adds an optional hint (for example --preset light).
95
- # On a kind cluster (#612) the available memory is the one of a single node
96
- # and the message says so. Return 0 when the memory is enough, 2 when it is
97
- # not or the cluster is unreachable.
98
- verifier_memoire_module() {
99
- local nom_module="$1" minimum_go="$2" astuce="${3:-}" memoire precision=""
100
- if ! memoire_cluster_ki >/dev/null; then
101
- echo "devzone : ${nom_module} : cluster des services injoignable : devzone cluster" >&2
102
- return 2
103
- fi
104
- memoire="$MEMOIRE_KI"
105
- if [ "$MEMOIRE_REGLE" = "maximum" ]; then
106
- precision=" (mémoire d'un seul nœud : cluster kind, VM partagée)"
107
- fi
108
- if [ "$memoire" -lt "$((minimum_go * 1048576))" ]; then
109
- echo "devzone : ${nom_module} : il faut au moins ${minimum_go} Go de mémoire allouable dans le cluster (disponible : $((memoire / 1048576)) Go)${precision} ; agrandir le cluster (Docker Desktop → Settings → Resources) puis relancer : devzone enable ${nom_module}${astuce:+ ; astuce : ${astuce}}" >&2
110
- return 2
111
- fi
112
- return 0
113
- }
File without changes
File without changes
File without changes
File without changes