Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
8190480
Add Karmada bootstrapping and volcano-global deployment scripts
kaffie-1517 Apr 1, 2026
8974cb0
Add environment setup scripts for Karmada, Volcano, and volcano-globa…
kaffie-1517 Apr 2, 2026
2c09e66
omit cloning entire history of Karmada
kaffie-1517 Apr 2, 2026
3065e21
maintain consistency in member cluster name
kaffie-1517 Apr 2, 2026
27aebd4
Verify karmada-host context after local Karmada setup
kaffie-1517 Apr 2, 2026
c8feb8c
update default Volcano version to release-1.14 and replace manual ret…
kaffie-1517 May 11, 2026
380cc98
use curl and pin Karmada to v1.12.0
kaffie-1517 May 11, 2026
596c876
fix: disable Go VCS stamping when building Karmada from tarball
kaffie-1517 May 26, 2026
0bce417
test: add e2e framework and test runner
kaffie-1517 Apr 14, 2026
54efd1b
fixed local ginkgo execution
kaffie-1517 Apr 14, 2026
603eeea
make member cluster contexts configurable
kaffie-1517 Apr 14, 2026
a5707e0
URL fix for the Kubernetes Reflector
kaffie-1517 Apr 14, 2026
6f593bb
use configurable member clusters for log collection
kaffie-1517 Apr 14, 2026
3a3cc0b
test: add e2e test cases and CI workflow
kaffie-1517 May 14, 2026
52aa631
ci: update actions/cache pin from v4.2.3 to v5.0.5
kaffie-1517 May 14, 2026
6c26df1
ci: build images with golang:1.25 to satisfy module graph requirements
kaffie-1517 May 26, 2026
8ca6a7f
build: exclude test/e2e from unit-test target
kaffie-1517 May 26, 2026
a20d084
ci: mirror licenses for ginkgo and gomega dependencies
kaffie-1517 May 26, 2026
035620a
ci: use go-version-file for unit tests
kaffie-1517 May 26, 2026
b1dc886
e2e: enable HyperJob and DataDependency controllers during deploy
kaffie-1517 May 26, 2026
92e3879
test/e2e: require HyperJob and DataDependency reconciliation
kaffie-1517 May 26, 2026
487a67d
test/e2e: refactoring
kaffie-1517 May 26, 2026
30b06e6
for ci trigger
kaffie-1517 May 26, 2026
37225b2
test/e2e/hyperjob: create dedicated queue before running suite
kaffie-1517 May 26, 2026
405dcf9
test/e2e/quota: wait for ResourceBindings to be suspended before asse…
kaffie-1517 May 26, 2026
a162921
submit both jobs before asserting dispatch order
kaffie-1517 May 27, 2026
a7a731b
avoid asserting dispatch order under capacity
kaffie-1517 May 27, 2026
6473dc1
test/e2e/vcjob: tolerate missing suspend observation window
kaffie-1517 May 27, 2026
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
100 changes: 100 additions & 0 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: E2E Tests

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.actor }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

jobs:
e2e:
name: e2e test
runs-on: ubuntu-24.04
timeout-minutes: 120
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true

- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0

- name: Install Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: go.mod

- name: Cache Go modules
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-

- name: Install dependencies
run: |
GO111MODULE="on" go install sigs.k8s.io/kind@v0.31.0
curl -LO https://dl.k8s.io/release/v1.35.0/bin/linux/amd64/kubectl
sudo install kubectl /usr/local/bin/kubectl

- name: Setup Karmada
run: |
./hack/setup-karmada.sh

- name: Setup Volcano on member clusters
run: |
./hack/setup-volcano.sh

- name: Build volcano-global images
run: |
TAG=$(git rev-parse --verify HEAD 2>/dev/null || echo "latest")
# The Dockerfiles hardcode golang:1.24 which does not satisfy the
# effective module-graph minimum of Go >= 1.25 (k8s.io v0.34.x).
# Stream a sed-patched Dockerfile to docker build via stdin so we
# can use golang:1.25 without modifying main-codebase files.
for name in controller-manager webhook-manager; do
sed 's|FROM golang:[0-9][0-9.]* AS builder|FROM golang:1.25 AS builder|' \
"installer/dockerfile/${name}/Dockerfile" | \
docker build -t "volcanosh/volcano-global-${name}:${TAG}" -f - .
done
echo "BUILD_TAG=${TAG}" >> "${GITHUB_ENV}"

