[ARVADOS] updated: 428359fce0a1b8f9b922236cb55937ec6339a275

git at public.curoverse.com git at public.curoverse.com
Tue Mar 11 13:57:09 EDT 2014


Summary of changes:
 docker/api/production.rb.in |    2 +-
 docker/base/Dockerfile      |    4 +++-
 docker/build.rb             |   32 +++++++++++++++-----------------
 docker/build.sh             |    7 +++++--
 docker/workbench/Dockerfile |    9 ++++-----
 5 files changed, 28 insertions(+), 26 deletions(-)

       via  428359fce0a1b8f9b922236cb55937ec6339a275 (commit)
      from  c8060b94c485d5bf0e500d2321793cd56db4c856 (commit)

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 428359fce0a1b8f9b922236cb55937ec6339a275
Author: Tim Pierce <twp at curoverse.com>
Date:   Tue Mar 11 13:54:55 2014 -0400

    Fix bugs introduced from merge with master. (refs #2221)
    
    * build.rb: be smarter about preparing SSH key and building config.yml
    * build.sh: correct the check for ruby 1.9.3
    
    * base: CURL and SSL libraries are now prerequisites
    * apiserver: compute_node_domain must be set
    * workbench: secret_token needs to be installed before rake precompile

diff --git a/docker/api/production.rb.in b/docker/api/production.rb.in
index 8d52bab..967d185 100644
--- a/docker/api/production.rb.in
+++ b/docker/api/production.rb.in
@@ -80,7 +80,7 @@ Server::Application.configure do
   # config.compute_node_nameservers = ['1.2.3.4', '1.2.3.5']
   require 'net/http'
   config.compute_node_nameservers = [ '@@ARVADOS_DNS_SERVER@@' ]
-
+  config.compute_node_domain = false
   config.uuid_prefix = '@@API_HOSTNAME@@'
 
   # Authentication stub: hard code pre-approved API tokens.
diff --git a/docker/base/Dockerfile b/docker/base/Dockerfile
index a64d007..e20fd00 100644
--- a/docker/base/Dockerfile
+++ b/docker/base/Dockerfile
@@ -11,7 +11,9 @@ ENV DEBIAN_FRONTEND noninteractive
 #   * Arvados source code in /usr/src/arvados, for preseeding gem installation
 
 RUN apt-get update && \
-    apt-get -q -y install -q -y openssh-server apt-utils git curl locales postgresql-server-dev-9.1 && \
+    apt-get -q -y install -q -y openssh-server apt-utils git curl \
+    	     libcurl3 libcurl3-gnutls libcurl4-openssl-dev locales \
+	     postgresql-server-dev-9.1 && \
     /bin/mkdir -p /root/.ssh && \
     /bin/sed -ri 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
     /usr/sbin/locale-gen && \
diff --git a/docker/build.rb b/docker/build.rb
index cf39da7..7c5f3c5 100755
--- a/docker/build.rb
+++ b/docker/build.rb
@@ -35,22 +35,20 @@ def docker_ok?
   return system 'docker images > /dev/null 2>&1'
 end
 
-def find_ssh_key key_name
-  # If the user already has a key loaded in their agent, use one of those
-  agent_keys = `ssh-add -l`
-  if agent_keys.empty?
-    # Use a key named arvados_{key_name}_id_rsa, generating
-    # a passphraseless key if necessary.
-    ssh_key_file = "#{ENV['HOME']}/.ssh/arvados_#{key_name}_id_rsa"
-    unless File.exists? ssh_key_file
-      system 'ssh_keygen', '-f', ssh_key_file, '-P', ''
-    end
-  else
-    # choose an agent key at random
-    ssh_key_file = agent_keys.split("\n").first.split[2]
+# find_or_create_ssh_key arvados_name
+#   Return the SSH public key appropriate for this Arvados instance,
+#   generating one if necessary.
+#
+def find_or_create_ssh_key arvados_name
+  ssh_key_file = "#{ENV['HOME']}/.ssh/arvados_#{arvados_name}_id_rsa"
+  unless File.exists? ssh_key_file
+    system 'ssh-keygen',
+           '-f', ssh_key_file,
+           '-C', "arvados@#{arvados_name}",
+           '-P', ''
   end
 
-  return File.exists?("#{ssh_key_file}.pub") ? "#{ssh_key_file}.pub" : nil
+  return "#{ssh_key_file}.pub"
 end
 
 if not ip_forwarding_enabled?
@@ -91,8 +89,8 @@ if not debootstrap_ok?
   sudo '/usr/bin/apt-get', 'install', 'debootstrap'
 end
 
-# Generate a config.yml if it does not exist
-if not File.exists? 'config.yml'
+# Generate a config.yml if it does not exist or is empty
+if not File.size? 'config.yml'
   print "Generating config.yml.\n"
   print "Arvados needs to know the email address of the administrative user,\n"
   print "so that when that user logs in they are automatically made an admin.\n"
@@ -111,7 +109,7 @@ if not File.exists? 'config.yml'
     config = YAML.load_file 'config.yml.example'
     config['API_AUTO_ADMIN_USER'] = admin_email_address
     config['API_HOSTNAME'] = generate_api_hostname
-    config['PUBLIC_KEY_PATH'] = find_ssh_key(config['API_HOSTNAME'])
+    config['PUBLIC_KEY_PATH'] = find_or_create_ssh_key(config['API_HOSTNAME'])
     config.each_key do |var|
       if var.end_with?('_PW') or var.end_with?('_SECRET')
         config[var] = rand(2**256).to_s(36)
diff --git a/docker/build.sh b/docker/build.sh
index add3194..a6bb5b8 100755
--- a/docker/build.sh
+++ b/docker/build.sh
@@ -1,9 +1,12 @@
 #! /bin/bash
 
 # make sure Ruby 1.9.3 is installed before proceeding
-if ! ruby -v 2>/dev/null | grep '1\.9\.3' > /dev/null
+if ! ruby -e 'exit RUBY_VERSION >= "1.9.3"' 2>/dev/null
 then
-    echo "Installing Ruby. You may be required to enter your password."
+    echo "Installing Arvados requires at least Ruby 1.9.3."
+    echo "You may need to enter your password."
+    read -p "Press Ctrl-C to abort, otherwise we will install ruby1.9.3 now..." unused
+    
     sudo apt-get update
     sudo apt-get -y install ruby1.9.3
 fi
diff --git a/docker/workbench/Dockerfile b/docker/workbench/Dockerfile
index 0c5c294..bd0bf45 100644
--- a/docker/workbench/Dockerfile
+++ b/docker/workbench/Dockerfile
@@ -6,6 +6,10 @@ MAINTAINER Ward Vandewege <ward at curoverse.com>
 # Update Arvados source
 RUN /bin/mkdir -p /usr/src/arvados/apps
 ADD generated/workbench.tar.gz /usr/src/arvados/apps/
+ADD generated/secret_token.rb /usr/src/arvados/apps/workbench/config/initializers/secret_token.rb
+ADD generated/production.rb /usr/src/arvados/apps/workbench/config/environments/production.rb
+ADD passenger.conf /etc/apache2/conf.d/passenger
+
 
 RUN bundle install --gemfile=/usr/src/arvados/apps/workbench/Gemfile && \
     touch /usr/src/arvados/apps/workbench/log/production.log && \
@@ -23,11 +27,6 @@ RUN \
   a2ensite workbench && \
   a2enmod rewrite
 
-# Set up the production environment
-ADD generated/secret_token.rb /usr/src/arvados/apps/workbench/config/initializers/secret_token.rb
-ADD generated/production.rb /usr/src/arvados/apps/workbench/config/environments/production.rb
-ADD passenger.conf /etc/apache2/conf.d/passenger
-
 ADD apache2_foreground.sh /etc/apache2/foreground.sh
 
 # Start Apache

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list