[ARVADOS] updated: 1.1.1-258-gfc880f7

Git user git at public.curoverse.com
Thu Dec 14 16:04:15 EST 2017


Summary of changes:
 doc/_includes/_mount_types.liquid     |  3 +--
 services/crunch-run/crunchrun.go      |  6 +-----
 services/crunch-run/crunchrun_test.go |  9 ++++-----
 services/crunch-run/git_mount.go      |  8 ++++++++
 services/crunch-run/git_mount_test.go | 15 +++++++++++++++
 5 files changed, 29 insertions(+), 12 deletions(-)

       via  fc880f7053c5fc5a669d92453f4fc293e0b514f1 (commit)
       via  14e2d1af9ed30ca354805eb1f232444478d7427b (commit)
      from  64d66bca9b9816d0ff025fbee91d04b1d7211f13 (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 fc880f7053c5fc5a669d92453f4fc293e0b514f1
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date:   Thu Dec 14 16:01:19 2017 -0500

    8311: Remove support for writable git_tree mount.
    
    Feature is of dubious value, and expected behavior isn't clear --
    e.g., should all files be world-writable?
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>

diff --git a/doc/_includes/_mount_types.liquid b/doc/_includes/_mount_types.liquid
index 3a10349..734b07c 100644
--- a/doc/_includes/_mount_types.liquid
+++ b/doc/_includes/_mount_types.liquid
@@ -27,8 +27,7 @@ At container startup, the target path will have the same directory structure as
 |Git tree|@git_tree@|@"uuid"@ must be the UUID of an Arvados-hosted git repository.
 @"commit"@ must be a full 40-character commit hash.
 @"path"@, if provided, must be "/".
-At container startup, the target path will have the source tree indicated by the given commit. The @.git@ metadata directory _will not_ be available.
-If @"writable"@ is true, the target directory will be writable. Any changes will be discarded when the container exits.|<pre><code>{
+At container startup, the target path will have the source tree indicated by the given commit. The @.git@ metadata directory _will not_ be available.|<pre><code>{
  "kind":"git_tree",
  "uuid":"zzzzz-s0uqq-xxxxxxxxxxxxxxx",
  "commit":"f315c59f90934cccae6381e72bba59d27ba42099"
diff --git a/services/crunch-run/crunchrun.go b/services/crunch-run/crunchrun.go
index 2324680..8fd5801 100644
--- a/services/crunch-run/crunchrun.go
+++ b/services/crunch-run/crunchrun.go
@@ -554,11 +554,7 @@ func (runner *ContainerRunner) SetupMounts() (err error) {
 			if err != nil {
 				return err
 			}
-			bind := tmpdir + ":" + bind
-			if !mnt.Writable {
-				bind = bind + ":ro"
-			}
-			runner.Binds = append(runner.Binds, bind)
+			runner.Binds = append(runner.Binds, tmpdir+":"+bind+":ro")
 		}
 	}
 
diff --git a/services/crunch-run/crunchrun_test.go b/services/crunch-run/crunchrun_test.go
index 8fbf536..652b50d 100644
--- a/services/crunch-run/crunchrun_test.go
+++ b/services/crunch-run/crunchrun_test.go
@@ -1280,11 +1280,10 @@ func (s *TestSuite) TestSetupMounts(c *C) {
 				Path:   "/",
 			},
 			"/non-tip": {
-				Kind:     "git_tree",
-				UUID:     arvadostest.Repository2UUID,
-				Commit:   "5ebfab0522851df01fec11ec55a6d0f4877b542e",
-				Path:     "/",
-				Writable: true,
+				Kind:   "git_tree",
+				UUID:   arvadostest.Repository2UUID,
+				Commit: "5ebfab0522851df01fec11ec55a6d0f4877b542e",
+				Path:   "/",
 			},
 		}
 		cr.OutputPath = "/tmp"
diff --git a/services/crunch-run/git_mount.go b/services/crunch-run/git_mount.go
index 80086b9..b923518 100644
--- a/services/crunch-run/git_mount.go
+++ b/services/crunch-run/git_mount.go
@@ -35,6 +35,9 @@ func (gm gitMount) validate() error {
 	if !repoUUIDre.MatchString(gm.UUID) {
 		return fmt.Errorf("cannot mount git_tree with uuid %q -- must be a repository UUID", gm.UUID)
 	}
+	if gm.Writable {
+		return fmt.Errorf("writable git_tree mount is not supported")
+	}
 	return nil
 }
 
diff --git a/services/crunch-run/git_mount_test.go b/services/crunch-run/git_mount_test.go
index 39254df..4dc95bc 100644
--- a/services/crunch-run/git_mount_test.go
+++ b/services/crunch-run/git_mount_test.go
@@ -173,6 +173,15 @@ func (s *GitMountSuite) TestInvalid(c *check.C) {
 			},
 			matcher: ".*UUID.*",
 		},
+		{
+			gm: gitMount{
+				Path:     "/",
+				UUID:     arvadostest.Repository2UUID,
+				Commit:   "5ebfab0522851df01fec11ec55a6d0f4877b542e",
+				Writable: true,
+			},
+			matcher: ".*writable.*",
+		},
 	} {
 		err := trial.gm.extractTree(&ArvTestClient{}, s.tmpdir, arvadostest.ActiveToken)
 		c.Check(err, check.NotNil)

commit 14e2d1af9ed30ca354805eb1f232444478d7427b
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date:   Thu Dec 14 15:56:18 2017 -0500

    8311: Ensure git tree tmpdir is readable by container.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>

diff --git a/services/crunch-run/git_mount.go b/services/crunch-run/git_mount.go
index eacfdec..80086b9 100644
--- a/services/crunch-run/git_mount.go
+++ b/services/crunch-run/git_mount.go
@@ -3,6 +3,7 @@ package main
 import (
 	"fmt"
 	"net/url"
+	"os"
 	"regexp"
 
 	"git.curoverse.com/arvados.git/sdk/go/arvados"
@@ -88,5 +89,9 @@ func (gm gitMount) extractTree(ac IArvadosClient, dir string, token string) erro
 	if err != nil {
 		return fmt.Errorf("checkout failed: %s", err)
 	}
+	err = os.Chmod(dir, 0755)
+	if err != nil {
+		return fmt.Errorf("chmod %o %q: %s", 0755, dir, err)
+	}
 	return nil
 }
diff --git a/services/crunch-run/git_mount_test.go b/services/crunch-run/git_mount_test.go
index 0161abb..39254df 100644
--- a/services/crunch-run/git_mount_test.go
+++ b/services/crunch-run/git_mount_test.go
@@ -67,6 +67,12 @@ func (s *GitMountSuite) TestextractTree(c *check.C) {
 
 	// Ensure there's no extra stuff like a ".git" dir
 	s.checkTmpdirContents(c, []string{"dir1"})
+
+	// Ensure tmpdir is world-readable and world-executable so the
+	// UID inside the container can use it.
+	fi, err = os.Stat(s.tmpdir)
+	c.Check(err, check.IsNil)
+	c.Check(fi.Mode()&os.ModePerm, check.Equals, os.FileMode(0755))
 }
 
 // Commit 5ebfab0 is not the tip of any branch or tag, but is

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list