Merge branch '7816-crunch2-exec' closes #7816
[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 If you're using RVM:
16
17 <notextile>
18 <pre><code>~$ <span class="userinput">sudo /usr/local/rvm/bin/rvm-exec default gem install arvados-cli</span>
19 </code></pre>
20 </notextile>
21
22 If you're not using RVM:
23
24 <notextile>
25 <pre><code>~$ <span class="userinput">sudo gem install arvados-cli</span>
26 </code></pre>
27 </notextile>
28
29 h2. Install the Python SDK and utilities
30
31 {% include 'note_python27_sc' %}
32
33 On Debian-based systems:
34
35 <notextile>
36 <pre><code>~$ <span class="userinput">sudo apt-get install python-arvados-python-client python-arvados-fuse</span>
37 </code></pre>
38 </notextile>
39
40 On Red Hat-based systems:
41
42 <notextile>
43 <pre><code>~$ <span class="userinput">sudo yum install python27-python-arvados-python-client python27-python-arvados-fuse</span>
44 </code></pre>
45 </notextile>
46
47 h2. Install Git and curl
48
49 {% include 'install_git_curl' %}
50
51 h2. Update Git Config
52
53 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.
54
55 <notextile>
56 <pre>
57 <code>~$ <span class="userinput">sudo git config --system 'credential.https://git.<b>uuid_prefix.your.domain</b>/.username' none</span></code>
58 <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>
59 </pre>
60 </notextile>
61
62 h2. Install arvados-login-sync
63
64 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.
65
66 Create an Arvados virtual_machine object representing this shell server. This will assign a UUID.
67
68 <notextile>
69 <pre>
70 <code>apiserver:~$ <span class="userinput">arv --format=uuid virtual_machine create --virtual-machine '{"hostname":"<b>your.shell.server.hostname</b>"}'</span>
71 zzzzz-2x53u-zzzzzzzzzzzzzzz</code>
72 </pre>
73 </notextile>
74
75 Create a token that is allowed to read login information for this VM.
76
77 <notextile>
78 <pre>
79 <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"]}'
80 {
81  ...
82  "api_token":"zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz",
83  ...
84 }</code>
85 </pre>
86 </notextile>
87
88 Note the UUID and the API token output by the above commands: you will need them in a minute.
89
90 Install the arvados-login-sync program.
91
92 If you're using RVM:
93
94 <notextile>
95 <pre>
96 <code>shellserver:~$ <span class="userinput">sudo -i `which rvm-exec` default gem install arvados-login-sync</span></code>
97 </pre>
98 </notextile>
99
100 If you're not using RVM:
101
102 <notextile>
103 <pre>
104 <code>shellserver:~$ <span class="userinput">sudo -i gem install arvados-login-sync</span></code>
105 </pre>
106 </notextile>
107
108 Install cron.
109
110 On Debian-based systems:
111
112 <notextile>
113 <pre><code>~$ <span class="userinput">sudo apt-get install cron</span>
114 </code></pre>
115 </notextile>
116
117 On Red Hat-based systems:
118
119 <notextile>
120 <pre><code>~$ <span class="userinput">sudo yum install cron</span>
121 </code></pre>
122 </notextile>
123
124 Configure cron to run the @arvados-login-sync@ program every 2 minutes.
125
126 If you're using RVM:
127
128 <notextile>
129 <pre>
130 <code>shellserver:~$ <span class="userinput">sudo bash -c 'umask 077; tee /etc/cron.d/arvados-login-sync' &lt;&lt;'EOF'
131 ARVADOS_API_HOST="<strong>uuid_prefix.your.domain</strong>"
132 ARVADOS_API_TOKEN="<strong>the_token_you_created_above</strong>"
133 ARVADOS_VIRTUAL_MACHINE_UUID="<strong>zzzzz-2x53u-zzzzzzzzzzzzzzz</strong>"
134 */2 * * * * root /usr/local/rvm/bin/rvm-exec default arvados-login-sync
135 EOF</span></code>
136 </pre>
137 </notextile>
138
139 If you're not using RVM:
140
141 <notextile>
142 <pre>
143 <code>shellserver:~$ <span class="userinput">sudo bash -c 'umask 077; tee /etc/cron.d/arvados-login-sync' &lt;&lt;'EOF'
144 ARVADOS_API_HOST="<strong>uuid_prefix.your.domain</strong>"
145 ARVADOS_API_TOKEN="<strong>the_token_you_created_above</strong>"
146 ARVADOS_VIRTUAL_MACHINE_UUID="<strong>zzzzz-2x53u-zzzzzzzzzzzzzzz</strong>"
147 */2 * * * * root arvados-login-sync
148 EOF</span></code>
149 </pre>
150 </notextile>
151
152 A user should be able to log in to the shell server when the following conditions are satisfied:
153 * The user has uploaded an SSH public key: Workbench &rarr; Account menu &rarr; "SSH keys" item &rarr; "Add new SSH key" button.
154 * 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.
155 * Two minutes have elapsed since the above conditions were satisfied, and the cron job has had a chance to run.