mirror of
https://github.com/ModernRelay/omnigraph.git
synced 2026-06-27 02:39:38 +02:00
feat(docker): cluster-mode entrypoint and the CLI in the image
OMNIGRAPH_CLUSTER boots the container from a mounted cluster directory's applied revision — checked first and exclusive (exit 64 when combined with OMNIGRAPH_TARGET_URI/CONFIG/TARGET), the entrypoint-level mirror of the server's mode-inference rule 0. The omnigraph CLI joins the image so the day-2 loop (cluster apply/approve/status, data loads by explicit URI) runs in-container via docker/ECS exec or railway shell — no omnigraph.yaml required, which the cluster-local-config PR pins. entrypoint_test gains the cluster case plus all three exclusivity refusals. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
b8300736be
commit
d3ae31be08
4 changed files with 39 additions and 1 deletions
|
|
@ -9,6 +9,17 @@ fi
|
|||
|
||||
bind="${OMNIGRAPH_BIND:-0.0.0.0:8080}"
|
||||
|
||||
# Cluster mode first, and exclusive (the server's mode-inference rule 0):
|
||||
# a deployment serves from cluster state XOR omnigraph.yaml, never a merge.
|
||||
# Fail fast here with the same contract the server enforces.
|
||||
if [ -n "${OMNIGRAPH_CLUSTER:-}" ]; then
|
||||
if [ -n "${OMNIGRAPH_TARGET_URI:-}" ] || [ -n "${OMNIGRAPH_CONFIG:-}" ] || [ -n "${OMNIGRAPH_TARGET:-}" ]; then
|
||||
echo "OMNIGRAPH_CLUSTER is an exclusive boot source; unset OMNIGRAPH_TARGET_URI/OMNIGRAPH_CONFIG/OMNIGRAPH_TARGET" >&2
|
||||
exit 64
|
||||
fi
|
||||
exec "$SERVER_BIN" --cluster "${OMNIGRAPH_CLUSTER}" --bind "${bind}"
|
||||
fi
|
||||
|
||||
# URI comes from the env var (the positional arg wins over any config
|
||||
# `graphs` block in resolve_target_uri). OMNIGRAPH_CONFIG, when also set,
|
||||
# is forwarded as --config purely to supply a policy file — the two
|
||||
|
|
@ -28,6 +39,8 @@ fi
|
|||
|
||||
cat >&2 <<'EOF'
|
||||
omnigraph-server container startup requires one of:
|
||||
- OMNIGRAPH_CLUSTER (serve a cluster directory's applied revision;
|
||||
exclusive — cannot combine with the others)
|
||||
- OMNIGRAPH_TARGET_URI
|
||||
- OMNIGRAPH_CONFIG
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue