Skip to content

Commit e993995

Browse files
committed
feat: refactor topology test to deploy slim clusters and run latest examples
Signed-off-by: Magyari Sandor Szilard <sancyx@gmail.com>
1 parent ce387ec commit e993995

File tree

17 files changed

+343
-337
lines changed

17 files changed

+343
-337
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,12 @@ runs:
116116
task -d ./${{ inputs.checkout-path }} integrations:kind:create \
117117
KIND_CLUSTER_NAME=${{ inputs.kind-cluster-name }}
118118
119+
- name: Deploy SPIRE
120+
if: ${{ inputs.deploy-spire != 'false' }}
121+
shell: bash
122+
run: |
123+
task -d ./${{ inputs.checkout-path }} integrations:slim:spire:deploy
124+
119125
- name: Deploy SLIM topology
120126
if: ${{ inputs.deploy-slim-topology != 'false' }}
121127
shell: bash
@@ -132,12 +138,6 @@ runs:
132138
KIND_CLUSTER_NAME=${{ inputs.kind-cluster-name }} \
133139
HELM_NAMESPACE=${{ inputs.kind-cluster-namespace }}
134140
135-
- name: Deploy SPIRE
136-
if: ${{ inputs.deploy-spire != 'false' }}
137-
shell: bash
138-
run: |
139-
task -d ./${{ inputs.checkout-path }} integrations:slim:spire:deploy
140-
141141
- name: Deploy Slim
142142
if: ${{ inputs.deploy-slim != 'false' }}
143143
shell: bash

.github/workflows/test-integrations.yaml

Lines changed: 1 addition & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -77,69 +77,6 @@ jobs:
7777
echo "Set KinD version to: $KIND_VERSION"
7878
echo "kind-version=$KIND_VERSION" >> "$GITHUB_OUTPUT"
7979
80-
run-tests-slim:
81-
if: ${{ !inputs.skip_slim_test }}
82-
needs: [set-kind-version]
83-
runs-on: ubuntu-latest
84-
85-
permissions:
86-
contents: "read"
87-
id-token: "write"
88-
packages: "read"
89-
attestations: "read"
90-
91-
steps:
92-
- name: Checkout code
93-
uses: actions/checkout@v4
94-
with:
95-
fetch-depth: 0
96-
97-
- name: Login to GitHub Container Registry
98-
uses: docker/login-action@v3
99-
with:
100-
registry: ghcr.io
101-
username: ${{ github.actor }}
102-
password: ${{ secrets.GITHUB_TOKEN }}
103-
104-
- name: Setup Environment
105-
uses: ./.github/actions/setup-env
106-
with:
107-
python: true
108-
go: false
109-
110-
- name: Setup K8S Tools
111-
uses: ./.github/actions/setup-k8s
112-
with:
113-
kind-version: ${{ needs.set-kind-version.outputs.kind-version }}
114-
115-
- name: Deploy Slim
116-
uses: ./.github/actions/deploy-components
117-
with:
118-
deploy-spire: "true"
119-
deploy-slim: "true"
120-
slim-image-tag: ${{ inputs.override_slim_image_tag }}
121-
slim-chart-tag: ${{ inputs.override_slim_chart_tag }}
122-
123-
- name: Run slim sanity tests
124-
env:
125-
AZURE_OPENAI_ENDPOINT: ${{ vars.AZURE_OPENAI_ENDPOINT }}
126-
AZURE_MODEL_VERSION: ${{ vars.AZURE_MODEL_VERSION }}
127-
AZURE_DEPLOYMENT_NAME: ${{ vars.AZURE_DEPLOYMENT_NAME }}
128-
AZURE_OPENAI_API_VERSION: ${{ vars.AZURE_OPENAI_API_VERSION }}
129-
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
130-
run: task integrations:slim:test:sanity
131-
shell: bash
132-
133-
# - name: Run slim MCP integration tests
134-
# env:
135-
# AZURE_OPENAI_ENDPOINT: ${{ vars.AZURE_OPENAI_ENDPOINT }}
136-
# AZURE_MODEL_VERSION: ${{ vars.AZURE_MODEL_VERSION }}
137-
# AZURE_DEPLOYMENT_NAME: ${{ vars.AZURE_DEPLOYMENT_NAME }}
138-
# AZURE_OPENAI_API_VERSION: ${{ vars.AZURE_OPENAI_API_VERSION }}
139-
# AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
140-
# run: task integrations:slim:test:mcp-server
141-
# shell: bash
142-
14380
run-tests-slim-topology:
14481
if: ${{ !inputs.skip_slim_test }}
14582
needs: [set-kind-version]
@@ -179,7 +116,7 @@ jobs:
179116
uses: ./.github/actions/deploy-components
180117
with:
181118
deploy-slim: "false"
182-
deploy-spire: "false"
119+
deploy-spire: "true"
183120
deploy-slim-topology: "true"
184121
slim-config: "spire"
185122
slim-image-tag: ${{ inputs.override_slim_image_tag }}
@@ -194,66 +131,6 @@ jobs:
194131
with:
195132
artifact-name: "slim-test-result"
196133

