Skip to content

Commit 05c5c80

Browse files
authored
feat: Add helm chart (#17)
1 parent e2207a6 commit 05c5c80

19 files changed

Lines changed: 1801 additions & 55 deletions

.github/workflows/ci.yml

Lines changed: 23 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,31 @@
1-
name: CI
1+
name: Check
22

33
on:
4-
workflow_dispatch:
5-
pull_request:
64
push:
75
branches:
86
- main
97
- 'renovate/**'
8+
pull_request:
109

1110
jobs:
12-
check:
13-
name: Code Quality Checks
11+
python:
1412
runs-on: ubuntu-latest
15-
1613
steps:
17-
- name: Clone the code
18-
uses: 'actions/checkout@v5'
14+
- name: Checkout
15+
uses: 'actions/checkout@v6'
1916

2017
- name: Install uv
21-
uses: 'astral-sh/setup-uv@v6'
18+
uses: 'astral-sh/setup-uv@v7'
2219
with:
23-
version: "0.8.17"
20+
version: "0.9.26"
2421
enable-cache: true
2522

26-
- name: Setup Python
27-
uses: 'actions/setup-python@v6'
28-
with:
29-
python-version-file: ".python-version"
30-
3123
- name: Install Dependencies
3224
run: uv sync
3325

3426
- name: Run Checks
3527
run: uv run poe check
3628

37-
test:
38-
name: Unit Tests
39-
runs-on: ubuntu-latest
40-
permissions:
41-
contents: 'read'
42-
43-
steps:
44-
- name: Clone the code
45-
uses: 'actions/checkout@v5'
46-
47-
- name: Install uv
48-
uses: 'astral-sh/setup-uv@v6'
49-
with:
50-
version: "0.8.17"
51-
enable-cache: true
52-
53-
- name: Setup Python
54-
uses: 'actions/setup-python@v6'
55-
with:
56-
python-version-file: ".python-version"
57-
58-
- name: Install Dependencies
59-
run: uv sync
60-
6129
- name: Run Tests
6230
run: uv run poe test
6331

@@ -83,6 +51,20 @@ jobs:
8351
with:
8452
github_token: ${{ secrets.GITHUB_TOKEN }}
8553

54+
helm:
55+
runs-on: ubuntu-latest
56+
steps:
57+
- name: Checkout
58+
uses: 'actions/checkout@v6'
59+
60+
- name: Install Helm
61+
uses: azure/setup-helm@v4
62+
with:
63+
version: 'v3.14.0'
64+
65+
- name: Lint Helm Chart
66+
run: helm lint chart/
67+
8668
test-e2e:
8769
name: E2E Tests
8870
runs-on: ubuntu-latest
@@ -92,8 +74,8 @@ jobs:
9274
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
9375

9476
steps:
95-
- name: Clone the code
96-
uses: 'actions/checkout@v5'
77+
- name: Checkout
78+
uses: 'actions/checkout@v6'
9779

9880
- name: Extract image tag
9981
id: extract-tag

.github/workflows/release.yml

Lines changed: 65 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@ jobs:
1212
permissions:
1313
contents: write
1414
packages: write
15-
id-token: write
1615

1716
steps:
18-
- name: 'Checkout'
19-
uses: 'actions/checkout@v5'
17+
- name: Checkout
18+
uses: 'actions/checkout@v6'
2019
with:
2120
fetch-depth: 0
2221

@@ -50,3 +49,66 @@ jobs:
5049
--title="${tag#v}" \
5150
--generate-notes \
5251
install.yaml
52+
53+
helm-chart:
54+
runs-on: ubuntu-latest
55+
permissions:
56+
contents: read
57+
packages: write
58+
59+
steps:
60+
- name: Checkout
61+
uses: 'actions/checkout@v6'
62+
with:
63+
fetch-depth: 0
64+
65+
- name: Install Helm
66+
uses: azure/setup-helm@v4
67+
with:
68+
version: 'v3.14.0'
69+
70+
- name: Determine Chart Version
71+
id: version
72+
run: |
73+
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
74+
# For tags: use semver (e.g., v1.2.3 → 1.2.3)
75+
VERSION="${{ github.ref_name }}"
76+
VERSION="${VERSION#v}" # Remove 'v' prefix
77+
else
78+
# For branches/PRs: use pre-release version (e.g., 0.0.0-main-abc1234)
79+
GIT_BRANCH="${{ github.ref_name }}"
80+
GIT_SHA="${{ github.sha }}"
81+
# Replace slashes with dashes for branch names (e.g., feature/foo → feature-foo)
82+
GIT_BRANCH="${GIT_BRANCH//\//-}"
83+
VERSION="0.0.0-${GIT_BRANCH}-${GIT_SHA:0:7}"
84+
fi
85+
echo "version=$VERSION" >> $GITHUB_OUTPUT
86+
echo "Chart Version: $VERSION"
87+
88+
- name: Update Chart Version
89+
run: |
90+
# Update Chart.yaml with dynamic version
91+
sed -i "s|^version:.*|version: ${{ steps.version.outputs.version }}|" chart/Chart.yaml
92+
sed -i "s|^appVersion:.*|appVersion: ${{ steps.version.outputs.version }}|" chart/Chart.yaml
93+
94+
- name: Update Image Tags for Release
95+
run: |
96+
# Update image tags in values.yaml to use the versioned images
97+
# This assumes Docker images were built with the same git tag
98+
sed -i "s|tag: latest|tag: ${{ steps.version.outputs.version }}|g" chart/values.yaml
99+
100+
- name: Package Helm Chart
101+
run: |
102+
helm package chart/ --destination .
103+
104+
- name: Log into Docker Registry
105+
uses: docker/login-action@v3
106+
with:
107+
registry: ghcr.io
108+
username: ${{ github.actor }}
109+
password: ${{ secrets.GITHUB_TOKEN }}
110+
111+
- name: Push Helm Chart to OCI Registry
112+
if: startsWith(github.ref, 'refs/tags/v')
113+
run: |
114+
helm push *.tgz oci://ghcr.io/${{ github.repository_owner }}/charts

.pre-commit-config.yaml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ repos:
55
hooks:
66
- id: check-yaml
77
args: [--allow-multiple-documents]
8+
exclude: ^chart/templates/
89
- id: check-ast
910
- id: check-case-conflict
1011
- id: check-json
@@ -17,13 +18,6 @@ repos:
1718
- id: requirements-txt-fixer
1819
- id: mixed-line-ending
1920

20-
- repo: https://github.com/astral-sh/uv-pre-commit
21-
# uv version.
22-
rev: 0.9.11
23-
hooks:
24-
# Update the uv lockfile
25-
- id: uv-lock
26-
2721
- repo: local
2822
hooks:
2923
- id: python-lint
@@ -32,9 +26,17 @@ repos:
3226
entry: "uv run poe lint"
3327
types_or: [ python ]
3428
pass_filenames: false
29+
3530
- id: python-ruff
3631
name: python-ruff
3732
language: system
3833
entry: "uv run poe ruff"
3934
types_or: [ python ]
4035
pass_filenames: false
36+
37+
- id: helm-lint
38+
name: Helm Lint
39+
entry: helm lint chart/
40+
language: system
41+
pass_filenames: false
42+
files: ^chart/

Tiltfile

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,22 @@ helm_resource(
3838
'testkube',
3939
'oci://docker.io/kubeshop/testkube',
4040
namespace='testkube',
41-
flags=['--version=2.5.3', '--create-namespace', '--values=deploy/local/testkube/values.yaml', '--wait',
41+
flags=['--version=2.5.3', '--values=deploy/local/testkube/values.yaml', '--wait',
4242
'--wait-for-jobs', '--timeout=10m'],
4343
)
4444

45-
# Apply Kubernetes manifests
45+
# Deploy testbench Helm chart
46+
k8s_yaml(helm(
47+
'chart',
48+
name='testbench',
49+
namespace='testkube',
50+
values=['chart/values.yaml'],
51+
set=[
52+
'image.repository=testworkflows',
53+
],
54+
))
55+
56+
# Apply local development manifests
4657
k8s_yaml(kustomize('deploy/local'))
4758

4859
k8s_resource('ai-gateway-litellm', port_forwards=['11001:4000'])

chart/.helmignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/

chart/Chart.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
apiVersion: v2
2+
name: testbench
3+
description: A Helm chart for RAGAS-based agent evaluation via Testkube workflows
4+
type: application
5+
version: 0.1.0
6+
appVersion: "0.1.0"
7+
keywords:
8+
- ragas
9+
- testkube
10+
- evaluation
11+
- testing
12+
- a2a
13+
maintainers:
14+
- name: Agentic Layer Team
15+
url: https://docs.agentic-layer.ai/
16+
home: https://github.com/agentic-layer/testbench
17+
sources:
18+
- https://github.com/agentic-layer/testbench

0 commit comments

Comments
 (0)