[ARVADOS] updated: 94b11dfc98ed84d0f91f2bc2fc81e76b4d3c35d7

git at public.curoverse.com git at public.curoverse.com
Thu Sep 25 14:33:58 EDT 2014


Summary of changes:
 docker/api/Dockerfile                                       |  3 ++-
 docker/build_tools/build.rb                                 |  2 +-
 docker/passenger/Dockerfile                                 |  3 ++-
 services/api/app/controllers/static_controller.rb           | 13 ++++++++++++-
 .../api/app/views/user_notifier/account_is_setup.text.erb   |  4 ++--
 services/api/config/application.default.yml                 |  7 +++++--
 6 files changed, 24 insertions(+), 8 deletions(-)

  discards  1a9643523bb0b8dd00bdeb71dc037cb29fc42358 (commit)
       via  94b11dfc98ed84d0f91f2bc2fc81e76b4d3c35d7 (commit)
       via  e9622f371ad4d75f0a0b5ee9480fae779dd63156 (commit)
       via  5253b7d81a54c6087b35148499c360c692fac870 (commit)
       via  a452ab111d29f4f06d31c3fe760bb17b211020a6 (commit)

This update added new revisions after undoing existing revisions.  That is
to say, the old revision is not a strict subset of the new revision.  This
situation occurs when you --force push a change and generate a repository
containing something like this:

 * -- * -- B -- O -- O -- O (1a9643523bb0b8dd00bdeb71dc037cb29fc42358)
            \
             N -- N -- N (94b11dfc98ed84d0f91f2bc2fc81e76b4d3c35d7)

When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.

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 94b11dfc98ed84d0f91f2bc2fc81e76b4d3c35d7
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu Sep 25 13:52:51 2014 -0400

    3991: Use db:structure:load and db:seed instead of db:setup: the database already exists here.

diff --git a/docker/api/Dockerfile b/docker/api/Dockerfile
index 6a70fc3..fc2e3e4 100644
--- a/docker/api/Dockerfile
+++ b/docker/api/Dockerfile
@@ -35,7 +35,8 @@ RUN /usr/local/rvm/bin/rvm-exec default bundle install --gemfile=/usr/src/arvado
     rm /tmp/config_databases.sh && \
     /etc/init.d/postgresql start && \
     cd /usr/src/arvados/services/api && \
-    /usr/local/rvm/bin/rvm-exec default bundle exec rake db:setup && \
+    /usr/local/rvm/bin/rvm-exec default bundle exec rake db:structure:load && \
+    /usr/local/rvm/bin/rvm-exec default bundle exec rake db:seed && \
     /usr/local/rvm/bin/rvm-exec default bundle exec rake assets:precompile && \
     /usr/local/rvm/bin/rvm-exec default ./script/create_superuser_token.rb $(cat /tmp/superuser_token) && \
     chown www-data:www-data config.ru && \

commit e9622f371ad4d75f0a0b5ee9480fae779dd63156
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu Sep 25 14:30:09 2014 -0400

    3991: Handle "no workbench_address configured" more gracefully.
    
    * Remove example config from default production section.
    * Follow config rule: false = feature disabled, nil = sysadmin error.
    * Respond 404 at root url if no workbench_address is configured.
    * Never redirect to workbench if client requested JSON.

diff --git a/services/api/app/controllers/static_controller.rb b/services/api/app/controllers/static_controller.rb
index c71b850..6ee46e0 100644
--- a/services/api/app/controllers/static_controller.rb
+++ b/services/api/app/controllers/static_controller.rb
@@ -6,12 +6,17 @@ class StaticController < ApplicationController
   skip_before_filter :require_auth_scope, :only => [ :home, :login_failure ]
 
   def home
-    if Rails.configuration.respond_to? :workbench_address
-      redirect_to Rails.configuration.workbench_address
-    else
-      render json: {
-        error: ('This is the API server; you probably want to be at the workbench for this installation. Unfortunately, config.workbench_address is not set so I can not redirect you there automatically')
-      }
+    respond_to do |f|
+      f.html do
+        if Rails.configuration.workbench_address
+          redirect_to Rails.configuration.workbench_address
+        else
+          render_not_found "Path not found."
+        end
+      end
+      f.json do
+        render_not_found "Path not found."
+      end
     end
   end
 
