Enable lisafs by default for runsc.

Made some other changes:
- We no longer generate a separate runtime for p9 on `make
  dev`.
- We no longer run p9 runtime tests. Instead run lisafs runtime
  tests on presubmits.
- All tests are generated with lisafs. Only 1 p9 variant is
  generated with default platform.
- Run integration tests only with lisafs.

P9 is now considered deprecated.

Use `--lisafs=false` if you need to disable it. Make sure to
report a bug if you have the need to disable LISAFS.

Fixes #6319

PiperOrigin-RevId: 469548694
This commit is contained in:
Ayush Ranjan
2022-08-23 13:58:27 -07:00
committed by gVisor bot
parent de54e60f57
commit 006ba84955
7 changed files with 22 additions and 87 deletions
-47
View File
@@ -409,53 +409,6 @@ steps:
<<: *ubuntu_agents
arch: "amd64"
# Runtime tests (LISAFS).
- <<: *common
label: ":php: PHP runtime tests (LISAFS)"
command: make RUNTIME_LOG_DIR=/tmp/$${BUILDKITE_JOB_ID} php8.1.1-runtime-tests_lisafs
parallelism: 10
if: build.message =~ /lisafs/ || build.branch == "master"
agents:
<<: *platform_specific_agents
<<: *ubuntu_agents
arch: "amd64"
- <<: *common
label: ":java: Java runtime tests (LISAFS)"
command: make RUNTIME_LOG_DIR=/tmp/$${BUILDKITE_JOB_ID} java17-runtime-tests_lisafs
parallelism: 40
if: build.message =~ /lisafs/ || build.branch == "master"
agents:
<<: *platform_specific_agents
<<: *ubuntu_agents
arch: "amd64"
- <<: *common
label: ":golang: Go runtime tests (LISAFS)"
command: make RUNTIME_LOG_DIR=/tmp/$${BUILDKITE_JOB_ID} go1.16-runtime-tests_lisafs
parallelism: 10
if: build.message =~ /lisafs/ || build.branch == "master"
agents:
<<: *platform_specific_agents
<<: *ubuntu_agents
arch: "amd64"
- <<: *common
label: ":node: NodeJS runtime tests (LISAFS)"
command: make RUNTIME_LOG_DIR=/tmp/$${BUILDKITE_JOB_ID} nodejs16.13.2-runtime-tests_lisafs
parallelism: 10
if: build.message =~ /lisafs/ || build.branch == "master"
agents:
<<: *platform_specific_agents
<<: *ubuntu_agents
arch: "amd64"
- <<: *common
label: ":python: Python runtime tests (LISAFS)"
command: make RUNTIME_LOG_DIR=/tmp/$${BUILDKITE_JOB_ID} python3.10.2-runtime-tests_lisafs
parallelism: 10
if: build.message =~ /lisafs/ || build.branch == "master"
agents:
<<: *platform_specific_agents
<<: *ubuntu_agents
arch: "amd64"
# Run basic benchmarks smoke tests (no upload).
- <<: *common
label: ":fire: Benchmarks smoke test"
-9
View File
@@ -164,7 +164,6 @@ dev: $(RUNTIME_BIN) ## Installs a set of local runtimes. Requires sudo.
@$(call configure_noreload,$(RUNTIME)-p,--net-raw --profile)
@$(call configure_noreload,$(RUNTIME)-fuse-d,--net-raw --debug --strace --log-packets --fuse)
@$(call configure_noreload,$(RUNTIME)-cgroup-d,--net-raw --debug --strace --log-packets --cgroupfs)
@$(call configure_noreload,$(RUNTIME)-lisafs-d,--net-raw --debug --strace --log-packets --lisafs)
@$(call configure_noreload,$(RUNTIME)-systemd-d,--net-raw --debug --strace --log-packets --systemd-cgroup)
@$(call reload_docker)
.PHONY: dev
@@ -247,10 +246,6 @@ RUNTIME_TESTS_FLAKY_SHORT_CIRCUIT ?= true
@$(call install_runtime,$(RUNTIME),--watchdog-action=panic)
@$(call test_runtime,$(RUNTIME),--test_timeout=1800 --test_env=RUNTIME_TESTS_FILTER=$(RUNTIME_TESTS_FILTER) --test_env=RUNTIME_TESTS_PER_TEST_TIMEOUT=$(RUNTIME_TESTS_PER_TEST_TIMEOUT) --test_env=RUNTIME_TESTS_RUNS_PER_TEST=$(RUNTIME_TESTS_RUNS_PER_TEST) --test_env=RUNTIME_TESTS_FLAKY_IS_ERROR=$(RUNTIME_TESTS_FLAKY_IS_ERROR) --test_env=RUNTIME_TESTS_FLAKY_SHORT_CIRCUIT=$(RUNTIME_TESTS_FLAKY_SHORT_CIRCUIT) //test/runtimes:$*)
%-runtime-tests_lisafs: load-runtimes_% $(RUNTIME_BIN)
@$(call install_runtime,$(RUNTIME), --lisafs --watchdog-action=panic)
@$(call test_runtime,$(RUNTIME),--test_timeout=1800 --test_env=RUNTIME_TESTS_FILTER=$(RUNTIME_TESTS_FILTER) --test_env=RUNTIME_TESTS_PER_TEST_TIMEOUT=$(RUNTIME_TESTS_PER_TEST_TIMEOUT) --test_env=RUNTIME_TESTS_RUNS_PER_TEST=$(RUNTIME_TESTS_RUNS_PER_TEST) --test_env=RUNTIME_TESTS_FLAKY_IS_ERROR=$(RUNTIME_TESTS_FLAKY_IS_ERROR) --test_env=RUNTIME_TESTS_FLAKY_SHORT_CIRCUIT=$(RUNTIME_TESTS_FLAKY_SHORT_CIRCUIT) //test/runtimes:$*)
do-tests: $(RUNTIME_BIN)
@$(RUNTIME_BIN) --rootless do true
@$(RUNTIME_BIN) --rootless -network=none do true
@@ -277,10 +272,6 @@ docker-tests: load-basic $(RUNTIME_BIN)
@$(call install_runtime,$(RUNTIME)-fdlimit,--fdlimit=2000)
@$(call install_runtime,$(RUNTIME)-dcache,--fdlimit=2000 --dcache=100)
@$(call test_runtime,$(RUNTIME),$(INTEGRATION_TARGETS) //test/e2e:integration_runtime_test)
@$(call install_runtime,$(RUNTIME), --lisafs) # Run again with lisafs.
@$(call install_runtime,$(RUNTIME)-fdlimit,--lisafs --fdlimit=2000)
@$(call install_runtime,$(RUNTIME)-dcache,--lisafs --fdlimit=2000 --dcache=100)
@$(call test_runtime,$(RUNTIME),$(INTEGRATION_TARGETS) //test/e2e:integration_runtime_test)
.PHONY: docker-tests
overlay-tests: load-basic $(RUNTIME_BIN)
-1
View File
@@ -138,7 +138,6 @@ go_test(
"//pkg/control/server",
"//pkg/fspath",
"//pkg/log",
"//pkg/p9",
"//pkg/sentry/vfs",
"//pkg/sync",
"//pkg/unet",
+5 -8
View File
@@ -26,7 +26,6 @@ import (
"gvisor.dev/gvisor/pkg/control/server"
"gvisor.dev/gvisor/pkg/fspath"
"gvisor.dev/gvisor/pkg/log"
"gvisor.dev/gvisor/pkg/p9"
"gvisor.dev/gvisor/pkg/sentry/vfs"
"gvisor.dev/gvisor/pkg/sync"
"gvisor.dev/gvisor/pkg/unet"
@@ -87,21 +86,19 @@ func startGofer(root string) (int, func(), error) {
unix.Close(goferEnd)
return 0, nil, fmt.Errorf("error creating server on FD %d: %v", goferEnd, err)
}
at, err := fsgofer.NewAttachPoint(root, fsgofer.Config{ROMount: true})
server := fsgofer.NewLisafsServer(fsgofer.Config{})
c, err := server.CreateConnection(socket, root, true /* readonly */)
if err != nil {
return 0, nil, err
}
go func() {
s := p9.NewServer(at)
if err := s.Handle(socket); err != nil {
log.Infof("Gofer is stopping. FD: %d, err: %v\n", goferEnd, err)
}
}()
server.StartConnection(c)
// Closing the gofer socket will stop the gofer and exit goroutine above.
cleanup := func() {
if err := socket.Close(); err != nil {
log.Warningf("Error closing gofer socket: %v", err)
}
server.Wait()
server.Destroy()
}
return sandboxEnd, cleanup, nil
}
+1 -1
View File
@@ -81,7 +81,7 @@ func RegisterFlags(flagSet *flag.FlagSet) {
flagSet.Bool("fsgofer-host-uds", false, "allow the gofer to mount Unix Domain Sockets.")
flagSet.Bool("vfs2", true, "DEPRECATED: this flag has no effect.")
flagSet.Bool("fuse", false, "TEST ONLY; use while FUSE in VFSv2 is landing. This allows the use of the new experimental FUSE filesystem.")
flagSet.Bool("lisafs", false, "Enables lisafs protocol instead of 9P.")
flagSet.Bool("lisafs", true, "Enables lisafs protocol instead of 9P.")
flagSet.Bool("cgroupfs", false, "Automatically mount cgroupfs.")
flagSet.Bool("ignore-cgroups", false, "don't configure cgroups.")
flagSet.Int("fdlimit", -1, "Specifies a limit on the number of host file descriptors that can be open. Applies separately to the sentry and gofer. Note: each file in the sandbox holds more than one host FD open.")
+14 -17
View File
@@ -69,7 +69,7 @@ def _syscall_test(
file_access = "exclusive",
overlay = False,
add_uds_tree = False,
lisafs = False,
lisafs = True,
fuse = False,
container = None,
**kwargs):
@@ -170,7 +170,6 @@ def syscall_test(
add_overlay = False,
add_uds_tree = False,
add_hostinet = False,
add_lisafs = True,
fuse = False,
allow_native = True,
debug = True,
@@ -185,7 +184,6 @@ def syscall_test(
add_overlay: add an overlay test.
add_uds_tree: add a UDS test.
add_hostinet: add a hostinet test.
add_lisafs: add a lisafs test.
fuse: enable FUSE support.
allow_native: generate a native test variant.
debug: enable debug output.
@@ -222,20 +220,19 @@ def syscall_test(
**kwargs
)
if add_lisafs:
# Generate a *_lisafs variant with the default platform.
_syscall_test(
test = test,
platform = default_platform,
use_tmpfs = use_tmpfs,
add_uds_tree = add_uds_tree,
tags = platforms[default_platform] + tags + ["lisafs"],
debug = debug,
fuse = fuse,
container = container,
lisafs = True,
**kwargs
)
# Generate a P9 variant with the default platform.
_syscall_test(
test = test,
platform = default_platform,
use_tmpfs = use_tmpfs,
add_uds_tree = add_uds_tree,
tags = platforms[default_platform] + tags,
debug = debug,
fuse = fuse,
container = container,
lisafs = False,
**kwargs
)
if add_overlay:
_syscall_test(
test = test,
+2 -4
View File
@@ -51,7 +51,7 @@ var (
fileAccess = flag.String("file-access", "exclusive", "mounts root in exclusive or shared mode")
overlay = flag.Bool("overlay", false, "wrap filesystem mounts with writable tmpfs overlay")
fuse = flag.Bool("fuse", false, "enable FUSE")
lisafs = flag.Bool("lisafs", false, "enable lisafs protocol if vfs2 is also enabled")
lisafs = flag.Bool("lisafs", true, "enable lisafs protocol if vfs2 is also enabled")
container = flag.Bool("container", false, "run tests in their own namespaces (user ns, network ns, etc), pretending to be root. Implicitly enabled if network=host, or if using network namespaces")
setupContainerPath = flag.String("setup-container", "", "path to setup_container binary (for use with --container)")
trace = flag.Bool("trace", false, "enables all trace points")
@@ -195,6 +195,7 @@ func runRunsc(tc gtest.TestCase, spec *specs.Spec) error {
"-TESTONLY-allow-packet-endpoint-write=true",
"-net-raw=true",
fmt.Sprintf("-panic-signal=%d", unix.SIGTERM),
fmt.Sprintf("-lisafs=%t", *lisafs),
"-watchdog-action=panic",
"-platform", *platform,
"-file-access", *fileAccess,
@@ -205,9 +206,6 @@ func runRunsc(tc gtest.TestCase, spec *specs.Spec) error {
if *fuse {
args = append(args, "-fuse")
}
if *lisafs {
args = append(args, "-lisafs")
}
if *debug {
args = append(args, "-debug", "-log-packets=true")
}