Skip to content

Commit 46aa01d

Browse files
committed
tests: consolidate integration tests on a shared framework and the rlts scenarios
Extract the generic pieces of the snapshot-agent integration harness into tests/integration/harness — in-cluster client setup, node selection (TEST_NODE / free-GPU pick), pod lifecycle, exec (with stdin) / HTTP / VRAM helpers, and attach-by-label for chart-deployed pods. The snapshot-agent suite keeps its specifics (agent deployment, engine specs, agentctl call path) and composes the shared Cluster. Move the orchestrator E2E scenario drivers (RunSingleRLJobScenario, RunQueuedRLJobsScenario, FakeRLJob, PodFactory, Logger) from test/e2e/acceleratororchestrator to pkg/accelerator-orchestrator/scenarios so one implementation serves the rlts CLI, the in-process go tests (which stay in test/e2e with their fakes), and the integration suite. The suite gains the orchestrator phase: run.sh installs the official accelerator-orchestrator chart, labels TEST_NODE with the samplers/trainers groups, and TestOrchestrator runs the shared scenarios against it with a new pause pod template (no GPU work). The chart gains a snapshotAgentPort value; the phase points it at an unused port because a real agent correctly reports jobs without GPU activity as idle-not-loaded (stalling lock handoffs) — the agentless mode is what 'rlts test orchestrator' targets on orchestrator-only deployments, and agent-driven C/R scenarios need real GPU workloads (future work). run.sh is the single integration entrypoint: --phase all (default) = standalone + k8s + orchestrator, and --build now also covers the orchestrator image. Signed-off-by: Aishu Kamal <aishuk@google.com>
1 parent 5b49591 commit 46aa01d

13 files changed

Lines changed: 582 additions & 299 deletions

File tree

cmd/rlts/cmd/test_e2e.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727
"k8s.io/client-go/tools/clientcmd"
2828

2929
pb "github.com/llm-d-incubation/llm-d-rl-time-slicing/pkg/accelerator-orchestrator/api/v1alpha1"
30-
"github.com/llm-d-incubation/llm-d-rl-time-slicing/test/e2e/acceleratororchestrator"
30+
"github.com/llm-d-incubation/llm-d-rl-time-slicing/pkg/accelerator-orchestrator/scenarios"
3131
)
3232

