Skip to content

Commit

Permalink
Use AR images on the domain pkg.dev.
Browse files Browse the repository at this point in the history
Use pkg.dev consistently since GCR is deprecated. We don't have to
manage mirrored image repos for gcr.io and pkg.dev.

PiperOrigin-RevId: 695447391
  • Loading branch information
milantracy authored and gvisor-bot committed Nov 12, 2024
1 parent e22dc29 commit 685eeb8
Show file tree
Hide file tree
Showing 17 changed files with 74 additions and 24 deletions.
10 changes: 9 additions & 1 deletion test/kubernetes/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("//tools:defs.bzl", "proto_library")
load("//tools:defs.bzl", "go_library", "proto_library")

package(
default_applicable_licenses = ["//:license"],
Expand All @@ -16,3 +16,11 @@ proto_library(
"@com_google_protobuf//:any_proto",
],
)

go_library(
name = "kubernetes",
srcs = ["helpers.go"],
visibility = [
"//visibility:public",
],
)
10 changes: 10 additions & 0 deletions test/kubernetes/benchmarks/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ go_test(
"notap",
],
deps = [
"//test/kubernetes",
"//test/kubernetes/benchmarks/profiling",
"//test/kubernetes/benchmetric",
"//test/kubernetes/k8sctx",
Expand Down Expand Up @@ -49,6 +50,7 @@ go_test(
"notap",
],
deps = [
"//test/kubernetes",
"//test/kubernetes/benchmarks/profiling",
"//test/kubernetes/benchmetric",
"//test/kubernetes/k8sctx",
Expand All @@ -68,6 +70,7 @@ go_test(
],
deps = [
"//test/benchmarks/tools",
"//test/kubernetes",
"//test/kubernetes/benchmarks/profiling",
"//test/kubernetes/benchmetric",
"//test/kubernetes/k8sctx",
Expand All @@ -86,6 +89,7 @@ go_test(
"notap",
],
deps = [
"//test/kubernetes",
"//test/kubernetes/benchmarks/profiling",
"//test/kubernetes/benchmetric",
"//test/kubernetes/k8sctx",
Expand All @@ -104,6 +108,7 @@ go_test(
"notap",
],
deps = [
"//test/kubernetes",
"//test/kubernetes/benchmarks/profiling",
"//test/kubernetes/benchmetric",
"//test/kubernetes/k8sctx",
Expand All @@ -122,6 +127,7 @@ go_test(
"notap",
],
deps = [
"//test/kubernetes",
"//test/kubernetes/benchmarks/httpbench",
"//test/kubernetes/benchmarks/profiling",
"//test/kubernetes/k8sctx",
Expand Down Expand Up @@ -159,6 +165,7 @@ go_test(
"notap",
],
deps = [
"//test/kubernetes",
"//test/kubernetes/benchmarks/profiling",
"//test/kubernetes/benchmetric",
"//test/kubernetes/k8sctx",
Expand Down Expand Up @@ -196,6 +203,7 @@ go_test(
"notap",
],
deps = [
"//test/kubernetes",
"//test/kubernetes/benchmarks/profiling",
"//test/kubernetes/benchmetric",
"//test/kubernetes/k8sctx",
Expand All @@ -217,6 +225,7 @@ go_test(
],
deps = [
"//test/gpu/ollama",
"//test/kubernetes",
"//test/kubernetes/benchmetric",
"//test/kubernetes/k8sctx",
"//test/kubernetes/testcluster",
Expand All @@ -237,6 +246,7 @@ go_test(
],
deps = [
"//test/gpu/stablediffusion",
"//test/kubernetes",
"//test/kubernetes/benchmetric",
"//test/kubernetes/k8sctx",
"//test/kubernetes/testcluster",
Expand Down
3 changes: 2 additions & 1 deletion test/kubernetes/benchmarks/abslbuild_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"strings"
"testing"

k8s "gvisor.dev/gvisor/test/kubernetes"
"gvisor.dev/gvisor/test/kubernetes/benchmarks/profiling"
"gvisor.dev/gvisor/test/kubernetes/benchmetric"
"gvisor.dev/gvisor/test/kubernetes/k8sctx"
Expand All @@ -30,7 +31,7 @@ import (
)

const (
imageAMD = "gcr.io/gvisor-presubmit/benchmarks/absl_x86_64:latest"
imageAMD = k8s.ImageRepoPrefix + "benchmarks/absl_x86_64:latest"
)

// TestABSLBuild benchmarks building various Abseil C++ targets.
Expand Down
5 changes: 3 additions & 2 deletions test/kubernetes/benchmarks/ffmpeg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"strings"
"testing"

k8s "gvisor.dev/gvisor/test/kubernetes"
"gvisor.dev/gvisor/test/kubernetes/benchmarks/profiling"
"gvisor.dev/gvisor/test/kubernetes/benchmetric"
"gvisor.dev/gvisor/test/kubernetes/k8sctx"
Expand All @@ -29,9 +30,9 @@ import (
)

const (
imageAMD = "gcr.io/gvisor-presubmit/benchmarks/ffmpeg_x86_64:latest"
imageARM = "gcr.io/gvisor-presubmit/benchmarks/ffmpeg_aarch64:latest"
ffmpegContainerName = "ffmpeg"
imageAMD = k8s.ImageRepoPrefix + "benchmarks/ffmpeg_x86_64:latest"
imageARM = k8s.ImageRepoPrefix + "benchmarks/ffmpeg_aarch64:latest"
)

func TestFfmpeg(t *testing.T) {
Expand Down
5 changes: 3 additions & 2 deletions test/kubernetes/benchmarks/grpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"strings"
"testing"

k8s "gvisor.dev/gvisor/test/kubernetes"
"gvisor.dev/gvisor/test/kubernetes/benchmarks/profiling"
"gvisor.dev/gvisor/test/kubernetes/benchmetric"
"gvisor.dev/gvisor/test/kubernetes/k8sctx"
Expand All @@ -30,8 +31,8 @@ import (
)

const (
imageAMD = "gcr.io/gvisor-presubmit/benchmarks/build-grpc_x86_64:latest"
imageARM = "gcr.io/gvisor-presubmit/benchmarks/build-grpc_aarch64:latest"
imageAMD = k8s.ImageRepoPrefix + "benchmarks/build-grpc_x86_64:latest"
imageARM = k8s.ImageRepoPrefix + "benchmarks/build-grpc_aarch64:latest"
)

func TestGRPCBuild(t *testing.T) {
Expand Down
1 change: 1 addition & 0 deletions test/kubernetes/benchmarks/httpbench/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ go_library(
"//test/kubernetes/benchmarks:__subpackages__",
],
deps = [
"//test/kubernetes",
"//test/kubernetes/benchmetric",
"//test/kubernetes/testcluster",
"@io_k8s_api//core/v1:go_default_library",
Expand Down
3 changes: 2 additions & 1 deletion test/kubernetes/benchmarks/httpbench/httpbench.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"testing"
"time"

k8s "gvisor.dev/gvisor/test/kubernetes"
"gvisor.dev/gvisor/test/kubernetes/benchmetric"
"gvisor.dev/gvisor/test/kubernetes/testcluster"
v13 "k8s.io/api/core/v1"
Expand All @@ -37,7 +38,7 @@ import (
// the HTTP server with load on a single connection.
const InfiniteQPS = 1 << 16

const wrk2ImageAMD = "gcr.io/gvisor-presubmit/benchmarks/wrk2_x86_64:latest"
const wrk2ImageAMD = k8s.ImageRepoPrefix + "benchmarks/wrk2_x86_64:latest"

// MetricType is a type of metric to report.
type MetricType int
Expand Down
5 changes: 3 additions & 2 deletions test/kubernetes/benchmarks/nginx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"testing"
"time"

k8s "gvisor.dev/gvisor/test/kubernetes"
"gvisor.dev/gvisor/test/kubernetes/benchmarks/httpbench"
"gvisor.dev/gvisor/test/kubernetes/benchmarks/profiling"
"gvisor.dev/gvisor/test/kubernetes/k8sctx"
Expand All @@ -31,15 +32,15 @@ import (
)

const (
nginxImageAMD = "gcr.io/gvisor-presubmit/benchmarks/nginx_x86_64:latest"
nginxImageARM = "gcr.io/gvisor-presubmit/benchmarks/nginx_aarch64:latest"
nginxPort = 80
nginxBenchmarkDuration = 70 * time.Second
nginxRequestTimeout = 3 * time.Second
nginxServingDir = "/tmp/html"

nginxServerLabelKey = "app.kubernetes.io/name"
nginxServerLabelValue = "nginx-server"
nginxImageAMD = k8s.ImageRepoPrefix + "benchmarks/nginx_x86_64:latest"
nginxImageARM = k8s.ImageRepoPrefix + "benchmarks/nginx_aarch64:latest"
)

var (
Expand Down
5 changes: 3 additions & 2 deletions test/kubernetes/benchmarks/ollama_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"unicode"

"gvisor.dev/gvisor/test/gpu/ollama"
k8s "gvisor.dev/gvisor/test/kubernetes"
"gvisor.dev/gvisor/test/kubernetes/benchmetric"
"gvisor.dev/gvisor/test/kubernetes/k8sctx"
"gvisor.dev/gvisor/test/kubernetes/testcluster"
Expand Down Expand Up @@ -816,11 +817,11 @@ func doOllamaTest(ctx context.Context, t *testing.T, k8sCtx k8sctx.KubernetesCon
const (
ollamaServerLabelKey = "app.kubernetes.io/name"
ollamaServerLabelValue = "ollama-server"
ollamaBenchImage = "gcr.io/gvisor-presubmit/benchmarks/gpu/ollama/bench:latest"
ollamaBenchClientImage = "gcr.io/gvisor-presubmit/benchmarks/gpu/ollama/client:latest"
ollamaPort = 11434
ollamaPodName = "ollama-server"
ollamaServiceName = "ollama-service"
ollamaBenchImage = k8s.ImageRepoPrefix + "benchmarks/gpu/ollama/bench:latest"
ollamaBenchClientImage = k8s.ImageRepoPrefix + "benchmarks/gpu/ollama/client:latest"
)

// newOllamaServerPod returns the pod spec for an ollama server.
Expand Down
1 change: 1 addition & 0 deletions test/kubernetes/benchmarks/profiling/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ go_library(
deps = [
"//pkg/atomicbitops",
"//runsc/flag",
"//test/kubernetes",
"//test/kubernetes/testcluster",
"//test/metricsviz",
"@com_github_google_pprof//profile:go_default_library",
Expand Down
5 changes: 3 additions & 2 deletions test/kubernetes/benchmarks/profiling/profiling.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import (
"google.golang.org/protobuf/proto"
"gvisor.dev/gvisor/pkg/atomicbitops"
"gvisor.dev/gvisor/runsc/flag"
k8s "gvisor.dev/gvisor/test/kubernetes"
"gvisor.dev/gvisor/test/kubernetes/testcluster"
"gvisor.dev/gvisor/test/metricsviz"
appsv1 "k8s.io/api/apps/v1"
Expand All @@ -61,10 +62,10 @@ var (

const (
setupPodName = "runsc-profiling-setup"
profileHelperImageAMD64 = "gcr.io/gvisor-presubmit/benchmarks/profile-helper_x86_64:latest"
profileHelperImageARM64 = "gcr.io/gvisor-presubmit/benchmarks/profile-helper_aarch64:latest"
k8sApp = "k8s-app"
hostMountDir = "/host"
profileHelperImageAMD64 = k8s.ImageRepoPrefix + "benchmarks/profile-helper_x86_64:latest"
profileHelperImageARM64 = k8s.ImageRepoPrefix + "benchmarks/profile-helper_aarch64:latest"
)

// postProcessor is a function that is called after a profiling run completes.
Expand Down
7 changes: 3 additions & 4 deletions test/kubernetes/benchmarks/pytorch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import (
"testing"
"time"

k8s "gvisor.dev/gvisor/test/kubernetes"
"gvisor.dev/gvisor/test/kubernetes/benchmarks/profiling"
"gvisor.dev/gvisor/test/kubernetes/benchmetric"
"gvisor.dev/gvisor/test/kubernetes/k8sctx"
Expand All @@ -42,16 +43,14 @@ import (
v13 "k8s.io/api/core/v1"
)

const (
pytorchImage = "gcr.io/gvisor-presubmit/benchmarks/pytorch_x86_64:f6f280aeb1b07989"
)

// pytorchTestType is the method used, either training or evaluation, for the model.
type pytorchTestType string

const (
train = pytorchTestType("train")
eval = pytorchTestType("eval")

pytorchImage = k8s.ImageRepoPrefix + "benchmarks/pytorch_x86_64:f6f280aeb1b07989"
)

type pytorchMode string
Expand Down
5 changes: 3 additions & 2 deletions test/kubernetes/benchmarks/redis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"testing"
"time"

k8s "gvisor.dev/gvisor/test/kubernetes"
"gvisor.dev/gvisor/test/kubernetes/benchmarks/profiling"
"gvisor.dev/gvisor/test/kubernetes/benchmetric"
"gvisor.dev/gvisor/test/kubernetes/k8sctx"
Expand All @@ -39,12 +40,12 @@ const (
redisPort = 6379
defaultRequestsPerConnection = 50000

redisImageAMD = "gcr.io/gvisor-presubmit/benchmarks/redis_x86_64:latest"
redisImageARM = "gcr.io/gvisor-presubmit/benchmarks/redis_aarch64:latest"
redisServerLabelKey = "app.kubernetes.io/name"
redisServerLabelValue = "redis-server"
redisVolumeName = "redis-data"
redisDataDirectory = "/redis-data"
redisImageAMD = k8s.ImageRepoPrefix + "benchmarks/redis_x86_64:latest"
redisImageARM = k8s.ImageRepoPrefix + "benchmarks/redis_aarch64:latest"
)

var (
Expand Down
5 changes: 3 additions & 2 deletions test/kubernetes/benchmarks/ruby_dev_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"testing"

"gvisor.dev/gvisor/test/benchmarks/tools"
k8s "gvisor.dev/gvisor/test/kubernetes"
"gvisor.dev/gvisor/test/kubernetes/benchmarks/profiling"
"gvisor.dev/gvisor/test/kubernetes/benchmetric"
"gvisor.dev/gvisor/test/kubernetes/k8sctx"
Expand All @@ -34,9 +35,9 @@ import (
)

const (
imageAMD = "gcr.io/gvisor-presubmit/benchmarks/rubydev_x86_64:latest"
imageARM = "gcr.io/gvisor-presubmit/benchmarks/rubydev_aarch64:latest"
builderContainerName = "builder"
imageAMD = k8s.ImageRepoPrefix + "benchmarks/rubydev_x86_64:latest"
imageARM = k8s.ImageRepoPrefix + "benchmarks/rubydev_aarch64:latest"
)

// TestRubyDev benchmarks a build job on k8s clusters.
Expand Down
3 changes: 2 additions & 1 deletion test/kubernetes/benchmarks/stablediffusion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"time"

"gvisor.dev/gvisor/test/gpu/stablediffusion"
k8s "gvisor.dev/gvisor/test/kubernetes"
"gvisor.dev/gvisor/test/kubernetes/benchmetric"
"gvisor.dev/gvisor/test/kubernetes/k8sctx"
"gvisor.dev/gvisor/test/kubernetes/testcluster"
Expand All @@ -32,7 +33,7 @@ import (

const (
// Container image for Stable Diffusion XL.
stableDiffusionImage = "gcr.io/gvisor-presubmit/gpu/stable-diffusion-xl"
stableDiffusionImage = k8s.ImageRepoPrefix + "gpu/stable-diffusion-xl"
)

func TestStableDiffusionXL(t *testing.T) {
Expand Down
5 changes: 3 additions & 2 deletions test/kubernetes/benchmarks/tensorflow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"testing"
"time"

k8s "gvisor.dev/gvisor/test/kubernetes"
"gvisor.dev/gvisor/test/kubernetes/benchmarks/profiling"
"gvisor.dev/gvisor/test/kubernetes/benchmetric"
"gvisor.dev/gvisor/test/kubernetes/k8sctx"
Expand All @@ -30,8 +31,8 @@ import (
)

const (
imageAMD = "gcr.io/gvisor-presubmit/benchmarks/tensorflow_x86_64:latest"
imageARM = "gcr.io/gvisor-presubmit/benchmarks/tensorflow_aarch64:latest"
imageAMD = k8s.ImageRepoPrefix + "benchmarks/tensorflow_x86_64:latest"
imageARM = k8s.ImageRepoPrefix + "benchmarks/tensorflow_aarch64:latest"
)

var workloads = map[string]string{
Expand Down
20 changes: 20 additions & 0 deletions test/kubernetes/helpers.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Copyright 2024 The gVisor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Package kubernetes contains utilities for gVisor tests.
package kubernetes

// ImageRepoPrefix is the image repository prefix of images that are
// used by gVisor tests.
const ImageRepoPrefix = "us-central1-docker.pkg.dev/gvisor-presubmit/"

0 comments on commit 685eeb8

Please sign in to comment.