Add ARVADOS_BRANCH and WORKBENCH2_BRANCH to arvbox
[arvados.git] / doc / install / arvbox.html.textile.liquid
1 ---
2 layout: default
3 navsection: installguide
4 title: Arvados-in-a-box
5 ...
6 {% comment %}
7 Copyright (C) The Arvados Authors. All rights reserved.
8
9 SPDX-License-Identifier: CC-BY-SA-3.0
10 {% endcomment %}
11
12 Arvbox is a Docker-based self-contained development, demonstration and testing environment for Arvados.  It is not intended for production use.
13
14 h2. Quick start
15
16 <pre>
17 $ curl -O https://git.arvados.org/arvados.git/blob_plain/refs/heads/main:/tools/arvbox/bin/arvbox
18 $ chmod +x arvbox
19 $ ./arvbox start localdemo
20 $ ./arvbox adduser demouser demo@example.com
21 </pre>
22
23 You can now log in as @demouser@ using the password you selected.
24
25 h2. Requirements
26
27 * Linux 3.x+ and Docker 1.9+
28 * Minimum of 3 GiB of RAM  + additional memory to run jobs
29 * Minimum of 3 GiB of disk + storage for actual data
30
31 h2. Usage
32
33 <pre>
34 $ arvbox
35 Arvados-in-a-box             https://doc.arvados.org/install/arvbox.html
36
37 start|run <config> [tag]   start arvbox container
38 stop               stop arvbox container
39 restart <config>   stop, then run again
40 status             print some information about current arvbox
41 ip                 print arvbox docker container ip address
42 host               print arvbox published host
43 shell              enter shell as root
44 ashell             enter shell as 'arvbox'
45 psql               enter postgres console
46 open               open arvbox workbench in a web browser
47 root-cert          get copy of root certificate
48 update  <config>   stop, pull latest image, run
49 build   <config>   build arvbox Docker image
50 reboot  <config>   stop, build arvbox Docker image, run
51 rebuild <config>   build arvbox Docker image, no layer cache
52 checkpoint         create database backup
53 restore            restore checkpoint
54 hotreset           reset database and restart API without restarting container
55 reset              delete arvbox arvados data (be careful!)
56 destroy            delete all arvbox code and data (be careful!)
57 log <service>      tail log of specified service
58 ls <options>       list directories inside arvbox
59 cat <files>        get contents of files inside arvbox
60 pipe               run a bash script piped in from stdin
61 sv <start|stop|restart> <service>
62                    change state of service inside arvbox
63 clone <from> <to>  clone dev arvbox
64 adduser <username> <email>
65                    add a user login
66 removeuser <username>
67                    remove user login
68 listusers          list user logins
69 </pre>
70
71 h2. Install root certificate
72
73 Arvbox creates root certificate to authorize Arvbox services.  Installing the root certificate into your web browser will prevent security errors when accessing Arvbox services with your web browser.  Every  Arvbox instance generates a new root signing key.
74
75 # Export the certificate using @arvbox root-cert@
76 # Go to the certificate manager in your browser.
77 #* In Chrome, this can be found under "Settings &rarr; Advanced &rarr; Manage Certificates" or by entering @chrome://settings/certificates@ in the URL bar.
78 #* In Firefox, this can be found under "Preferences &rarr; Privacy & Security" or entering @about:preferences#privacy@ in the URL bar and then choosing "View Certificates...".
79 # Select the "Authorities" tab, then press the "Import" button.  Choose @arvbox-root-cert.pem@
80
81 The certificate will be added under the "Arvados testing" organization as "arvbox testing root CA".
82
83 To access your Arvbox instance using command line clients (such as arv-get and arv-put) without security errors, install the certificate into the OS certificate storage.
84
85 h3. On Debian/Ubuntu:
86
87 <notextile>
88 <pre><code>cp arvbox-root-cert.pem /usr/local/share/ca-certificates/
89 /usr/sbin/update-ca-certificates
90 </code></pre>
91 </notextile>
92
93 h3. On CentOS:
94
95 <notextile>
96 <pre><code>cp arvbox-root-cert.pem /etc/pki/ca-trust/source/anchors/
97 /usr/bin/update-ca-trust
98 </code></pre>
99 </notextile>
100
101 h2. Configs
102
103 h3. dev
104
105 Development configuration.  Boots a complete Arvados environment inside the container.  The "arvados" and "arvados-dev" code directories along data directories "postgres", "var", "passenger" and "gems" are bind mounted from the host file system for easy access and persistence across container rebuilds.  Services are bound to the Docker container's network IP address and can only be accessed on the local host.
106
107 In "dev" mode, you can override the default autogenerated settings of Rails projects by adding "application.yml.override" to any Rails project (api, workbench).  This can be used to test out API server settings or point Workbench at an alternate API server.
108
109 h3. localdemo
110
111 Demo configuration.  Boots a complete Arvados environment inside the container. Unlike the development configuration, code directories are included in the demo image, and data directories are stored in a separate data volume container. Services are bound to the Docker container's network IP address and can only be accessed on the local host.
112
113 h3. test
114
115 Starts postgres and initializes the API server, then runs the Arvados test suite.  Will pass command line arguments to test runner.  Supports test runner interactive mode.
116
117 h3. devenv
118
119 Starts a minimal container with no services and the host's $HOME bind mounted inside the container, then enters an interactive login shell.  Intended to make it convenient to use tools installed in arvbox that don't require services.
120
121 h3. publicdev
122
123 Publicly accessible development configuration.  Similar to 'dev' except that service ports are published to the host's IP address and can accessed by anyone who can connect to the host system.  See below for more information.  WARNING! The public arvbox configuration is NOT SECURE and must not be placed on a public IP address or used for production work.
124
125 h3. publicdemo
126
127 Publicly accessible development configuration.  Similar to 'localdemo' except that service ports are published to the host's IP address and can accessed by anyone who can connect to the host system.  See below for more information.  WARNING! The public arvbox configuration is NOT SECURE and must not be placed on a public IP address or used for production work.
128
129 h2. Environment variables
130
131 h3. ARVBOX_DOCKER
132
133 The location of Dockerfile.base and associated files used by "arvbox build".
134 default: result of $(readlink -f $(dirname $0)/../lib/arvbox/docker)
135
136 h3. ARVBOX_CONTAINER
137
138 The name of the Docker container to manipulate.
139 default: arvbox
140
141 h3. ARVBOX_BASE
142
143 The base directory to store persistent data for arvbox containers.
144 default: $HOME/.arvbox
145
146 h3. ARVBOX_DATA
147
148 The base directory to store persistent data for the current container.
149 default: $ARVBOX_BASE/$ARVBOX_CONTAINER
150
151 h3. ARVADOS_ROOT
152
153 The root directory of the Arvados source tree
154 default: $ARVBOX_DATA/arvados
155
156 h3. ARVADOS_DEV_ROOT
157
158 The root directory of the Arvados-dev source tree
159 default: $ARVBOX_DATA/arvados-dev
160
161 h3. ARVBOX_PUBLISH_IP
162
163 The IP address on which to publish services when running in public configuration.  Overrides default detection of the host's IP address.
164
165 h2. Using Arvbox for Arvados development
166
167 The "Arvbox section of Hacking Arvados":https://dev.arvados.org/projects/arvados/wiki/Arvbox has information about using Arvbox for Arvados development.
168
169 h2. Making Arvbox accessible from other hosts
170
171 In "dev" and "localdemo" mode, Arvbox can only be accessed on the same host it is running.  To publish Arvbox service ports to the host's service ports and advertise the host's IP address for services, use @publicdev@ or @publicdemo@:
172
173 <pre>
174 $ arvbox start publicdemo
175 </pre>
176
177 This attempts to auto-detect the correct IP address to use by taking the IP address of the default route device.  If the auto-detection is wrong, you want to publish a hostname instead of a raw address, or you need to access it through a different device (such as a router or firewall), set @ARVBOX_PUBLISH_IP@ to the desire hostname or IP address.
178
179 <pre>
180 $ export ARVBOX_PUBLISH_IP=example.com
181 $ arvbox start publicdemo
182 </pre>
183
184 Note: this expects to bind the host's port 80 (http) for workbench, so you cannot have a conflicting web server already running on the host.  It does not attempt to take bind the host's port 22 (ssh), as a result the arvbox ssh port is not published.
185
186 h2. Notes
187
188 Services are designed to install and auto-configure on start or restart.  For example, the service script for keepstore always compiles keepstore from source and registers the daemon with the API server.
189
190 Services are run with process supervision, so a service which exits will be restarted.  Dependencies between services are handled by repeatedly trying and failing the service script until dependencies are fulfilled (by other service scripts) enabling the service script to complete.