Skip to content

Commit edee74a

Browse files
committed
new CI jobs for assisted-chat
- local dev presubmit job for assisted-chat - periodic check for eval-test
1 parent 3cdce7c commit edee74a

9 files changed

+306
-0
lines changed

ci-operator/config/rh-ecosystem-edge/assisted-chat/rh-ecosystem-edge-assisted-chat-main.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ base_images:
33
name: assisted-chat-img
44
namespace: edge-infrastructure
55
tag: assisted-service-mcp
6+
nested-podman:
7+
name: nested-podman
8+
namespace: ci
9+
tag: latest
610
build_root:
711
image_stream_tag:
812
name: release
@@ -13,6 +17,17 @@ images:
1317
to: rh-ecosystem-edge-assisted-chat-install
1418
- dockerfile_path: test/prow/Dockerfile
1519
to: rh-ecosystem-edge-assisted-chat-test
20+
- dockerfile_literal: |
21+
FROM nested-podman
22+
USER root
23+
RUN dnf install -y make git jq fzf python3.11 python3.11-pip && \
24+
ln -sf /usr/bin/python3.11 /usr/local/bin/python && \
25+
python3.11 -m pip install --no-cache-dir yq uv git+https://github.com/lightspeed-core/lightspeed-evaluation.git#subdirectory=lsc_agent_eval && \
26+
dnf clean all
27+
COPY . .
28+
USER 1000
29+
from: nested-podman
30+
to: assisted-chat-nested
1631
promotion:
1732
to:
1833
- name: assisted-chat-img
@@ -48,6 +63,30 @@ tests:
4863
ASSISTED_CHAT_TEST: rh-ecosystem-edge-assisted-chat-test
4964
ASSISTED_MCP_IMG: assisted-service-mcp
5065
workflow: rh-ecosystem-edge-assisted-chat
66+
- always_run: true
67+
as: eval-test-periodic
68+
cluster_claim:
69+
architecture: amd64
70+
cloud: aws
71+
owner: rh-ecosystem-edge
72+
product: ocp
73+
timeout: 1h0m0s
74+
version: "4.17"
75+
cron: 0 2 * * *
76+
steps:
77+
allow_best_effort_post_steps: true
78+
dependencies:
79+
ASSISTED_CHAT_IMG: rh-ecosystem-edge-assisted-chat-install
80+
ASSISTED_CHAT_TEST: rh-ecosystem-edge-assisted-chat-test
81+
ASSISTED_MCP_IMG: assisted-service-mcp
82+
workflow: rh-ecosystem-edge-assisted-chat
83+
- as: local-development
84+
capabilities:
85+
- nested-podman
86+
nested_podman: true
87+
optional: true
88+
steps:
89+
workflow: rh-ecosystem-edge-assisted-chat-local-development
5190
zz_generated_metadata:
5291
branch: main
5392
org: rh-ecosystem-edge
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
periodics:
2+
- agent: kubernetes
3+
cluster: build05
4+
cron: 0 2 * * *
5+
decorate: true
6+
decoration_config:
7+
skip_cloning: true
8+
extra_refs:
9+
- base_ref: main
10+
org: rh-ecosystem-edge
11+
repo: assisted-chat
12+
labels:
13+
ci.openshift.io/generator: prowgen
14+
pj-rehearse.openshift.io/can-be-rehearsed: "true"
15+
name: periodic-ci-rh-ecosystem-edge-assisted-chat-main-eval-test-periodic
16+
spec:
17+
containers:
18+
- args:
19+
- --gcs-upload-secret=/secrets/gcs/service-account.json
20+
- --hive-kubeconfig=/secrets/hive-hive-credentials/kubeconfig
21+
- --image-import-pull-secret=/etc/pull-secret/.dockerconfigjson
22+
- --report-credentials-file=/etc/report/credentials
23+
- --secret-dir=/secrets/ci-pull-credentials
24+
- --target=eval-test-periodic
25+
command:
26+
- ci-operator
27+
image: ci-operator:latest
28+
imagePullPolicy: Always
29+
name: ""
30+
resources:
31+
requests:
32+
cpu: 10m
33+
volumeMounts:
34+
- mountPath: /secrets/ci-pull-credentials
35+
name: ci-pull-credentials
36+
readOnly: true
37+
- mountPath: /secrets/gcs
38+
name: gcs-credentials
39+
readOnly: true
40+
- mountPath: /secrets/hive-hive-credentials
41+
name: hive-hive-credentials
42+
readOnly: true
43+
- mountPath: /secrets/manifest-tool
44+
name: manifest-tool-local-pusher
45+
readOnly: true
46+
- mountPath: /etc/pull-secret
47+
name: pull-secret
48+
readOnly: true
49+
- mountPath: /etc/report
50+
name: result-aggregator
51+
readOnly: true
52+
serviceAccountName: ci-operator
53+
volumes:
54+
- name: ci-pull-credentials
55+
secret:
56+
secretName: ci-pull-credentials
57+
- name: hive-hive-credentials
58+
secret:
59+
secretName: hive-hive-credentials
60+
- name: manifest-tool-local-pusher
61+
secret:
62+
secretName: manifest-tool-local-pusher
63+
- name: pull-secret
64+
secret:
65+
secretName: registry-pull-credentials
66+
- name: result-aggregator
67+
secret:
68+
secretName: result-aggregator