diff --git a/services/api/app/mailers/user_notifier.rb b/services/api/app/mailers/user_notifier.rb
index 1f9ad8c..055fe3a 100644
--- a/services/api/app/mailers/user_notifier.rb
+++ b/services/api/app/mailers/user_notifier.rb
@@ -2,22 +2,10 @@ class UserNotifier < ActionMailer::Base
   include AbstractController::Callbacks
 
   default from: Rails.configuration.user_notifier_email_from
-  before_filter :load_variables
 
   def account_is_setup(user)
     @user = user
     mail(to: user.email, subject: 'Welcome to Curoverse')
   end
 
-private
-  def load_variables
-    if Rails.configuration.respond_to?('workbench_address') and
-       not Rails.configuration.workbench_address.nil? and
-       not Rails.configuration.workbench_address.empty? then
-      @wb_address = Rails.configuration.workbench_address
-    else
-      @wb_address = '(Unfortunately, config.workbench_address is not set, please contact your site administrator)'
-    end
-  end
-
 end
diff --git a/services/api/app/views/user_notifier/account_is_setup.text.erb b/services/api/app/views/user_notifier/account_is_setup.text.erb
index a7cca2f..5d8c9e7 100644
--- a/services/api/app/views/user_notifier/account_is_setup.text.erb
+++ b/services/api/app/views/user_notifier/account_is_setup.text.erb
@@ -5,9 +5,9 @@ Hi there,
 <% end -%>
 
 Your Arvados account has been set up. You can log in with your Google account
-associated with the e-mail address <%= @user.email %> at:
+associated with the e-mail address <%= @user.email %><% if Rails.configuration.workbench_address %> at:
 
-  <%= @wb_address %>
+  <%= Rails.configuration.workbench_address %><% else %>.<% end %>
 
 Thanks,
 The Arvados team.
diff --git a/services/api/config/application.default.yml b/services/api/config/application.default.yml
index 5526501..7571bb0 100644
--- a/services/api/config/application.default.yml
+++ b/services/api/config/application.default.yml
@@ -17,10 +17,6 @@ development:
   assets.debug: true
   local_modified: <%= '-modified' if `git status -s` %>
 
-  # Visitors to the API server will be redirected to the workbench
-  # By default, workbench_address is unset.
-  #workbench_address: https://workbench.local:3031/
-
 production:
   force_ssl: true
   cache_classes: true
@@ -31,10 +27,6 @@ production:
   assets.compile: false
   assets.digest: true
 
-  # Visitors to the API server will be redirected to the workbench
-  # By default, workbench_address is unset.
-  #workbench_address: <%= "https://workbench." + `hostname`.strip %>
-
 test:
   force_ssl: false
   cache_classes: true
@@ -51,16 +43,18 @@ test:
   uuid_prefix: zzzzz
   secret_token: <%= rand(2**512).to_s(36) %>
   blob_signing_key: zfhgfenhffzltr9dixws36j1yhksjoll2grmku38mi7yxd66h5j4q9w4jzanezacp8s6q0ro3hxakfye02152hncy6zml2ed0uc
-
-  # email address to which mail should be sent when the user creates profile for the first time
   user_profile_notification_address: arvados at example.com
-
-  # Visitors to the API server will be redirected to the workbench
   workbench_address: https://localhost:3001/
 
 common:
   uuid_prefix: <%= Digest::MD5.hexdigest(`hostname`).to_i(16).to_s(36)[0..4] %>
 
+  # If this is not false, HTML requests at the API server's root URL
+  # are redirected to this location, and it is provided in the text of
+  # user activation notification email messages to remind them where
+  # to log in.
+  workbench_address: false
+
   # Git repositories must be readable by api server, or you won't be
   # able to submit crunch jobs. To pass the test suites, put a clone
   # of the arvados tree in {git_repositories_dir}/arvados.git or
diff --git a/services/api/config/application.yml.example b/services/api/config/application.yml.example
index d6de1ff..f31820a 100644
--- a/services/api/config/application.yml.example
+++ b/services/api/config/application.yml.example
@@ -14,12 +14,14 @@ development:
   # Mandatory site secrets. See application.default.yml for more info.
   secret_token: ~
   blob_signing_key: ~
