[ARVADOS] updated: 61b286dcf40fa85319cceb69e16660aebc71b942

Git user git at public.curoverse.com
Tue Oct 25 15:07:09 EDT 2016


Summary of changes:
 sdk/go/arvados/container.go           |  9 +++++----
 services/crunch-run/crunchrun.go      |  4 ++++
 services/crunch-run/crunchrun_test.go | 22 ++++++++++++++++++++++
 3 files changed, 31 insertions(+), 4 deletions(-)

       via  61b286dcf40fa85319cceb69e16660aebc71b942 (commit)
      from  7a3816393dddc19f67838ae495b83d32e90182d4 (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 61b286dcf40fa85319cceb69e16660aebc71b942
Author: radhika <radhika at curoverse.com>
Date:   Tue Oct 25 15:05:57 2016 -0400

    10231: update crunchrun to pass Container.RuntimeConstraints.KeepCacheRAM as file-cache argument to arv mount.

diff --git a/sdk/go/arvados/container.go b/sdk/go/arvados/container.go
index e5050cb..6a76f1f 100644
--- a/sdk/go/arvados/container.go
+++ b/sdk/go/arvados/container.go
@@ -30,10 +30,11 @@ type Mount struct {
 // RuntimeConstraints specify a container's compute resources (RAM,
 // CPU) and network connectivity.
 type RuntimeConstraints struct {
-	API       *bool
-	RAM       int      `json:"ram"`
-	VCPUs     int      `json:"vcpus"`
-	Partition []string `json:"partition"`
+	API          *bool
+	RAM          int      `json:"ram"`
+	VCPUs        int      `json:"vcpus"`
+	KeepCacheRAM int      `json:"keep_cache_ram"`
+	Partition    []string `json:"partition"`
 }
 
 // ContainerList is an arvados#containerList resource.
diff --git a/services/crunch-run/crunchrun.go b/services/crunch-run/crunchrun.go
index d804c01..ab3a9f5 100644
--- a/services/crunch-run/crunchrun.go
+++ b/services/crunch-run/crunchrun.go
@@ -357,6 +357,10 @@ func (runner *ContainerRunner) SetupMounts() (err error) {
 	}
 	arvMountCmd = append(arvMountCmd, runner.ArvMountPoint)
 
+	if runner.Container.RuntimeConstraints.KeepCacheRAM > 0 {
+		arvMountCmd = append(arvMountCmd, "--file-cache", fmt.Sprintf("%d", runner.Container.RuntimeConstraints.KeepCacheRAM))
+	}
+
 	token, err := runner.ContainerToken()
 	if err != nil {
 		return fmt.Errorf("could not get container token: %s", err)
diff --git a/services/crunch-run/crunchrun_test.go b/services/crunch-run/crunchrun_test.go
index 0ce6587..7ac71cc 100644
--- a/services/crunch-run/crunchrun_test.go
+++ b/services/crunch-run/crunchrun_test.go
@@ -840,6 +840,28 @@ func (s *TestSuite) TestSetupMounts(c *C) {
 		checkEmpty()
 	}
 
+	{
+		i = 0
+		cr.Container.RuntimeConstraints.KeepCacheRAM = 512
+		cr.Container.Mounts = map[string]arvados.Mount{
+			"/keepinp": {Kind: "collection", PortableDataHash: "59389a8f9ee9d399be35462a0f92541c+53"},
+			"/keepout": {Kind: "collection", Writable: true},
+		}
+		cr.OutputPath = "/keepout"
+
+		os.MkdirAll(realTemp+"/keep1/by_id/59389a8f9ee9d399be35462a0f92541c+53", os.ModePerm)
+		os.MkdirAll(realTemp+"/keep1/tmp0", os.ModePerm)
+
+		err := cr.SetupMounts()
+		c.Check(err, IsNil)
+		c.Check(am.Cmd, DeepEquals, []string{"--foreground", "--allow-other", "--read-write", "--mount-tmp", "tmp0", "--mount-by-pdh", "by_id", realTemp + "/keep1", "--file-cache", "512"})
+		sort.StringSlice(cr.Binds).Sort()
+		c.Check(cr.Binds, DeepEquals, []string{realTemp + "/keep1/by_id/59389a8f9ee9d399be35462a0f92541c+53:/keepinp:ro",
+			realTemp + "/keep1/tmp0:/keepout"})
+		cr.CleanupDirs()
+		checkEmpty()
+	}
+
 	for _, test := range []struct {
 		in  interface{}
 		out string

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list