Automated rollback of changelist 673541771

PiperOrigin-RevId: 673651019
This commit is contained in:
Etienne Perot
2024-09-11 20:42:21 -07:00
committed by gVisor bot
parent 2a413db730
commit 1e97c039bf
3 changed files with 41 additions and 32 deletions
+16 -16
View File
@@ -284,15 +284,15 @@ gpu-smoke-images: load-basic_cuda-vector-add load-gpu_cuda-tests
.PHONY: gpu-smoke-images
gpu-smoke-tests: gpu-smoke-images $(RUNTIME_BIN)
@$(call test,test/gpu:smoke_test,--runtime=runc -test.v $(ARGS))
@$(call sudo,test/gpu:smoke_test,--runtime=runc -test.v $(ARGS))
@$(call install_runtime,$(RUNTIME),--nvproxy=true --nvproxy-docker=true)
@$(call test,test/gpu:smoke_test,--runtime=$(RUNTIME) -test.v $(ARGS))
@$(call sudo,test/gpu:smoke_test,--runtime=$(RUNTIME) -test.v $(ARGS))
.PHONY: gpu-smoke-tests
cos-gpu-smoke-tests: gpu-smoke-images $(RUNTIME_BIN)
@$(call test,test/gpu:smoke_test,--runtime=runc -test.v --cos-gpu $(ARGS))
@$(call sudo,test/gpu:smoke_test,--runtime=runc -test.v --cos-gpu $(ARGS))
@$(call install_runtime,$(RUNTIME),--nvproxy=true)
@$(call test,test/gpu:smoke_test,--runtime=$(RUNTIME) -test.v --cos-gpu $(ARGS))
@$(call sudo,test/gpu:smoke_test,--runtime=$(RUNTIME) -test.v --cos-gpu $(ARGS))
.PHONY: cos-gpu-smoke-tests
# Images needed for GPU tests.
@@ -304,22 +304,22 @@ gpu-images: gpu-smoke-images load-gpu_pytorch load-gpu_ollama load-gpu_ollama_cl
gpu-all-tests: gpu-images gpu-smoke-tests $(RUNTIME_BIN)
@$(call install_runtime,$(RUNTIME),--nvproxy=true --nvproxy-docker=true)
@$(call test,test/gpu:pytorch_test,--runtime=$(RUNTIME) -test.v $(ARGS))
@$(call test,test/gpu:textgen_test,--runtime=$(RUNTIME) -test.v $(ARGS))
@$(call test,test/gpu:imagegen_test,--runtime=$(RUNTIME) -test.v $(ARGS))
@$(call test,test/gpu:sr_test,--runtime=$(RUNTIME) -test.v $(ARGS))
@$(call test,test/gpu:nccl_test,--runtime=$(RUNTIME) -test.v $(ARGS))
@$(call test,test/gpu:sniffer_test,--runtime=$(RUNTIME) -test.v $(ARGS))
@$(call sudo,test/gpu:pytorch_test,--runtime=$(RUNTIME) -test.v $(ARGS))
@$(call sudo,test/gpu:textgen_test,--runtime=$(RUNTIME) -test.v $(ARGS))
@$(call sudo,test/gpu:imagegen_test,--runtime=$(RUNTIME) -test.v $(ARGS))
@$(call sudo,test/gpu:sr_test,--runtime=$(RUNTIME) -test.v $(ARGS))
@$(call sudo,test/gpu:nccl_test,--runtime=$(RUNTIME) -test.v $(ARGS))
@$(call sudo,test/gpu:sniffer_test,--runtime=$(RUNTIME) -test.v $(ARGS))
.PHONY: gpu-all-tests
cos-gpu-all-tests: gpu-images cos-gpu-smoke-tests $(RUNTIME_BIN)
@$(call install_runtime,$(RUNTIME),--nvproxy=true)
@$(call test,test/gpu:pytorch_test,--runtime=$(RUNTIME) -test.v --cos-gpu $(ARGS))
@$(call test,test/gpu:textgen_test,--runtime=$(RUNTIME) -test.v --cos-gpu $(ARGS))
@$(call test,test/gpu:imagegen_test,--runtime=$(RUNTIME) -test.v --cos-gpu $(ARGS))
@$(call test,test/gpu:sr_test,--runtime=$(RUNTIME) -test.v --cos-gpu $(ARGS))
@$(call test,test/gpu:nccl_test,--runtime=$(RUNTIME) -test.v --cos-gpu $(ARGS))
@$(call test,test/gpu:sniffer_test,--runtime=$(RUNTIME) -test.v --cos-gpu $(ARGS))
@$(call sudo,test/gpu:pytorch_test,--runtime=$(RUNTIME) -test.v --cos-gpu $(ARGS))
@$(call sudo,test/gpu:textgen_test,--runtime=$(RUNTIME) -test.v --cos-gpu $(ARGS))
@$(call sudo,test/gpu:imagegen_test,--runtime=$(RUNTIME) -test.v --cos-gpu $(ARGS))
@$(call sudo,test/gpu:sr_test,--runtime=$(RUNTIME) -test.v --cos-gpu $(ARGS))
@$(call sudo,test/gpu:nccl_test,--runtime=$(RUNTIME) -test.v --cos-gpu $(ARGS))
@$(call sudo,test/gpu:sniffer_test,--runtime=$(RUNTIME) -test.v --cos-gpu $(ARGS))
.PHONY: cos-gpu-all-tests
portforward-tests: load-basic_redis load-basic_nginx $(RUNTIME_BIN)
+14 -2
View File
@@ -5,6 +5,17 @@ package(
licenses = ["notice"],
)
# We copy the `run_sniffer` binary here because `go:embed` can only embed
# from the current directory or subdirectories, not parents of it.
genrule(
name = "run_sniffer_bin",
srcs = [
"//tools/ioctl_sniffer:run_sniffer",
],
outs = ["run_sniffer_copy"],
cmd = "cat < $(SRCS) > $@",
)
go_library(
name = "dockerutil",
testonly = 1,
@@ -16,9 +27,10 @@ go_library(
"network.go",
"profile.go",
],
data = [
"//tools/ioctl_sniffer:run_sniffer",
embedsrcs = [
":run_sniffer_bin", # keep
],
nogo = False,
visibility = ["//:sandbox"],
deps = [
"//pkg/sync",
+11 -14
View File
@@ -18,12 +18,13 @@ package dockerutil
import (
"flag"
"fmt"
"io"
"os"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/mount"
"gvisor.dev/gvisor/pkg/test/testutil"
// Needed for go:embed
_ "embed"
)
// Flags.
@@ -31,6 +32,9 @@ var (
setCOSGPU = flag.Bool("cos-gpu", false, "set to configure GPU settings for COS, as opposed to Docker")
)
//go:embed run_sniffer_copy
var runSnifferBinary []byte
const (
// ioctlSnifferMountPath is the in-container path at which the ioctl sniffer is mounted.
ioctlSnifferMountPath = "/ioctl_sniffer"
@@ -50,22 +54,12 @@ const (
func GPURunOpts(sniffGPUOpts SniffGPUOpts) (RunOpts, error) {
var mounts []mount.Mount
if sniffGPUOpts.DisableSnifferReason == "" {
snifferRunfilesPath, err := testutil.FindFile("tools/ioctl_sniffer/run_sniffer")
if err != nil {
return RunOpts{}, fmt.Errorf("failed to find run_sniffer binary: %w", err)
}
snifferRunfilesFile, err := os.Open(snifferRunfilesPath)
if err != nil {
return RunOpts{}, fmt.Errorf("failed to open run_sniffer binary: %w", err)
}
defer snifferRunfilesFile.Close()
// Copy the sniffer binary to a temporary location.
// Extract the sniffer binary to a temporary location.
runSniffer, err := os.CreateTemp("", "run_sniffer.*")
if err != nil {
return RunOpts{}, fmt.Errorf("failed to create temporary file: %w", err)
}
defer runSniffer.Close()
if _, err := io.Copy(runSniffer, snifferRunfilesFile); err != nil {
if _, err := runSniffer.Write(runSnifferBinary); err != nil {
return RunOpts{}, fmt.Errorf("failed to write to temporary file: %w", err)
}
if err := runSniffer.Sync(); err != nil {
@@ -74,6 +68,9 @@ func GPURunOpts(sniffGPUOpts SniffGPUOpts) (RunOpts, error) {
if err := runSniffer.Chmod(0o555); err != nil {
return RunOpts{}, fmt.Errorf("failed to chmod temporary file: %w", err)
}
if err := runSniffer.Close(); err != nil {
return RunOpts{}, fmt.Errorf("failed to close temporary file: %w", err)
}
sniffGPUOpts.runSniffer = runSniffer
mounts = append(mounts, mount.Mount{
Source: runSniffer.Name(),