Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/actions/deploy-components/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,22 @@ inputs:
description: 'Set slim chart version'
required: false
default: ''
slim-controller-image-tag:
description: 'Set slim controller container image version'
required: false
default: ''
preload-slim-images:
description: 'Load prebuilt slim images into kind'
required: false
default: 'false'
slim-node-image:
description: 'Full slim node image reference to load into kind'
required: false
default: ''
slim-controller-image:
description: 'Full slim controller image reference to load into kind'
required: false
default: ''
deploy-directory:
description: 'Deploy directory to a kind cluster'
required: false
Expand Down Expand Up @@ -116,6 +132,20 @@ runs:
task -d ./${{ inputs.checkout-path }} integrations:kind:create \
KIND_CLUSTER_NAME=${{ inputs.kind-cluster-name }}

- name: Load prebuilt slim images into kind
if: ${{ inputs.preload-slim-images != 'false' }}
shell: bash
run: |
set -euo pipefail

if [ -z "${{ inputs.slim-node-image }}" ] || [ -z "${{ inputs.slim-controller-image }}" ]; then
echo "Both slim-node-image and slim-controller-image are required when preload-slim-images is enabled."
exit 1
fi

kind load docker-image "${{ inputs.slim-node-image }}" --name "${{ inputs.kind-cluster-name }}"
kind load docker-image "${{ inputs.slim-controller-image }}" --name "${{ inputs.kind-cluster-name }}"

- name: Deploy SPIRE
if: ${{ inputs.deploy-spire != 'false' }}
shell: bash
Expand All @@ -128,12 +158,14 @@ runs:
run: |
task -d ./${{ inputs.checkout-path }} integrations:slim:test-env:deploy:controller \
SLIM_IMAGE_TAG=${{ inputs.slim-image-tag }} \
SLIM_CONTROLLER_IMAGE_TAG=${{ inputs.slim-controller-image-tag }} \
SLIM_CHART_TAG=${{ inputs.slim-chart-tag }} \
KIND_CLUSTER_NAME=${{ inputs.kind-cluster-name }} \
HELM_NAMESPACE=${{ inputs.kind-cluster-namespace }}

task -d ./${{ inputs.checkout-path }} integrations:slim:test-env:deploy:clusters \
SLIM_IMAGE_TAG=${{ inputs.slim-image-tag }} \
SLIM_CONTROLLER_IMAGE_TAG=${{ inputs.slim-controller-image-tag }} \
SLIM_CHART_TAG=${{ inputs.slim-chart-tag }} \
KIND_CLUSTER_NAME=${{ inputs.kind-cluster-name }} \
HELM_NAMESPACE=${{ inputs.kind-cluster-namespace }}
Expand Down
52 changes: 51 additions & 1 deletion .github/workflows/test-integrations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,64 @@ jobs:
with:
kind-version: ${{ needs.set-kind-version.outputs.kind-version }}

- name: Resolve slim image tags
id: resolve-slim-tags
shell: bash
run: |
set -euo pipefail
if [ -n "${{ inputs.override_slim_image_tag }}" ]; then
tag="${{ inputs.override_slim_image_tag }}"
else
tag="local-${GITHUB_SHA::12}"
fi
echo "slim_tag=${tag}" >> "$GITHUB_OUTPUT"
echo "controller_tag=${tag}" >> "$GITHUB_OUTPUT"

- name: Checkout slim source
if: ${{ inputs.override_slim_image_tag == '' }}
uses: actions/checkout@v4
with:
repository: agntcy/slim
fetch-depth: 1
path: slim-src

- name: Set up Docker Buildx
if: ${{ inputs.override_slim_image_tag == '' }}
uses: docker/setup-buildx-action@v3

- name: Build slim images (linux/amd64)
if: ${{ inputs.override_slim_image_tag == '' }}
shell: bash
run: |
set -euo pipefail
SLIM_TAG="${{ steps.resolve-slim-tags.outputs.slim_tag }}"

docker buildx build \
--platform linux/amd64 \
--load \
--tag "ghcr.io/agntcy/slim:${SLIM_TAG}" \
--file slim-src/data-plane/Dockerfile \
slim-src

docker buildx build \
--platform linux/amd64 \
--load \
--tag "ghcr.io/agntcy/slim/control-plane:${SLIM_TAG}" \
--file slim-src/control-plane/Dockerfile \
slim-src

- name: Deploy Slim with Controller
uses: ./.github/actions/deploy-components
with:
deploy-slim: "false"
deploy-spire: "true"
deploy-slim-topology: "true"
slim-config: "spire"
slim-image-tag: ${{ inputs.override_slim_image_tag }}
preload-slim-images: ${{ inputs.override_slim_image_tag == '' }}
slim-node-image: ghcr.io/agntcy/slim:${{ steps.resolve-slim-tags.outputs.slim_tag }}
slim-controller-image: ghcr.io/agntcy/slim/control-plane:${{ steps.resolve-slim-tags.outputs.controller_tag }}
slim-image-tag: ${{ steps.resolve-slim-tags.outputs.slim_tag }}
slim-controller-image-tag: ${{ steps.resolve-slim-tags.outputs.controller_tag }}
slim-chart-tag: ${{ inputs.override_slim_chart_tag }}

