[ARVADOS] updated: 1.1.1-256-g64d66bc
Git user
git at public.curoverse.com
Thu Dec 14 15:23:16 EST 2017
Summary of changes:
services/crunch-run/crunchrun.go | 12 ++++++------
services/crunch-run/crunchrun_test.go | 1 +
services/crunch-run/git_mount.go | 5 ++---
services/crunch-run/git_mount_test.go | 12 ++++++------
4 files changed, 15 insertions(+), 15 deletions(-)
via 64d66bca9b9816d0ff025fbee91d04b1d7211f13 (commit)
from 635123c249440ef01cd1f4a56fc4464541d55926 (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 64d66bca9b9816d0ff025fbee91d04b1d7211f13
Author: Peter Amstutz <pamstutz at veritasgenetics.com>
Date: Thu Dec 14 15:22:24 2017 -0500
8311: Pass in container token to extractTree
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz at veritasgenetics.com>
diff --git a/services/crunch-run/crunchrun.go b/services/crunch-run/crunchrun.go
index d262b3d..2324680 100644
--- a/services/crunch-run/crunchrun.go
+++ b/services/crunch-run/crunchrun.go
@@ -390,6 +390,11 @@ func (runner *ContainerRunner) SetupMounts() (err error) {
return fmt.Errorf("While creating keep mount temp dir: %v", err)
}
+ token, err := runner.ContainerToken()
+ if err != nil {
+ return fmt.Errorf("could not get container token: %s", err)
+ }
+
pdhOnly := true
tmpcount := 0
arvMountCmd := []string{
@@ -545,7 +550,7 @@ func (runner *ContainerRunner) SetupMounts() (err error) {
return fmt.Errorf("creating temp dir: %v", err)
}
runner.CleanupTempDir = append(runner.CleanupTempDir, tmpdir)
- err = gitMount(mnt).extractTree(runner.ArvClient, tmpdir)
+ err = gitMount(mnt).extractTree(runner.ArvClient, tmpdir, token)
if err != nil {
return err
}
@@ -578,11 +583,6 @@ func (runner *ContainerRunner) SetupMounts() (err error) {
}
arvMountCmd = append(arvMountCmd, runner.ArvMountPoint)
- token, err := runner.ContainerToken()
- if err != nil {
- return fmt.Errorf("could not get container token: %s", err)
- }
-
runner.ArvMount, err = runner.RunArvMount(arvMountCmd, token)
if err != nil {
return fmt.Errorf("While trying to start arv-mount: %v", err)
diff --git a/services/crunch-run/crunchrun_test.go b/services/crunch-run/crunchrun_test.go
index 4d76e34..8fbf536 100644
--- a/services/crunch-run/crunchrun_test.go
+++ b/services/crunch-run/crunchrun_test.go
@@ -1270,6 +1270,7 @@ func (s *TestSuite) TestSetupMounts(c *C) {
i = 0
cr.ArvMountPoint = ""
(*GitMountSuite)(nil).useTestGitServer(c)
+ cr.token = arvadostest.ActiveToken
cr.Container.Mounts = make(map[string]arvados.Mount)
cr.Container.Mounts = map[string]arvados.Mount{
"/tip": {
diff --git a/services/crunch-run/git_mount.go b/services/crunch-run/git_mount.go
index d24c432..eacfdec 100644
--- a/services/crunch-run/git_mount.go
+++ b/services/crunch-run/git_mount.go
@@ -6,7 +6,6 @@ import (
"regexp"
"git.curoverse.com/arvados.git/sdk/go/arvados"
- "git.curoverse.com/arvados.git/sdk/go/arvadostest"
"gopkg.in/src-d/go-billy.v3/osfs"
git "gopkg.in/src-d/go-git.v4"
git_config "gopkg.in/src-d/go-git.v4/config"
@@ -40,7 +39,7 @@ func (gm gitMount) validate() error {
// ExtractTree extracts the specified tree into dir, which is an
// existing empty local directory.
-func (gm gitMount) extractTree(ac IArvadosClient, dir string) error {
+func (gm gitMount) extractTree(ac IArvadosClient, dir string, token string) error {
err := gm.validate()
if err != nil {
return err
@@ -74,7 +73,7 @@ func (gm gitMount) extractTree(ac IArvadosClient, dir string) error {
}
err = repo.Fetch(&git.FetchOptions{
RemoteName: "origin",
- Auth: git_http.NewBasicAuth("none", arvadostest.ActiveToken),
+ Auth: git_http.NewBasicAuth("none", token),
})
if err != nil {
return fmt.Errorf("git fetch %q: %s", u.String(), err)
diff --git a/services/crunch-run/git_mount_test.go b/services/crunch-run/git_mount_test.go
index 82dce3a..0161abb 100644
--- a/services/crunch-run/git_mount_test.go
+++ b/services/crunch-run/git_mount_test.go
@@ -42,7 +42,7 @@ func (s *GitMountSuite) TestextractTree(c *check.C) {
UUID: arvadostest.Repository2UUID,
Commit: "fd3531f42995344f36c30b79f55f27b502f3d344",
}
- err := gm.extractTree(&ArvTestClient{}, s.tmpdir)
+ err := gm.extractTree(&ArvTestClient{}, s.tmpdir, arvadostest.ActiveToken)
c.Check(err, check.IsNil)
fnm := filepath.Join(s.tmpdir, "dir1/dir2/file with mode 0644")
@@ -76,7 +76,7 @@ func (s *GitMountSuite) TestExtractNonTipCommit(c *check.C) {
UUID: arvadostest.Repository2UUID,
Commit: "5ebfab0522851df01fec11ec55a6d0f4877b542e",
}
- err := gm.extractTree(&ArvTestClient{}, s.tmpdir)
+ err := gm.extractTree(&ArvTestClient{}, s.tmpdir, arvadostest.ActiveToken)
c.Check(err, check.IsNil)
fnm := filepath.Join(s.tmpdir, "file only on testbranch")
@@ -91,7 +91,7 @@ func (s *GitMountSuite) TestNonexistentRepository(c *check.C) {
UUID: "zzzzz-s0uqq-nonexistentrepo",
Commit: "5ebfab0522851df01fec11ec55a6d0f4877b542e",
}
- err := gm.extractTree(&ArvTestClient{}, s.tmpdir)
+ err := gm.extractTree(&ArvTestClient{}, s.tmpdir, arvadostest.ActiveToken)
c.Check(err, check.NotNil)
c.Check(err, check.ErrorMatches, ".*repository not found.*")
@@ -104,7 +104,7 @@ func (s *GitMountSuite) TestNonexistentCommit(c *check.C) {
UUID: arvadostest.Repository2UUID,
Commit: "bb66b6bb6b6bbb6b6b6b66b6b6b6b6b6b6b6b66b",
}
- err := gm.extractTree(&ArvTestClient{}, s.tmpdir)
+ err := gm.extractTree(&ArvTestClient{}, s.tmpdir, arvadostest.ActiveToken)
c.Check(err, check.NotNil)
c.Check(err, check.ErrorMatches, ".*object not found.*")
@@ -118,7 +118,7 @@ func (s *GitMountSuite) TestGitUrlDiscoveryFails(c *check.C) {
UUID: arvadostest.Repository2UUID,
Commit: "5ebfab0522851df01fec11ec55a6d0f4877b542e",
}
- err := gm.extractTree(&ArvTestClient{}, s.tmpdir)
+ err := gm.extractTree(&ArvTestClient{}, s.tmpdir, arvadostest.ActiveToken)
c.Check(err, check.ErrorMatches, ".*gitUrl.*")
}
@@ -168,7 +168,7 @@ func (s *GitMountSuite) TestInvalid(c *check.C) {
matcher: ".*UUID.*",
},
} {
- err := trial.gm.extractTree(&ArvTestClient{}, s.tmpdir)
+ err := trial.gm.extractTree(&ArvTestClient{}, s.tmpdir, arvadostest.ActiveToken)
c.Check(err, check.NotNil)
s.checkTmpdirContents(c, []string{})
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list