Working on improving install documentation.
authorPeter Amstutz <peter.amstutz@curoverse.com>
Thu, 13 Mar 2014 01:53:57 +0000 (21:53 -0400)
committerPeter Amstutz <peter.amstutz@curoverse.com>
Thu, 13 Mar 2014 01:53:57 +0000 (21:53 -0400)
doc/install/install-api-server.html.md.liquid [deleted file]
doc/install/install-api-server.html.textile.liquid [new file with mode: 0644]
doc/install/install-sso.html.textile.liquid
services/api/config/database.yml.sample
services/api/config/initializers/omniauth.rb.example

diff --git a/doc/install/install-api-server.html.md.liquid b/doc/install/install-api-server.html.md.liquid
deleted file mode 100644 (file)
index 6eaef18..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
----
-layout: default
-navsection: installguide
-title: Install the API server
-navorder: 1
-...
-
-# API server setup
-
-## Prerequisites:
-
-1. A GNU/Linux (virtual) machine
-2. A domain name for your api server
-3. Ruby >= 2.0.0
-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.
-
-## Install gem dependencies
-
-    cd services/api && bundle install
-
-## Configure the API server
-
-Configure the database:
-
-    cp -i config/database.yml.sample config/database.yml
-
-Edit `config/database.yml` to your liking and make sure the database
-and db user exist. Then set up the database:
-    RAILS_ENV=production bundle exec rake db:setup
-
-Then set up omniauth:
-
-    cp -i config/initializers/omniauth.rb.example config/initializers/omniauth.rb
-
-Edit `config/initializers/omniauth.rb`. Choose an *APP_SECRET* and
-*APP_ID*. Also set *CUSTOM_PROVIDER_URL*.
-
-Make sure your Omniauth provider knows about your *APP_ID* and *APP_SECRET*
-combination.
-
-Edit the main configuration.
-
-    cp -i config/application.yml.example config/application.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:
-
-    {{ site.arvados_api_host }}
-
-For a development site, use your own domain instead of arvadosapi.com.
-
-You also need to install a secret_token for signing cookies. Generate
-a new secret:
-
-    rake secret
-
-Put it in `config/application.yml` in the production or common section:
-
-    secret_token: your-new-secret-here
-
-You will also want to change `compute_node_nameservers` to suit your
-environment.
-
-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
-
-Set up Apache and Passenger. Point them to the services/api directory in the source tree.
-
-To enable streaming so users can monitor crunch jobs in real time, add
-to your Apache configuration:
-
-    PassengerBufferResponse off
-
-## Add an admin user
-
-Point browser to the API endpoint. Log in with a google account.
-
-In the rails console:
-
-    Thread.current[:user] = User.find(1)
-    Thread.current[:user].is_admin = true
-    User.find(1).update_attributes is_admin: true, is_active: true
-    User.find(1).is_admin
-
-This should be
-
-     => true
-
-## Create a token
-
-In rails console
-
-     a = ApiClient.new(owner_uuid:'0'); a.save!
-     x = ApiClientAuthorization.new(api_client_id:a.id, user_id:1); x.save; x.api_token
-
diff --git a/doc/install/install-api-server.html.textile.liquid b/doc/install/install-api-server.html.textile.liquid
new file mode 100644 (file)
index 0000000..5f2a157
--- /dev/null
@@ -0,0 +1,123 @@
+---
+layout: default
+navsection: installguide
+title: Install the API server
+...
+
+h2. Prerequisites:
+
+1. A GNU/Linux (virtual) machine
+2. A domain name for your api server
+3. Ruby >= 2.0.0
+4. Bundler: @gem install bundler@
+5. Curl libraries: @sudo apt-get install libcurl3 libcurl3-gnutls libcurl4-openssl-dev@
+
+h2. Download the source tree
+
+<notextile>
+<pre><code>~$ <span class="userinput">git clone https://github.com/curoverse/arvados.git</span>
+</code></pre></notextile>
+
+See also: "Downloading the source code:https://arvados.org/projects/arvados/wiki/Download on the Arvados wiki.
+
+h2. Install gem dependencies
+
+<notextile>
+<pre><code>~$ <span class="userinput">cd arvados/services/api</span>
+~/arvados/services/api$ <span class="userinput">bundle install</span>
+</code></pre></notextile>
+
+h2. Configure the API server
+
+Configure the database:
+
+<notextile>
+<pre><code>~/arvados/services/api$ <span class="userinput">cp -i config/database.yml.sample config/database.yml</span>
+</code></pre></notextile>
+
+By default, the development database will use the sqlite3 driver, so no configuration is necessary.  If you wish to use mysql or postgres, edit @config/database.yml@ to your liking and make sure the database and db user exist. Then initialize the database:
+
+<notextile>
+<pre><code>~/arvados/services/api$ <span class="userinput">RAILS_ENV=development bundle exec rake db:setup</span>
+</code></pre></notextile>
+
+Then set up omniauth:
+
+<notextile>
+<pre><code>~/arvados/services/api$ <span class="userinput">cp -i config/initializers/omniauth.rb.example config/initializers/omniauth.rb
+</code></pre></notextile>
+
+Edit @config/initializers/omniauth.rb@. Set @APP_SECRET@ to the value of @app_secret@ from "installing the single sign on server":install-sso.html .
+
+Next, edit the main configuration:
+
+<notextile>
+<pre><code>~/arvados/services/api$ <span class="userinput">cp -i config/application.yml.example config/application.yml
+</code></pre></notextile>
+
+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.
+
+For a development site, use your own domain instead of arvadosapi.com.
+
+You also need to install a secret_token for signing cookies. Generate a new secret:
+
+<notextile>
+<pre><code>~/arvados/services/api$ <span class="userinput">rake secret
+zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
+</code></pre></notextile>
+
+Put it in @config/application.yml@ in the production or common section:
+
+<notextile>
+<pre><code><span class="userinput">    secret_token: zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz</span>
+</code></pre>
+</notextile>
+
+You will also want to change @compute_node_nameservers@ to suit your environment.
+
+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@.
+
+You can now run the development server:
+
+<notextile>
+<pre><code>~/arvados/services/api$ <span class="userinput">rails server
+</code></pre></notextile>
+
+h3. Apache/Passenger (optional)
+
+You can use "Passenger":https://www.phusionpassenger.com/ for deployment. Point it to the services/api directory in the source tree.
+
+To enable streaming so users can monitor crunch jobs in real time, add to your Passenger configuration in Apache:
+
+<notextile>
+<pre><code><span class="userinput">PassengerBufferResponse off</span>
+</code></pre>
+</notextile>
+
+h2. Add an admin user
+
+Point browser to the API endpoint. Log in with a google account.
+
+In the rails console:
+
+<notextile>
+<pre><code>~/arvados/services/api$ <span class="userinput">rails console</span>
+irb(main):001:0&gt; <span class="userinput">Thread.current[:user] = User.find(1)</span>
+irb(main):002:0&gt; <span class="userinput">Thread.current[:user].is_admin = true</span>
+irb(main):003:0&gt; <span class="userinput">User.find(1).update_attributes is_admin: true, is_active: true</span>
+irb(main):004:0&gt; <span class="userinput">User.find(1).is_admin</span>
+=&gt; true
+</code></pre></notextile>
+
+h2. Create an API token
+
+In rails console:
+
+<notextile>
+<pre><code>~/arvados/services/api$ <span class="userinput">rails console</span>
+irb(main):001:0&gt; <span class="userinput">a = ApiClient.new(owner_uuid:'0')</span>
+irb(main):002:0&gt; <span class="userinput">a.save!</span>
+irb(main):003:0&gt; <span class="userinput">x = ApiClientAuthorization.new(api_client_id:a.id, user_id:1)</span>
+irb(main):004:0&gt; <span class="userinput">x.save</span>
+irb(main):005:0&gt; <span class="userinput">x.api_token</span>
+</code></pre></notextile>
index b12bc511f3a9e1147f02887c6df93a41760f5662..f220ef6d369c33ccaae266bfb416e44a550a9f9f 100644 (file)
@@ -19,5 +19,6 @@ irb(main):003:0&gt; <span class="userinput">c.app_id = "arvados-server"</span>
 irb(main):004:0&gt; <span class="userinput">c.app_secret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"</span>
 irb(main):005:0&gt; <span class="userinput">c.save!</span>
 irb(main):006:0&gt; <span class="userinput">quit</span>
+~/sso-devise-omniauth-provider$ <span class="userinput">rails server --port=3002</span>
 </code></pre>
 </notextile>
index 8f54e6630987377588d8ce0e00a2e59a3434b351..25fcc7ada79ba516073a6c206699b26792d1b6f7 100644 (file)
@@ -1,10 +1,6 @@
 development:
-  adapter: postgresql
-  encoding: utf8
-  database: arvados_development
-  username: arvados
-  password: ********
-  host: localhost
+  adapter: sqlite3
+  database: db/arvados_development.sqlite3
 
 test:
   adapter: postgresql
index 05d1ee625bfeab686af94f2af804c1ca72fff007..aefcf56625b90e3f3410dbcb4e8f3d4999244719 100644 (file)
@@ -4,7 +4,7 @@ APP_ID = 'arvados-server'
 APP_SECRET = rand(2**512).to_s(36) # CHANGE ME!
 
 # Update your custom Omniauth provider URL here
-CUSTOM_PROVIDER_URL = 'http://auth.curoverse.com'
+CUSTOM_PROVIDER_URL = 'http://localhost:3002'
 
 Rails.application.config.middleware.use OmniAuth::Builder do
   provider :josh_id, APP_ID, APP_SECRET, CUSTOM_PROVIDER_URL