3333
var testCmd = &cobra.Command{
@@ -163,7 +163,7 @@ var orchestratorTestCmd = &cobra.Command{
163163

164164
// Scenario 1: Single RL Job
165165
fmt.Println("--- Running Scenario: Single RL Job ---")
166-
err = acceleratororchestrator.RunSingleRLJobScenario(ctx, clientset, client, cliLogger, samplerTemplateKey, trainerTemplateKey)
166+
err = scenarios.RunSingleRLJobScenario(ctx, clientset, client, cliLogger, samplerTemplateKey, trainerTemplateKey)
167167
scenario1Passed := err == nil
168168
if !scenario1Passed {
169169
fmt.Printf("[FAIL] Single RL Job Scenario failed: %v\n\n", err)
@@ -173,7 +173,7 @@ var orchestratorTestCmd = &cobra.Command{
173173

174174
// Scenario 2: Queued RL Jobs
175175
fmt.Println("--- Running Scenario: Queued RL Jobs ---")
176-
err = acceleratororchestrator.RunQueuedRLJobsScenario(ctx, clientset, client, cliLogger, samplerTemplateKey, trainerTemplateKey)
176+
err = scenarios.RunQueuedRLJobsScenario(ctx, clientset, client, cliLogger, samplerTemplateKey, trainerTemplateKey)
177177
scenario2Passed := err == nil
178178
if !scenario2Passed {
179179
fmt.Printf("[FAIL] Queued RL Jobs Scenario failed: %v\n\n", err)
@@ -220,7 +220,7 @@ func init() {
220220
"Name of the Kubernetes PodTemplate to use for trainer pods (blank for default pause pod)")
221221
}
222222

223-
// cliLogger implements acceleratororchestrator.Logger interface to print to stdout.
223+
// cliLogger implements scenarios.Logger interface to print to stdout.
224224
type cliLogger struct{}
225225

226226
func (c *cliLogger) Log(args ...interface{}) {

deploy/acceleratororchestrator/templates/deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ spec:
2020
- name: {{ .Chart.Name }}
2121
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
2222
imagePullPolicy: {{ .Values.image.pullPolicy }}
23+
args:
24+
- "-snapshot-agent-port={{ .Values.snapshotAgentPort }}"
2325
ports:
2426
- name: grpc
2527
containerPort: 50051

deploy/acceleratororchestrator/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ service:
99
type: ClusterIP
1010
port: 50051
1111

12+
# Port the orchestrator uses to reach the snapshot agents on group nodes
13+
# (hostNetwork). Must match the snapshot-agent chart's `port` value.
14+
snapshotAgentPort: 9001
15+
1216
resources: {}
1317
# limits:
1418
# cpu: 100m

test/e2e/acceleratororchestrator/fake_rl_job.go renamed to pkg/accelerator-orchestrator/scenarios/fake_rl_job.go

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
1-
package acceleratororchestrator
1+
// Copyright 2026 The llm-d Authors.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
package scenarios
216

317
import (
418
"context"

test/e2e/acceleratororchestrator/pod_factory.go renamed to pkg/accelerator-orchestrator/scenarios/pod_factory.go

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
package acceleratororchestrator
15+
package scenarios
1616

1717
import (
1818
"sync"
@@ -62,6 +62,20 @@ func NewPodFactory() *PodFactory {
6262
},
6363
},
6464
})
65+
// "pause" runs no GPU work at all: for exercising the lock/scheduling
66+
// protocol on clusters where the GPUs must stay untouched.
67+
factory.Register("pause", &corev1.Pod{
68+
Spec: corev1.PodSpec{
69+
TerminationGracePeriodSeconds: &gracePeriodSec,
70+
Containers: []corev1.Container{
71+
{
72+
Name: "pause",
73+
Image: "registry.k8s.io/pause:3.10",
74+
ImagePullPolicy: corev1.PullIfNotPresent,
75+
},
76+
},
77+
},
78+
})
6579
factory.Register("vllm", &corev1.Pod{
6680
Spec: corev1.PodSpec{
6781
Containers: []corev1.Container{

test/e2e/acceleratororchestrator/scenarios.go renamed to pkg/accelerator-orchestrator/scenarios/scenarios.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
package acceleratororchestrator
15+
// Package scenarios contains the accelerator-orchestrator E2E scenario
16+
// drivers. It is the single implementation shared by the rlts CLI
17+
// (`rlts test orchestrator`) and the Go test suites: scenarios take a gRPC
18+
// client and a Kubernetes clientset, report progress through the Logger
19+
// interface, and return errors rather than printing or exiting.
20+
package scenarios
1621

1722
import (
1823
"context"

test/e2e/acceleratororchestrator/e2e_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
pb "github.com/llm-d-incubation/llm-d-rl-time-slicing/pkg/accelerator-orchestrator/api/v1alpha1"
1212
"github.com/llm-d-incubation/llm-d-rl-time-slicing/pkg/accelerator-orchestrator/controller"
1313
"github.com/llm-d-incubation/llm-d-rl-time-slicing/pkg/accelerator-orchestrator/infrastructure"
14+
"github.com/llm-d-incubation/llm-d-rl-time-slicing/pkg/accelerator-orchestrator/scenarios"
1415
"github.com/llm-d-incubation/llm-d-rl-time-slicing/pkg/accelerator-orchestrator/server"
1516
"github.com/llm-d-incubation/llm-d-rl-time-slicing/pkg/accelerator-orchestrator/store"
1617
google_grpc "google.golang.org/grpc"
@@ -152,7 +153,7 @@ func TestE2E_SingleRLJob(t *testing.T) {
152153
t.Log("Store initialized with samplers and trainers groups")
153154

154155
// Run Scenario
155-
if err := RunSingleRLJobScenario(ctx, clientset, client, t, "", ""); err != nil {
156+
if err := scenarios.RunSingleRLJobScenario(ctx, clientset, client, t, "", ""); err != nil {
156157
t.Fatalf("Scenario failed: %v", err)
157158
}
158159
}
@@ -283,7 +284,7 @@ func TestE2E_QueuedRLJobs(t *testing.T) {
283284
t.Log("Store initialized with samplers and trainers groups")
284285

285286
// Run Scenario
286-
if err := RunQueuedRLJobsScenario(ctx, clientset, client, t, "", ""); err != nil {
287+
if err := scenarios.RunQueuedRLJobsScenario(ctx, clientset, client, t, "", ""); err != nil {
287288
t.Fatalf("Scenario failed: %v", err)
288289
}
289290
}

0 commit comments

Comments
 (0)