-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix(docker): build the compatibility manifest inside the image #5030
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -136,19 +136,32 @@ l'état et le catalogue Codex. Ce n'est pas une commande de mise à jour ou de r | |
|
|
||
| Il n’existe pas d’image Docker officielle, mais le dépôt fournit un `Dockerfile` et un `compose.yaml` maintenus pour construire localement une image Bun épinglée par digest. Initialisez une seule fois la clé de données via stdin ; elle est enregistrée avec des permissions réservées au propriétaire dans le volume `ocx-state` et n’est jamais affichée. | ||
|
|
||
| Installez Git et Bun sur l’hôte. Avant chaque construction, générez le manifeste canonique depuis les sources suivies par Git, sans modifier les sources entre la génération et la construction. Le JSON généré reste non suivi ; `.git` est exclu du contexte Docker. Le port hôte est lié à `127.0.0.1` par défaut. Pour un accès distant, utilisez explicitement `OPENCODEX_BIND_ADDRESS=<IP-LAN-ou-Tailscale> docker compose up -d` ; `0.0.0.0` expose toutes les interfaces. Protégez cet accès par un pare-feu et un frontal TLS/tailnet authentifié. | ||
| Pour un checkout local, l’hôte a besoin de Git et Docker Compose ; avec un contexte Git distant, Docker Compose suffit. Bun et la génération manuelle ne sont plus requis. Une étape de construction dédiée génère le manifeste canonique depuis l’instantané Git sélectionné, puis le vérifie avant toute copie des sources. Les métadonnées `.git` ne sont accessibles que par un montage en lecture seule et ne sont copiées dans aucune couche. Un manifeste déjà généré sur l’hôte reste accepté après vérification. Le port hôte est lié à `127.0.0.1` par défaut. Pour un accès distant, utilisez explicitement `OPENCODEX_BIND_ADDRESS=<IP-LAN-ou-Tailscale> docker compose up -d` ; `0.0.0.0` expose toutes les interfaces. Protégez cet accès par un pare-feu et un frontal TLS/tailnet authentifié. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: sed -n '1,55p' Dockerfile
rg -n 'copi|copy|layer|couche|レイヤ|레이어|сло|katman|层|圖層|\.git' docs-site/src/content/docs/guides/remote-hub.md docs-site/src/content/docs/*/guides/remote-hub.mdRepository: lidge-jun/opencodex Length of output: 10219 🏁 Script executed: set -eu
printf '%s\n' '--- Dockerfile stages and relevant operations ---'
nl -ba Dockerfile | sed -n '1,150p'
printf '%s\n' '--- English canonical section ---'
nl -ba docs-site/src/content/docs/guides/remote-hub.md | sed -n '570,595p'
printf '%s\n' '--- Changed-file scope ---'
git diff --stat
git diff --name-only
printf '%s\n' '--- All locale claim lines ---'
rg -n '\.git|image layer|layer|镜像层|映像層|레이어|レイヤ|слой|сло|katman' docs-site/src/content/docs/*/guides/remote-hub.mdRepository: lidge-jun/opencodex Length of output: 13988 🏁 Script executed: set -eu
printf '%s\n' '--- Dockerfile stages and relevant operations ---'
nl -ba Dockerfile | sed -n '1,150p'
printf '%s\n' '--- English canonical section ---'
nl -ba docs-site/src/content/docs/guides/remote-hub.md | sed -n '570,595p'
printf '%s\n' '--- Changed-file scope ---'
git diff --stat
git diff --name-only
printf '%s\n' '--- All locale claim lines ---'
rg -n '\.git|image layer|layer|镜像层|映像層|레이어|レイヤ|слой|сло|katman|image katmanı' docs-site/src/content/docs/*/guides/remote-hub.mdRepository: lidge-jun/opencodex Length of output: 13988 Correct the When the Git-context branch runs, Replace the claim that Apply the correction to:
🧰 Tools🪛 LanguageTool[typographical] ~139-~139: Il manque une espace après le point. (ESPACE_APRES_POINT) [typographical] ~139-~139: Le trait d’union est employé sans espaces pour former des mots, alors que le tiret est encadré par des espaces et placé entre deux mots distincts. (TIRET) 🤖 Prompt for AI Agents |
||
|
|
||
| La construction rejette les manifestes périmés en comparant chaque SHA-256 aux fichiers du contexte puis de l’image. Les fichiers manquants ou divergents, les sources supplémentaires et les liens symboliques sont refusés. `package.json`, `bun.lock` et le seul fichier autorisé de `scripts/`, `scripts/model-metadata.source.json`, sont obligatoires. | ||
|
|
||
| ```bash | ||
| git clone https://github.com/lidge-jun/opencodex.git | ||
| cd opencodex | ||
| bun scripts/generate-compatibility-version.ts | ||
| docker compose build | ||
| openssl rand -hex 32 | docker compose run --rm -T hub bun run docker/bootstrap-token.ts | ||
| docker compose up -d | ||
| ``` | ||
|
|
||
| Pour construire directement depuis un contexte Git distant, conservez les métadonnées Git avec l’argument BuildKit intégré : | ||
|
|
||
| ```yaml | ||
| services: | ||
| hub: | ||
| pull_policy: build | ||
| build: | ||
| context: https://github.com/lidge-jun/opencodex.git#main | ||
| dockerfile: Dockerfile | ||
| target: runtime | ||
| args: | ||
| BUILDKIT_CONTEXT_KEEP_GIT_DIR: "1" | ||
| ``` | ||
|
Comment on lines
+153
to
+163
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: sed -n '595,625p' docs-site/src/content/docs/guides/remote-hub.md
sed -n '145,170p' docs-site/src/content/docs/fr/guides/remote-hub.md
sed -n '1,35p' compose.yaml
rg -n -B3 -A16 'BUILDKIT_CONTEXT_KEEP_GIT_DIR' README.md docs-site/src/content/docs/*/guides/remote-hub.md docs-site/src/content/docs/guides/remote-hub.mdRepository: lidge-jun/opencodex Length of output: 21378 🏁 Script executed: set -eu
for f in \
docs-site/src/content/docs/guides/remote-hub.md \
docs-site/src/content/docs/fr/guides/remote-hub.md \
docs-site/src/content/docs/ja/guides/remote-hub.md \
docs-site/src/content/docs/ko/guides/remote-hub.md \
docs-site/src/content/docs/ru/guides/remote-hub.md \
docs-site/src/content/docs/tr/guides/remote-hub.md \
docs-site/src/content/docs/zh-cn/guides/remote-hub.md \
docs-site/src/content/docs/zh-tw/guides/remote-hub.md
do
echo "=== $f ==="
rg -n -B4 -A16 'BUILDKIT_CONTEXT_KEEP_GIT_DIR' "$f"
done
echo '=== remote-hub locale files ==='
git ls-files 'docs-site/src/content/docs/*/guides/remote-hub.md'Repository: lidge-jun/opencodex Length of output: 11377 🏁 Script executed: set -eu
for f in \
docs-site/src/content/docs/fr/guides/remote-hub.md \
docs-site/src/content/docs/ja/guides/remote-hub.md \
docs-site/src/content/docs/ko/guides/remote-hub.md \
docs-site/src/content/docs/ru/guides/remote-hub.md \
docs-site/src/content/docs/tr/guides/remote-hub.md \
docs-site/src/content/docs/zh-cn/guides/remote-hub.md \
docs-site/src/content/docs/zh-tw/guides/remote-hub.md
do
echo "=== $f ==="
line=$(rg -n 'BUILDKIT_CONTEXT_KEEP_GIT_DIR' "$f" | cut -d: -f1)
start=$((line - 8))
end=$((line + 1))
sed -n "${start},${end}p" "$f"
doneRepository: lidge-jun/opencodex Length of output: 2146 Mark translated remote Compose snippets as build-block overrides. The canonical English guide states that this YAML replaces only the service’s Apply explicit override wording to all seven translated pages: 🤖 Prompt for AI Agents |
||
|
|
||
| Le conteneur s’exécute avec l’utilisateur non-root `bun`, un système de fichiers racine en lecture seule et uniquement le port `10100` publié. Ne publiez jamais `10101` et ne placez aucun secret dans `ARG`, `ENV`, `COPY`, Compose, l’historique d’image ou argv. Après le healthcheck, vérifiez séparément `/readyz`, le catalogue authentifié et une réponse réelle. `docker compose down` conserve le volume ; `docker compose down --volumes` supprime aussi la configuration, les identifiants et la clé. | ||
|
|
||
| - Hub indisponible : `ocx disconnect` restaure localement, mais la révocation reste à faire. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: lidge-jun/opencodex
Length of output: 9900
🤖 get_repo_knowledge executed:
get_repo_knowledge lidge-jun/opencodex /tmp/coderabbit-repo-knowledge/lidge-jun-opencodex-7afea732/learnings /tmp/coderabbit-repo-knowledge/lidge-jun-opencodex-7afea732/conventionsLength of output: 15627
🏁 Script executed:
Repository: lidge-jun/opencodex
Length of output: 50376
🏁 Script executed:
Repository: lidge-jun/opencodex
Length of output: 50376
Preserve Git split-index checkouts.
When
core.splitIndexis enabled,.git/indexreferences.git/sharedindex.*..dockerignore:15admits only.git/indexand.git/HEAD. The manifest stage copies those files into/gitdirand runsgit ls-fileswithGIT_DIR=/gitdir. Git cannot resolve the missing shared index, so manifest generation can fail in the documented local-clone workflow.A host-generated manifest is a workaround, so this is a narrow local-build failure. Add
!.git/sharedindex.*to.dockerignore, then copy all available shared-index files without failing for non-split-index checkouts:Place the loop after the existing copy at
Dockerfile:41.🤖 Prompt for AI Agents