Skip to content

Commit 1c47b6a

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 1c47b6a

9 files changed

+284
-0
lines changed

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

Lines changed: 37 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,15 @@ 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-pip curl && \
24+
pip3 install --no-cache-dir yq uv git+https://github.com/lightspeed-core/lightspeed-evaluation.git#subdirectory=lsc_agent_eval && \
25+
dnf clean all
26+
USER 1000
27+
from: nested-podman
28+
to: assisted-chat-nested
1629
promotion:
1730
to:
1831
- name: assisted-chat-img
@@ -48,6 +61,30 @@ tests:
4861
ASSISTED_CHAT_TEST: rh-ecosystem-edge-assisted-chat-test
4962
ASSISTED_MCP_IMG: assisted-service-mcp
5063
workflow: rh-ecosystem-edge-assisted-chat
64+
- always_run: true
65+
as: eval-test-periodic
66+
cluster_claim:
67+
architecture: amd64
68+
cloud: aws
69+
owner: rh-ecosystem-edge
70+
product: ocp
71+
timeout: 1h0m0s
72+
version: "4.17"
73+
cron: 0 2 * * *
74+
steps:
75+
allow_best_effort_post_steps: true
76+
dependencies:
77+
ASSISTED_CHAT_IMG: rh-ecosystem-edge-assisted-chat-install
78+
ASSISTED_CHAT_TEST: rh-ecosystem-edge-assisted-chat-test
79+
ASSISTED_MCP_IMG: assisted-service-mcp
80+
workflow: rh-ecosystem-edge-assisted-chat
81+
- as: local-development
82+
capabilities:
83+
- nested-podman
84+
nested_podman: true
85+
optional: true
86+
steps:
87+
workflow: rh-ecosystem-edge-assisted-chat-local-development
5188
zz_generated_metadata:
5289
branch: main
5390
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,78 @@
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/*.json 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+
# Non-interactive ocm login if token present
19+
OCM_TOKEN_VALUE="${OCM_TOKEN:-}" || true
20+
if [ -z "$OCM_TOKEN_VALUE" ] && [ -d /var/run/secrets/sso-ci ]; then \
21+
for f in /var/run/secrets/sso-ci/*; do \
22+
if [ -f "$f" ]; then OCM_TOKEN_VALUE="$(cat "$f")"; break; fi; \
23+
done; \
24+
fi
25+
if [ -n "$OCM_TOKEN_VALUE" ]; then \
26+
ocm login --token "$OCM_TOKEN_VALUE" >/dev/null 2>&1 || true; \
27+
fi
28+
29+
# Try to obtain an access token for service calls
30+
if [ -z "${OCM_TOKEN:-}" ]; then \
31+
export OCM_TOKEN="$(ocm token 2>/dev/null || true)"; \
32+
fi
33+
34+
# Repo prep
35+
git submodule update --init --recursive
36+
# .env setup
37+
if [ ! -f .env ] && [ -f .env.template ]; then cp .env.template .env; fi
38+
if [ -n "${GEMINI_API_KEY:-}" ]; then \
39+
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; \
40+
fi
41+
# Do not write GOOGLE_APPLICATION_CREDENTIALS into .env; pod uses a fixed in-container path
42+
43+
# Ensure config dir exists
44+
mkdir -p config
45+
46+
# If Vertex creds path provided, copy it to the path expected by pod subPath mount
47+
if [ -n "${GOOGLE_APPLICATION_CREDENTIALS:-}" ] && [ -f "${GOOGLE_APPLICATION_CREDENTIALS}" ]; then \
48+
cp -f "${GOOGLE_APPLICATION_CREDENTIALS}" config/vertex-credentials.json; \
49+
fi
50+
51+
# Podman auth
52+
if [ -f /etc/pull-secret/.dockerconfigjson ]; then mkdir -p ${HOME}/.config/containers && cp /etc/pull-secret/.dockerconfigjson ${HOME}/.config/containers/auth.json; fi
53+
54+
# Generate config
55+
make generate || echo "make generate failed or interactive; proceeding with shim"
56+
if [ -n "${GEMINI_API_KEY:-}" ] && [ -z "${GOOGLE_APPLICATION_CREDENTIALS:-}" ]; then \
57+
mkdir -p config && [ -s config/vertex-credentials.json ] || printf '{}' > config/vertex-credentials.json; \
58+
fi
59+
60+
# Run workflow
61+
make build-images
62+
make run &
63+
# Wait briefly for service
64+
sleep 10
65+
66+
# Non-interactive sample query (replaces interactive "make query" step)
67+
BASE_URL="http://localhost:8090"
68+
if [ -n "${OCM_TOKEN:-}" ]; then \
69+
MODELS_JSON=$(curl -sS --max-time 10 -H "Authorization: Bearer ${OCM_TOKEN}" "${BASE_URL}/v1/models" || true); \
70+
SEL=$(echo "$MODELS_JSON" | jq -r '.models[] | select(.model_type=="llm") | "\(.provider_resource_id)|\(.provider_id)"' | head -n1 || true); \
71+
MODEL_NAME=$(echo "$SEL" | cut -d'|' -f1); MODEL_PROVIDER=$(echo "$SEL" | cut -d'|' -f2); \
72+
if [ -n "$MODEL_NAME" ] && [ -n "$MODEL_PROVIDER" ]; then \
73+
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; \
74+
fi; \
75+
fi
76+
77+
# Proceed to evaluation
78+
make test-eval
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,21 @@
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+
documentation: |
21+
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)