8311: Remove support for writable git_tree mount.
authorTom Clegg <tclegg@veritasgenetics.com>
Thu, 14 Dec 2017 21:01:19 +0000 (16:01 -0500)
committerTom Clegg <tclegg@veritasgenetics.com>
Thu, 14 Dec 2017 21:01:43 +0000 (16:01 -0500)
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@veritasgenetics.com>

doc/_includes/_mount_types.liquid
services/crunch-run/crunchrun.go
services/crunch-run/crunchrun_test.go
services/crunch-run/git_mount.go
services/crunch-run/git_mount_test.go

index 3a10349ba4afee22b415bdc1168e49a9f7f5ef50..734b07c8b7970c00bdd6e99be3815e9d8d31f1f0 100644 (file)
@@ -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"
index 23246805960f8faf1a862098bcaac4b122273e7a..8fd5801d236015b28ae125d56f787b3a236064cf 100644 (file)
@@ -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")
                }
        }
 
index 8fbf536a39933fb724e416a35c84eadf590db74b..652b50d1798ac42fa5a2df59731b6059ba8959e6 100644 (file)
@@ -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"
index 80086b9c3c2270176acc35c7691a379d60a1c5da..b923518a8ad12a9ad09192e03db2fdbadbb4e430 100644 (file)
@@ -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
 }
 
index 39254df300ee4180309272162ca0f11dae1a9efd..4dc95bc3dfae529069595cc996ef23ab1b83cb09 100644 (file)
@@ -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)