X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/f3e7d40574c721225c280de14394ffd5b97ab4ab..cf5d136d81bd22ce5340243643a4734f3cf20856:/doc/install/install-api-server.html.textile.liquid
diff --git a/doc/install/install-api-server.html.textile.liquid b/doc/install/install-api-server.html.textile.liquid
index 3aa123e26f..c234bca927 100644
--- a/doc/install/install-api-server.html.textile.liquid
+++ b/doc/install/install-api-server.html.textile.liquid
@@ -3,183 +3,275 @@ layout: default
navsection: installguide
title: Install the API server
...
+{% comment %}
+Copyright (C) The Arvados Authors. All rights reserved.
-This installation guide assumes you are on a 64 bit Debian or Ubuntu system.
+SPDX-License-Identifier: CC-BY-SA-3.0
+{% endcomment %}
h2. Install prerequisites
-~$ sudo apt-get install \
- bison build-essential gettext libcurl3 libcurl3-gnutls \
- libcurl4-openssl-dev libpcre3-dev libpq-dev libreadline-dev \
- libssl-dev libxslt1.1 postgresql sudo wget zlib1g-dev
-
~$ cd $HOME # (or wherever you want to install)
-~$ git clone https://github.com/curoverse/arvados.git
-
+~$ sudo apt-get install bison build-essential libcurl4-openssl-dev git arvados-api-server
+
~$ cd arvados/services/api
-~/arvados/services/api$ bundle install
-
~$ sudo yum install bison make automake gcc gcc-c++ libcurl-devel git arvados-api-server
+
+
-The API server can be run in @development@ or in @production@ mode. Unless this installation is going to be used for development on the Arvados API server itself, you should run it in @production@ mode.
+{% include 'install_git' %}
-Copy the example environment file for your environment. For example, if you choose @production@:
+h2(#configure_application). Configure the API server
-~/arvados/services/api$ cp -i config/environments/production.rb.example config/environments/production.rb
-
~/arvados/services/api$ cp -i config/application.yml.example config/application.yml
-
Clusters:
+ zzzzz:
+ ...
+
-The API server reads the @config/application.yml@ file, as well as the @config/application.defaults.yml@ file. Values in @config/application.yml@ take precedence over the defaults that are defined in @config/application.defaults.yml@. The @config/application.yml.example@ file is not read by the API server and is provided for installation convenience, only.
+h3(#configure). PostgreSQL.Connection
-Consult @config/application.default.yml@ for a full list of configuration options. Always put your local configuration in @config/application.yml@, never edit @config/application.default.yml@.
+Replace the @xxxxxxxx@ database password placeholder with the "password you generated during database setup":install-postgresql.html#api.
-h3(#uuid_prefix). uuid_prefix
+Clusters:
+ zzzzz:
+ PostgreSQL:
+ Connection:
+ host: localhost
+ user: arvados
+ password: xxxxxxxx
+ dbname: arvados_production
+
+~$ ruby -e 'puts rand(2**400).to_s(36)'
+yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
+
~/arvados/services/api$ sudo mkdir -p /var/lib/arvados/git
-~/arvados/services/api$ sudo git clone --bare ../../.git /var/lib/arvados/git/arvados.git
-
Clusters:
+ zzzzz:
+ API:
+ RailsSessionSecretToken: yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
+
-h3. secret_token
+h3(#blob_signing_key). Collections.BlobSigningKey
-Generate a new secret token for signing cookies:
+The @Collections.BlobSigningKey@ is used to enforce access control to Keep blocks. This same key must be provided to the Keepstore daemons when "installing Keepstore servers.":install-keepstore.html IMPORTANT: This is a site secret. It should be at least 50 characters. Generate a random value and set it in @config.yml@:
~/arvados/services/api$ rake secret
-zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
+~$ ruby -e 'puts rand(2**400).to_s(36)'
+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Clusters:
+ zzzzz:
+ Collections:
+ BlobSigningKey: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+Clusters:
+ zzzzz:
+ Services:
+ SSO:
+ ExternalURL: https://sso.example.com
+ Login:
+ ProviderAppID: arvados-server
+ ProviderAppSecret: wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+~/arvados/services/api$ ruby -e 'puts rand(2**128).to_s(36)'
-6gqa1vu492idd7yca9tfandj3
-
Clusters:
+ zzzzz:
+ Services:
+ Workbench1:
+ ExternalURL: https://workbench.zzzzz.example.com
+
-Create a new database user with permission to create its own databases.
+h3. Services.Websocket.ExternalURL
-~/arvados/services/api$ sudo -u postgres createuser --createdb --encrypted --pwprompt arvados
-[sudo] password for you: yourpassword
-Enter password for new role: paste-password-you-generated
-Enter it again: paste-password-again
-Shall the new role be a superuser? (y/n) n
-Shall the new role be allowed to create more new roles? (y/n) n
-
~/arvados/services/api$ cp -i config/database.yml.sample config/database.yml
-~/arvados/services/api$ edit config/database.yml
-
Clusters:
+ zzzzz:
+ Services:
+ Websocket:
+ ExternalURL: wss://ws.zzzzz.example.com
+
-Create and initialize the database. If you are planning a production system, choose the @production@ rails environment, otherwise use @development@.
+h3(#git_repositories_dir). Git.Repositories
-~/arvados/services/api$ RAILS_ENV=production bundle exec rake db:setup
-
~/arvados/services/api$ su postgres createdb arvados_production -E UTF8 -O arvados
-~/arvados/services/api$ RAILS_ENV=production bundle exec rake db:structure:load
-~/arvados/services/api$ RAILS_ENV=production bundle exec rake db:seed
+~$ sudo mkdir -p /var/lib/arvados/git/repositories
ERROR: must be owner of extension plpgsql
Clusters:
+ zzzzz:
+ Git:
+ Repositories: /var/lib/arvados/git/repositories
+
-h2(#omniauth). Set up omniauth
+h3(#enable_legacy_jobs_api). Containers.JobsAPI.Enable
-First copy the omniauth configuration file:
+Enable the legacy "Jobs API":install-crunch-dispatch.html . Note: new installations should use the "Containers API":crunch2-slurm/install-prerequisites.html
-~/arvados/services/api$ cp -i config/initializers/omniauth.rb.example config/initializers/omniauth.rb
-
APP_ID = 'arvados-server'
-APP_SECRET = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
-CUSTOM_PROVIDER_URL = 'https://sso.example.com/'
-
+Clusters:
+ zzzzz:
+ Containers:
+ JobsAPI:
+ Enable: 'auto'
~/arvados/services/api$ bundle exec rails server --port=3030
-
Clusters:
+ zzzzz:
+ Containers:
+ JobsAPI:
+ GitInternalDir: /var/lib/arvados/internal.git
+
-h3. Production environment
+h2(#set_up). Set up Nginx and Passenger
-We recommend "Passenger":https://www.phusionpassenger.com/ to run the API server in production.
+The Nginx server will serve API requests using Passenger. It will also be used to proxy SSL requests to other services which are covered later in this guide.
-Point it to the services/api directory in the source tree.
+First, "Install Nginx and Phusion Passenger":https://www.phusionpassenger.com/library/walkthroughs/deploy/ruby/ownserver/nginx/oss/install_passenger_main.html.
-To enable streaming so users can monitor crunch jobs in real time, make sure to add the following to your Passenger configuration:
+Edit the http section of your Nginx configuration to run the Passenger server. Add a block like the following, adding SSL and logging parameters to taste:
PassengerBufferResponse off
+
+server {
+ listen 127.0.0.1:8000;
+ server_name localhost-api;
+
+ root /var/www/arvados-api/current/public;
+ index index.html index.htm index.php;
+
+ passenger_enabled on;
+ # If you're using RVM, uncomment the line below.
+ #passenger_ruby /usr/local/rvm/wrappers/default/ruby;
+
+ # This value effectively limits the size of API objects users can
+ # create, especially collections. If you change this, you should
+ # also ensure the following settings match it:
+ # * `client_max_body_size` in the server section below
+ # * `client_max_body_size` in the Workbench Nginx configuration (twice)
+ # * `API.MaxRequestSize` in config.yml
+ client_max_body_size 128m;
+}
+
+upstream api {
+ server 127.0.0.1:8000 fail_timeout=10s;
+}
+
+proxy_http_version 1.1;
+
+# When Keep clients request a list of Keep services from the API server, the
+# server will automatically return the list of available proxies if
+# the request headers include X-External-Client: 1. Following the example
+# here, at the end of this section, add a line for each netmask that has
+# direct access to Keep storage daemons to set this header value to 0.
+geo $external_client {
+ default 1;
+ 10.20.30.0/24 0;
+}
~$ sudo nginx -s reload
+
+Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will +break this application for all non-root users on this machine.
fatal: Not a git repository (or any of the parent directories): .git