197-
run-tests-slim-spire:
198-
if: ${{ !inputs.skip_slim_spire_test }}
199-
needs: [set-kind-version]
200-
runs-on: ubuntu-latest
201-
202-
permissions:
203-
contents: "read"
204-
id-token: "write"
205-
packages: "read"
206-
attestations: "read"
207-
208-
steps:
209-
- name: Checkout code
210-
uses: actions/checkout@v4
211-
with:
212-
fetch-depth: 0
213-
214-
- name: Login to GitHub Container Registry
215-
uses: docker/login-action@v3
216-
with:
217-
registry: ghcr.io
218-
username: ${{ github.actor }}
219-
password: ${{ secrets.GITHUB_TOKEN }}
220-
221-
- name: Setup Environment
222-
uses: ./.github/actions/setup-env
223-
with:
224-
python: true
225-
go: false
226-
227-
- name: Setup K8S Tools
228-
uses: ./.github/actions/setup-k8s
229-
with:
230-
kind-version: ${{ needs.set-kind-version.outputs.kind-version }}
231-
232-
- name: Deploy Slim with SPIRE
233-
uses: ./.github/actions/deploy-components
234-
with:
235-
deploy-slim: "true"
236-
deploy-spire: "true"
237-
slim-config: "spire"
238-
slim-image-tag: ${{ inputs.override_slim_image_tag }}
239-
slim-chart-tag: ${{ inputs.override_slim_chart_tag }}
240-
241-
- name: Run slim sanity tests (mtls with SPIRE)
242-
env:
243-
AZURE_OPENAI_ENDPOINT: ${{ vars.AZURE_OPENAI_ENDPOINT }}
244-
AZURE_MODEL_VERSION: ${{ vars.AZURE_MODEL_VERSION }}
245-
AZURE_DEPLOYMENT_NAME: ${{ vars.AZURE_DEPLOYMENT_NAME }}
246-
AZURE_OPENAI_API_VERSION: ${{ vars.AZURE_OPENAI_API_VERSION }}
247-
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
248-
SLIM_CONFIG: "spire"
249-
run: task integrations:slim:test:sanity
250-
shell: bash
251-
252-
- name: Create artifact from integrations test reports
253-
uses: ./.github/actions/create-artifact
254-
with:
255-
artifact-name: "slim-spire-test-result"
256-
257134
run-tests-directory:
258135
if: ${{ !inputs.skip_directory_test }}
259136
needs: [set-kind-version]

integrations/agntcy-slim/Taskfile.yml

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,17 @@ vars:
1010
KIND_CLUSTER_NAME: '{{ .KIND_CLUSTER_NAME | default "agntcy-test" }}'
1111

