[DO NOT MERGE] CI validation for #562 (llm-proxy behind hub, oidc images)#566
Draft
fabianvf wants to merge 23 commits into
Draft
[DO NOT MERGE] CI validation for #562 (llm-proxy behind hub, oidc images)#566fabianvf wants to merge 23 commits into
fabianvf wants to merge 23 commits into
Conversation
Signed-off-by: Jeff Ortel <jortel@redhat.com>
Signed-off-by: Jeff Ortel <jortel@redhat.com>
Signed-off-by: Jeff Ortel <jortel@redhat.com>
Signed-off-by: Jeff Ortel <jortel@redhat.com>
Signed-off-by: Jeff Ortel <jortel@redhat.com>
Signed-off-by: Jeff Ortel <jortel@redhat.com>
Signed-off-by: Jeff Ortel <jortel@redhat.com>
Signed-off-by: Jeff Ortel <jortel@redhat.com>
Signed-off-by: Jeff Ortel <jortel@redhat.com>
Signed-off-by: Jeff Ortel <jortel@redhat.com>
Signed-off-by: Jeff Ortel <jortel@redhat.com>
Signed-off-by: Jeff Ortel <jortel@redhat.com>
Signed-off-by: Jeff Ortel <jortel@redhat.com>
llm-proxy is now reached only through tackle2-hub's /services/llm-proxy reverse-proxy endpoint. The hub validates the bearer token, enforces the llm-proxy RBAC scope, and forwards user identity in the X-Hub-User / X-Hub-User-Attributes headers it injects in ServiceHandler.Forward. Operator changes: - Hub Deployment gains LLM_PROXY_URL env (only when kai_llm_proxy_enabled), pointing at the cluster-internal Service URL. Hub reads this at startup to register the llm-proxy route in its serviceRoutes map. - UI Deployment drops KAI_LLM_PROXY_URL; the new UI image's server-side proxy targets TACKLE_HUB_URL with pathRewrite /llm-proxy -> /services/llm-proxy. - llm-proxy ConfigMap drops the oauth2_token Keycloak JWKS auth block. llm-proxy itself does no token validation; the namespace NetworkPolicy is the only barrier against in-namespace callers bypassing the hub. Same trust posture as kai-solution-server today. - Renamed kai_llm_proxy_url -> kai_llm_proxy_internal_url to signal "only hub should call this directly". - test-llm-proxy.sh rewritten for the new auth flow: uses HTTP Basic Auth against hub's seeded admin user and hits the LLM through /hub/services/llm-proxy/* so the test path goes through the existing /hub UI proxy and does not depend on the new tackle2-ui image. Companion changes required in: - tackle2-hub: register llm-proxy in serviceRoutes + inject X-Hub-User identity headers in ServiceHandler.Forward. - tackle2-ui: server/src/proxies.js retargets /llm-proxy at TACKLE_HUB_URL with pathRewrite to /services/llm-proxy. (Browser use only; not needed for the e2e test in this PR.) Based on PR konveyor#562 (Keycloak dependency removal / hub OIDC provider).
✨ Route llm-proxy through hub /services/llm-proxy
The "Set federated IDP issuer" set_fact guarded the conditionally- registered rhsso_keycloak_cr / rhbk_keycloak_cr vars with `is defined`. Those k8s_info tasks only run `when: app_profile == 'mta'`; on other profiles they are skipped, but a skipped task still registers a result dict that has no `.resources` key. `is defined` is True for that dict, so the template then evaluated `.resources` and failed with "'dict object' has no attribute 'resources'", aborting the reconcile before any workloads were created. Keep the `is defined` guard (short-circuits a genuinely undefined var) and add `default([])` on `.resources` so the skipped-register case (defined dict, missing attribute) collapses to an empty list. Signed-off-by: Fabian von Feilitzsch <fabian@fabianism.us>
"Set app base URL from UI Ingress" (and the matching Hub OIDC issuer task) read ui_ingress_info.resources[0].spec.rules[0].host, guarded only by `resources | length > 0`. The default UI Ingress (ingress-ui.yml.j2) defines a host-less rule (`- http:` with no `host:`), so on any non-OpenShift cluster (e.g. minikube CI) the rule exists but has no `host` key, and the template failed with "'dict object' has no attribute 'host'", aborting the reconcile before llm-proxy / kai-db were created. Add a `...rules[0].host is defined` guard to both tasks so a host-less Ingress leaves app_base_url / hub_oidc_issuer at their defaults instead of crashing. Signed-off-by: Fabian von Feilitzsch <fabian@fabianism.us>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Do not merge. Points the hub/ui images at jortel's personal quay :oidc tags (the OIDC-provider hub from tackle2-hub#1042 and the matching UI) so the draft CI on operator#562 can exercise the real hub-OIDC auth flow instead of crashing on the stale keycloak-based :latest images. Source of truth is helm/values.yaml (make bundle regenerates the CSV from the helm chart); the bundle CSV is updated to match. The real bundle must pin published konveyor images. Signed-off-by: Fabian von Feilitzsch <fabian@fabianism.us>
Two changes so the OIDC stack comes up on minikube CI: - deployment-ui.yml.j2: re-add KAI_LLM_PROXY_URL (gated on kai_llm_proxy_enabled) so the current UI image, which still proxies /llm-proxy directly, boots. Marked TODO to remove once a UI image that routes /llm-proxy through the hub is published. The hub reaches llm-proxy via LLM_PROXY_URL, not this. - llm-proxy-test.yml: the hub's builtin OIDC provider requires an issuer derived from app_base_url; minikube's Ingress is host-less, so supply app_base_url from the minikube IP via the test CR. Signed-off-by: Fabian von Feilitzsch <fabian@fabianism.us>
- main.yml: derive hub_oidc_issuer whenever app_base_url is set (not only when an ingress host exists), and re-apply the Hub Deployment after the issuer is derived. The hub is created earlier in the play (before the UI Route/Ingress), so without the re-apply it always starts with an empty OIDC_ISSUER and the builtin provider refuses to boot. - test-llm-proxy.sh: port-forward to the hub Service and hit /services/llm-proxy directly, instead of via the UI's /hub proxy, so the llm-proxy test validates the hub auth+route path without depending on the UI image. Signed-off-by: Fabian von Feilitzsch <fabian@fabianism.us>
kai_database_image_fqin aliased keycloak_database_image_fqin to reuse the shared postgres image for the llm-proxy DB. 562 deleted that var, leaving a dangling reference that failed reconcile with "AnsibleUndefinedVariable: keycloak_database_image_fqin is undefined". Source the same image from RELATED_IMAGE_TACKLE_POSTGRES directly. Signed-off-by: Fabian von Feilitzsch <fabian@fabianism.us>
The llm-proxy test reaches the hub directly and does not exercise the UI. Until a UI image matching 562's OIDC env contract is published, run the UI at 0 replicas so the install's deployment-readiness gate isn't blocked by the crashlooping UI image. Test-only; revert when a working UI image exists. Signed-off-by: Fabian von Feilitzsch <fabian@fabianism.us>
- workflow debug step: also dump tackle-hub logs on failure - test-llm-proxy.sh: capture and print the HTTP status code + body on a failed chat-completion request, so auth (401/403) vs route/forward (5xx) failures are distinguishable Signed-off-by: Fabian von Feilitzsch <fabian@fabianism.us>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft / do-not-merge. Scratch PR to run the real
llm-proxy-testCI against jortel'soidcbranch (#562) plus fixes, iterating to green before #562 merges.Contains, on top of #562:
:bug:fix for the line-575 reconcile crash (skipped Keycloak-detection register lacks.resources).:bug:fix for the line-753 reconcile crash (host-less UI Ingress has no.spec.rules[0].host).quay.io/jortel/tackle2-hub:oidcandquay.io/jortel/tackle2-ui:oidc, so CI exercises the real hub-OIDC auth flow instead of the stale keycloak-based:latestimages.(1) and (2) land cleanly via jortel#2 →
jortel:oidc. (3) is throwaway. Base ismainso the diff shows all of #562 + these.Refs: #562, konveyor/tackle2-hub#1042