3 navsection: installguide
4 title: Install the cloud dispatcher
7 Copyright (C) The Arvados Authors. All rights reserved.
9 SPDX-License-Identifier: CC-BY-SA-3.0
12 # "Introduction":#introduction
13 # "Create compute node VM image":#create-image
14 # "Update config.yml":#update-config
15 # "Install arvados-dispatch-cloud":#install-packages
16 # "Start the service":#start-service
17 # "Restart the API server and controller":#restart-api
18 # "Confirm working installation":#confirm-working
20 h2(#introduction). Introduction
22 The cloud dispatch service is for running containers on cloud VMs. It works with Microsoft Azure and Amazon EC2; future versions will also support Google Compute Engine.
24 The cloud dispatch service can run on any node that can connect to the Arvados API service, the cloud provider's API, and the SSH service on cloud VMs. It is not resource-intensive, so you can run it on the API server node.
26 h2(#create-image). Create compute node VM image
28 Create a VM image following the steps "to set up a compute node":crunch2-slurm/install-compute-node.html
30 h2(#update-config). Update config.yml
32 h3. Create a private key
34 Generate an SSH private key with no passphrase. Save it in the cluster configuration file (see @PrivateKey@ in the example below).
37 <pre><code>~$ <span class="userinput">ssh-keygen -N '' -f ~/.ssh/id_dispatcher</span>
38 Generating public/private rsa key pair.
39 Your identification has been saved in /home/user/.ssh/id_dispatcher.
40 Your public key has been saved in /home/user/.ssh/id_dispatcher.pub.
41 The key fingerprint is:
43 ~$ <span class="userinput">cat ~/.ssh/id_dispatcher</span>
44 -----BEGIN RSA PRIVATE KEY-----
45 MIIEpQIBAAKCAQEAqXoCzcOBkFQ7w4dvXf9B++1ctgZRqEbgRYL3SstuMV4oawks
46 ttUuxJycDdsPmeYcHsKo8vsEZpN6iYsX6ZZzhkO5nEayUTU8sBjmg1ZCTo4QqKXr
48 oFyAjVoexx0RBcH6BveTfQtJKbktP1qBO4mXo2dP0cacuZEtlAqW9Eb06Pvaw/D9
49 foktmqOY8MyctzFgXBpGTxPliGjqo8OkrOyQP2g+FL7v+Km31Xs61P8=
50 -----END RSA PRIVATE KEY-----
54 You can delete the key files after you have copied the private key to your configuration file.
57 <pre><code>~$ <span class="userinput">rm ~/.ssh/id_dispatcher ~/.ssh/id_dispatcher.pub</span>
61 h3. Configure CloudVMs
63 Add or update the following portions of your cluster configuration file, @/etc/arvados/config.yml@. Refer to "config.defaults.yml":{{site.baseurl}}/admin/config.html for information about additional configuration options.
69 "http://localhost:9006": {}
72 # BootProbeCommand is a shell command that succeeds when an instance is ready for service
73 BootProbeCommand: "sudo systemctl status docker"
75 <b># --- driver-specific configuration goes here --- see Amazon and Azure examples below ---</b>
78 -----BEGIN RSA PRIVATE KEY-----
79 MIIEpQIBAAKCAQEAqXoCzcOBkFQ7w4dvXf9B++1ctgZRqEbgRYL3SstuMV4oawks
80 ttUuxJycDdsPmeYcHsKo8vsEZpN6iYsX6ZZzhkO5nEayUTU8sBjmg1ZCTo4QqKXr
81 FJ+amZ7oYMDof6QEdwl6KNDfIddL+NfBCLQTVInOAaNss7GRrxLTuTV7HcRaIUUI
82 jYg0Ibg8ZZTzQxCvFXXnjseTgmOcTv7CuuGdt91OVdoq8czG/w8TwOhymEb7mQlt
83 lXuucwQvYgfoUgcnTgpJr7j+hafp75g2wlPozp8gJ6WQ2yBWcfqL2aw7m7Ll88Nd
85 oFyAjVoexx0RBcH6BveTfQtJKbktP1qBO4mXo2dP0cacuZEtlAqW9Eb06Pvaw/D9
86 foktmqOY8MyctzFgXBpGTxPliGjqo8OkrOyQP2g+FL7v+Km31Xs61P8=
87 -----END RSA PRIVATE KEY-----
90 ProviderType: x1.medium
96 ProviderType: x1.large
99 IncludedScratch: 128GB
104 h4. Minimal configuration example for Amazon EC2
107 <pre><code> Containers:
109 ImageID: ami-01234567890abcdef
112 AccessKeyID: XXXXXXXXXXXXXXXXXXXX
113 SecretAccessKey: YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
116 SubnetID: subnet-0123abcd
119 AdminUsername: arvados
123 h4. Minimal configuration example for Azure
126 <pre><code> Containers:
128 ImageID: "https://zzzzzzzz.blob.core.windows.net/system/Microsoft.Compute/Images/images/zzzzz-compute-osDisk.55555555-5555-5555-5555-555555555555.vhd"
131 SubscriptionID: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
132 ClientID: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
133 ClientSecret: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
134 TenantID: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
135 CloudEnvironment: AzurePublicCloud
139 Subnet: zzzzz-subnet-private
140 StorageAccount: example
142 DeleteDanglingResourcesAfter: 20s
143 AdminUsername: arvados
147 Get the @SubscriptionID@ and @TenantID@:
153 "cloudName": "AzureCloud",
154 "id": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX",
156 "name": "Your Subscription",
158 "tenantId": "YYYYYYYY-YYYY-YYYY-YYYYYYYY",
160 "name": "you@example.com",
167 You will need to create a "service principal" to use as a delegated authority for API access.
170 $ az ad app create --display-name "Arvados Dispatch Cloud (ClusterID)" --homepage "https://arvados.org" --identifier-uris "https://ClusterID.example.com" --end-date 2299-12-31 --password <Your_Password>
171 $ az ad sp create "<appId>"
172 (appId is part of the response of the previous command)
173 $ az role assignment create --assignee "<objectId>" --role Owner --scope /subscriptions/{subscriptionId}/
174 (objectId is part of the response of the previous command)
177 @ClientID@ is the 'appId' value.
179 @ClientSecret@ is what was provided as <Your_Password>.
181 h3. Test your configuration
183 Run the @cloudtest@ tool to verify that your configuration works. This creates a new cloud VM, confirms that it boots correctly and accepts your configured SSH private key, and shuts it down.
186 <pre><code>~$ <span class="userinput">arvados-server cloudtest && echo "OK!"</span>
190 Refer to the "cloudtest tool documentation":../admin/cloudtest.html for more information.
192 {% assign arvados_component = 'arvados-dispatch-cloud' %}
194 {% include 'install_packages' %}
196 {% include 'start_service' %}
198 {% include 'restart_api' %}
200 h2(#confirm-working). Confirm working installation
202 On the dispatch node, start monitoring the arvados-dispatch-cloud logs:
205 <pre><code>~$ <span class="userinput">sudo journalctl -o cat -fu arvados-dispatch-cloud.service</span>
209 "Make sure to install the arvados/jobs image.":install-jobs-image.html
211 Submit a simple container request:
214 <pre><code>shell:~$ <span class="userinput">arv container_request create --container-request '{
216 "state": "Committed",
218 "container_image": "arvados/jobs:latest",
219 "command": ["echo", "Hello, Crunch!"],
220 "output_path": "/out",
227 "runtime_constraints": {
235 This command should return a record with a @container_uuid@ field. Once @arvados-dispatch-cloud@ polls the API server for new containers to run, you should see it dispatch that same container.
237 The @arvados-dispatch-cloud@ API a list of queued and running jobs. For example:
240 <pre><code>~$ <span class="userinput">curl ...</span>
244 When the container finishes, the dispatcher will log it.
246 After the container finishes, you can get the container record by UUID *from a shell server* to see its results:
249 <pre><code>shell:~$ <span class="userinput">arv get <b>zzzzz-dz642-hdp2vpu9nq14tx0</b></span>
253 "log":"a01df2f7e5bc1c2ad59c60a837e90dc6+166",
254 "output":"d41d8cd98f00b204e9800998ecf8427e+0",
261 You can use standard Keep tools to view the container's output and logs from their corresponding fields. For example, to see the logs from the collection referenced in the @log@ field:
264 <pre><code>~$ <span class="userinput">arv keep ls <b>a01df2f7e5bc1c2ad59c60a837e90dc6+166</b></span>
268 ~$ <span class="userinput">arv-get <b>a01df2f7e5bc1c2ad59c60a837e90dc6+166</b>/stdout.txt</span>
269 2016-08-05T13:53:06.201011Z Hello, Crunch!
273 If the container does not dispatch successfully, refer to the @arvados-dispatch-cloud@ logs for information about why it failed.