[ARVADOS] created: 2.1.0-2465-gaca887b6a
Git user
git at public.arvados.org
Mon May 16 17:32:14 UTC 2022
at aca887b6aafe4f6cb617ad24d609f63a7337043a (commit)
commit aca887b6aafe4f6cb617ad24d609f63a7337043a
Author: Tom Clegg <tom at curii.com>
Date: Mon May 16 13:30:02 2022 -0400
16888: Test unsupported federation use case.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>
diff --git a/lib/controller/integration_test.go b/lib/controller/integration_test.go
index 7bf739f90..7a679a549 100644
--- a/lib/controller/integration_test.go
+++ b/lib/controller/integration_test.go
@@ -1126,7 +1126,7 @@ func (s *IntegrationSuite) TestForwardRuntimeTokenToLoginCluster(c *check.C) {
}
func (s *IntegrationSuite) TestRunTrivialContainer(c *check.C) {
- outcoll := s.runContainer(c, "z1111", map[string]interface{}{
+ outcoll, _ := s.runContainer(c, "z1111", "", map[string]interface{}{
"command": []string{"sh", "-c", "touch \"/out/hello world\" /out/ohai"},
"container_image": "busybox:uclibc",
"cwd": "/tmp",
@@ -1141,10 +1141,49 @@ func (s *IntegrationSuite) TestRunTrivialContainer(c *check.C) {
c.Check(outcoll.PortableDataHash, check.Equals, "8fa5dee9231a724d7cf377c5a2f4907c+65")
}
-func (s *IntegrationSuite) runContainer(c *check.C, clusterID string, ctrSpec map[string]interface{}, expectExitCode int) arvados.Collection {
+func (s *IntegrationSuite) TestContainerInputOnDifferentCluster(c *check.C) {
+ conn := s.super.Conn("z1111")
+ rootctx, _, _ := s.super.RootClients("z1111")
+ userctx, ac, _, _ := s.super.UserClients("z1111", rootctx, c, conn, s.oidcprovider.AuthEmail, true)
+ z1coll, err := conn.CollectionCreate(userctx, arvados.CreateOptions{Attrs: map[string]interface{}{
+ "manifest_text": ". d41d8cd98f00b204e9800998ecf8427e+0 0:0:ocelot\n",
+ }})
+ c.Assert(err, check.IsNil)
+
+ outcoll, logcfs := s.runContainer(c, "z2222", ac.AuthToken, map[string]interface{}{
+ "command": []string{"ls", "/in"},
+ "container_image": "busybox:uclibc",
+ "cwd": "/tmp",
+ "environment": map[string]string{},
+ "mounts": map[string]arvados.Mount{
+ "/in": {Kind: "collection", PortableDataHash: z1coll.PortableDataHash},
+ "/out": {Kind: "tmp", Capacity: 10000},
+ },
+ "output_path": "/out",
+ "runtime_constraints": arvados.RuntimeConstraints{RAM: 100000000, VCPUs: 1},
+ "priority": 1,
+ "state": arvados.ContainerRequestStateCommitted,
+ "container_count_max": 1,
+ }, -1)
+ if outcoll.UUID == "" {
+ arvmountlog, err := fs.ReadFile(arvados.FS(logcfs), "/arv-mount.txt")
+ c.Check(err, check.IsNil)
+ c.Check(string(arvmountlog), check.Matches, `(?ms).*cannot use a locally issued token to forward a request to our login cluster \(z1111\).*`)
+ c.Skip("this use case is not supported yet")
+ }
+ stdout, err := fs.ReadFile(arvados.FS(logcfs), "/stdout.txt")
+ c.Check(err, check.IsNil)
+ c.Check(string(stdout), check.Equals, "ocelot\n")
+}
+
+func (s *IntegrationSuite) runContainer(c *check.C, clusterID string, token string, ctrSpec map[string]interface{}, expectExitCode int) (outcoll arvados.Collection, logcfs arvados.CollectionFileSystem) {
conn := s.super.Conn(clusterID)
rootctx, _, _ := s.super.RootClients(clusterID)
- _, ac, kc, _ := s.super.UserClients(clusterID, rootctx, c, conn, s.oidcprovider.AuthEmail, true)
+ if token == "" {
+ _, ac, _, _ := s.super.UserClients(clusterID, rootctx, c, conn, s.oidcprovider.AuthEmail, true)
+ token = ac.AuthToken
+ }
+ _, ac, kc := s.super.ClientsWithToken(clusterID, token)
c.Log("[docker load]")
out, err := exec.Command("docker", "load", "--input", arvadostest.BusyboxDockerImage(c)).CombinedOutput()
@@ -1165,7 +1204,7 @@ func (s *IntegrationSuite) runContainer(c *check.C, clusterID string, ctrSpec ma
})
c.Assert(err, check.IsNil)
- showlogs := func(collectionID string) {
+ showlogs := func(collectionID string) arvados.CollectionFileSystem {
var logcoll arvados.Collection
err = ac.RequestAndDecode(&logcoll, "GET", "/arvados/v1/collections/"+collectionID, nil, nil)
c.Assert(err, check.IsNil)
@@ -1183,42 +1222,36 @@ func (s *IntegrationSuite) runContainer(c *check.C, clusterID string, ctrSpec ma
c.Logf("=== %s\n%s\n", path, buf)
return nil
})
+ return cfs
}
var ctr arvados.Container
var lastState arvados.ContainerState
deadline := time.Now().Add(time.Minute)
-wait:
- for ; ; lastState = ctr.State {
- err = ac.RequestAndDecode(&ctr, "GET", "/arvados/v1/containers/"+cr.ContainerUUID, nil, nil)
+ for cr.State != arvados.ContainerRequestStateFinal {
+ err = ac.RequestAndDecode(&cr, "GET", "/arvados/v1/container_requests/"+cr.UUID, nil, nil)
c.Assert(err, check.IsNil)
- switch ctr.State {
- case lastState:
+ err = ac.RequestAndDecode(&ctr, "GET", "/arvados/v1/containers/"+cr.ContainerUUID, nil, nil)
+ if err != nil {
+ c.Logf("error getting container state: %s", err)
+ } else if ctr.State != lastState {
+ c.Logf("container state changed to %q", ctr.State)
+ lastState = ctr.State
+ } else {
if time.Now().After(deadline) {
- c.Errorf("timed out, container request state is %q", cr.State)
+ c.Errorf("timed out, container state is %q", cr.State)
showlogs(ctr.Log)
c.FailNow()
}
time.Sleep(time.Second / 2)
- case arvados.ContainerStateComplete:
- break wait
- case arvados.ContainerStateQueued, arvados.ContainerStateLocked, arvados.ContainerStateRunning:
- c.Logf("container state changed to %q", ctr.State)
- default:
- c.Errorf("unexpected container state %q", ctr.State)
- showlogs(ctr.Log)
- c.FailNow()
}
}
- c.Check(ctr.ExitCode, check.Equals, 0)
-
- err = ac.RequestAndDecode(&cr, "GET", "/arvados/v1/container_requests/"+cr.UUID, nil, nil)
- c.Assert(err, check.IsNil)
-
- showlogs(cr.LogUUID)
-
- var outcoll arvados.Collection
- err = ac.RequestAndDecode(&outcoll, "GET", "/arvados/v1/collections/"+cr.OutputUUID, nil, nil)
- c.Assert(err, check.IsNil)
- return outcoll
+ if expectExitCode >= 0 {
+ c.Check(ctr.State, check.Equals, arvados.ContainerStateComplete)
+ c.Check(ctr.ExitCode, check.Equals, expectExitCode)
+ err = ac.RequestAndDecode(&outcoll, "GET", "/arvados/v1/collections/"+cr.OutputUUID, nil, nil)
+ c.Assert(err, check.IsNil)
+ }
+ logcfs = showlogs(cr.LogUUID)
+ return outcoll, logcfs
}
commit 3844e08a8d45a3c2d27987523effd5ae7eb66eaf
Author: Tom Clegg <tom at curii.com>
Date: Mon May 16 03:34:06 2022 -0400
15370: 19081: Check command arg quoting.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>
diff --git a/lib/controller/integration_test.go b/lib/controller/integration_test.go
index fb5dce6b3..7bf739f90 100644
--- a/lib/controller/integration_test.go
+++ b/lib/controller/integration_test.go
@@ -1127,7 +1127,7 @@ func (s *IntegrationSuite) TestForwardRuntimeTokenToLoginCluster(c *check.C) {
func (s *IntegrationSuite) TestRunTrivialContainer(c *check.C) {
outcoll := s.runContainer(c, "z1111", map[string]interface{}{
- "command": []string{"touch", "/out/hello_world"},
+ "command": []string{"sh", "-c", "touch \"/out/hello world\" /out/ohai"},
"container_image": "busybox:uclibc",
"cwd": "/tmp",
"environment": map[string]string{},
@@ -1137,8 +1137,8 @@ func (s *IntegrationSuite) TestRunTrivialContainer(c *check.C) {
"priority": 1,
"state": arvados.ContainerRequestStateCommitted,
}, 0)
- c.Check(outcoll.ManifestText, check.Matches, `\. d41d8.* 0:0:hello_world\n`)
- c.Check(outcoll.PortableDataHash, check.Equals, "dac08d558cfb6c9536f604ca89e3c002+53")
+ c.Check(outcoll.ManifestText, check.Matches, `\. d41d8.* 0:0:hello\\040world 0:0:ohai\n`)
+ c.Check(outcoll.PortableDataHash, check.Equals, "8fa5dee9231a724d7cf377c5a2f4907c+65")
}
func (s *IntegrationSuite) runContainer(c *check.C, clusterID string, ctrSpec map[string]interface{}, expectExitCode int) arvados.Collection {
commit 130e03cbb8a98b8949c85b5fd736609d07eaf8c1
Author: Tom Clegg <tom at curii.com>
Date: Mon May 16 01:21:23 2022 -0400
15370: Split "run container request X" into test helper.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>
diff --git a/lib/controller/integration_test.go b/lib/controller/integration_test.go
index 9455eb575..fb5dce6b3 100644
--- a/lib/controller/integration_test.go
+++ b/lib/controller/integration_test.go
@@ -1126,9 +1126,25 @@ func (s *IntegrationSuite) TestForwardRuntimeTokenToLoginCluster(c *check.C) {
}
func (s *IntegrationSuite) TestRunTrivialContainer(c *check.C) {
- conn1 := s.super.Conn("z1111")
- rootctx1, _, _ := s.super.RootClients("z1111")
- _, ac1, kc1, _ := s.super.UserClients("z1111", rootctx1, c, conn1, s.oidcprovider.AuthEmail, true)
+ outcoll := s.runContainer(c, "z1111", map[string]interface{}{
+ "command": []string{"touch", "/out/hello_world"},
+ "container_image": "busybox:uclibc",
+ "cwd": "/tmp",
+ "environment": map[string]string{},
+ "mounts": map[string]arvados.Mount{"/out": {Kind: "tmp", Capacity: 10000}},
+ "output_path": "/out",
+ "runtime_constraints": arvados.RuntimeConstraints{RAM: 100000000, VCPUs: 1},
+ "priority": 1,
+ "state": arvados.ContainerRequestStateCommitted,
+ }, 0)
+ c.Check(outcoll.ManifestText, check.Matches, `\. d41d8.* 0:0:hello_world\n`)
+ c.Check(outcoll.PortableDataHash, check.Equals, "dac08d558cfb6c9536f604ca89e3c002+53")
+}
+
+func (s *IntegrationSuite) runContainer(c *check.C, clusterID string, ctrSpec map[string]interface{}, expectExitCode int) arvados.Collection {
+ conn := s.super.Conn(clusterID)
+ rootctx, _, _ := s.super.RootClients(clusterID)
+ _, ac, kc, _ := s.super.UserClients(clusterID, rootctx, c, conn, s.oidcprovider.AuthEmail, true)
c.Log("[docker load]")
out, err := exec.Command("docker", "load", "--input", arvadostest.BusyboxDockerImage(c)).CombinedOutput()
@@ -1137,33 +1153,23 @@ func (s *IntegrationSuite) TestRunTrivialContainer(c *check.C) {
c.Log("[arv-keepdocker]")
akd := exec.Command("arv-keepdocker", "--no-resume", "busybox:uclibc")
- akd.Env = append(os.Environ(), "ARVADOS_API_HOST="+ac1.APIHost, "ARVADOS_API_HOST_INSECURE=1", "ARVADOS_API_TOKEN="+ac1.AuthToken)
+ akd.Env = append(os.Environ(), "ARVADOS_API_HOST="+ac.APIHost, "ARVADOS_API_HOST_INSECURE=1", "ARVADOS_API_TOKEN="+ac.AuthToken)
c.Logf("[arv-keepdocker env] %q", akd.Env)
out, err = akd.CombinedOutput()
c.Logf("[arv-keepdocker done] %s", out)
c.Check(err, check.IsNil)
var cr arvados.ContainerRequest
- err = ac1.RequestAndDecode(&cr, "POST", "/arvados/v1/container_requests", nil, map[string]interface{}{
- "container_request": map[string]interface{}{
- "command": []string{"touch", "/out/hello_world"},
- "container_image": "busybox:uclibc",
- "cwd": "/tmp",
- "environment": map[string]string{},
- "mounts": map[string]arvados.Mount{"/out": {Kind: "tmp", Capacity: 10000}},
- "output_path": "/out",
- "runtime_constraints": arvados.RuntimeConstraints{RAM: 100000000, VCPUs: 1},
- "priority": 1,
- "state": arvados.ContainerRequestStateCommitted,
- },
+ err = ac.RequestAndDecode(&cr, "POST", "/arvados/v1/container_requests", nil, map[string]interface{}{
+ "container_request": ctrSpec,
})
c.Assert(err, check.IsNil)
showlogs := func(collectionID string) {
var logcoll arvados.Collection
- err = ac1.RequestAndDecode(&logcoll, "GET", "/arvados/v1/collections/"+collectionID, nil, nil)
+ err = ac.RequestAndDecode(&logcoll, "GET", "/arvados/v1/collections/"+collectionID, nil, nil)
c.Assert(err, check.IsNil)
- cfs, err := logcoll.FileSystem(ac1, kc1)
+ cfs, err := logcoll.FileSystem(ac, kc)
c.Assert(err, check.IsNil)
fs.WalkDir(arvados.FS(cfs), "/", func(path string, d fs.DirEntry, err error) error {
if d.IsDir() || strings.HasPrefix(path, "/log for container") {
@@ -1184,7 +1190,7 @@ func (s *IntegrationSuite) TestRunTrivialContainer(c *check.C) {
deadline := time.Now().Add(time.Minute)
wait:
for ; ; lastState = ctr.State {
- err = ac1.RequestAndDecode(&ctr, "GET", "/arvados/v1/containers/"+cr.ContainerUUID, nil, nil)
+ err = ac.RequestAndDecode(&ctr, "GET", "/arvados/v1/containers/"+cr.ContainerUUID, nil, nil)
c.Assert(err, check.IsNil)
switch ctr.State {
case lastState:
@@ -1206,14 +1212,13 @@ wait:
}
c.Check(ctr.ExitCode, check.Equals, 0)
- err = ac1.RequestAndDecode(&cr, "GET", "/arvados/v1/container_requests/"+cr.UUID, nil, nil)
+ err = ac.RequestAndDecode(&cr, "GET", "/arvados/v1/container_requests/"+cr.UUID, nil, nil)
c.Assert(err, check.IsNil)
showlogs(cr.LogUUID)
var outcoll arvados.Collection
- err = ac1.RequestAndDecode(&outcoll, "GET", "/arvados/v1/collections/"+cr.OutputUUID, nil, nil)
+ err = ac.RequestAndDecode(&outcoll, "GET", "/arvados/v1/collections/"+cr.OutputUUID, nil, nil)
c.Assert(err, check.IsNil)
- c.Check(outcoll.ManifestText, check.Matches, `\. d41d8.* 0:0:hello_world\n`)
- c.Check(outcoll.PortableDataHash, check.Equals, "dac08d558cfb6c9536f604ca89e3c002+53")
+ return outcoll
}
commit db83329ac14cf4a1858a4ba477eb289ff097352c
Author: Tom Clegg <tom at curii.com>
Date: Mon May 16 01:18:51 2022 -0400
15370: Disable "broken node" flag when testing with loopback.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>
diff --git a/lib/controller/integration_test.go b/lib/controller/integration_test.go
index d65bb3149..9455eb575 100644
--- a/lib/controller/integration_test.go
+++ b/lib/controller/integration_test.go
@@ -76,13 +76,14 @@ func (s *IntegrationSuite) SetUpSuite(c *check.C) {
CloudVMs:
Enable: true
Driver: loopback
- BootProbeCommand: id
+ BootProbeCommand: "rm -f /var/lock/crunch-run-broken"
ProbeInterval: 1s
PollInterval: 5s
SyncInterval: 10s
TimeoutIdle: 1s
TimeoutBooting: 2s
RuntimeEngine: singularity
+ CrunchRunArgumentsList: ["--broken-node-hook", "true"]
RemoteClusters:
z1111:
Host: ` + hostport["z1111"] + `
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list