0514245414e1c2bc1347994ebea0331e2238a0a9
[arvados.git] / doc / install / install-using-salt.html.textile.liquid
1 ---
2 layout: default
3 navsection: installguide
4 title: Install Arvados using Saltstack's arvados-formula
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 # "For the impatient (tl;rl)":#tlrl
13 # "Introduction":#introduction
14 # "Install Saltstack":#saltstack
15 # "Install dependencies":#dependencies
16 # "Install Arvados using Saltstack":#saltstack
17 # "Single host install using the provision.sh script":#single_host
18 # "Local testing Arvados in a Vagrant box":#vagrant
19 # "Final DNS configuration":#final_steps
20 # "Initial user and login":#initial_user
21
22 h2(#tlrl). For the impatient (TL;RL)
23
24 We added a "script":https://github.com/arvados/arvados/tree/master/tools/salt-install/provision.sh under the "tools/salt-install":https://github.com/arvados/arvados/tree/master/tools/salt-install directory.
25
26 Just edit the @provision.sh@ script, modify the variables at the top of the file to suit your needs (usually not required), copy the file to the host where you want to install Arvados and run it as root
27
28 <notextile>
29 <pre><code>bash ./provision.sh
30 </code></pre>
31 </notextile>
32
33 It will install all the main Arvados components to get you up and running.
34
35 The whole installation procedure takes somewhere between 15 to 60 minutes, depending on the host and your network bandwith. On a virtual machine with 1 core and 1 GB RAM, it takes ~25 minutes to do the initial install.
36
37 There is a companion @Vagrantfile@ to install Arvados in a local Vagrant virtual machine. If you have "Vagrant":https://www.vagrantup.com/ installed in your computer, you can just get Arvados installed running in a local virtual machine with the command (this can be done as a regular user). You will only need root to perform the "final dns configuration":#final_steps
38
39 <notextile>
40 <pre><code>vagrant up
41 </code></pre>
42 </notextile>
43
44 If you want to run these scripts in another host or instance, just copy the directory to the destination host, edit the @provision.sh@ file and run it.
45
46 Once the installation is over, you can just point your browser to the Workbench url and log in using the user you configured.
47
48 If you changed nothing from the script, the initial URL will be:
49
50 * https://workbench.arva2.arv.local for regular installations, or
51 * https://workbench.arva2.arv.local:8443 for vagrant installations
52
53 The rest of the document is a description of the individual steps the @provision.sh@ script perform.
54
55 h2(#introduction). Introduction
56
57 To ease the installation of the various Arvados components, we have developed a "Saltstack":https://www.saltstack.com/ 's "arvados-formula":https://github.com/saltstack-formulas/arvados-formula which can help you get an Arvados cluster up and running.
58
59 Saltstack is a Python-based, open-source software for event-driven IT automation, remote task execution, and configuration management. It can be used in a master/minion setup or master-less.
60
61 h2(#saltstack). Install Saltsack
62
63 If you already have a Saltstack environment you can skip this section.
64
65 The simplest way to get Salt up and running on a node is to use the bootstrap script they provide:
66
67 <notextile>
68 <pre><code>curl -L https://bootstrap.saltstack.com -o /tmp/bootstrap_salt.sh
69 sudo sh /tmp/bootstrap_salt.sh -XUdfP -x python3
70 </code></pre>
71 </notextile>
72
73 For more information check "Saltstack's documentation":https://docs.saltstack.com/en/latest/topics/installation/index.html
74
75 h2(#dependencies). Install dependencies
76
77 Arvados depends in a few applications and packages (postgresql, nginx+passenger, ruby) that can also be installed using their respective Saltstack formulas.
78
79 The formulas we use are:
80
81 * "postgres":https://github.com/saltstack-formulas/postgres-formula.git
82 * "nginx":https://github.com/saltstack-formulas/nginx-formula.git
83 * "docker":https://github.com/saltstack-formulas/docker-formula.git
84 * "locale":https://github.com/saltstack-formulas/locale-formula.git
85
86 There are example Salt pillar files for each of those formulas in the "test/salt/pillar/examples":https://github.com/saltstack-formulas/arvados-formula/tree/master/test/salt/pillar/examples directory. As they are, they allow you to get all the main Arvados components up and running.
87
88 h2(#saltstack). Install Arvados using Saltstack
89
90 The Arvados formula we maintain is located in the Saltstack's community repository of formulas:
91
92 * "arvados-formula":https://github.com/saltstack-formulas/arvados-formula.git
93
94 and we keep a @development@ version at our own repo
95
96 * "arvados-formula develpment":https://github.com/arvados/arvados-formula.git
97
98 This last one might break from time to time, as we try and add new features. Use with caution.
99
100 As much as possible, we try to keep it up to date, with example pillars to help you deploy Arvados.
101
102 For those familiar with Saltstack, the process to get it deployed is similar to any other formula:
103
104 1. Fork/copy the formula to your Salt master host.
105 2. Edit the Arvados, nginx, postgres, locale and docker pillars to match your desired configuration.
106 3. Run a @state.apply@ to get it deployed.
107
108 h2(#single_host). Single host install using the provision.sh script
109
110 In case you want to run it on a single node and don't want to (or don't have) a Saltstack master/minion infrastructure in place, we provide a very simple script named @provision.sh@ which can be used to deploy Arvados, using the @arvados-formula@ in a master-less setup.
111
112 Just
113
114 1. edit the variables at the very beginning ot the file,
115 2. run the script
116 3. wait for it to finish
117
118 If everything goes OK, you'll get some final lines stating something like:
119
120 <notextile>
121 <pre><code>arvados: Succeeded: 109 (changed=9)
122 arvados: Failed:      0
123 </code></pre>
124 </notextile>
125
126 h2(#vagrant). Local testing Arvados in a Vagrant box
127
128 If you want to try Arvados in a local virtual machine, there's a companion @Vagrantfile@ to install it on a virtual machine in your computer using "Vagrant":https://www.vagrantup.com/.
129
130 To get it running, simply install Vagrant in your computer, edit the @provision@ file as described in the previous section, and run
131
132 <notextile>
133 <pre><code>vagrant up
134 </code></pre>
135 </notextile>
136
137 If you want to reconfigure the running box, you can just:
138
139 1. edit the pillars to suit your needs
140 2. run
141
142 <notextile>
143 <pre><code>vagrant reload --provision
144 </code></pre>
145 </notextile>
146
147 h2(#final_steps). Final DNS configuration
148
149 After the setup is done, you need to set up your DNS to be able to access the cluster.
150
151 The simplest way to do this is to edit your @/etc/hosts@ file (as root):
152
153 <notextile>
154 <pre><code>export CLUSTER="arva2"
155 export DOMAIN="arv.local"
156 export HOST_IP="127.0.0.2"    # This is valid either if installing in your computer directly
157                               # or in a Vagrant VM. If you're installing it on a remote host
158                               # just change the IP to match that of the host.
159 echo "${HOST_IP} api keep keep0 collections download ws workbench workbench2 ${CLUSTER}.${DOMAIN} api.${CLUSTER}.${DOMAIN} keep.${CLUSTER}.${DOMAIN} keep0.${CLUSTER}.${DOMAIN} collections.${CLUSTER}.${DOMAIN} download.${CLUSTER}.${DOMAIN} ws.${CLUSTER}.${DOMAIN} workbench.${CLUSTER}.${DOMAIN} workbench2.${CLUSTER}.${DOMAIN}" >> /etc/hosts
160 </code></pre>
161 </notextile>
162
163 h2(#initial_user). Initial user and login
164
165 Once you finished running the @provision.sh@ script you'll be able to log into the Arvados cluster.
166
167 If you changed nothing from the script, the initial URL will be:
168
169 * https://workbench.arva2.arv.local for regular installations, or
170 * https://workbench.arva2.arv.local:8443 for vagrant installations
171
172 or, in general, the url format will be:
173
174 * https://workbench.@<cluster>.<domain>@ for regular installations, or
175 * https://workbench.@<cluster>.<domain>:8443@ for vagrant installations
176
177 The provision script, by default, sets an initial user for testing purposes, configured as administrator of the newly created cluster.
178
179 Assuming you don't change any value from the script, the initial credentials are:
180
181 * User: 'admin'
182 * Password: 'password'
183 * Email: 'admin@arva2.arv.local'