+  workbench_address: https://localhost:3031
 
 production:
   # Mandatory site secrets. See application.default.yml for more info.
   secret_token: ~
   blob_signing_key: ~
   uuid_prefix: bogus
+  workbench_address: https://workbench.bogus.arvadosapi.com
 
 test:
   # Tests should be able to run without further configuration, but if you do

commit 5253b7d81a54c6087b35148499c360c692fac870
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu Sep 25 14:16:33 2014 -0400

    3991: Run passenger script using bundle exec.
    
    Passenger was installed in a previous step, but that was done using
    "bundle install", which installs into ./vendor/bundle instead of a
    system-wide install dir. This way, we install the passenger version
    listed in services/api/Gemfile.lock instead of installing some other
    version (or failing completely).

diff --git a/docker/passenger/Dockerfile b/docker/passenger/Dockerfile
index 049ce2d..e6254bd 100644
--- a/docker/passenger/Dockerfile
+++ b/docker/passenger/Dockerfile
@@ -8,7 +8,9 @@ RUN apt-get update && \
     apt-get install -q -y apt-utils git curl procps apache2-mpm-worker \
                           libcurl4-openssl-dev apache2-threaded-dev \
                           libapr1-dev libaprutil1-dev && \
-    /usr/local/rvm/bin/rvm-exec default passenger-install-apache2-module --auto
+    cd /usr/src/arvados/services/api && \
+    /usr/local/rvm/bin/rvm-exec default bundle exec passenger-install-apache2-module --auto
 
-RUN /usr/local/rvm/bin/rvm-exec default passenger-install-apache2-module --snippet > /etc/apache2/conf.d/passenger
+RUN cd /usr/src/arvados/services/api && \
+    /usr/local/rvm/bin/rvm-exec default bundle exec passenger-install-apache2-module --snippet > /etc/apache2/conf.d/passenger
 

commit a452ab111d29f4f06d31c3fe760bb17b211020a6
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu Sep 25 14:11:17 2014 -0400

    3991: Set workbench_address in docker config.

diff --git a/docker/api/application.yml.in b/docker/api/application.yml.in
index 355c4e5..a60b4e6 100644
--- a/docker/api/application.yml.in
+++ b/docker/api/application.yml.in
@@ -56,6 +56,8 @@ production:
   action_mailer.raise_delivery_errors: false
   action_mailer.perform_deliveries: false
 
+  workbench_address: @@API_WORKBENCH_ADDRESS@@
+
 test:
   uuid_prefix: zzzzz
   secret_token: <%= rand(2**512).to_s(36) %>
diff --git a/docker/build_tools/build.rb b/docker/build_tools/build.rb
index e7f2b7d..cda8651 100755
--- a/docker/build_tools/build.rb
+++ b/docker/build_tools/build.rb
@@ -84,6 +84,7 @@ def main options
       config['API_AUTO_ADMIN_USER'] = admin_email_address
       config['ARVADOS_USER_NAME'] = user_name
       config['API_HOSTNAME'] = generate_api_hostname
+      config['API_WORKBENCH_ADDRESS'] = 'http://localhost:9899'
       config['PUBLIC_KEY_PATH'] = find_or_create_ssh_key(config['API_HOSTNAME'])
       config.each_key do |var|
         config_out.write "#{var}: #{config[var]}\n"
diff --git a/docker/config.yml.example b/docker/config.yml.example
index 0765f2f..6ba5bcf 100644
--- a/docker/config.yml.example
+++ b/docker/config.yml.example
@@ -32,6 +32,11 @@ API_HOSTNAME:           # e.g. qr1hi
 # should be an address associated with a Google account.
 API_AUTO_ADMIN_USER:
 
+# The location of the Workbench application where users should be
+# redirected if they point their browsers at the API server, e.g.,
+# https://localhost:9899
+API_WORKBENCH_ADDRESS:
+
 # If a _PW variable is set to an empty string, a password
 # will be chosen randomly at build time. This is the
 # recommended setting.

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list