[ARVADOS] updated: 41f2b53c35ec79498a513cce2e2fd9019e769c70

git at public.curoverse.com git at public.curoverse.com
Mon Nov 17 09:42:22 EST 2014


Summary of changes:
 docker/api/apache2_vhost.in | 1 -
 1 file changed, 1 deletion(-)

  discards  4f257e48f16b8e846119d9eab9a7ec02e1487986 (commit)
  discards  e4e47b5f631befe382a48d00122234e248f155ad (commit)
  discards  3ca79283e89ba51a0ab98d0f84f2efd52f9c3550 (commit)
       via  41f2b53c35ec79498a513cce2e2fd9019e769c70 (commit)
       via  b709c1bdaefdbbb8819cfd497fa557ef2d662a9c (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 (4f257e48f16b8e846119d9eab9a7ec02e1487986)
            \
             N -- N -- N (41f2b53c35ec79498a513cce2e2fd9019e769c70)

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 41f2b53c35ec79498a513cce2e2fd9019e769c70
Author: Tom Clegg <tom at curoverse.com>
Date:   Sun Nov 16 13:34:24 2014 -0500

    3824: Create "all users" group in seeds.rb instead of asking a human to do it.

diff --git a/doc/install/create-standard-objects.html.textile.liquid b/doc/install/create-standard-objects.html.textile.liquid
index 92b0ade..e977bb7 100644
--- a/doc/install/create-standard-objects.html.textile.liquid
+++ b/doc/install/create-standard-objects.html.textile.liquid
@@ -1,29 +1,12 @@
 ---
 layout: default
 navsection: installguide
-title: Create standard objects
+title: Add an arvados repository
 
 ...
 
 
-Next, we're going to use the Arvados CLI tools on the <strong>shell server</strong> to create some standard objects.
-
-h3. "All users" group
-
-The convention is to add every active user to this group. We give it a distinctive UUID that looks like an IP broadcast address.
-
-<notextile>
-<pre><code>~$ <span class="userinput">prefix=`arv --format=uuid user current | cut -d- -f1`</span>
-~$ <span class="userinput">echo "Site prefix is '$prefix'"</span>
-~$ <span class="userinput">read -rd $'\000' newgroup <<EOF; arv group create --group "$newgroup"</span>
-<span class="userinput">{
- "uuid":"$prefix-j7d0g-fffffffffffffff",
- "name":"All users"
-}</span>
-EOF
-</code></pre></notextile>
-
-h3. "arvados" repository
+Next, we're going to use the Arvados CLI tools on the <strong>shell server</strong> to set up a locally hosted clone of the arvados repository.
 
 This will be readable by the "All users" group, and therefore by every active user. This makes it possible for users to run the bundled Crunch scripts by specifying @"script_version":"master","repository":"arvados"@ rather than pulling the Arvados source tree into their own repositories.
 
diff --git a/docker/api/setup.sh.in b/docker/api/setup.sh.in
index cba4759..7af6afb 100755
--- a/docker/api/setup.sh.in
+++ b/docker/api/setup.sh.in
@@ -8,15 +8,6 @@ export ARVADOS_API_HOST=api
 export ARVADOS_API_HOST_INSECURE=yes
 export ARVADOS_API_TOKEN=@@API_SUPERUSER_SECRET@@
 
-# All users group
-prefix=`arv --format=uuid user current | cut -d- -f1`
-read -rd $'\000' newgroup <<EOF; arv group create --group "$newgroup"
-{
- "uuid":"$prefix-j7d0g-fffffffffffffff",
- "name":"All users"
-}
-EOF
-
 # Arvados repository object
 all_users_group_uuid="$prefix-j7d0g-fffffffffffffff"
 repo_uuid=`arv --format=uuid repository create --repository '{"name":"arvados","fetch_url":"git at api:arvados.git","push_url":"git at api:arvados.git"}'`
diff --git a/services/api/app/models/user.rb b/services/api/app/models/user.rb
index b939d07..f55e24b 100644
--- a/services/api/app/models/user.rb
+++ b/services/api/app/models/user.rb
@@ -399,34 +399,15 @@ class User < ArvadosModel
 
   # add the user to the 'All users' group
   def create_user_group_link
-    # Look up the "All users" group (we expect uuid *-*-fffffffffffffff).
-    group = Group.where(name: 'All users').select do |g|
-      g[:uuid].match /-f+$/
-    end.first
-
-    if not group
-      logger.warn "No 'All users' group with uuid '*-*-fffffffffffffff'."
-      raise "No 'All users' group with uuid '*-*-fffffffffffffff' is found"
-    else
-      logger.info { "\"All users\" group uuid: " + group[:uuid] }
-
-      group_perms = Link.where(tail_uuid: self.uuid,
-                              head_uuid: group[:uuid],
-                              link_class: 'permission',
-                              name: 'can_read')
-
-      if !group_perms.any?
-        group_perm = Link.create(tail_uuid: self.uuid,
-                                 head_uuid: group[:uuid],
-                                 link_class: 'permission',
-                                 name: 'can_read')
-        logger.info { "group permission: " + group_perm[:uuid] }
-      else
-        group_perm = group_perms.first
-      end
-
-      return group_perm
-    end
+    return (Link.where(tail_uuid: self.uuid,
+                       head_uuid: all_users_group[:uuid],
+                       link_class: 'permission',
+                       name: 'can_read').first
+            or
+            Link.create(tail_uuid: self.uuid,
+                        head_uuid: all_users_group[:uuid],
+                        link_class: 'permission',
+                        name: 'can_read'))
   end
 
   # Give the special "System group" permission to manage this user and
diff --git a/services/api/db/seeds.rb b/services/api/db/seeds.rb
index d397b91..0a13ae6 100644
--- a/services/api/db/seeds.rb
+++ b/services/api/db/seeds.rb
@@ -7,6 +7,7 @@
 include CurrentApiClient
 system_user
 system_group
+all_users_group
 anonymous_group
 anonymous_user
 empty_collection
diff --git a/services/api/lib/current_api_client.rb b/services/api/lib/current_api_client.rb
index 4c26010..eaf54da 100644
--- a/services/api/lib/current_api_client.rb
+++ b/services/api/lib/current_api_client.rb
@@ -98,6 +98,27 @@ module CurrentApiClient
     $system_group
   end
 
+  def all_users_group_uuid
+    [Server::Application.config.uuid_prefix,
+     Group.uuid_prefix,
+     'fffffffffffffff'].join('-')
+  end
+
+  def all_users_group
+    if not $all_users_group
+      act_as_system_user do
+        ActiveRecord::Base.transaction do
+          $system_group = Group.
+            where(uuid: all_users_group_uuid).first_or_create do |g|
+            g.update_attributes(name: "All users",
+                                description: "All users")
+          end
+        end
+      end
+    end
+    $all_users_group
+  end
+
   def act_as_system_user
     if block_given?
       act_as_user system_user do

commit b709c1bdaefdbbb8819cfd497fa557ef2d662a9c
Author: Tom Clegg <tom at curoverse.com>
Date:   Sun Nov 16 13:33:08 2014 -0500

    3824: autorestart non-detached services regardless of exit code.

diff --git a/docker/api/supervisor.conf b/docker/api/supervisor.conf
index e85bb72..e684ff8 100644
--- a/docker/api/supervisor.conf
+++ b/docker/api/supervisor.conf
@@ -6,10 +6,12 @@ startsecs=0
 [program:postgres]
 user=postgres
 command=/usr/lib/postgresql/9.1/bin/postgres -D /var/lib/postgresql/9.1/main -c config_file=/etc/postgresql/9.1/main/postgresql.conf
+autorestart=true
 
 [program:apache2]
 command=/etc/apache2/foreground.sh
 stopsignal=6
+autorestart=true
 
 [program:munge]
 user=root
@@ -39,3 +41,4 @@ startsecs=0
 [program:crunch-dispatch]
 user=root
 command=/usr/local/bin/crunch-dispatch-run.sh
+autorestart=true

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list