Skip to content
Open
Changes from 1 commit
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
29 changes: 17 additions & 12 deletions test/e2e/e2e_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ package e2e

import (
"context"
"fmt"
"io"
"os/exec"
"runtime"
"strings"
"testing"
"time"
Expand All @@ -12,7 +14,7 @@ import (
"github.com/onsi/gomega"
"github.com/onsi/gomega/gexec"
apiextv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
"k8s.io/apimachinery/pkg/runtime"
k8sruntime "k8s.io/apimachinery/pkg/runtime"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/client/config"
Expand Down Expand Up @@ -58,7 +60,7 @@ var (
ctx = context.Background()
k8sClient client.Client
port string
scheme = runtime.NewScheme()
scheme = k8sruntime.NewScheme()

eppTag = env.GetEnvString("EPP_TAG", "dev", ginkgo.GinkgoLogr)
vllmSimTag = env.GetEnvString("VLLM_SIMULATOR_TAG", "dev", ginkgo.GinkgoLogr)
Expand Down Expand Up @@ -118,20 +120,23 @@ func setupK8sCluster() {
gomega.Expect(err).ShouldNot(gomega.HaveOccurred())
gomega.Eventually(session).WithTimeout(600 * time.Second).Should(gexec.Exit(0))

command = exec.Command("kind", "--name", "e2e-tests", "load", "docker-image",
"ghcr.io/llm-d/llm-d-inference-sim:"+vllmSimTag)
session, err = gexec.Start(command, ginkgo.GinkgoWriter, ginkgo.GinkgoWriter)
gomega.Expect(err).ShouldNot(gomega.HaveOccurred())
gomega.Eventually(session).WithTimeout(600 * time.Second).Should(gexec.Exit(0))
kindLoad("ghcr.io/llm-d/llm-d-inference-sim:" + vllmSimTag)
kindLoad("ghcr.io/llm-d/llm-d-inference-scheduler:" + eppTag)
kindLoad("ghcr.io/llm-d/llm-d-routing-sidecar:" + routingSideCarTag)
}

command = exec.Command("kind", "--name", "e2e-tests", "load", "docker-image",
"ghcr.io/llm-d/llm-d-inference-scheduler:"+eppTag)
session, err = gexec.Start(command, ginkgo.GinkgoWriter, ginkgo.GinkgoWriter)
func kindLoad(image string) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: perhaps kindLoadImage?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

tempDir := ginkgo.GinkgoT().TempDir()

ginkgo.By(fmt.Sprintf("Loading %s into the cluster e2e-tests", image))

command := exec.Command("docker", "save", "--platform", "linux/"+runtime.GOARCH,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: perhaps define target := tempDir+"/docker.tar" and then reuse in L134 and L139.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

"--output", tempDir+"/docker.tar", image)
session, err := gexec.Start(command, ginkgo.GinkgoWriter, ginkgo.GinkgoWriter)
gomega.Expect(err).ShouldNot(gomega.HaveOccurred())
gomega.Eventually(session).WithTimeout(600 * time.Second).Should(gexec.Exit(0))

command = exec.Command("kind", "--name", "e2e-tests", "load", "docker-image",
"ghcr.io/llm-d/llm-d-routing-sidecar:"+routingSideCarTag)
command = exec.Command("kind", "--name", "e2e-tests", "load", "image-archive", tempDir+"/docker.tar")
session, err = gexec.Start(command, ginkgo.GinkgoWriter, ginkgo.GinkgoWriter)
gomega.Expect(err).ShouldNot(gomega.HaveOccurred())
gomega.Eventually(session).WithTimeout(600 * time.Second).Should(gexec.Exit(0))
Expand Down