- name: Run slim topology test
Expand Down
24 changes: 20 additions & 4 deletions integrations/agntcy-slim/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ vars:
MCP_PROXY_IMAGE_TAG: '{{ .MCP_PROXY_IMAGE_TAG | default "0.1.5" }}'
SLIM_CONFIG: '{{ .SLIM_CONFIG | default "base" }}'

SLIM_CHART_TAG: '{{ .SLIM_CHART_TAG | default "v0.7.0" }}'
SLIM_IMAGE_TAG: '{{ .SLIM_IMAGE_TAG | default "0.7.2-dev.1" }}'
SLIM_CHART_TAG: '{{ .SLIM_CHART_TAG | default "v1.0.0" }}'
SLIM_IMAGE_TAG: '{{ .SLIM_IMAGE_TAG | default "1.3.0-rc.0" }}'

SLIM_CONTROLLER_CHART_TAG: '{{ .SLIM_CONTROLLER_CHART_TAG | default "v0.7.0" }}'
SLIM_CONTROLLER_IMAGE_TAG: '{{ .SLIM_CONTROLLER_IMAGE_TAG | default "0.7.2-dev.1" }}'
SLIM_CONTROLLER_CHART_TAG: '{{ .SLIM_CONTROLLER_CHART_TAG | default "v1.0.0" }}'
SLIM_CONTROLLER_IMAGE_TAG: '{{ .SLIM_CONTROLLER_IMAGE_TAG | default "1.0.0" }}'

SLIM_CONTROLLER_ENDPOINT: '{{ .SLIM_CONTROLLER_ENDPOINT | default "https://slim-control.admin.svc.cluster.local:50052" }}'
SLIM_CONTROLLER_LOCAL_ENDPOINT: '{{ .SLIM_CONTROLLER_LOCAL_ENDPOINT | default "localhost:50051" }}'
Expand Down Expand Up @@ -116,6 +116,22 @@ tasks:
- test-env:generate:cluster-configs
cmd: |
#!/bin/sh
cleanup_watch() {
if [ -n "${KUBE_WATCH_PID:-}" ]; then
kill "$KUBE_WATCH_PID" 2>/dev/null || true
wait "$KUBE_WATCH_PID" 2>/dev/null || true
fi
}
trap cleanup_watch EXIT

# Watch workload resources cluster-wide for up to 10m while Helm --wait runs (multi-namespace deploy).
if command -v timeout >/dev/null 2>&1; then
timeout 600s kubectl get pods -A -o wide -w &
else
kubectl get pods -A -o wide -w &
fi
KUBE_WATCH_PID=$!

for file in "./config/.gen"/*.yaml ;do
helm upgrade agntcy-$(basename "$file" .yaml) \
oci://{{ .IMAGE_REPO }}/slim/helm/slim \
Expand Down
4 changes: 2 additions & 2 deletions integrations/agntcy-slim/config/peer-to-peer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ topology:
- "cluster-b"
image: ghcr.io/agntcy/slim/bindings-examples:0.7.1
args:
- p2p
- slim-bindings-p2p
- --local
- org/ns/alice
- --spire-socket-path
Expand All @@ -20,7 +20,7 @@ topology:
- "cluster-a"
image: ghcr.io/agntcy/slim/bindings-examples:0.7.1
args:
- p2p
- slim-bindings-p2p
- --local
- org/ns/bob
- --remote
Expand Down
4 changes: 2 additions & 2 deletions integrations/agntcy-slim/tests/topology_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ var _ = ginkgo.Describe("Agntcy slim topology test", func() {
cfgJSON, err := json.Marshal(cfg)
gomega.Expect(err).NotTo(gomega.HaveOccurred(), "failed to marshal client config")

args := append(args, "--slim", string(cfgJSON))
args := append(args, "--slim-config", string(cfgJSON))
k8sHelper = k8sHelper.WithArgs(args).WithSpire()

} else {
Expand All @@ -196,7 +196,7 @@ var _ = ginkgo.Describe("Agntcy slim topology test", func() {
cfgJSON, err := json.Marshal(cfg)
gomega.Expect(err).NotTo(gomega.HaveOccurred(), "failed to marshal client config")

args = append(args, "--slim", string(cfgJSON))
args = append(args, "--slim-config", string(cfgJSON))
k8sHelper = k8sHelper.WithArgs(args)
}

Expand Down
Loading