9309: Add CentOS 7 to Install Guide.
[arvados.git] / doc / install / install-shell-server.html.textile.liquid
1 ---
2 layout: default
3 navsection: installguide
4 title: Install a shell server
5 ...
6
7 There is nothing inherently special about an Arvados shell server. It is just a GNU/Linux machine with Arvados utilites and SDKs installed. For optimal performance, the Arvados shell server should be on the same LAN as the Arvados cluster, but that is not required.
8
9 h2. Install API tokens
10
11 Please follow the "API token guide":../user/reference/api-tokens.html to get API tokens for your Arvados account and install them on your shell server. We will use those tokens to test the SDKs as we install them.
12
13 h2. Install the Ruby SDK and utilities
14
15 First, install the curl development libraries necessary to build the Arvados Ruby SDK.  On Debian-based systems:
16
17 <notextile>
18 <pre><code>~$ <span class="userinput">sudo apt-get install libcurl4-openssl-dev</span>
19 </code></pre>
20 </notextile>
21
22 On Red Hat-based systems:
23
24 <notextile>
25 <pre><code>~$ <span class="userinput">sudo yum install libcurl-devel</span>
26 </code></pre>
27 </notextile>
28
29 Next, install the arvados-cli Ruby gem.  If you're using RVM:
30
31 <notextile>
32 <pre><code>~$ <span class="userinput">sudo /usr/local/rvm/bin/rvm-exec default gem install arvados-cli</span>
33 </code></pre>
34 </notextile>
35
36 If you're not using RVM:
37
38 <notextile>
39 <pre><code>~$ <span class="userinput">sudo -i gem install arvados-cli</span>
40 </code></pre>
41 </notextile>
42
43 h2. Install the Python SDK and utilities
44
45 {% assign rh_version = "6" %}
46 {% include 'note_python_sc' %}
47
48 On CentOS 6 and RHEL 6:
49
50 <notextile>
51 <pre><code>~$ <span class="userinput">sudo yum install python27-python-arvados-python-client python27-python-arvados-fuse crunchrunner</span>
52 </code></pre>
53 </notextile>
54
55 On other Red Hat-based systems:
56
57 <notextile>
58 <pre><code>~$ <span class="userinput">echo 'exclude=python2-llfuse' | sudo tee -a /etc/yum.conf</span>
59 ~$ <span class="userinput">sudo yum install python-arvados-python-client python-arvados-fuse crunchrunner</span>
60 </code></pre>
61 </notextile>
62
63 On Debian-based systems:
64
65 <notextile>
66 <pre><code>~$ <span class="userinput">sudo apt-get install python-arvados-python-client python-arvados-fuse crunchrunner</span>
67 </code></pre>
68 </notextile>
69
70 h2. Install Git and curl
71
72 {% include 'install_git_curl' %}
73
74 h2. Update Git Config
75
76 Configure git to use the ARVADOS_API_TOKEN environment variable to authenticate to arv-git-httpd. We use the @--system@ flag so it takes effect for all current and future user accounts. It does not affect git's behavior when connecting to other git servers.
77
78 <notextile>
79 <pre>
80 <code>~$ <span class="userinput">sudo git config --system 'credential.https://git.<b>uuid_prefix.your.domain</b>/.username' none</span></code>
81 <code>~$ <span class="userinput">sudo git config --system 'credential.https://git.<b>uuid_prefix.your.domain</b>/.helper' '!cred(){ cat >/dev/null; if [ "$1" = get ]; then echo password=$ARVADOS_API_TOKEN; fi; };cred'</span></code>
82 </pre>
83 </notextile>
84
85 h2. Install arvados-login-sync
86
87 This program makes it possible for Arvados users to log in to the shell server -- subject to permissions assigned by the Arvados administrator -- using the SSH keys they upload to Workbench. It sets up login accounts, updates group membership, and adds users' public keys to the appropriate @authorized_keys@ files.
88
89 Create an Arvados virtual_machine object representing this shell server. This will assign a UUID.
90
91 <notextile>
92 <pre>
93 <code>apiserver:~$ <span class="userinput">arv --format=uuid virtual_machine create --virtual-machine '{"hostname":"<b>your.shell.server.hostname</b>"}'</span>
94 zzzzz-2x53u-zzzzzzzzzzzzzzz</code>
95 </pre>
96 </notextile>
97
98 Create a token that is allowed to read login information for this VM.
99
100 <notextile>
101 <pre>
102 <code>apiserver:~$ <span class="userinput">arv api_client_authorization create --api-client-authorization '{"scopes":["GET /arvados/v1/virtual_machines/<b>zzzzz-2x53u-zzzzzzzzzzzzzzz</b>/logins"]}'
103 {
104  ...
105  "api_token":"zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz",
106  ...
107 }</code>
108 </pre>
109 </notextile>
110
111 Note the UUID and the API token output by the above commands: you will need them in a minute.
112
113 Install the arvados-login-sync program.
114
115 If you're using RVM:
116
117 <notextile>
118 <pre>
119 <code>shellserver:~$ <span class="userinput">sudo -i `which rvm-exec` default gem install arvados-login-sync</span></code>
120 </pre>
121 </notextile>
122
123 If you're not using RVM:
124
125 <notextile>
126 <pre>
127 <code>shellserver:~$ <span class="userinput">sudo -i gem install arvados-login-sync</span></code>
128 </pre>
129 </notextile>
130
131 Install cron.
132
133 On CentOS 6 and RHEL 6:
134
135 <notextile>
136 <pre><code>~$ <span class="userinput">sudo yum install cronie</span>
137 ~$ <span class="userinput">sudo chkconfig crond on</span>
138 ~$ <span class="userinput">sudo service crond start</span>
139 </code></pre>
140 </notextile>
141
142 On other Red Hat-based distributions:
143
144 <notextile>
145 <pre><code>~$ <span class="userinput">sudo yum install cronie</span>
146 ~$ <span class="userinput">sudo systemctl enable crond</span>
147 ~$ <span class="userinput">sudo systemctl start crond</span>
148 </code></pre>
149 </notextile>
150
151 On Debian-based systems:
152
153 <notextile>
154 <pre><code>~$ <span class="userinput">sudo apt-get install cron</span>
155 </code></pre>
156 </notextile>
157
158 Configure cron to run the @arvados-login-sync@ program every 2 minutes.
159
160 If you're using RVM:
161
162 <notextile>
163 <pre>
164 <code>shellserver:~$ <span class="userinput">sudo bash -c 'umask 077; tee /etc/cron.d/arvados-login-sync' &lt;&lt;'EOF'
165 ARVADOS_API_HOST="<strong>uuid_prefix.your.domain</strong>"
166 ARVADOS_API_TOKEN="<strong>the_token_you_created_above</strong>"
167 ARVADOS_VIRTUAL_MACHINE_UUID="<strong>zzzzz-2x53u-zzzzzzzzzzzzzzz</strong>"
168 */2 * * * * root /usr/local/rvm/bin/rvm-exec default arvados-login-sync
169 EOF</span></code>
170 </pre>
171 </notextile>
172
173 If you're not using RVM:
174
175 <notextile>
176 <pre>
177 <code>shellserver:~$ <span class="userinput">sudo bash -c 'umask 077; tee /etc/cron.d/arvados-login-sync' &lt;&lt;'EOF'
178 ARVADOS_API_HOST="<strong>uuid_prefix.your.domain</strong>"
179 ARVADOS_API_TOKEN="<strong>the_token_you_created_above</strong>"
180 ARVADOS_VIRTUAL_MACHINE_UUID="<strong>zzzzz-2x53u-zzzzzzzzzzzzzzz</strong>"
181 */2 * * * * root arvados-login-sync
182 EOF</span></code>
183 </pre>
184 </notextile>
185
186 A user should be able to log in to the shell server when the following conditions are satisfied:
187 * The user has uploaded an SSH public key: Workbench &rarr; Account menu &rarr; "SSH keys" item &rarr; "Add new SSH key" button.
188 * As an admin user, you have given the user permission to log in: Workbench &rarr; Admin menu &rarr; "Users" item &rarr; "Show" button &rarr; "Admin" tab &rarr; "Setup shell account" button.
189 * Two minutes have elapsed since the above conditions were satisfied, and the cron job has had a chance to run.