[ARVADOS] created: cb0b666f86ce87d35667e8e23e3775b703a37841

Git user git at public.curoverse.com
Mon Mar 6 15:00:31 EST 2017


        at  cb0b666f86ce87d35667e8e23e3775b703a37841 (commit)


commit cb0b666f86ce87d35667e8e23e3775b703a37841
Author: Tom Clegg <tom at curoverse.com>
Date:   Mon Mar 6 14:59:56 2017 -0500

    11166: Use ensure_unique_name to avoid collisions when saving logs and output.

diff --git a/services/crunch-run/crunchrun.go b/services/crunch-run/crunchrun.go
index d42fe0b..3b3cdf1 100644
--- a/services/crunch-run/crunchrun.go
+++ b/services/crunch-run/crunchrun.go
@@ -726,6 +726,7 @@ func (runner *ContainerRunner) CaptureOutput() error {
 	manifestText = manifest.Extract(".", ".").Text
 	err = runner.ArvClient.Create("collections",
 		arvadosclient.Dict{
+			"ensure_unique_name": true,
 			"collection": arvadosclient.Dict{
 				"is_trashed":    true,
 				"name":          "output for " + runner.Container.UUID,
@@ -830,6 +831,7 @@ func (runner *ContainerRunner) CommitLogs() error {
 	var response arvados.Collection
 	err = runner.ArvClient.Create("collections",
 		arvadosclient.Dict{
+			"ensure_unique_name": true,
 			"collection": arvadosclient.Dict{
 				"is_trashed":    true,
 				"name":          "logs for " + runner.Container.UUID,
diff --git a/services/crunch-run/crunchrun_test.go b/services/crunch-run/crunchrun_test.go
index eaf62d1..36ddd36 100644
--- a/services/crunch-run/crunchrun_test.go
+++ b/services/crunch-run/crunchrun_test.go
@@ -484,6 +484,7 @@ func (s *TestSuite) TestCommitLogs(c *C) {
 	c.Check(err, IsNil)
 
 	c.Check(api.Calls, Equals, 2)
+	c.Check(api.Content[1]["ensure_unique_name"], Equals, true)
 	c.Check(api.Content[1]["collection"].(arvadosclient.Dict)["name"], Equals, "logs for zzzzz-zzzzz-zzzzzzzzzzzzzzz")
 	c.Check(api.Content[1]["collection"].(arvadosclient.Dict)["manifest_text"], Equals, ". 744b2e4553123b02fa7b452ec5c18993+123 0:123:crunch-run.txt\n")
 	c.Check(*cr.LogsPDH, Equals, "63da7bdacf08c40f604daad80c261e9a+60")
@@ -1238,6 +1239,7 @@ func (s *TestSuite) TestStdoutWithMultipleMountPointsUnderOutputDir(c *C) {
 	c.Check(api.CalledWith("container.state", "Complete"), NotNil)
 	for _, v := range api.Content {
 		if v["collection"] != nil {
+			c.Check(v["ensure_unique_name"], Equals, true)
 			collection := v["collection"].(arvadosclient.Dict)
 			if strings.Index(collection["name"].(string), "output") == 0 {
 				manifest := collection["manifest_text"].(string)

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list