[ARVADOS] updated: 2.1.0-829-ge11c355ce

Git user git at public.arvados.org
Tue Jun 8 05:46:56 UTC 2021


Summary of changes:
 go.mod                 |  4 +--
 go.sum                 |  5 +++
 lib/diagnostics/cmd.go | 87 +++++++++++++++++++++++++++++++++++++++++++++++---
 3 files changed, 90 insertions(+), 6 deletions(-)

       via  e11c355cef17e8df7f66e4020b1862f10ef4f73b (commit)
       via  188b43f26757a2fadec308c21cc74ae071259cdd (commit)
       via  7a5c3a935b7274b6789b05cc3a9b4e873f3b716b (commit)
      from  5b1e3319104a46f6ab705e6ee8133796e14a445f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit e11c355cef17e8df7f66e4020b1862f10ef4f73b
Author: Tom Clegg <tom at curii.com>
Date:   Tue Jun 8 01:45:55 2021 -0400

    17609: Improve output formatting.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>

diff --git a/go.mod b/go.mod
index aa289761b..9062c667d 100644
--- a/go.mod
+++ b/go.mod
@@ -55,13 +55,13 @@ require (
 	github.com/prometheus/common v0.7.0
 	github.com/satori/go.uuid v1.2.1-0.20180103174451-36e9d2ebbde5 // indirect
 	github.com/sergi/go-diff v1.0.0 // indirect
-	github.com/sirupsen/logrus v1.4.2
+	github.com/sirupsen/logrus v1.8.1
 	github.com/src-d/gcfg v1.3.0 // indirect
 	github.com/xanzy/ssh-agent v0.1.0 // indirect
 	golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9
 	golang.org/x/net v0.0.0-20201021035429-f5854403a974
 	golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
-	golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4
+	golang.org/x/sys v0.0.0-20210603125802-9665404d3644
 	golang.org/x/tools v0.1.0 // indirect
 	google.golang.org/api v0.13.0
 	gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d // indirect
diff --git a/go.sum b/go.sum
index 006118ad9..23731f69a 100644
--- a/go.sum
+++ b/go.sum
@@ -234,6 +234,8 @@ github.com/shabbyrobe/gocovmerge v0.0.0-20180507124511-f6ea450bfb63/go.mod h1:n+
 github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
 github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4=
 github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
+github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE=
+github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
 github.com/spf13/afero v1.2.1 h1:qgMbHoJbPbw579P+1zVY+6n4nIFuIchaIjzZ/I/Yq8M=
 github.com/spf13/afero v1.2.1/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
 github.com/src-d/gcfg v1.3.0 h1:2BEDr8r0I0b8h/fOqwtxCEiq2HJu8n2JGZJQFGXWLjg=
@@ -301,9 +303,12 @@ golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7w
 golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4 h1:myAQVi0cGEoqQVR5POX+8RR2mrocKqNN1hmeMqhX27k=
 golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210603125802-9665404d3644 h1:CA1DEQ4NdKphKeL70tvsWNdT5oFh1lOjihRcEDROi0I=
+golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
diff --git a/lib/diagnostics/cmd.go b/lib/diagnostics/cmd.go
index 4f3ad8b0a..2f43263e5 100644
--- a/lib/diagnostics/cmd.go
+++ b/lib/diagnostics/cmd.go
@@ -41,7 +41,7 @@ func (cmd Command) RunCommand(prog string, args []string, stdin io.Reader, stdou
 		return 2
 	}
 	diag.logger = ctxlog.New(stdout, "text", diag.logLevel)
-	diag.logger.SetFormatter(&logrus.TextFormatter{DisableTimestamp: true, DisableLevelTruncation: true})
+	diag.logger.SetFormatter(&logrus.TextFormatter{DisableTimestamp: true, DisableLevelTruncation: true, PadLevelText: true})
 	diag.runtests()
 	if len(diag.errors) == 0 {
 		diag.logger.Info("--- no errors ---")
@@ -101,14 +101,15 @@ func (diag *diagnoser) dotest(id int, title string, fn func() error) {
 	}
 	diag.done[id] = true
 
-	diag.infof("%4d %s", id, title)
+	diag.infof("%4d: %s", id, title)
 	t0 := time.Now()
 	err := fn()
 	elapsed := fmt.Sprintf("%.0dms", time.Now().Sub(t0)/time.Millisecond)
 	if err != nil {
-		diag.errorf("%s (%s): %s", title, elapsed, err)
+		diag.errorf("%4d: %s (%s): %s", id, title, elapsed, err)
+	} else {
+		diag.debugf("%4d: %s (%s): ok", id, title, elapsed)
 	}
-	diag.debugf("%4d %s (%s): ok", id, title, elapsed)
 }
 
 func (diag *diagnoser) runtests() {

commit 188b43f26757a2fadec308c21cc74ae071259cdd
Author: Tom Clegg <tom at curii.com>
Date:   Tue Jun 8 01:45:40 2021 -0400

    17609: Add "run container" test.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>

diff --git a/lib/diagnostics/cmd.go b/lib/diagnostics/cmd.go
index 54c78d07c..4f3ad8b0a 100644
--- a/lib/diagnostics/cmd.go
+++ b/lib/diagnostics/cmd.go
@@ -31,6 +31,7 @@ func (cmd Command) RunCommand(prog string, args []string, stdin io.Reader, stdou
 	f.StringVar(&diag.logLevel, "log-level", "info", "logging level (debug, info, warning, error)")
 	f.BoolVar(&diag.checkInternal, "internal-client", false, "check that this host is considered an \"internal\" client")
 	f.BoolVar(&diag.checkExternal, "external-client", false, "check that this host is considered an \"external\" client")
+	f.IntVar(&diag.priority, "priority", 500, "priority for test container (1..1000)")
 	f.DurationVar(&diag.timeout, "timeout", 10*time.Second, "timeout for http requests")
 	err := f.Parse(args)
 	if err == flag.ErrHelp {
@@ -60,6 +61,7 @@ type diagnoser struct {
 	stdout        io.Writer
 	stderr        io.Writer
 	logLevel      string
+	priority      int
 	projectName   string
 	checkInternal bool
 	checkExternal bool
@@ -523,4 +525,80 @@ func (diag *diagnoser) runtests() {
 		}
 		return nil
 	})
+
+	diag.dotest(160, "running a container", func() error {
+		if diag.priority < 1 {
+			diag.debugf("skipping, caller requested priority<1 (%d)", diag.priority)
+			return nil
+		}
+
+		var cr arvados.ContainerRequest
+		ctx, cancel := context.WithDeadline(context.Background(), time.Now().Add(diag.timeout))
+		defer cancel()
+
+		timestamp := time.Now().Format(time.RFC3339)
+		err := client.RequestAndDecodeContext(ctx, &cr, "POST", "arvados/v1/container_requests", nil, map[string]interface{}{"container_request": map[string]interface{}{
+			"owner_uuid":      project.UUID,
+			"name":            fmt.Sprintf("diagnostics container request %s", timestamp),
+			"container_image": "arvados/jobs",
+			"command":         []string{"echo", timestamp},
+			"use_existing":    false,
+			"output_path":     "/mnt/output",
+			"output_name":     fmt.Sprintf("diagnostics output %s", timestamp),
+			"priority":        diag.priority,
+			"state":           arvados.ContainerRequestStateCommitted,
+			"mounts": map[string]map[string]interface{}{
+				"/mnt/output": {
+					"kind":     "collection",
+					"writable": true,
+				},
+			},
+			"runtime_constraints": arvados.RuntimeConstraints{
+				VCPUs:        1,
+				RAM:          1 << 26,
+				KeepCacheRAM: 1 << 26,
+			},
+		}})
+		if err != nil {
+			return err
+		}
+		diag.debugf("container request uuid = %s", cr.UUID)
+		diag.debugf("container uuid = %s", cr.ContainerUUID)
+
+		timeout := 10 * time.Minute
+		diag.infof("container request submitted, waiting up to %v for container to run", arvados.Duration(timeout))
+		ctx, cancel = context.WithDeadline(context.Background(), time.Now().Add(timeout))
+		defer cancel()
+
+		var c arvados.Container
+		for ; cr.State != arvados.ContainerRequestStateFinal; time.Sleep(2 * time.Second) {
+			ctx, cancel := context.WithDeadline(ctx, time.Now().Add(diag.timeout))
+			defer cancel()
+
+			crStateWas := cr.State
+			err := client.RequestAndDecodeContext(ctx, &cr, "GET", "arvados/v1/container_requests/"+cr.UUID, nil, nil)
+			if err != nil {
+				return err
+			}
+			if cr.State != crStateWas {
+				diag.debugf("container request state = %s", cr.State)
+			}
+
+			cStateWas := c.State
+			err = client.RequestAndDecodeContext(ctx, &c, "GET", "arvados/v1/containers/"+cr.ContainerUUID, nil, nil)
+			if err != nil {
+				return err
+			}
+			if c.State != cStateWas {
+				diag.debugf("container state = %s", c.State)
+			}
+		}
+
+		if c.State != arvados.ContainerStateComplete {
+			return fmt.Errorf("container request %s is final but container %s did not complete: container state = %q", cr.UUID, cr.ContainerUUID, c.State)
+		} else if c.ExitCode != 0 {
+			return fmt.Errorf("container exited %d", c.ExitCode)
+		}
+		return nil
+	})
 }

commit 7a5c3a935b7274b6789b05cc3a9b4e873f3b716b
Author: Tom Clegg <tom at curii.com>
Date:   Wed Jun 2 15:23:56 2021 -0400

    17609: Improve log text alignment.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>

diff --git a/lib/diagnostics/cmd.go b/lib/diagnostics/cmd.go
index 3b3ed400b..54c78d07c 100644
--- a/lib/diagnostics/cmd.go
+++ b/lib/diagnostics/cmd.go
@@ -99,14 +99,14 @@ func (diag *diagnoser) dotest(id int, title string, fn func() error) {
 	}
 	diag.done[id] = true
 
-	diag.infof("%d %s", id, title)
+	diag.infof("%4d %s", id, title)
 	t0 := time.Now()
 	err := fn()
 	elapsed := fmt.Sprintf("%.0dms", time.Now().Sub(t0)/time.Millisecond)
 	if err != nil {
 		diag.errorf("%s (%s): %s", title, elapsed, err)
 	}
-	diag.debugf("%d %s (%s): ok", id, title, elapsed)
+	diag.debugf("%4d %s (%s): ok", id, title, elapsed)
 }
 
 func (diag *diagnoser) runtests() {

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list