[ARVADOS] updated: 2.1.0-279-g6cbc0020a

Git user git at public.arvados.org
Thu Jan 14 20:40:32 UTC 2021


Summary of changes:
 cmd/arvados-client/container_gateway.go            |  6 +--
 doc/admin/spot-instances.html.textile.liquid       | 23 ++++++---
 doc/install/config.html.textile.liquid             |  2 +-
 .../install-compute-node.html.textile.liquid       | 58 +++++++++++-----------
 .../install-dispatch-cloud.html.textile.liquid     | 14 ++++--
 .../install-shell-server.html.textile.liquid       | 22 +++++++-
 doc/sdk/java-v2/index.html.textile.liquid          |  2 +-
 lib/cloud/azure/azure.go                           | 11 ++++
 lib/cloud/azure/azure_test.go                      | 20 ++++++++
 lib/controller/localdb/container_gateway.go        | 21 ++++++--
 lib/controller/rpc/conn.go                         |  4 +-
 lib/crunchrun/container_gateway.go                 |  6 +--
 services/login-sync/bin/arvados-login-sync         |  5 +-
 13 files changed, 136 insertions(+), 58 deletions(-)

       via  6cbc0020a8937689cbfc5232dde3b14c643fbf83 (commit)
       via  8c283c6262809df6f9db1aa176a1a8a5e95a717b (commit)
       via  879bd007e5133c3124cb91a0fb660dfda9cf4ace (commit)
       via  a80122e544ddf72fe31d02398d914089b300d1c9 (commit)
       via  f2c6e467c4cfd079b00070ac4f50b551b6ee3bdf (commit)
       via  8439ad9df4a6d9b28bbed985bf87599f2d1b3820 (commit)
       via  025639399f5c3c7c836109442cba71f38405149c (commit)
       via  2df04c08ce5a0c4e82345d3e57404c040bb6eee4 (commit)
       via  42d491072c6757a68cbc597961237a1566de4172 (commit)
       via  bfd4fc641457a4786a5c14b7ae574acc65e1f2b8 (commit)
       via  e98f4df4aa47fba614e2a078c0ab6d4213d96674 (commit)
       via  c1a84bf6f6c570cc632a5ba8c6406543e2206e3a (commit)
       via  96afcc7682db1f1f67bcf4ae6acab54927418f1e (commit)
       via  a622b6980539db9563b6a92e0996197b61dae862 (commit)
       via  045e3127cb48845c7d988d01488c055f02ae2ec3 (commit)
       via  f53363ea4642dd165decc6786b835979a1dc9f73 (commit)
       via  4cc84d12503c936e1a32664cdee836215dc4705f (commit)
      from  5d05dd3ef4822dfb3b476777ba1aacaafed8278d (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 6cbc0020a8937689cbfc5232dde3b14c643fbf83
Author: Tom Clegg <tom at curii.com>
Date:   Thu Jan 14 15:40:07 2021 -0500

    17170: Improve error messages.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>

diff --git a/lib/controller/localdb/container_gateway.go b/lib/controller/localdb/container_gateway.go
index f255bff84..807995b3c 100644
--- a/lib/controller/localdb/container_gateway.go
+++ b/lib/controller/localdb/container_gateway.go
@@ -55,12 +55,17 @@ func (conn *Conn) ContainerSSH(ctx context.Context, opts arvados.ContainerSSHOpt
 		return
 	}
 
-	ctr, err := conn.railsProxy.ContainerGet(ctx, arvados.GetOptions{UUID: opts.UUID})
-	if err != nil {
+	switch ctr.State {
+	case arvados.ContainerStateQueued, arvados.ContainerStateLocked:
+		err = httpserver.ErrorWithStatus(fmt.Errorf("gateway is not available, container is %s", strings.ToLower(string(ctr.State))), http.StatusServiceUnavailable)
 		return
-	}
-	if ctr.GatewayAddress == "" || ctr.State != arvados.ContainerStateRunning {
-		err = httpserver.ErrorWithStatus(fmt.Errorf("gateway is not available, container is %s", strings.ToLower(string(ctr.State))), http.StatusBadGateway)
+	case arvados.ContainerStateRunning:
+		if ctr.GatewayAddress == "" {
+			err = httpserver.ErrorWithStatus(errors.New("container is running but gateway is not available"), http.StatusServiceUnavailable)
+			return
+		}
+	default:
+		err = httpserver.ErrorWithStatus(fmt.Errorf("gateway is not available, container is %s", strings.ToLower(string(ctr.State))), http.StatusGone)
 		return
 	}
 	// crunch-run uses a self-signed / unverifiable TLS
@@ -101,6 +106,7 @@ func (conn *Conn) ContainerSSH(ctx context.Context, opts arvados.ContainerSSHOpt
 		},
 	})
 	if err != nil {
+		err = httpserver.ErrorWithStatus(err, http.StatusBadGateway)
 		return
 	}
 	if respondAuth == "" {
diff --git a/lib/crunchrun/container_gateway.go b/lib/crunchrun/container_gateway.go
index 0d869ca7f..d136513a6 100644
--- a/lib/crunchrun/container_gateway.go
+++ b/lib/crunchrun/container_gateway.go
@@ -194,7 +194,7 @@ func (gw *Gateway) handleSSH(w http.ResponseWriter, req *http.Request) {
 	go ssh.DiscardRequests(reqs)
 	for newch := range newchans {
 		if newch.ChannelType() != "session" {
-			newch.Reject(ssh.UnknownChannelType, "unknown channel type")
+			newch.Reject(ssh.UnknownChannelType, "unsupported channel type %q", newch.ChannelType())
 			continue
 		}
 		ch, reqs, err := newch.Accept()

commit 8c283c6262809df6f9db1aa176a1a8a5e95a717b
Author: Tom Clegg <tom at curii.com>
Date:   Thu Jan 14 15:39:34 2021 -0500

    17170: Check container is readable before checking write permission.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>

diff --git a/lib/controller/localdb/container_gateway.go b/lib/controller/localdb/container_gateway.go
index ff3e3de5b..f255bff84 100644
--- a/lib/controller/localdb/container_gateway.go
+++ b/lib/controller/localdb/container_gateway.go
@@ -34,6 +34,11 @@ func (conn *Conn) ContainerSSH(ctx context.Context, opts arvados.ContainerSSHOpt
 	if err != nil {
 		return
 	}
+	ctr, err := conn.railsProxy.ContainerGet(ctx, arvados.GetOptions{UUID: opts.UUID})
+	if err != nil {
+		return
+	}
+
 	ctxRoot := auth.NewContext(ctx, &auth.Credentials{Tokens: []string{conn.cluster.SystemRootToken}})
 	crs, err := conn.railsProxy.ContainerRequestList(ctxRoot, arvados.ListOptions{Limit: -1, Filters: []arvados.Filter{{"container_uuid", "=", opts.UUID}}})
 	if err != nil {

commit 879bd007e5133c3124cb91a0fb660dfda9cf4ace
Author: Tom Clegg <tom at curii.com>
Date:   Thu Jan 14 15:38:38 2021 -0500

    17170: Fix -help output.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>

diff --git a/cmd/arvados-client/container_gateway.go b/cmd/arvados-client/container_gateway.go
index 1ed6dc279..40f40291f 100644
--- a/cmd/arvados-client/container_gateway.go
+++ b/cmd/arvados-client/container_gateway.go
@@ -27,7 +27,7 @@ func (shellCommand) RunCommand(prog string, args []string, stdin io.Reader, stdo
 	f := flag.NewFlagSet(prog, flag.ContinueOnError)
 	f.SetOutput(stderr)
 	f.Usage = func() {
-		fmt.Print(stderr, prog+`: open an interactive shell on a running container.
+		fmt.Fprint(stderr, prog+`: open an interactive shell on a running container.
 
 Usage: `+prog+` [options] [username@]container-uuid [ssh-options] [remote-command [args...]]
 
@@ -38,8 +38,7 @@ Options:
 	detachKeys := f.String("detach-keys", "ctrl-],ctrl-]", "set detach key sequence, as in docker-attach(1)")
 	err := f.Parse(args)
 	if err != nil {
-		fmt.Println(stderr, err)
-		f.Usage()
+		fmt.Fprintln(stderr, err)
 		return 2
 	}
 
@@ -103,7 +102,6 @@ Options:
 	detachKeys := f.String("detach-keys", "", "set detach key sequence, as in docker-attach(1)")
 	if err := f.Parse(args); err != nil {
 		fmt.Fprintln(stderr, err)
-		f.Usage()
 		return 2
 	} else if f.NArg() != 1 {
 		f.Usage()

commit a80122e544ddf72fe31d02398d914089b300d1c9
Merge: f2c6e467c 025639399
Author: Tom Clegg <tom at curii.com>
Date:   Thu Jan 14 11:08:46 2021 -0500

    17170: Merge branch 'master'
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>


commit f2c6e467c4cfd079b00070ac4f50b551b6ee3bdf
Author: Tom Clegg <tom at curii.com>
Date:   Wed Jan 13 23:22:51 2021 -0500

    17170: Fix closing pty/tty when nil.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>

diff --git a/lib/crunchrun/container_gateway.go b/lib/crunchrun/container_gateway.go
index 8b2fe4144..0d869ca7f 100644
--- a/lib/crunchrun/container_gateway.go
+++ b/lib/crunchrun/container_gateway.go
@@ -204,8 +204,6 @@ func (gw *Gateway) handleSSH(w http.ResponseWriter, req *http.Request) {
 		}
 		var pty0, tty0 *os.File
 		go func() {
-			defer pty0.Close()
-			defer tty0.Close()
 			// Where to send errors/messages for the
 			// client to see
 			logw := io.Writer(ch.Stderr())
@@ -280,6 +278,8 @@ func (gw *Gateway) handleSSH(w http.ResponseWriter, req *http.Request) {
 						fmt.Fprintf(ch.Stderr(), "pty failed: %s"+eol, err)
 						break
 					}
+					defer p.Close()
+					defer t.Close()
 					pty0, tty0 = p, t
 					ok = true
 					var payload struct {

commit 8439ad9df4a6d9b28bbed985bf87599f2d1b3820
Author: Tom Clegg <tom at curii.com>
Date:   Wed Jan 13 23:22:40 2021 -0500

    17170: Fixup error display.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>

diff --git a/lib/controller/rpc/conn.go b/lib/controller/rpc/conn.go
index 5fecf662f..26f41e128 100644
--- a/lib/controller/rpc/conn.go
+++ b/lib/controller/rpc/conn.go
@@ -343,12 +343,12 @@ func (conn *Conn) ContainerSSH(ctx context.Context, options arvados.ContainerSSH
 		body, _ := ioutil.ReadAll(resp.Body)
 		var message string
 		var errDoc httpserver.ErrorResponse
-		if err := json.Unmarshal(body, &errDoc); err != nil {
+		if err := json.Unmarshal(body, &errDoc); err == nil {
 			message = strings.Join(errDoc.Errors, "; ")
 		} else {
 			message = fmt.Sprintf("%q", body)
 		}
-		err = fmt.Errorf("server did not provide a tunnel: %q (HTTP %d)", message, resp.StatusCode)
+		err = fmt.Errorf("server did not provide a tunnel: %s (HTTP %d)", message, resp.StatusCode)
 		return
 	}
 	if strings.ToLower(resp.Header.Get("Upgrade")) != "ssh" ||

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list