Skip to content

E2E

E2E #500

Workflow file for this run

name: E2E
on:
pull_request:
workflow_dispatch:
inputs:
workload_group:
description: Workload E2E group to run.
required: false
default: all
type: choice
options:
- all
- real-agent-ziti
- orchestrator-workloads
- k8s-runner-workloads
- platform-usage
agents_orchestrator_ref:
description: agents-orchestrator ref for workload source deploys.
required: false
default: main
k8s_runner_ref:
description: k8s-runner ref for workload source deploys.
required: false
default: main
push:
branches: [main]
concurrency:
group: >-
e2e-${{ github.event_name == 'pull_request' && github.event.pull_request.number ||
github.event_name == 'workflow_dispatch' && github.run_id || github.sha }}
cancel-in-progress: true
jobs:
platform-usage:
if: >-
${{ github.event_name != 'workflow_dispatch' ||
inputs.workload_group == 'all' ||
inputs.workload_group == 'platform-usage' }}
runs-on: ubuntu-latest
timeout-minutes: 60
permissions:
contents: read
env:
AGYN_AGENT_INIT_IMAGE: ghcr.io/agynio/agent-init:v1.0.0
CODEX_INIT_IMAGE: ghcr.io/agynio/agent-init-codex:0.13.29
AGN_INIT_IMAGE: ghcr.io/agynio/agent-init-agn:0.5.5
CLAUDE_INIT_IMAGE: ghcr.io/agynio/agent-init-claude:0.1.29
AGN_EXPOSE_INIT_IMAGE: ghcr.io/agynio/agent-init-agn:0.5.5
TF_VAR_threads_chart_version: 0.4.12
TF_VAR_threads_image_tag: 0.4.12
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Provision cluster
uses: agynio/bootstrap/.github/actions/provision@main
with:
ref: main
- name: Run platform usage E2E test
uses: ./.github/actions/run-tests
env:
E2E_SUITES: playwright
E2E_PLAYWRIGHT_TEST_ARGS: test/e2e/organization-platform-usage.spec.ts
with:
e2e-ref: >-
${{ github.event_name == 'pull_request' &&
github.event.pull_request.head.sha || github.ref }}
tag: svc_metering
include_smoke: false
go-core-workloads:
runs-on: ubuntu-latest
timeout-minutes: 90
permissions:
contents: read
env:
AGYN_AGENT_INIT_IMAGE: ghcr.io/agynio/agent-init:v1.0.0
CODEX_INIT_IMAGE: ghcr.io/agynio/agent-init-codex:0.13.29
AGN_INIT_IMAGE: ghcr.io/agynio/agent-init-agn:0.5.5
CLAUDE_INIT_IMAGE: ghcr.io/agynio/agent-init-claude:0.1.29
AGN_EXPOSE_INIT_IMAGE: ghcr.io/agynio/agent-init-agn:0.5.5
TF_VAR_threads_chart_version: 0.4.12
TF_VAR_threads_image_tag: 0.4.12
strategy:
fail-fast: false
matrix:
include:
- name: real-agent-ziti
tags: svc_agents_orchestrator
run: >-
TestAgentAgynCLIWaitToAnotherAgent|TestFullPipelineAgnMessageResponse
- name: orchestrator-workloads
tags: svc_agents_orchestrator
run: >-
TestWorkloadStartsOnUnackedMessage|TestWorkloadStopsAfterIdleTimeout|TestWorkloadStartRetryPolicyFastRetry
- name: k8s-runner-workloads
tags: svc_k8s_runner,svc_runners,svc_llm
run: >-
TestWorkloadLifecycle|TestExec|TestStreaming|TestStreamEvents|TestPutArchive|TestVolumeQueries
steps:
- name: Checkout
if: >-
${{ github.event_name != 'workflow_dispatch' ||
inputs.workload_group == 'all' ||
inputs.workload_group == matrix.name }}
uses: actions/checkout@v4
- name: Provision cluster
if: >-
${{ github.event_name != 'workflow_dispatch' ||
inputs.workload_group == 'all' ||
inputs.workload_group == matrix.name }}
uses: agynio/bootstrap/.github/actions/provision@main
with:
ref: main
- name: Setup DevSpace for source deploy
if: >-
${{ (github.event_name != 'workflow_dispatch' ||
inputs.workload_group == 'all' ||
inputs.workload_group == matrix.name) &&
(matrix.name == 'real-agent-ziti' ||
matrix.name == 'orchestrator-workloads') }}
uses: ./.github/actions/setup-devspace
- name: Checkout k8s-runner source
if: >-
${{ (github.event_name != 'workflow_dispatch' ||
inputs.workload_group == 'all' ||
inputs.workload_group == matrix.name) &&
matrix.name == 'real-agent-ziti' }}
uses: actions/checkout@v4
with:
repository: agynio/k8s-runner
ref: >-
${{ github.event_name == 'workflow_dispatch' &&
inputs.k8s_runner_ref || 'main' }}
path: .e2e-deps/k8s-runner
- name: Checkout agents-orchestrator source
if: >-
${{ (github.event_name != 'workflow_dispatch' ||
inputs.workload_group == 'all' ||
inputs.workload_group == matrix.name) &&
(matrix.name == 'real-agent-ziti' ||
matrix.name == 'orchestrator-workloads') }}
uses: actions/checkout@v4
with:
repository: agynio/agents-orchestrator
ref: >-
${{ github.event_name == 'workflow_dispatch' &&
inputs.agents_orchestrator_ref || 'main' }}
path: .e2e-deps/agents-orchestrator
- name: Deploy k8s-runner from source
if: >-
${{ (github.event_name != 'workflow_dispatch' ||
inputs.workload_group == 'all' ||
inputs.workload_group == matrix.name) &&
matrix.name == 'real-agent-ziti' }}
working-directory: .e2e-deps/k8s-runner
run: devspace run deploy
- name: Deploy agents-orchestrator from source
if: >-
${{ (github.event_name != 'workflow_dispatch' ||
inputs.workload_group == 'all' ||
inputs.workload_group == matrix.name) &&
(matrix.name == 'real-agent-ziti' ||
matrix.name == 'orchestrator-workloads') }}
working-directory: .e2e-deps/agents-orchestrator
run: |
if [ "${{ matrix.name }}" = "real-agent-ziti" ]; then
export ZITI_RUNTIME_CONTROLLER_RESOLVE_HOST=istio-ingressgateway.istio-gateway.svc.cluster.local
export ZITI_RUNTIME_CONTROLLER_PORT=443
fi
devspace run deploy
- name: Allow workload DNS egress to Ziti
if: >-
${{ (github.event_name != 'workflow_dispatch' ||
inputs.workload_group == 'all' ||
inputs.workload_group == matrix.name) &&
(matrix.name == 'real-agent-ziti' ||
matrix.name == 'orchestrator-workloads') }}
run: |
set -euo pipefail
patch='[{"op":"add","path":"/spec/egress/-","value":{"to":[{"namespaceSelector":{"matchLabels":{"kubernetes.io/metadata.name":"ziti"}},"podSelector":{"matchLabels":{"app.kubernetes.io/name":"ziti-workload-dns"}}}],"ports":[{"protocol":"UDP","port":53},{"protocol":"TCP","port":53}]}}'
ziti_controller_ip="$(kubectl get service ziti-controller-client -n ziti -o jsonpath='{.spec.clusterIP}')"
if [ -z "$ziti_controller_ip" ]; then
echo "ziti-controller-client ClusterIP is empty" >&2
exit 1
fi
if [ "${{ matrix.name }}" = "real-agent-ziti" ]; then
istio_gateway_ip="$(kubectl get service istio-ingressgateway -n istio-gateway -o jsonpath='{.spec.clusterIP}')"
if [ -z "$istio_gateway_ip" ]; then
echo "istio-ingressgateway ClusterIP is empty" >&2
exit 1
fi
kubectl patch configmap ziti-workload-dns \
-n ziti \
--type=merge \
-p "$(cat <<EOF_DNS
{"data":{"ziti.db":"\$ORIGIN ziti.agyn.dev.\n\$TTL 30\n@ IN SOA ns.ziti.agyn.dev. hostmaster.agyn.dev. 1 7200 3600 1209600 30\n@ IN NS ns.ziti.agyn.dev.\n@ IN A ${istio_gateway_ip}\nns IN A ${istio_gateway_ip}\n"}}
EOF_DNS
)"
kubectl rollout restart deployment/ziti-workload-dns -n ziti
kubectl rollout status deployment/ziti-workload-dns -n ziti --timeout=120s
patch="${patch},{\"op\":\"add\",\"path\":\"/spec/egress/-\",\"value\":{\"to\":[{\"ipBlock\":{\"cidr\":\"${istio_gateway_ip}/32\"}}],\"ports\":[{\"protocol\":\"TCP\",\"port\":443}]}}"
fi
patch="${patch},{\"op\":\"add\",\"path\":\"/spec/egress/-\",\"value\":{\"to\":[{\"ipBlock\":{\"cidr\":\"${ziti_controller_ip}/32\"}}],\"ports\":[{\"protocol\":\"TCP\",\"port\":2496}]}}]"
kubectl patch networkpolicy agent-workload-egress \
-n agyn-workloads \
--type=json \
-p "$patch"
- name: Run go-core workload E2E tests
if: >-
${{ github.event_name != 'workflow_dispatch' ||
inputs.workload_group == 'all' ||
inputs.workload_group == matrix.name }}
uses: ./.github/actions/run-tests
env:
E2E_SUITES: go-core
E2E_GO_TEST_RUN: ${{ matrix.run }}
E2E_GO_TEST_TIMEOUT: 35m
with:
e2e-ref: >-
${{ github.event_name == 'pull_request' &&
github.event.pull_request.head.sha || github.ref }}
tag: ${{ matrix.tags }}
include_smoke: false
- name: Restore k8s-runner ArgoCD sync
if: >-
${{ always() && (github.event_name != 'workflow_dispatch' ||
inputs.workload_group == 'all' ||
inputs.workload_group == matrix.name) &&
matrix.name == 'real-agent-ziti' }}
run: |
if [ -d .e2e-deps/k8s-runner ]; then
cd .e2e-deps/k8s-runner
devspace run restore-argocd
fi
- name: Restore agents-orchestrator ArgoCD sync
if: >-
${{ always() && (github.event_name != 'workflow_dispatch' ||
inputs.workload_group == 'all' ||
inputs.workload_group == matrix.name) &&
(matrix.name == 'real-agent-ziti' ||
matrix.name == 'orchestrator-workloads') }}
run: |
if [ -d .e2e-deps/agents-orchestrator ]; then
cd .e2e-deps/agents-orchestrator
devspace run restore-argocd
fi