ci-operator/jobs/rh-ecosystem-edge/assisted-chat/rh-ecosystem-edge-assisted-chat-main-presubmits.yaml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,67 @@ presubmits:
125125
secret:
126126
secretName: result-aggregator
127127
trigger: (?m)^/test( | .* )images,?($|\s.*)
128+
- agent: kubernetes
129+
always_run: true
130+
branches:
131+
- ^main$
132+
- ^main-
133+
cluster: build02
134+
context: ci/prow/local-development
135+
decorate: true
136+
decoration_config:
137+
skip_cloning: true
138+
labels:
139+
capability/nested-podman: nested-podman
140+
ci.openshift.io/generator: prowgen
141+
pj-rehearse.openshift.io/can-be-rehearsed: "true"
142+
name: pull-ci-rh-ecosystem-edge-assisted-chat-main-local-development
143+
optional: true
144+
rerun_command: /test local-development
145+
spec:
146+
containers:
147+
- args:
148+
- --gcs-upload-secret=/secrets/gcs/service-account.json
149+
- --image-import-pull-secret=/etc/pull-secret/.dockerconfigjson
150+
- --report-credentials-file=/etc/report/credentials
151+
- --secret-dir=/secrets/ci-pull-credentials
152+
- --target=local-development
153+
command:
154+
- ci-operator
155+
image: ci-operator:latest
156+
imagePullPolicy: Always
157+
name: ""
158+
resources:
159+
requests:
160+
cpu: 10m
161+
volumeMounts:
162+
- mountPath: /secrets/ci-pull-credentials
163+
name: ci-pull-credentials
164+
readOnly: true
165+
- mountPath: /secrets/gcs
166+
name: gcs-credentials
167+
readOnly: true
168+
- mountPath: /secrets/manifest-tool
169+
name: manifest-tool-local-pusher
170+
readOnly: true
171+
- mountPath: /etc/pull-secret
172+
name: pull-secret
173+
readOnly: true
174+
- mountPath: /etc/report
175+
name: result-aggregator
176+
readOnly: true
177+
serviceAccountName: ci-operator
178+
volumes:
179+
- name: ci-pull-credentials
180+
secret:
181+
secretName: ci-pull-credentials
182+
- name: manifest-tool-local-pusher
183+
secret:
184+
secretName: manifest-tool-local-pusher
185+
- name: pull-secret
186+
secret:
187+
secretName: registry-pull-credentials
188+
- name: result-aggregator
189+
secret:
190+
secretName: result-aggregator
191+
trigger: (?m)^/test( | .* )local-development,?($|\s.*)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Fetched from https://github.com/rh-ecosystem-edge/assisted-chat root OWNERS
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
# Read credentials from mounted secrets (set both if present)
5+
GEM_KEY=""; if [ -d /var/run/secrets/gemini ]; then for f in /var/run/secrets/gemini/*; do if [ -f "$f" ]; then GEM_KEY="$(cat "$f")"; break; fi; done; fi
6+
VJSON=""; if [ -d /var/run/secrets/vertex ]; then VJSON="$(ls /var/run/secrets/vertex/service_account 2>/dev/null | head -n1)" || true; fi
7+
if [ -n "$GEM_KEY" ]; then export GEMINI_API_KEY="$GEM_KEY"; fi
8+
if [ -n "$VJSON" ]; then export GOOGLE_APPLICATION_CREDENTIALS="$VJSON"; fi
9+
10+
# Ensure ocm is available
11+
export PATH="${HOME}/.local/bin:${PATH}"
12+
if ! command -v ocm >/dev/null 2>&1; then \
13+
mkdir -p "${HOME}/.local/bin" && \
14+
curl -sSL -o "${HOME}/.local/bin/ocm" "https://github.com/openshift-online/ocm-cli/releases/latest/download/ocm-linux-amd64" && \
15+
chmod +x "${HOME}/.local/bin/ocm"; \
16+
fi
17+
18+
# OCM auth: support either raw JWT token or client credentials
19+
OCM_TOKEN_VALUE="${OCM_TOKEN:-}" || true
20+
if [ -z "$OCM_TOKEN_VALUE" ] && [ -d /var/run/secrets/sso-ci ]; then \
21+
FIRST_FILE=$(ls -1 /var/run/secrets/sso-ci/* 2>/dev/null | head -n1 || true); \
22+
if [ -n "$FIRST_FILE" ] && [ -f "$FIRST_FILE" ]; then OCM_TOKEN_VALUE="$(cat "$FIRST_FILE" 2>/dev/null || true)"; fi; \
23+
fi
24+
# If token looks like a JWT (has two dots), login with --token; otherwise try client credentials
25+
if [ -n "$OCM_TOKEN_VALUE" ] && echo "$OCM_TOKEN_VALUE" | grep -qE '^[^\.]+\.[^\.]+\.[^\.]+$'; then \
26+
ocm login --token "$OCM_TOKEN_VALUE" >/dev/null 2>&1 || true; \
27+
else \
28+
CID_FILE=$(ls -1 /var/run/secrets/sso-ci/*id* 2>/dev/null | head -n1 || true); \
29+
CSEC_FILE=$(ls -1 /var/run/secrets/sso-ci/*secret* 2>/dev/null | head -n1 || true); \
30+
CLIENT_ID=""; CLIENT_SECRET=""; \
31+
if [ -n "$CID_FILE" ] && [ -f "$CID_FILE" ]; then CLIENT_ID="$(cat "$CID_FILE" 2>/dev/null || true)"; fi; \
32+
if [ -n "$CSEC_FILE" ] && [ -f "$CSEC_FILE" ]; then CLIENT_SECRET="$(cat "$CSEC_FILE" 2>/dev/null || true)"; fi; \
33+
if [ -n "$CLIENT_ID" ] && [ -n "$CLIENT_SECRET" ]; then \
34+
ocm login --client-id "$CLIENT_ID" --client-secret "$CLIENT_SECRET" >/dev/null 2>&1 || true; \
35+
fi; \
36+
fi
37+
# Obtain access token if possible
38+
if [ -z "${OCM_TOKEN:-}" ]; then \
39+
export OCM_TOKEN="$(ocm token 2>/dev/null || true)"; \
40+
fi
41+
42+
# Repo prep
43+
git submodule update --init --recursive
44+
# .env setup
45+
if [ ! -f .env ] && [ -f .env.template ]; then cp .env.template .env; fi
46+
if [ -n "${GEMINI_API_KEY:-}" ]; then \
47+
if grep -q '^GEMINI_API_KEY=' .env 2>/dev/null; then sed -i "s/^GEMINI_API_KEY=.*/GEMINI_API_KEY=${GEMINI_API_KEY//\//\\/}/" .env; else echo "GEMINI_API_KEY=${GEMINI_API_KEY}" >> .env; fi; \
48+
fi
49+
# Do not write GOOGLE_APPLICATION_CREDENTIALS into .env; pod uses a fixed in-container path
50+
51+
# Ensure config dir exists
52+
mkdir -p config
53+
54+
# If Vertex creds path provided, copy it to the path expected by pod subPath mount
55+
if [ -n "${GOOGLE_APPLICATION_CREDENTIALS:-}" ] && [ -f "${GOOGLE_APPLICATION_CREDENTIALS}" ]; then \
56+
cp -f "${GOOGLE_APPLICATION_CREDENTIALS}" config/vertex-credentials.json; \
57+
fi
58+
59+
# Podman auth
60+
if [ -f /etc/pull-secret/.dockerconfigjson ]; then mkdir -p ${HOME}/.config/containers && cp /etc/pull-secret/.dockerconfigjson ${HOME}/.config/containers/auth.json; fi
61+
62+
# Generate config
63+
make generate || echo "make generate failed or interactive; proceeding with shim"
64+
if [ -n "${GEMINI_API_KEY:-}" ] && [ -z "${GOOGLE_APPLICATION_CREDENTIALS:-}" ]; then \
65+
mkdir -p config && [ -s config/vertex-credentials.json ] || printf '{}' > config/vertex-credentials.json; \
66+
fi
67+
68+
# Create a fake cert.pem file to satisfy the build
69+
touch /etc/pki/consumer/cert.pem
70+
71+
# Run workflow
72+
make build-images
73+
make run &
74+
75+
# Readiness wait with timeout (up to 90s)
76+
BASE_URL="http://localhost:8090"
77+
for i in $(seq 1 18); do \
78+
if curl -sS --max-time 5 "${BASE_URL}/healthz" >/dev/null 2>&1; then echo "service ready"; break; fi; \
79+
sleep 5; \
80+
if [ "$i" -eq 18 ]; then echo "service failed to become ready in time"; fi; \
81+
done
82+
83+
# Non-interactive sample query (guarded by token and readiness)
84+
if [ -n "${OCM_TOKEN:-}" ]; then \
85+
MODELS_JSON=$(curl -sS --max-time 10 -H "Authorization: Bearer ${OCM_TOKEN}" "${BASE_URL}/v1/models" || true); \
86+
SEL=$(echo "$MODELS_JSON" | jq -r '.models[] | select(.model_type=="llm") | "\(.provider_resource_id)|\(.provider_id)"' | head -n1 || true); \
87+
MODEL_NAME=$(echo "$SEL" | cut -d'|' -f1); MODEL_PROVIDER=$(echo "$SEL" | cut -d'|' -f2); \
88+
if [ -n "$MODEL_NAME" ] && [ -n "$MODEL_PROVIDER" ]; then \
89+
curl -sS --max-time 15 -H "Authorization: Bearer ${OCM_TOKEN}" "${BASE_URL}/v1/query" --json '{"model":"'"$MODEL_NAME"'","provider":"'"$MODEL_PROVIDER"'","query":"hello"}' >/dev/null || true; \
90+
fi; \
91+
fi
92+
93+
# Proceed to evaluation
94+
make test-eval
95+
96+
# Stop the pod
97+
make stop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"path": "rh-ecosystem-edge/assisted-chat/local-development/rh-ecosystem-edge-assisted-chat-local-development-ref.yaml",
3+
"owners": {}
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
ref:
2+
as: rh-ecosystem-edge-assisted-chat-local-development
3+
from: assisted-chat-nested
4+
cli: latest
5+
commands: rh-ecosystem-edge-assisted-chat-local-development-commands.sh
6+
credentials:
7+
- namespace: test-credentials
8+
name: assisted-chat-gemini-api-key
9+
mount_path: /var/run/secrets/gemini
10+
- namespace: test-credentials
11+
name: assisted-chat-vertex-service-account
12+
mount_path: /var/run/secrets/vertex
13+
- namespace: test-credentials
14+
name: assisted-chat-sso-ci
15+
mount_path: /var/run/secrets/sso-ci
16+
resources:
17+
requests:
18+
cpu: 1000m
19+
memory: 1Gi
20+
grace_period: 30s
21+
documentation: |
22+
Runs assisted-chat local development validation with nested Podman.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"path": "rh-ecosystem-edge/assisted-chat/local-development/rh-ecosystem-edge-assisted-chat-local-development-workflow.yaml",
3+
"owners": {}
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
workflow:
2+
as: rh-ecosystem-edge-assisted-chat-local-development
3+
steps:
4+
test:
5+
- ref: rh-ecosystem-edge-assisted-chat-local-development
6+
documentation: |
7+
Workflow to run assisted-chat local development validation in CI.

0 commit comments

Comments
 (0)