- name: Deploy Volcano-Global
run: |
SKIP_BUILD=true TAG="${BUILD_TAG}" ./hack/deploy-volcano-global.sh

- name: Run e2e tests
run: |
export ARTIFACTS_PATH=${{ github.workspace }}/volcano-global-e2e-logs
export SKIP_SETUP=true
make e2e-test

- name: Upload e2e logs
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: volcano-global-e2e-logs
path: ${{ github.workspace }}/volcano-global-e2e-logs

10 changes: 5 additions & 5 deletions .github/workflows/unit_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ jobs:
permissions:
contents: read
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.24.x

- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Cache Go modules
uses: actions/cache@v4
with:
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ images:
done

unit-test:
go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...
go test -v -race -coverprofile=coverage.txt -covermode=atomic $$(go list ./... | grep -v /test/e2e)

e2e-test:
./hack/e2e.sh

clean:
rm -rf _output/
Expand Down
125 changes: 125 additions & 0 deletions docs/e2e-test-guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# Volcano-Global E2E Test Guide

## Overview

This guide explains how to run and extend the `volcano-global` e2e suite.

The e2e pipeline validates:
- Resource quota and priority dispatch behavior
- Cross-cluster VCJob scheduling
- Data dependency aware scheduling
- HyperJob scheduling

## Suite Coverage Map

| Suite | What it asserts |
|-------|-----------------|
| `quota/` | Queue propagation to member clusters; dispatcher unsuspends RBs when capacity is available; low/high priority VCJobs produce ResourceBindings |
| `vcjob/` | Webhook suspends a newly created RB; dispatcher unsuspends it; the VCJob is actually pushed to a target member cluster |
| `hyperjob/` | The HyperJob reconciler creates child VCJobs and PropagationPolicies for each ReplicatedJob entry |
| `datadependency/` | The DataDependency controller reconciles `DataSourceClaim` status (`Bound`/`Pending`) when the `DataDependencyAwareness` feature gate is enabled |

## Prerequisites

- Docker
- Go (version from `go.mod`)
- `kubectl`
- `kind`
- Internet access to pull Karmada/Volcano manifests and images

## Local Run

From repository root:

```bash
./hack/setup-e2e-env.sh
make e2e-test
```

Logs are collected in `volcano-global-e2e-logs/` by default.
For one-command execution, run:

```bash
./hack/e2e.sh
```

For reruns without reprovisioning:

```bash
SKIP_SETUP=true ./hack/e2e.sh
```

## Test Layout

```text
test/e2e/
framework/
clients.go
framework.go
vcjob.go
queue.go
propagationpolicy.go
resourcebinding.go
hyperjob.go
quota/
vcjob/
hyperjob/
datadependency/
```

## CI Workflow

The workflow is at `.github/workflows/e2e.yaml` and runs on:
- `pull_request` to `main`
- `push` to `main`
- manual `workflow_dispatch`

Main CI stages:
1. Setup toolchain (`go`, `kind`, `kubectl`)
2. Bootstrap Karmada multi-cluster environment
3. Install Volcano on member clusters
4. Deploy volcano-global components
5. Run ginkgo e2e tests (`SKIP_SETUP=true` in CI because setup was done in prior steps)
6. Upload logs as artifacts (`if: always()`)

## Deploy Guide Coverage Checks

The script flow mirrors `docs/deploy/README.md` and validates:
- reflector and `karmada-webhook-config` secret reflection into `volcano-global`
- CRDs applied to `karmada-apiserver` context
- webhook configurations present on `karmada-apiserver`
- resource interpreter customizations (`vcjob-configuration`, `queue-configuration`)
- all-queue ClusterPropagationPolicy label `resourcetemplate.karmada.io/deletion-protected=Always`

## Adding New E2E Cases