1212
## Image config
13-
IMAGE_REPO: '{{ .IMAGE_REPO | default "ghcr.io/agntcy" }}'
14-
SLIM_IMAGE_TAG: '{{ .SLIM_IMAGE_TAG | default "0.4.0" }}'
13+
IMAGE_REPO: '{{ .IMAGE_REPO | default "ghcr.io/agntcy" }}'
1514
MCP_PROXY_IMAGE_TAG: '{{ .MCP_PROXY_IMAGE_TAG | default "0.1.5" }}'
16-
SLIM_CHART_TAG: '{{ .SLIM_CHART_TAG | default "v0.1.9" }}'
1715
SLIM_CONFIG: '{{ .SLIM_CONFIG | default "base" }}'
1816

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" }}'
17+
SLIM_CHART_TAG: '{{ .SLIM_CHART_TAG | default "v0.6.0" }}'
18+
SLIM_IMAGE_TAG: '{{ .SLIM_IMAGE_TAG | default "0.6.0" }}'
19+
20+
SLIM_CONTROLLER_CHART_TAG: '{{ .SLIM_CONTROLLER_CHART_TAG | default "v0.6.0" }}'
21+
SLIM_CONTROLLER_IMAGE_TAG: '{{ .SLIM_CONTROLLER_IMAGE_TAG | default "0.6.0" }}'
22+
23+
SLIM_CONTROLLER_ENDPOINT: '{{ .SLIM_CONTROLLER_ENDPOINT | default "https://slim-control.admin.svc.cluster.local:50052" }}'
2224
SLIM_CONTROLLER_LOCAL_ENDPOINT: '{{ .SLIM_CONTROLLER_LOCAL_ENDPOINT | default "localhost:50051" }}'
2325
SLIMCTL_VERSION: '{{ .SLIMCTL_VERSION | default "v0.2.1" }}'
2426
SLIMCTL_PATH: '{{ .SLIMCTL_PATH | default "./bin/slimctl" }}'
@@ -39,9 +41,9 @@ vars:
3941

4042
RUNNER_TYPE: '{{ .RUNNER_TYPE | default "docker" }}'
4143

42-
SPIRE_NAMESPACE: '{{ .SPIRE_NAMESPACE | default "spire-server" }}'
44+
SPIRE_NAMESPACE: '{{ .SPIRE_NAMESPACE | default "spire" }}'
4345

44-
TOPOLOGY_CONFIG: '{{ .TOPOLOGY_CONFIG | default "config/fire-and-forget.yaml" }}'
46+
TOPOLOGY_CONFIG: '{{ .TOPOLOGY_CONFIG | default "config/peer-to-peer.yaml" }}'
4547

4648
tasks:
4749
k8s:port-forward:setup:
@@ -94,18 +96,19 @@ tasks:
9496
oci://{{ .IMAGE_REPO }}/slim/helm/slim-control-plane \
9597
--version {{ .SLIM_CONTROLLER_CHART_TAG }} \
9698
--set image.tag="{{ .SLIM_CONTROLLER_IMAGE_TAG }}" \
97-
--namespace {{ .HELM_NAMESPACE }} \
99+
-f ./config/controller-values.yaml \
100+
--namespace "admin" \
98101
--create-namespace \
99102
--install \
100103
--wait \
101104
--wait-for-jobs \
102105
--timeout "15m"
103106
104-
test-env:cleanup:contoroller:
107+
test-env:cleanup:controller:
105108
desc: Remove agent slim test env
106109
cmds:
107110
- task k8s:port-forward:controller:teardown
108-
- helm delete --namespace {{ .HELM_NAMESPACE }} slim-controller
111+
- helm delete --namespace "admin" slim-controller
109112

