Merge branch 'master' into 2221-complete-docker
authorTim Pierce <twp@curoverse.com>
Tue, 11 Mar 2014 19:54:22 +0000 (15:54 -0400)
committerTim Pierce <twp@curoverse.com>
Tue, 11 Mar 2014 19:54:22 +0000 (15:54 -0400)
apps/workbench/app/controllers/collections_controller.rb
apps/workbench/app/helpers/provenance_helper.rb
apps/workbench/config/routes.rb
doc/Gemfile
doc/_config.yml
doc/install/install-api-server.html.md.liquid
sdk/cli/bin/crunch-job
sdk/python/bin/arv-mount
services/api/config/application.yml.example

index 737583a31e68c6d6ab64b40ba298bafe0832dd41..d46ec0354ccba317211342dd60c0c0d692ba4333 100644 (file)
@@ -105,7 +105,7 @@ class CollectionsController < ApplicationController
       puts request
       @prov_svg = ProvenanceHelper::create_provenance_graph(u.provenance, "provenance_svg", 
                                                             {:request => request,
-                                                              :direction => :top_down
+                                                              :direction => :bottom_up
                                                               :combine_jobs => :script_only}) rescue nil
       @used_by_svg = ProvenanceHelper::create_provenance_graph(u.used_by, "used_by_svg", 
                                                                {:request => request,
index c0b2fd36f814d0be75c01343f7b071cdf62fff2e..66754d20b2f209248270d7ca73cedb0b5e758554 100644 (file)
@@ -26,6 +26,14 @@ module ProvenanceHelper
       end
     end
 
+    def url_for u
+      p = { :host => @opts[:request].host, 
+        :port => @opts[:request].port,
+        :protocol => @opts[:request].protocol }
+      p.merge! u
+      Rails.application.routes.url_helpers.url_for (p)      
+    end 
+
     def determine_fillcolor(n)
       fillcolor = %w(aaaaaa aaffaa aaaaff aaaaaa ffaaaa)[n || 0] || 'aaaaaa'
       "style=filled,fillcolor=\"##{fillcolor}\""
@@ -37,11 +45,9 @@ module ProvenanceHelper
 
       rsc = ArvadosBase::resource_class_for_uuid uuid.to_s
       if rsc
-        href = Rails.application.routes.url_helpers.url_for ({:controller => rsc.to_s.tableize, 
-                                                               :action => :show, 
-                                                               :id => uuid.to_s, 
-                                                               :host => @opts[:request].host, 
-                                                               :port => @opts[:request].port})
+        href = url_for ({:controller => rsc.to_s.tableize, 
+                          :action => :show, 
+                          :id => uuid.to_s })
       
         #"\"#{uuid}\" [label=\"#{rsc}\\n#{uuid}\",href=\"#{href}\"];\n"
         if rsc == Collection
@@ -80,8 +86,8 @@ module ProvenanceHelper
               end
             end  
           end
-          return "\"#{uuid}\" [label=\"#{rsc}\",href=\"#{href}\",#{bgcolor}];\n"
         end
+        return "\"#{uuid}\" [label=\"#{rsc}\",href=\"#{href}\",#{bgcolor}];\n"
       end
       "\"#{uuid}\" [#{bgcolor}];\n"
     end
@@ -227,11 +233,9 @@ module ProvenanceHelper
 
       @pdata.each do |k, link|
         if link[:head_uuid] == uuid.to_s and link[:link_class] == "provenance"
-          href = Rails.application.routes.url_helpers.url_for ({:controller => Link.to_s.tableize, 
-                                                                 :action => :show, 
-                                                                 :id => link[:uuid], 
-                                                                 :host => @opts[:request].host, 
-                                                                 :port => @opts[:request].port})
+          href = url_for ({:controller => Link.to_s.tableize, 
+                            :action => :show, 
+                            :id => link[:uuid] })
 
           gr += describe_node(link[:tail_uuid])
           gr += edge(link[:head_uuid], link[:tail_uuid], {:label => link[:name], :href => href}) 
@@ -247,10 +251,8 @@ module ProvenanceHelper
     def describe_jobs
       gr = ""
       @jobs.each do |k, v|
-        href = Rails.application.routes.url_helpers.url_for ({:controller => Job.to_s.tableize, 
-                                                               :action => :index, 
-                                                               :host => @opts[:request].host, 
-                                                               :port => @opts[:request].port})
+        href = url_for ({:controller => Job.to_s.tableize, 
+                          :action => :index })
 
         gr += "\"#{k}\" [href=\"#{href}?"
         
index 617679eb33b69a48b47ad1a323a8060a8e5dde96..523771c0b172cf4000e0da80d4f656f328918597 100644 (file)
@@ -2,8 +2,10 @@ ArvadosWorkbench::Application.routes.draw do
   themes_for_rails
 
   resources :keep_disks
-  resources :user_agreements
-  post '/user_agreements/sign' => 'user_agreements#sign'
+  resources :user_agreements do
+    put 'sign', on: :collection
+    get 'signatures', on: :collection
+  end
   get '/user_agreements/signatures' => 'user_agreements#signatures'
   resources :nodes
   resources :humans
index 381b70676339e997229b26840db2efe3773203dd..9ee5f581c39ca8a88d4839dd9a8e86115e31b6d2 100644 (file)
@@ -3,4 +3,4 @@ source 'https://rubygems.org'
 gem 'zenweb'
 gem 'liquid'
 gem 'RedCloth'
-gem 'colorize'
\ No newline at end of file
+gem 'colorize'
index dbf638979ebdc2a0e785f1527c4e36fd0e699e51..d035e2caecfd35e1d400d256a5b964a307ad0c7b 100644 (file)
@@ -95,8 +95,8 @@ navbar:
       - admin/cheat_sheet.html.textile.liquid
   installguide:
     - Install:
-      - install/install-api-server.html.md.liquid
       - install/index.html.md.liquid
+      - install/install-api-server.html.md.liquid
       - install/install-workbench-app.html.md.liquid
       - install/client.html.textile.liquid
       - install/create-standard-objects.html.textile.liquid
index 582feb95b1543c24ea9541c454bd142f27e18a8b..6eaef1823c816dad4426721c99c1468e10eed12f 100644 (file)
@@ -12,29 +12,30 @@ navorder: 1
 1. A GNU/Linux (virtual) machine
 2. A domain name for your api server
 3. Ruby >= 2.0.0
-4. Bundler
+4. Bundler: `gem install bundler`
+5. Curl libraries: `sudo apt-get install libcurl3 libcurl3-gnutls libcurl4-openssl-dev`
 
 ## Download the source tree
 
     git clone https://github.com/curoverse/arvados.git
+    cd arvados
 
 See also: [Downloading the source code](https://arvados.org/projects/arvados/wiki/Download) on the Arvados wiki.
 
-## Configure the API server
+## Install gem dependencies
 
-First install the gems:
+    cd services/api && bundle install
 
-    cd arvados/services/api
-    bundle install
+## Configure the API server
 
-Next, configure the database:
+Configure the database:
 
     cp -i config/database.yml.sample config/database.yml
 
-Edit `database.yml` to your liking and make sure the database and db user exist.
-Then set up the database:
+Edit `config/database.yml` to your liking and make sure the database
+and db user exist. Then set up the database:
  
-    RAILS_ENV=production rake db:setup
+    RAILS_ENV=production bundle exec rake db:setup
 
 Then set up omniauth:
 
@@ -46,41 +47,35 @@ Edit `config/initializers/omniauth.rb`. Choose an *APP_SECRET* and
 Make sure your Omniauth provider knows about your *APP_ID* and *APP_SECRET*
 combination.
 
-You also need to update `config/initializers/secret_token.rb`.
-Generate a new secret with
-
-    rake secret
-
-and put it in `config/initializers/secret_token.rb`:
-
-    Server::Application.config.secret_token = 'your-new-secret-here'
+Edit the main configuration.
 
-Edit the main configuration:
+    cp -i config/application.yml.example config/application.yml
 
-    cp -i config/config.yml.example config/config.yml
+First, choose a unique 5-character alphanumeric string to use as your
+`uuid_prefix`. An example is given that generates a 5-character string
+based on a hash of your hostname. The `uuid_prefix` is a unique
+identifier for your API server. It also serves as the first part of
+the hostname for your API server:
 
-First, you want to make sure that
+    {{ site.arvados_api_host }}
 
-    uuid_prefix
+For a development site, use your own domain instead of arvadosapi.com.
 
-is set to a unique 5-character alphanumeric string. An example is
-given that generates a 5-character string based on a hash of your
-hostname.
+You also need to install a secret_token for signing cookies. Generate
+a new secret:
 
-The `uuid_prefix` is a unique identifier for your API server. It also
-serves as the first part of the hostname for your API server, for
-instance
+    rake secret
 
-    {{ site.arvados_api_host }}
+Put it in `config/application.yml` in the production or common section:
 
-For a development site, use your own domain instead of arvadosapi.com.
+    secret_token: your-new-secret-here
 
 You will also want to change `compute_node_nameservers` to suit your
 environment.
 
-Consult `config.defaults.yml` for a full list of configuration
-options. Always put your local configuration in `config.yml` instead
-of editing `config.defaults.yml`.
+Consult `application.default.yml` for a full list of configuration
+options. Always put your local configuration in `application.yml`
+instead of editing `application.default.yml`.
 
 ## Apache/Passenger
 
index 87b4fbf8a5385f498c2e016f9225d467a3dd664a..5d362f4529ffd545ecb476adcdb78dfcabfa0d70 100755 (executable)
@@ -579,10 +579,6 @@ for (my $todo_ptr = 0; $todo_ptr <= $#jobstep_todo; $todo_ptr ++)
       $command .=
          "&& perl -";
     }
-    $ENV{"PYTHONPATH"} =~ s{^}{:} if $ENV{"PYTHONPATH"};
-    $ENV{"PYTHONPATH"} =~ s{^}{$ENV{CRUNCH_SRC}/sdk/python}; # xxx hack
-    $ENV{"PYTHONPATH"} =~ s{^}{$ENV{CRUNCH_SRC}/arvados/sdk/python:}; # xxx hack
-    $ENV{"PYTHONPATH"} =~ s{$}{:/usr/local/arvados/src/sdk/python}; # xxx hack
     $command .=
         "&& exec arv-mount $ENV{TASK_KEEPMOUNT} --exec $ENV{CRUNCH_SRC}/crunch_scripts/" . $Job->{"script"};
     my @execargs = ('bash', '-c', $command);
index ac9cd9bcf6088cbc54751ec340d143b66c423154..5e773dfbc6c0185f32b02b76ab3255692a8b4cbe 100755 (executable)
@@ -51,10 +51,14 @@ with "--".
         # wait until the driver is finished initializing
         operations.initlock.wait()
 
+        rc = 255
         try:
             rc = subprocess.call(args.exec_args, shell=False)
-        except:
-            rc = 255
+        except OSError as e:
+            sys.stderr.write('arv-mount: %s -- exec %s\n' % (str(e), args.exec_args))
+            rc = e.errno
+        except Exception as e:
+            sys.stderr.write('arv-mount: %s\n' % str(e))
         finally:
             subprocess.call(["fusermount", "-u", "-z", args.mountpoint])
 
index dcfcb42f186404df4b42da0fb1f318dd7f70e501..c48308d0935af8a7c9cb2e1ee8de4c0d0b7291d5 100644 (file)
@@ -25,7 +25,7 @@ production:
       Net::HTTP.get(URI("http://169.254.169.254/latest/meta-data/#{iface}-ipv4")).match(/^[\d\.]+$/)[0]
     end << '172.16.0.23'
   %>
-  # You must customize these. See config.defaults.yml for information.
+  # You must customize these. See application.default.yml for information.
   compute_node_ami: ~
   compute_node_ec2_tag_enable: ~
   compute_node_domain: ~