Skip to content

Commit 2617dd0

Browse files
authored
ci(eval): migrate gatekeeper eval jobs to Vertex AI and update model … (#450)
ci(eval): migrate gatekeeper eval jobs to Vertex AI and update model lineup Add gatekeeper evaluation jobs with Vertex AI, using service account credentials downloaded via GitLab secure files. Add a new setup job (download-secure-files) to fetch credentials, and configure GOOGLE_APPLICATION_CREDENTIALS in the eval base template. Model changes: - Add Vertex AI jobs: gpt-oss-120b, gemini-3.1-pro-preview - Add Models.corp jobs: granite-4.0-h-small - Remove claude-4.6-opus (OpenRouter) job
1 parent bd9b242 commit 2617dd0

2 files changed

Lines changed: 82 additions & 10 deletions

File tree

.gitlab/ci/CREDENTIALS.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# GitLab CI Credentials
2+
3+
This document describes the credentials used by the GitLab CI pipelines and how they were provisioned.
4+
5+
## CI/CD Variables
6+
7+
These are configured in **Settings > CI/CD > Variables** on the GitLab project.
8+
9+
### `GITLAB_TOKEN`
10+
11+
- **Used by:** `mirror.yml` (PR mirroring workflow)
12+
- **Purpose:** Pushes mirrored GitHub PR branches into the GitLab repo.
13+
- **Type:** Personal or Project Access Token with `write_repository` scope.
14+
- **How to create:** GitLab > Settings > Access Tokens > create a token with `write_repository`. Then add it as a CI/CD variable (Protected + Masked).
15+
16+
### `MODELS_CORP_*_API_KEY`
17+
18+
- **Used by:** `eval-gatekeeper.yml` (models.corp eval jobs)
19+
- **Purpose:** Authenticates against the internal Red Hat model platform (`models.corp.redhat.com`) to run gatekeeper evals. Each variable follows the pattern `MODELS_CORP_<MODEL_NAME>_API_KEY` (e.g. `MODELS_CORP_GPT_OSS_20B_API_KEY`, `MODELS_CORP_GRANITE_4_0_H_SMALL_API_KEY`).
20+
- **Type:** API key issued by models.corp.
21+
- **How to create:** Check [models.corp user documentation](https://gitlab.cee.redhat.com/models-corp/user-documentation) for requesting an API key. Add it as a CI/CD variable (Protected + Masked). When adding a new models.corp eval job, create a corresponding variable following the naming convention.
22+
23+
## Secure Files
24+
25+
These are uploaded via **Settings > CI/CD > Secure Files** and downloaded at runtime by the `download-secure-files` job using `glab securefile download`.
26+
27+
### `gatekeeper-eval-service-account-credential.json`
28+
29+
- **Used by:** `eval-gatekeeper.yml` (all Vertex AI eval jobs, via `GOOGLE_APPLICATION_CREDENTIALS`)
30+
- **Purpose:** Authenticates to the Google Cloud project `rhel-lightspeed-650189` to call Vertex AI model endpoints (e.g. `gpt-oss-120b-maas`, `gemini-3.1-pro-preview`).
31+
- **Type:** Google Cloud Service Account key (JSON).
32+
- **How it was created:**
33+
1. In the GCP console for project `rhel-lightspeed-650189`, a service account was created with the Vertex AI User role (or equivalent).
34+
2. A JSON key was exported for that service account.
35+
3. The JSON key file was uploaded to GitLab at **Settings > CI/CD > Secure Files**.
36+
- **Rotation:** Generate a new JSON key in GCP, re-upload to Secure Files, and delete the old key.

.gitlab/ci/eval-gatekeeper.yml

Lines changed: 46 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,19 @@ setup-uv-and-mcp-apps:
2424
- mcp-app/dist/
2525
expire_in: 1 hour
2626

27+
download-secure-files:
28+
stage: setup
29+
image: registry.gitlab.com/gitlab-org/cli:latest
30+
script:
31+
- mkdir -p securefiles
32+
- glab auth login --job-token $CI_JOB_TOKEN --hostname $CI_SERVER_FQDN --api-protocol $CI_SERVER_PROTOCOL
33+
- glab -R $CI_PROJECT_PATH securefile download --all --output-dir="./securefiles"
34+
- cd securefiles && ls
35+
artifacts:
36+
paths:
37+
- securefiles/
38+
39+
2740
# ==========================================
2841
# EVAL WORKFLOW - TEMPLATES
2942
# ==========================================
@@ -34,13 +47,26 @@ setup-uv-and-mcp-apps:
3447
needs:
3548
- job: setup-uv-and-mcp-apps
3649
artifacts: true
50+
- job: download-secure-files
51+
artifacts: true
52+
3753
before_script:
54+
# Add path of UV executable to PATH & Install dependencies
3855
- export PATH="$CI_PROJECT_DIR/.local/bin:$PATH"
3956
- uv sync --locked
57+
58+
# Create data/ to store the evaluation result
4059
- mkdir -p "$CI_PROJECT_DIR/data"
60+
61+
# Download Red Hat CA certifacate and combine it with root CA
4162
- export SSL_CERT_FILE="$CI_PROJECT_DIR/cert.pem"
4263
- cp /etc/ssl/certs/ca-certificates.crt $SSL_CERT_FILE
4364
- curl https://certs.corp.redhat.com/certs/2022-IT-Root-CA.pem >> $SSL_CERT_FILE
65+
66+
# Setup environment variables for Vertex AI
67+
- export GOOGLE_APPLICATION_CREDENTIALS="$CI_PROJECT_DIR/securefiles/gatekeeper-eval-service-account-credential.json"
68+
- export VERTEXAI_PROJECT="rhel-lightspeed-650189"
69+
- export VERTEXAI_LOCATION="global"
4470
artifacts:
4571
paths:
4672
- data/
@@ -49,26 +75,36 @@ setup-uv-and-mcp-apps:
4975
# ==========================================
5076
# EVAL WORKFLOW - JOBS
5177
# ==========================================
52-
gatekeeper-eval-claude-4.6-opus:
78+
79+
# Vertex AI
80+
gatekeeper-eval-gpt-oss-120b:
5381
extends: .eval-base
5482
variables:
55-
MODEL_NAME: "claude-4.6-opus"
83+
MODEL_NAME: "gpt-oss-120b"
5684
script:
57-
- export LINUX_MCP_GATEKEEPER_MODEL="openrouter/anthropic/$MODEL_NAME"
58-
- uv run eval/gatekeeper/run-eval.py --all -f json --output-all -o "$CI_PROJECT_DIR/data/$MODEL_NAME.json"
59-
rules:
60-
- if: $OPENROUTER_API_KEY
85+
- export LINUX_MCP_GATEKEEPER_MODEL="vertex_ai/openai/$MODEL_NAME-maas"
86+
- uv run --extra gcp eval/gatekeeper/run-eval.py --all -f json --output-all -o "$CI_PROJECT_DIR/data/$MODEL_NAME.json"
6187

62-
gatekeeper-eval-models-corp-gemini:
88+
gatekeeper-eval-gemini-3.1-pro-preview:
6389
extends: .eval-base
6490
variables:
6591
MODEL_NAME: "gemini-3.1-pro-preview"
6692
script:
67-
- export OPENAI_API_KEY="$MODELS_CORP_GEMINI_API_KEY"
68-
- export MODEL="$MODEL_NAME"
93+
- export LINUX_MCP_GATEKEEPER_MODEL="vertex_ai/$MODEL_NAME"
94+
- uv run --extra gcp eval/gatekeeper/run-eval.py --all -f json --output-all -o "$CI_PROJECT_DIR/data/$MODEL_NAME.json"
95+
96+
97+
# Models.corp
98+
gatekeeper-eval-models-corp-granite-4.0-h-small:
99+
extends: .eval-base
100+
variables:
101+
MODEL_NAME: "granite-4.0-h-small"
102+
script:
103+
- export OPENAI_API_KEY="$MODELS_CORP_GRANITE_4_0_H_SMALL_API_KEY"
104+
- export MODEL="ibm-granite/$MODEL_NAME"
69105
- ./eval/gatekeeper/run-eval-models-corp.sh --all -f json --output-all -o "$CI_PROJECT_DIR/data/$MODEL_NAME.json"
70106
rules:
71-
- if: $MODELS_CORP_GEMINI_API_KEY
107+
- if: $MODELS_CORP_GRANITE_4_0_H_SMALL_API_KEY
72108

73109
gatekeeper-eval-models-corp-gpt-oss-20b:
74110
extends: .eval-base

0 commit comments

Comments
 (0)