Successfully starts first stage of active pipelines.
authorPeter Amstutz <peter.amstutz@curoverse.com>
Wed, 5 Mar 2014 14:58:35 +0000 (09:58 -0500)
committerPeter Amstutz <peter.amstutz@curoverse.com>
Wed, 5 Mar 2014 14:58:35 +0000 (09:58 -0500)
sdk/cli/bin/arv-run-pipeline-instance
services/api/Gemfile
services/api/Gemfile.lock
services/api/script/crunch-dispatch.rb

index d2b1109e1630e2fbba84fcfa626d10e7bbe45bc6..6e8a64ab1d2536118235ad614f54eae46a302919 100755 (executable)
@@ -80,13 +80,15 @@ $arvados_api_token = ENV['ARVADOS_API_TOKEN'] or
 
 begin
   require 'rubygems'
-  require 'google/api_client'
   require 'json'
   require 'pp'
   require 'trollop'
-rescue LoadError
+  require 'google/api_client'
+rescue LoadError => l
+  puts $:
   abort <<-EOS
-#{$0}: fatal: some runtime dependencies are missing.
+#{$0}: fatal: #{l.message}
+Some runtime dependencies may be missing.
 Try: gem install pp google-api-client json trollop
   EOS
 end
index 59b16cc7eabb8029eac745d98d1acd6a64b7c9bf..54e83d883e29c5315f69ec409492604c1b17850e 100644 (file)
@@ -53,3 +53,6 @@ gem 'andand'
 gem 'redis'
 
 gem 'test_after_commit', :group => :test
+
+gem 'google-api-client', '~> 0.6.3'
+gem 'trollop'
\ No newline at end of file
index 3929125b3724a6156c99bb697077fd9124aafbdc..c78f3a7befad32cf4b0bedc0b1b89b4752a00fa2 100644 (file)
@@ -32,8 +32,13 @@ GEM
       activemodel (>= 3.0.0)
       activesupport (>= 3.0.0)
       rack (>= 1.1.0)
+    addressable (2.3.5)
     andand (1.3.3)
     arel (3.0.2)
+    autoparse (0.3.3)
+      addressable (>= 2.3.1)
+      extlib (>= 0.9.15)
+      multi_json (>= 1.0.0)
     builder (3.0.4)
     capistrano (2.15.5)
       highline
@@ -51,8 +56,19 @@ GEM
     daemon_controller (1.1.7)
     erubis (2.7.0)
     execjs (2.0.2)
+    extlib (0.9.16)
     faraday (0.8.8)
       multipart-post (~> 1.2.0)
+    google-api-client (0.6.4)
+      addressable (>= 2.3.2)
+      autoparse (>= 0.3.3)
+      extlib (>= 0.9.15)
+      faraday (~> 0.8.4)
+      jwt (>= 0.1.5)
+      launchy (>= 2.1.1)
+      multi_json (>= 1.0.0)
+      signet (~> 0.4.5)
+      uuidtools (>= 2.1.0)
     hashie (1.2.0)
     highline (1.6.20)
     hike (1.2.3)
@@ -65,6 +81,8 @@ GEM
     json (1.8.1)
     jwt (0.1.8)
       multi_json (>= 1.5)
+    launchy (2.4.2)
+      addressable (~> 2.3)
     libv8 (3.16.14.3)
     mail (2.5.4)
       mime-types (~> 1.16)
@@ -132,6 +150,11 @@ GEM
       railties (~> 3.2.0)
       sass (>= 3.1.10)
       tilt (~> 1.3)
+    signet (0.4.5)
+      addressable (>= 2.2.3)
+      faraday (~> 0.8.1)
+      jwt (>= 0.1.5)
+      multi_json (>= 1.0.0)
     sprockets (2.2.2)
       hike (~> 1.2)
       multi_json (~> 1.0)
@@ -146,10 +169,12 @@ GEM
     treetop (1.4.15)
       polyglot
       polyglot (>= 0.3.1)
+    trollop (2.0)
     tzinfo (0.3.38)
     uglifier (2.3.0)
       execjs (>= 0.3.0)
       json (>= 1.8.0)
+    uuidtools (2.1.4)
 
 PLATFORMS
   ruby
@@ -158,6 +183,7 @@ DEPENDENCIES
   acts_as_api
   andand
   coffee-rails (~> 3.2.0)
+  google-api-client (~> 0.6.3)
   jquery-rails
   multi_json
   oj
@@ -171,4 +197,5 @@ DEPENDENCIES
   sass-rails (>= 3.2.0)
   test_after_commit
   therubyracer
+  trollop
   uglifier (>= 1.0.3)
index 3b2d5bae0fffafa512960fca2fffbbcd8a869392..eeabc16271e2373a031f47feece0a8e79b818d94 100755 (executable)
@@ -317,9 +317,12 @@ class Dispatcher
   def update_pipelines
     puts @todo_pipelines
     @todo_pipelines.each do |p|
-      puts "arv-run-pipeline-instance --no-wait --instance #{p.uuid}"
-      puts `env`
-      `arv-run-pipeline-instance --no-wait --instance #{p.uuid}`
+      pipe_auth = ApiClientAuthorization.
+        new(user: User.where('uuid=?', p.modified_by_user_uuid).first,
+            api_client_id: 0)
+      pipe_auth.save
+
+      puts `export ARVADOS_API_TOKEN=#{pipe_auth.api_token} && arv-run-pipeline-instance --no-wait --instance #{p.uuid}`
     end
   end