Loading
Match the default AI Gateway tag to the GitLab version, falling back by patch
Closes #41 (closed)
Plain up derived self-hosted-v<X.Y.Z>-ee from the GitLab version and failed at the pull when upstream had not published that patch. Today the derived tag is v19.5.6, which is unpublished; v19.5.5 is the newest. This MR makes the default match the GitLab version as closely as the registry allows, and says so.
flowchart TD
A[up starts the gateway] --> B{--aigw-branch, --aigw-mr or SIM_AIGW_IMAGE alone?}
B -- yes --> Z[No tag resolved: built or custom image]
B -- no --> C{SIM_AIGW_TAG set?}
C -- yes --> D[Use it as given]
D --> P[Pull: unpublished is fatal, no fallback]
C -- no --> E[Derive self-hosted-vX.Y.Z-ee from the GitLab version]
E --> F[List the minor's published tags, anonymous]
F --> G{Registry answered?}
G -- no --> H[Warn, use the exact tag unchecked]
G -- yes --> I{Exact tag published?}
I -- yes --> J[Use the exact tag]
I -- no --> K{Lower patch in the same minor?}
K -- yes --> L[Warn naming both tags, use the newest lower patch]
K -- no --> M[Fail: the minor has no published tag]
H --> P2[Pull]
J --> R[Record aigw_tag]
L --> R2[Record aigw_tag and aigw_tag_requested]
P2 --> RWhat changed
- With no tag set,
uplists the registry once (a pull-scoped token from the public auth endpoint, then the tag list; no credentials). It uses the exact tag when published, else the newest published lower patch of the same major.minor, with a warning that names both tags. - Patches compare numerically, so
19.5.10follows19.5.9. A patch above the requested one is never taken. - A minor with no published tag fails with a message saying so. A registry that cannot be read keeps the exact tag with a warning, and the pull decides, as before.
- An explicit
SIM_AIGW_TAGis never replaced; unpublished, it still fails at the pull and names the nearest tag.--aigw-branchand--aigw-mrnever resolve a tag. - State:
aigw_tagis the tag that ran. Newaigw_tag_requestedholds the tag wanted, set only after a fallback and cleared by the next exact start.status --jsoncarries it;schema_versionis 11. - This reverses the "never falls back" stance of !143 (merged) for the default path only.
Proof
- Resolver against the real registry for the default version
19.5.6: printsWARNING: AI Gateway tag self-hosted-v19.5.6-ee is unpublished; using self-hosted-v19.5.5-ee, the newest published patch below it in the same minorand resolves toself-hosted-v19.5.5-ee. - Engine self-test (stubbed registry listing): exact match used; fallback to the newest lower patch, including
19.5.10over19.5.9; no tag in the minor is fatal; unreadable registry keeps the exact tag; explicit unpublished tag is fatal at the pull;--aigw-mrunaffected; state records both keys and clears the requested one on an exact start. - Rig run, one omnibus rig (
sim-aigwm1), plainupwith no AI Gateway tag set: it logged the same warning, pulledself-hosted-v19.5.5-ee, and came upready.status --jsonshowedschema_version11,aigw_tagself-hosted-v19.5.5-eeandaigw_tag_requestedself-hosted-v19.5.6-ee; the gateway's/monitoring/healthzreturned 200. The rig is torn down and nosim-aigwminstance remains.
Word budget is unchanged at 40484 of 40489: the doc edit is paid for with equal cuts in aigw.md.
Edited by Andrew Dunn