From cc6141f424ee9f2f27af92c27a3d7eea809809c4 Mon Sep 17 00:00:00 2001 From: ALI YESILKAYA Date: Sun, 28 Jun 2026 17:03:45 +0200 Subject: [PATCH] fix(openalice): embarque les shims CLI alice* (bug packaging Dockerfile amont) (#62) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Le Dockerfile amont v0.60.0-beta.1 copie src/workspaces/templates dans l'image runtime mais oublie src/workspaces/cli, alors que cliBinPath() (/app/src/workspaces/cli/bin) est requis au runtime pour poser les shims alice/alice-uta/traderhub sur le PATH des agents. Sans eux, l'agent ne peut pas joindre le moteur de trading ("alice-uta introuvable sur mon PATH"). - build-openalice.yml : patch du Dockerfile cloné (COPY src/workspaces/cli) + guard - tag image suffixé via IMAGE_PATCH=p1 → nouveau tag immuable, ArgoCD redéploie - deployment.yaml → :v0.60.0-beta.1-p1 - doc admin/ia/openalice.md (correctifs locaux) Co-authored-by: Claude Opus 4.8 --- .github/workflows/build-openalice.yml | 22 ++++++++++++++++++++-- admin/ia/openalice.md | 11 +++++++++++ k8s/apps/openalice/deployment.yaml | 5 +++-- 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-openalice.yml b/.github/workflows/build-openalice.yml index ca81d57..b8afb80 100644 --- a/.github/workflows/build-openalice.yml +++ b/.github/workflows/build-openalice.yml @@ -17,6 +17,9 @@ env: IMAGE: ghcr.io/alkatrazz24/funk-openalice OPENALICE_REPO: TraderAlice/OpenAlice OPENALICE_REF: v0.60.0-beta.1 # révision amont épinglée + # Suffixe de nos patches locaux par-dessus la ref amont (bump à chaque correctif local + # → nouveau tag immuable, ArgoCD redéploie). Voir l'étape « Patch Dockerfile » ci-dessous. + IMAGE_PATCH: p1 jobs: build: @@ -33,10 +36,25 @@ jobs: git clone --depth 1 --branch "${OPENALICE_REF}" \ "https://github.com/${OPENALICE_REPO}.git" openalice-src - - name: Calcule le tag (= ref amont) + la liste des tags + # Bug de packaging amont (v0.60.0-beta.1) : le Dockerfile copie + # src/workspaces/templates dans l'image runtime mais OUBLIE src/workspaces/cli, + # alors que cliBinPath() = /app/src/workspaces/cli/bin est requis au runtime pour + # poser les shims `alice`/`alice-uta`/`traderhub` sur le PATH des agents (sans quoi + # l'agent ne peut PAS joindre le moteur de trading). On ajoute la copie manquante, + # juste après la copie des templates. À retirer si corrigé en amont. + - name: Patch Dockerfile — copie le dossier cli manquant (shims alice*) + run: | + cd openalice-src + sed -i '\#src/workspaces/templates#a COPY --from=build /src/src/workspaces/cli ./src/workspaces/cli' Dockerfile + echo "--- Dockerfile (extrait COPY) ---" + grep -n "src/workspaces" Dockerfile + grep -q "COPY --from=build /src/src/workspaces/cli " Dockerfile \ + || { echo "::error::patch cli COPY non appliqué (la ligne templates a-t-elle changé en amont ?)"; exit 1; } + + - name: Calcule le tag (= ref amont + patch local) + la liste des tags id: vars run: | - TAG="${OPENALICE_REF}" + TAG="${OPENALICE_REF}-${IMAGE_PATCH}" echo "tag=${TAG}" >> "$GITHUB_OUTPUT" if [ "${{ github.ref }}" = "refs/heads/main" ]; then echo "tags=${IMAGE}:${TAG},${IMAGE}:latest" >> "$GITHUB_OUTPUT" diff --git a/admin/ia/openalice.md b/admin/ia/openalice.md index 71c387c..1f440ea 100644 --- a/admin/ia/openalice.md +++ b/admin/ia/openalice.md @@ -36,6 +36,17 @@ optionnelle pour les cours live (les K-lines/quotes ne sont pas sur le hub). - **Ressources** : req 512Mi / lim 1.5Gi (nœuds 8 Go, OOM actif) — runtime Node + CLIs agent embarqués (claude-code, codex) ; surveiller la conso réelle après déploiement. +## Correctifs locaux (patch image) + +- **Shims CLI manquants (`-p1`)** : le Dockerfile amont `v0.60.0-beta.1` copie + `src/workspaces/templates` dans l'image runtime mais **oublie `src/workspaces/cli`**, + alors que `cliBinPath()` = `/app/src/workspaces/cli/bin` est requis au runtime pour poser + les shims `alice` / `alice-uta` (trading) / `traderhub` sur le **PATH des agents**. Sans eux, + l'agent (Claude/codex) répond *« alice-uta introuvable sur mon PATH »* et **ne peut pas + joindre le moteur de trading / le broker**. Corrigé dans la CI (`build-openalice.yml`, + étape « Patch Dockerfile ») qui ajoute la copie manquante ; tag image suffixé `-p1` + (`IMAGE_PATCH`). À signaler en amont / retirer si corrigé. + ## Onboarding (premier boot) Voir checklist détaillée dans `k8s/apps/openalice/README.md` : diff --git a/k8s/apps/openalice/deployment.yaml b/k8s/apps/openalice/deployment.yaml index 835d97e..14c2464 100644 --- a/k8s/apps/openalice/deployment.yaml +++ b/k8s/apps/openalice/deployment.yaml @@ -31,8 +31,9 @@ spec: type: RuntimeDefault containers: - name: openalice - # Tag amont géré par la CI (build-openalice.yml) : bumpé en à chaque build main. - image: ghcr.io/alkatrazz24/funk-openalice:v0.60.0-beta.1 + # Tag = -, géré par la CI (build-openalice.yml). + # -p1 : patch du Dockerfile amont qui oubliait src/workspaces/cli (shims alice*). + image: ghcr.io/alkatrazz24/funk-openalice:v0.60.0-beta.1-p1 securityContext: allowPrivilegeEscalation: false capabilities: