Skip to content

Commit 5b96a73

Browse files
sancyxlpuskas
andauthored
Slim topology test (#131)
* feat: add topology parser and server config generation Signed-off-by: Magyari Sandor Szilard <sancyx@gmail.com> * feat deploy helm charts Signed-off-by: Magyari Sandor Szilard <sancyx@gmail.com> * fix: values file generation and deployment task Signed-off-by: Magyari Sandor Szilard <sancyx@gmail.com> * feat: task for generating test env configurations based on a setup descriptor Signed-off-by: Magyari Sandor Szilard <sancyx@gmail.com> * feat: added generator task as a dependency for the deployer task Signed-off-by: Magyari Sandor Szilard <sancyx@gmail.com> * add slim example build in csit Signed-off-by: Magyari Sandor Szilard <sancyx@gmail.com> * feat: setup routes Signed-off-by: Magyari Sandor Szilard <sancyx@gmail.com> * feat: add generated files path to gitignore Signed-off-by: Magyari Sandor Szilard <sancyx@gmail.com> * feat: fix topology file Signed-off-by: Magyari Sandor Szilard <sancyx@gmail.com> * feat: setup routes using control-plane Signed-off-by: Magyari Sandor Szilard <sancyx@gmail.com> * fix: remove whitespaces so that the task works properly Signed-off-by: Laszlo Puskas <laszlo.puskas1@gmail.com> Signed-off-by: Magyari Sandor Szilard <sancyx@gmail.com> * fix: setup routes Signed-off-by: Magyari Sandor Szilard <sancyx@gmail.com> * feat: downlaod released slimctl Signed-off-by: Magyari Sandor Szilard <sancyx@gmail.com> * fix: use latest bindings image, few fixes Signed-off-by: Magyari Sandor Szilard <sancyx@gmail.com> * fix: disable log buffer for python processes Signed-off-by: Magyari Sandor Szilard <sancyx@gmail.com> * feat: add assertion possibility for SLIM clients Signed-off-by: Magyari Sandor Szilard <sancyx@gmail.com> * docs: update README Signed-off-by: Magyari Sandor Szilard <sancyx@gmail.com> * feat: add slim topology test to github actions Signed-off-by: Magyari Sandor Szilard <sancyx@gmail.com> * fix: github integrations inputs Signed-off-by: Magyari Sandor Szilard <sancyx@gmail.com> * fix: remove trailing spaces Signed-off-by: Magyari Sandor Szilard <sancyx@gmail.com> --------- Signed-off-by: Magyari Sandor Szilard <sancyx@gmail.com> Signed-off-by: Laszlo Puskas <laszlo.puskas1@gmail.com> Co-authored-by: Laszlo Puskas <laszlo.puskas1@gmail.com>
1 parent 2ee93a6 commit 5b96a73

File tree

16 files changed

+1159
-23
lines changed

16 files changed

+1159
-23
lines changed

.github/actions/deploy-components/action.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ inputs:
2525
description: 'Deploy SPIRE to a kind cluster'
2626
required: false
2727
default: 'false'
28+
deploy-slim-topology:
29+
description: 'Deploy slim topology to a kind cluster'
30+
required: false
31+
default: 'false'
2832
slim-image-tag:
2933
description: 'Set slim container image version'
3034
required: false
@@ -112,6 +116,22 @@ runs:
112116
task -d ./${{ inputs.checkout-path }} integrations:kind:create \
113117
KIND_CLUSTER_NAME=${{ inputs.kind-cluster-name }}
114118
119+
- name: Deploy SLIM topology
120+
if: ${{ inputs.deploy-slim-topology != 'false' }}
121+
shell: bash
122+
run: |
123+
task -d ./${{ inputs.checkout-path }} integrations:slim:test-env:deploy:controller \
124+
SLIM_IMAGE_TAG=${{ inputs.slim-image-tag }} \
125+
SLIM_CHART_TAG=${{ inputs.slim-chart-tag }} \
126+
KIND_CLUSTER_NAME=${{ inputs.kind-cluster-name }} \
127+
HELM_NAMESPACE=${{ inputs.kind-cluster-namespace }}
128+
129+
task -d ./${{ inputs.checkout-path }} integrations:slim:test-env:deploy:generated \
130+
SLIM_IMAGE_TAG=${{ inputs.slim-image-tag }} \
131+
SLIM_CHART_TAG=${{ inputs.slim-chart-tag }} \
132+
KIND_CLUSTER_NAME=${{ inputs.kind-cluster-name }} \
133+
HELM_NAMESPACE=${{ inputs.kind-cluster-namespace }}
134+
115135
- name: Deploy SPIRE
116136
if: ${{ inputs.deploy-spire != 'false' }}
117137
shell: bash

.github/workflows/test-integrations.yaml

Lines changed: 52 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,7 @@ on:
3838
description: 'Skip slim tests'
3939
required: false
4040
default: true
41-
type: boolean
42-
skip_slim_spire_test:
43-
description: 'Skip slim with SPIRE tests'
44-
required: false
45-
default: true
46-
type: boolean
41+
type: boolean
4742
run_agentic_apps_test:
4843
description: 'Run agentic apps tests'
4944
required: false
@@ -140,8 +135,58 @@ jobs:
140135
# run: task integrations:slim:test:mcp-server
141136
# shell: bash
142137

138+
run-tests-slim-topology:
139+
if: ${{ !inputs.skip_slim_test }}
140+
needs: [ set-kind-version ]
141+
runs-on: ubuntu-latest
142+
143+
permissions:
144+
contents: 'read'
145+
id-token: 'write'
146+
packages: 'read'
147+
attestations: 'read'
148+
149+
steps:
150+
- name: Checkout code
151+
uses: actions/checkout@v4
152+
with:
153+
fetch-depth: 0
154+
155+
- name: Login to GitHub Container Registry
156+
uses: docker/login-action@v3
157+
with:
158+
registry: ghcr.io
159+
username: ${{ github.actor }}
160+
password: ${{ secrets.GITHUB_TOKEN }}
161+
162+
- name: Setup Environment
163+
uses: ./.github/actions/setup-env
164+
with:
165+
python: true
166+
go: false
167+
168+
- name: Setup K8S Tools
169+
uses: ./.github/actions/setup-k8s
170+
with:
171+
kind-version: ${{ needs.set-kind-version.outputs.kind-version }}
172+
173+
- name: Deploy Slim with Controller
174+
uses: ./.github/actions/deploy-components
175+
with:
176+
deploy-slim: 'false'
177+
deploy-spire: 'false'
178+
deploy-slim-topology: 'true'
179+
slim-config: 'spire'
180+
slim-image-tag: ${{ inputs.override_slim_image_tag }}
181+
slim-chart-tag: ${{ inputs.override_slim_chart_tag }}
182+
183+
- name: Run slim topology test
184+
run: task integrations:slim:test:topology
185+
shell: bash
186+
187+
143188
run-tests-slim-spire:
144-
if: ${{ !inputs.skip_slim_spire_test }}
189+
if: ${{ !inputs.skip_slim_test }}
145190
needs: [ set-kind-version ]
146191
runs-on: ubuntu-latest
147192

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,4 +131,10 @@ samples/evaluation/.deepeval*
131131
integrations/**/.bin
132132

133133
# Agentic tools
134-
wfsm
134+
wfsm
135+
136+
.gen
137+
138+
bin
139+
140+
reports

README.md

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@
22

33
- [CSIT - Continuous System Integration Testing](#csit---continuous-system-integration-testing)
44
- [Architecture](#architecture)
5+
- [Tasks](#tasks)
56
- [Integration tests](#integration-tests)
67
- [Directory structure](#directory-structure)
78
- [Running tests](#running-tests)
89
- [Running tests using GitHub actions](#running-tests-using-github-actions)
910
- [How to extend tests with your own test](#how-to-extend-tests-with-your-own-test)
1011
- [Samples](#samples)
1112
- [Running tests](#running-tests-1)
12-
- [Updating the `agntcy/dir` testdata](#updating-the-agntcydir-testdata)
13-
- [Copyright Notice](#copyright-notice)
13+
- [Updating the agntcy/dir testdata](#updating-the-agntcydir-testdata)
14+
- [Copyright Notice](#copyright-notice)
1415

1516
## Architecture
1617

@@ -99,13 +100,25 @@ task: Available tasks for this project:
99100
* integrations:directory:test:list: Directory agent list test
100101
* integrations:directory:test:networking: Directory agent networking test
101102
* integrations:directory:test:push: Directory agent push test
102-
* integrations:slim:build:agentic-apps: Build agentic containers
103-
* integrations:slim:test-env:cleanup: Remove agent slim test env
104-
* integrations:slim:test-env:deploy: Deploy agntcy slim test env
105-
* integrations:slim:test:mcp-server: Test MCP over Slim
106-
* integrations:slim:test:mcp-server:slim-native: Test Slim native MCP server
107-
* integrations:slim:test:mcp-server:mcp-proxy: Test MCP server via MCP proxy
108-
* integrations:slim:test:sanity: Sanity slim test
103+
* integrations:slim:build:agentic-apps: Build agentic containers
104+
* integrations:slim:cert-manager:deploy: Deploy cert-manager
105+
* integrations:slim:cert-manager:remove: Remove cert-manager
106+
* integrations:slim:certificates:create: Create certificates
107+
* integrations:slim:spire:deploy: Deploy SPIRE server
108+
* integrations:slim:spire:remove: Remove SPIRE server
109+
* integrations:slim:test-env:cleanup: Remove agent slim test env
110+
* integrations:slim:test-env:cleanup:contoroller: Remove slim controller test env
111+
* integrations:slim:test-env:cleanup:generated: Undeploy agntcy slim test env for each values file in config/.generated
112+
* integrations:slim:test-env:deploy: Deploy agntcy slim test env
113+
* integrations:slim:test-env:deploy:controller: Deploy slim controller
114+
* integrations:slim:test-env:deploy:generated: Deploy agntcy slim test env for each values file in config/.generated
115+
* integrations:slim:test-env:generate:configs: Generates test environment configuration(s) for agntcy slim based on the provided test-setup descriptor
116+
* integrations:slim:test:mcp-server: Test MCP over Slim
117+
* integrations:slim:test:mcp-server:mcp-proxy: Test MCP server via MCP proxy
118+
* integrations:slim:test:mcp-server:slim-native: Test Slim native MCP server
119+
* integrations:slim:test:sanity: Sanity slim test
120+
* integrations:slim:test:slimctl-download: Download slimctl executable for current OS and architecture
121+
* integrations:slim:test:topology: Slim topology test
109122
* integrations:kind:create: Create kind cluster
110123
* integrations:kind:destroy: Destroy kind cluster
111124
* integrations:version: Get version

integrations/agntcy-slim/Taskfile.yml

Lines changed: 107 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,17 @@ vars:
1313
IMAGE_REPO: '{{ .IMAGE_REPO | default "ghcr.io/agntcy" }}'
1414
SLIM_IMAGE_TAG: '{{ .SLIM_IMAGE_TAG | default "0.4.0" }}'
1515
MCP_PROXY_IMAGE_TAG: '{{ .MCP_PROXY_IMAGE_TAG | default "0.1.5" }}'
16-
SLIM_CHART_TAG: '{{ .SLIM_CHART_TAG | default "v0.1.8" }}'
16+
SLIM_CHART_TAG: '{{ .SLIM_CHART_TAG | default "v0.1.9" }}'
1717
SLIM_CONFIG: '{{ .SLIM_CONFIG | default "base" }}'
1818

19+
SLIM_CONTROLLER_CHART_TAG: '{{ .SLIM_CONTROLLER_CHART_TAG | default "0.1.2" }}'
20+
SLIM_CONTROLLER_IMAGE_TAG: '{{ .SLIM_CONTROLLER_IMAGE_TAG | default "0.1.0" }}'
21+
SLIM_CONTROLLER_ENDPOINT: '{{ .SLIM_CONTROLLER_ENDPOINT | default "http://slim-control:50052" }}'
22+
SLIM_CONTROLLER_LOCAL_ENDPOINT: '{{ .SLIM_CONTROLLER_LOCAL_ENDPOINT | default "localhost:50051" }}'
23+
SLIMCTL_VERSION: '{{ .SLIMCTL_VERSION | default "v0.2.1" }}'
24+
SLIMCTL_PATH: '{{ .SLIMCTL_PATH | default "./bin/slimctl" }}'
25+
26+
1927
IMAGE_BAKE_OPTS: '{{ .IMAGE_BAKE_OPTS | default "--set *.platform=linux/arm64" }}'
2028
LANGCHAIN_APP_TAG: '{{ .LANGCHAIN_APP_TAG | default "v0.0.16" }}'
2129
AUTOGEN_APP_TAG: '{{ .AUTOGEN_APP_TAG | default "v0.0.16" }}'
@@ -34,6 +42,7 @@ vars:
3442

3543
SPIRE_NAMESPACE: '{{ .SPIRE_NAMESPACE | default "spire-server" }}'
3644

45+
TOPOLOGY_CONFIG: '{{ .TOPOLOGY_CONFIG | default "config/fire-and-forget.yaml" }}'
3746

3847
tasks:
3948
k8s:port-forward:setup:
@@ -47,6 +56,15 @@ tasks:
4756
cmds:
4857
- kill -9 $(ps aux | grep port-forward | grep agntcy-slim | awk '{print $2}') || true
4958

59+
k8s:port-forward:controller:setup:
60+
cmds:
61+
- kubectl port-forward svc/slim-control -n {{ .HELM_NAMESPACE }} 50051:50051 &
62+
- sleep 1
63+
64+
k8s:port-forward:controller:teardown:
65+
cmds:
66+
- kill -9 $(ps aux | grep port-forward | grep slim-control | awk '{print $2}') || true
67+
5068
test-env:deploy:
5169
desc: Deploy agntcy slim test env
5270
cmds:
@@ -62,7 +80,63 @@ tasks:
6280
--install \
6381
--wait \
6482
--wait-for-jobs \
65-
--timeout "15m"
83+
--timeout "15m"
84+
85+
test-env:generate:configs:
86+
desc: Generates test environment configuration(s) for agntcy slim based on the provided test-setup descriptor
87+
cmd: |
88+
TOPOLOGY_CONFIG={{.TOPOLOGY_CONFIG}} SLIM_CONTROLLER_ENDPOINT={{ .SLIM_CONTROLLER_ENDPOINT }} go run ./tests/config/main/
89+
90+
test-env:deploy:controller:
91+
desc: Deploy slim controller
92+
cmds:
93+
- |
94+
helm upgrade slim-controller \
95+
oci://{{ .IMAGE_REPO }}/slim/helm/slim-control-plane \
96+
--version {{ .SLIM_CONTROLLER_CHART_TAG }} \
97+
--set image.tag="{{ .SLIM_CONTROLLER_IMAGE_TAG }}" \
98+
--namespace {{ .HELM_NAMESPACE }} \
99+
--create-namespace \
100+
--install \
101+
--wait \
102+
--wait-for-jobs \
103+
--timeout "15m"
104+
105+
test-env:cleanup:contoroller:
106+
desc: Remove agent slim test env
107+
cmds:
108+
- task k8s:port-forward:controller:teardown
109+
- helm delete --namespace {{ .HELM_NAMESPACE }} slim-controller
110+
111+
test-env:deploy:generated:
112+
desc: Deploy agntcy slim test env for each values file in config/.generated
113+
deps:
114+
- test-env:generate:configs
115+
cmd: |
116+
#!/bin/sh
117+
for file in "./config/.gen"/*.yaml ;do
118+
helm upgrade agntcy-$(basename "$file" .yaml) \
119+
oci://{{ .IMAGE_REPO }}/slim/helm/slim \
120+
--version {{ .SLIM_CHART_TAG }} \
121+
--set slim.image.tag="{{ .SLIM_IMAGE_TAG }}" \
122+
-f "$file" \
123+
--namespace {{ .HELM_NAMESPACE }} \
124+
--create-namespace \
125+
--install \
126+
--wait \
127+
--wait-for-jobs \
128+
--timeout "15m"
129+
echo "Deployed agntcy-slim-$(basename "$file" .yaml) with config $(basename "$file")"
130+
done
131+
132+
test-env:cleanup:generated:
133+
desc: Undeploy agntcy slim test env for each values file in config/.generated
134+
cmd: |
135+
#!/bin/sh
136+
for file in "./config/.gen"/*.yaml ;do
137+
helm delete --namespace {{ .HELM_NAMESPACE }} agntcy-$(basename "$file" .yaml)
138+
echo "Deleted agntcy-slim-$(basename "$file" .yaml) with config $(basename "$file")"
139+
done
66140
67141
test-env:cleanup:
68142
desc: Remove agent slim test env
@@ -121,8 +195,8 @@ tasks:
121195
spire:remove:
122196
desc: Remove SPIRE server
123197
cmds:
124-
- helm delete spire -n {{ .SPIRE_NAMESPACE }}
125-
- helm delete spire-crds -n {{ .SPIRE_NAMESPACE }}
198+
- helm delete spire -n {{ .SPIRE_NAMESPACE }}
199+
- helm delete spire-crds -n {{ .SPIRE_NAMESPACE }}
126200

127201
build:agentic-apps:
128202
desc: Build agentic containers
@@ -135,6 +209,34 @@ tasks:
135209
cmds:
136210
- SLIM_CONFIG={{ .SLIM_CONFIG }} NAMESPACE={{.HELM_NAMESPACE}} IMAGE_REPO={{.IMAGE_REPO}} LANGCHAIN_APP_TAG={{.LANGCHAIN_APP_TAG}} AUTOGEN_APP_TAG={{.AUTOGEN_APP_TAG}} go test ./tests -v -failfast -test.v -test.paniconexit0 -ginkgo.timeout 30m -timeout 30m -ginkgo.v -ginkgo.focus "Agntcy slim sanity test" --ginkgo.json-report=../reports/report-slim-sanity.json --ginkgo.junit-report=../reports/report-slim-sanity.xml
137211

212+
test:slimctl-download:
213+
desc: Download slimctl executable for current OS and architecture
214+
cmds:
215+
- |
216+
set -e
217+
SLIMCTL_ARCH=$(arch)
218+
SLIMCTL_OS=$(echo $(uname -s) | tr '[:upper:]' '[:lower:]')
219+
# Map x86_64 to amd64 for Linux
220+
if [[ "$SLIMCTL_ARCH" == "x86_64" && "$SLIMCTL_OS" == "linux" ]]; then
221+
SLIMCTL_ARCH="amd64"
222+
fi
223+
echo "Detected OS: $SLIMCTL_OS, Architecture: $SLIMCTL_ARCH"
224+
SLIMCTL_URL="https://github.com/agntcy/slim/releases/download/slimctl-{{.SLIMCTL_VERSION}}/slimctl-$SLIMCTL_OS-$SLIMCTL_ARCH"
225+
echo "Downloading slimctl from $SLIMCTL_URL"
226+
TARGET_DIR=$(dirname {{ .SLIMCTL_PATH }})
227+
mkdir -p $TARGET_DIR
228+
curl -L -o {{ .SLIMCTL_PATH }} $SLIMCTL_URL
229+
chmod +x {{ .SLIMCTL_PATH }}
230+
echo "slimctl downloaded to {{ .SLIMCTL_PATH }}"
231+
232+
test:topology:
233+
desc: Slim topology test
234+
deps:
235+
- test:slimctl-download
236+
cmds:
237+
- task k8s:port-forward:controller:setup
238+
- NAMESPACE={{.HELM_NAMESPACE}} SLIMCTL_PATH=../{{.SLIMCTL_PATH}} TOPOLOGY_CONFIG=../{{.TOPOLOGY_CONFIG}} SLIM_CONTROLLER_LOCAL_ENDPOINT={{.SLIM_CONTROLLER_LOCAL_ENDPOINT}} go test ./tests -v -failfast -test.v -test.paniconexit0 -ginkgo.timeout 30m -timeout 30m -ginkgo.v -ginkgo.focus "Slim topology test"
239+
138240
test:mcp-server:
139241
desc: Test MCP over Slim
140242
cmds:
@@ -151,4 +253,4 @@ tasks:
151253
- NAMESPACE={{.HELM_NAMESPACE}} IMAGE_REPO={{.IMAGE_REPO}} MCP_SERVER_TIME_TAG={{.MCP_SERVER_TIME_TAG}} LLAMAINDEX_TIME_AGENT_TAG={{.LLAMAINDEX_TIME_AGENT_TAG}} go test ./tests -v -failfast -test.v -test.paniconexit0 -ginkgo.timeout 30m -timeout 30m -ginkgo.v -ginkgo.focus "MCP server via MCP proxy" --ginkgo.json-report=../reports/report-slim-mcp-proxy.json --ginkgo.junit-report=../reports/report-slim-mcp-proxy.xml
152254

153255
default:
154-
cmd: task -l
256+
cmd: task -l

0 commit comments

Comments
 (0)