1. Add shared logic under `test/e2e/framework/` if reusable.
2. Add test spec in the feature suite package (`quota`, `vcjob`, `hyperjob`, `datadependency`).
3. Keep tests:
- deterministic
- isolated (use unique namespaces/resources)
- cleanup-safe
4. Re-run:

```bash
make e2e-test
```

## Controller Enablement at Deploy Time

The upstream `docs/deploy/volcano-global-controller-manager.yaml` ships with only `--controllers=dispatcher`. To exercise the HyperJob and DataDependency suites without modifying the upstream manifest, `hack/deploy-volcano-global.sh` patches the deployment on the fly to add:

```
- --controllers=dispatcher,reconciler,datadependency-controller
- --reconcilers=hyperjob
- --feature-gates=DataDependencyAwareness=true
```

If you bypass that script (e.g. by applying the manifest directly), the HyperJob and DataDependency suites will fail because the corresponding controllers are not running.

## Known Limitations

- Current upstream interpreter behavior for divided VCJob replicas can produce invalid `minAvailable`/`replicas` combinations in some scenarios. Prefer Aggregated placement in VCJob e2e tests until upstream fix is merged.
- Priority ordering under constrained queue capacity is not e2e-gated yet. The dispatcher still has a TODO for full capacity-based dispatch (`pkg/dispatcher/dispatcher.go`); the quota suite verifies RB creation for priority-tagged jobs instead.
- The vcjob suite may miss the brief webhook-suspend window if the dispatcher unsuspends the ResourceBinding before the test observes it. The test still verifies unsuspend and member-cluster dispatch.

23 changes: 15 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
module volcano.sh/volcano-global

go 1.24.0
go 1.25.0

require (
github.com/google/go-cmp v0.7.0
github.com/karmada-io/karmada v1.13.0-beta.0
github.com/onsi/ginkgo/v2 v2.28.3
github.com/onsi/gomega v1.40.0
github.com/spf13/pflag v1.0.6
github.com/stretchr/testify v1.10.0
gomodules.xyz/jsonpatch/v2 v2.4.0
Expand All @@ -24,6 +26,7 @@ require (

require (
cel.dev/expr v0.24.0 // indirect
github.com/Masterminds/semver/v3 v3.4.0 // indirect
github.com/antlr4-go/antlr/v4 v4.13.1 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
Expand All @@ -39,10 +42,12 @@ require (
github.com/go-openapi/jsonpointer v0.21.1 // indirect
github.com/go-openapi/jsonreference v0.21.0 // indirect
github.com/go-openapi/swag v0.23.1 // indirect
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/google/cadvisor v0.52.1 // indirect
github.com/google/cel-go v0.26.0 // indirect
github.com/google/gnostic-models v0.7.0 // indirect
github.com/google/pprof v0.0.0-20260402051712-545e8a4df936 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
Expand All @@ -67,18 +72,20 @@ require (
go.opentelemetry.io/otel/trace v1.36.0 // indirect
go.yaml.in/yaml/v2 v2.4.2 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/crypto v0.39.0 // indirect
golang.org/x/crypto v0.50.0 // indirect
golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0 // indirect
golang.org/x/net v0.41.0 // indirect
golang.org/x/mod v0.35.0 // indirect
golang.org/x/net v0.53.0 // indirect
golang.org/x/oauth2 v0.30.0 // indirect
golang.org/x/sync v0.15.0 // indirect
golang.org/x/sys v0.33.0 // indirect
golang.org/x/term v0.32.0 // indirect
golang.org/x/text v0.26.0 // indirect
golang.org/x/sync v0.20.0 // indirect
golang.org/x/sys v0.43.0 // indirect
golang.org/x/term v0.42.0 // indirect
golang.org/x/text v0.36.0 // indirect
golang.org/x/time v0.11.0 // indirect
golang.org/x/tools v0.44.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250324211829-b45e905df463 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250505200425-f936aa4a68b2 // indirect
google.golang.org/protobuf v1.36.6 // indirect
google.golang.org/protobuf v1.36.7 // indirect
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
Expand Down
Loading