arvados-cli 0.1.20140905131846 → 0.1.20140905165259

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/arv-run-pipeline-instance +27 -9
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2c350a84f281c5ea4ebc212a224c8191d65201ae
4
- data.tar.gz: f1a1ae00ed6d390d69220607159725c19954f4de
3
+ metadata.gz: 2c70283faebf5e804fd7514a0d302895d3741c49
4
+ data.tar.gz: 3df3bcaaa4885fd1fe5b434e04b40a2416b65fea
5
5
  SHA512:
6
- metadata.gz: cd3eb2850608056b797c6b19994e6f719c907f42834bfbcd37a15213b2ec37009af52a9ec031500ffd50f5ef3c2e4bb20d70363e0480f30a1ed61830ed9fc13c
7
- data.tar.gz: 31911f9355ce5bbc1f3ccf55d3e7401d27092d1d5293c485ade9692efdde7719f3d419fc91f49257a0e2e5093e30e77c8acf8691e005c848ccc46340bd70abea
6
+ metadata.gz: 77012fcf4ea2c01d673f6b41fbe77a0ca08f78f2be6b81a3d1928d05efc469f55f032b106a13d1e9e9066274d7064ca58515f3fa80e6b3260ed83d393b4e1dd8
7
+ data.tar.gz: 6a6b9b5a08f72470e7f867cfdc1787b90ca0b819adb23b0d0e3169f03c0c9a483b2b1b72a2f40dd77c974002f58ff72146f9d231b85e57d5487822012106a424
@@ -570,7 +570,6 @@ class WhRunPipelineInstance
570
570
  pipeline_name = @template[:name]
571
571
  end
572
572
  if c[:output_name] != false
573
- output_name = c[:output_name] || "Output of #{cname} of #{pipeline_name}"
574
573
  # Create a collection located in the same project as the pipeline with the contents of the output.
575
574
  portable_data_hash = c[:job][:output]
576
575
  collections = $arv.collection.list(limit: 1,
@@ -578,14 +577,33 @@ class WhRunPipelineInstance
578
577
  select: ["portable_data_hash", "manifest_text"]
579
578
  )[:items]
580
579
  if collections.any?
581
- newcollection = {
582
- owner_uuid: owner_uuid,
583
- name: "#{output_name} at #{c[:job][:finished_at]}",
584
- portable_data_hash: collections.first[:portable_data_hash],
585
- manifest_text: collections.first[:manifest_text]
586
- }
587
- debuglog "Creating collection #{newcollection}", 0
588
- newcollection_actual = $arv.collection.create collection: newcollection
580
+ name = c[:output_name] || "Output #{portable_data_hash[0..7]} of #{cname} of #{pipeline_name}"
581
+
582
+ # check if there is a name collision.
583
+ name_collisions = $arv.collection.list(filters: [["owner_uuid", "=", owner_uuid],
584
+ ["name", "=", name]])[:items]
585
+
586
+ newcollection_actual = nil
587
+ if name_collisions.any? and name_collisions.first[:portable_data_hash] == portable_data_hash
588
+ # There is already a collection with the same name and the
589
+ # same contents, so just point to that.
590
+ newcollection_actual = name_collisions.first
591
+ end
592
+
593
+ if newcollection_actual.nil?
594
+ # Did not find a collection with the same name (or the
595
+ # collection has a different portable data hash) so create
596
+ # a new collection with ensure_unique_name: true.
597
+ newcollection = {
598
+ owner_uuid: owner_uuid,
599
+ name: name,
600
+ portable_data_hash: collections.first[:portable_data_hash],
601
+ manifest_text: collections.first[:manifest_text]
602
+ }
603
+ debuglog "Creating collection #{newcollection}", 0
604
+ newcollection_actual = $arv.collection.create collection: newcollection, ensure_unique_name: true
605
+ end
606
+
589
607
  c[:output_uuid] = newcollection_actual[:uuid]
590
608
  else
591
609
  debuglog "Could not find a collection with portable data hash #{portable_data_hash}", 0
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arvados-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.20140905131846
4
+ version: 0.1.20140905165259
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arvados Authors
@@ -166,7 +166,7 @@ dependencies:
166
166
  - - "<"
167
167
  - !ruby/object:Gem::Version
168
168
  version: 1.0.0
169
- description: This is the Arvados SDK CLI gem, git revision 33a6cc0d0b748b4ec5a01db6218b8fa21afb11ed
169
+ description: This is the Arvados SDK CLI gem, git revision b60e52e031eeba96ef1a301660de2f8cec4518b6
170
170
  email: gem-dev@curoverse.com
171
171
  executables:
172
172
  - arv