110113
test-env:deploy:generated:
111114
desc: Deploy agntcy slim test env for each values file in config/.generated
@@ -119,7 +122,7 @@ tasks:
119122
--version {{ .SLIM_CHART_TAG }} \
120123
--set slim.image.tag="{{ .SLIM_IMAGE_TAG }}" \
121124
-f "$file" \
122-
--namespace {{ .HELM_NAMESPACE }} \
125+
--namespace $(basename "$file" .yaml) \
123126
--create-namespace \
124127
--install \
125128
--wait \
@@ -133,7 +136,7 @@ tasks:
133136
cmd: |
134137
#!/bin/sh
135138
for file in "./config/.gen"/*.yaml ;do
136-
helm delete --namespace {{ .HELM_NAMESPACE }} agntcy-$(basename "$file" .yaml)
139+
helm delete --namespace $(basename "$file" .yaml) agntcy-$(basename "$file" .yaml)
137140
echo "Deleted agntcy-slim-$(basename "$file" .yaml) with config $(basename "$file")"
138141
done
139142
@@ -230,10 +233,10 @@ tasks:
230233
231234
test:topology:
232235
desc: Slim topology test
233-
deps:
234-
- test:slimctl-download
236+
# deps:
237+
# - test:slimctl-download
235238
cmds:
236-
- task k8s:port-forward:controller:setup
239+
# - task k8s:port-forward:controller:setup
237240
- 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" --ginkgo.json-report=../reports/report-slim-topology.json --ginkgo.junit-report=../reports/report-slim-topology.xml
238241

239242
test:mcp-server:

integrations/agntcy-slim/components/config/spire/helper.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ renew_signal = ""
66
svid_file_name = "tls.crt"
77
svid_key_file_name = "tls.key"
88
svid_bundle_file_name = "svid_bundle.pem"
9-
jwt_bundle_file_name = "cert.jwt"
9+
jwt_bundle_file_name = "key.jwt"
1010
cert_file_mode = 0644
1111
key_file_mode = 0644
1212
jwt_svid_file_mode = 0644
1313
jwt_bundle_file_mode = 0644
14-
jwt_svids = [{jwt_audience="test", jwt_svid_file_name="jwt_svid.token"}]
14+
jwt_svids = [{jwt_audience="slim-demo", jwt_svid_file_name="jwt_svid.token"}]
1515
daemon_mode = false
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Copyright AGNTCY Contributors (https://github.com/agntcy)
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# Default values for slim-control-plane.
5+
# This is a YAML-formatted file.
6+
# Declare variables to be passed into your templates.
7+
8+
# This will set the replicaset count more information can be found here: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/
9+
replicaCount: 1
10+
11+
# This sets the container image more information can be found here: https://kubernetes.io/docs/concepts/containers/images/
12+
image:
13+
repository: "ghcr.io/agntcy/slim/control-plane"
14+
# This sets the pull policy for images.
15+
pullPolicy: IfNotPresent
16+
# Overrides the image tag whose default is the chart appVersion.
17+
tag: ""
18+
19+
fullnameOverride: "slim-control"
20+
21+
config:
22+
northbound:
23+
httpHost: 0.0.0.0
24+
httpPort: "{{ .Values.service.north.port }}"
25+
26+
southbound:
27+
httpHost: 0.0.0.0
28+
httpPort: "{{ .Values.service.south.port }}"
29+
tls:
30+
useSpiffe: true
31+
spire:
32+
socketPath: "unix:///run/spire/agent-sockets/api.sock"
33+
34+
logging:
35+
level: DEBUG
36+
37+
spire:
38+
enabled: true
39+
40+
service:
41+
type: ClusterIP
42+
south:
43+
port: 50052
44+
north:
45+
port: 50051

integrations/agntcy-slim/config/fire-and-forget.yaml

Lines changed: 0 additions & 30 deletions
This file was deleted.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
topology:
2+
clients:
3+
"alice":
4+
spireMtls: true
5+
connectedTo:
6+
- "cluster-b"
7+
image: ghcr.io/agntcy/slim/bindings-examples:0.6.0
8+
args: ["p2p", "--local", "org/ns/alice", "--shared-secret","secret123"]
9+
assertFor: "received: hello"
10+
"bob":
11+
spireMtls: true
12+
connectedTo:
13+
- "cluster-a"
14+
image: ghcr.io/agntcy/slim/bindings-examples:0.6.0
15+
args: ["p2p", "--local", "org/ns/bob", "--remote", "org/ns/alice", "--shared-secret","secret123","--message","hello","--iterations","10"]
16+
assertFor: "Sent message hello - 10/10"
17+
clusters:
18+
"cluster-a":
19+
spireMtls: true
20+
#daemonSet: false
21+
"cluster-b":
22+
spireMtls: true

0 commit comments

Comments
 (0)