Migrating from arvados-node-manager to arvados-dispatch-cloud » History » Version 11

Tom Clegg, 02/15/2019 09:19 PM

1 5 Tom Clegg
h1. Migrating from arvados-node-manager to arvados-dispatch-cloud
2 1 Tom Clegg
3 1 Tom Clegg
{{toc}}
4 1 Tom Clegg
5 1 Tom Clegg
h2. Choose a node
6 1 Tom Clegg
7 1 Tom Clegg
The dispatch service can run on any host that can connect to the Arvados API service, the cloud provider's API, and the SSH service on cloud VMs. In the following example it runs on the same node as the API server and controller.
8 1 Tom Clegg
9 4 Tom Clegg
h2. Prepare key pair and worker VM image
10 4 Tom Clegg
11 9 Tom Clegg
Generate an SSH private key with no passphrase. Save it in the cluster configuration file (see @PrivateKey@ in the example below).
12 4 Tom Clegg
13 9 Tom Clegg
If you are using Azure, the dispatcher will create a login account and install your public key automatically, so you do *not* need to save the corresponding public key in an authorized_keys file in the VM image (or anywhere else, for that matter).
14 4 Tom Clegg
15 9 Tom Clegg
Prepare a worker VM image. It needs docker, arv-mount (python-arvados-fuse), and crunch-run. The version of crunch-run must be new enough to include commit:2873d55ea (TODO: when merged/published, give minimum package version instead of commit).
16 4 Tom Clegg
17 1 Tom Clegg
h2. Update cluster configuration file
18 1 Tom Clegg
19 1 Tom Clegg
In @/etc/arvados/config.yml@, add configuration items for the dispatch service.
20 1 Tom Clegg
21 1 Tom Clegg
<pre><code class="yaml">
22 1 Tom Clegg
Clusters:
23 8 Tom Clegg
  zzzzz:
24 1 Tom Clegg
    CloudVMs:
25 1 Tom Clegg
      BootProbeCommand: "mount | grep /mnt/scratch"
26 1 Tom Clegg
      SSHPort: "2222"
27 1 Tom Clegg
      SyncInterval: 1m
28 1 Tom Clegg
      TimeoutIdle: 2m
29 1 Tom Clegg
      TimeoutBooting: 10m
30 1 Tom Clegg
      TimeoutProbe: 5m
31 1 Tom Clegg
      TimeoutShutdown: 30s
32 8 Tom Clegg
      ImageID: "https://zzzzzzzz.blob.core.windows.net/system/Microsoft.Compute/Images/images/zzzzz-compute-osDisk.55555555-5555-5555-5555-555555555555.vhd"
33 7 Ward Vandewege
      Driver: azure
34 1 Tom Clegg
      DriverParameters:
35 2 Tom Clegg
        SubscriptionID: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
36 2 Tom Clegg
        ClientID: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
37 1 Tom Clegg
        ClientSecret: 2WyXt0XFbEtutnf2hp528t6Wk9S5bOHWkRaaWwavKQo=
38 8 Tom Clegg
        TenantID: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
39 11 Tom Clegg
        CloudEnvironment: AzurePublicCloud
40 2 Tom Clegg
        ResourceGroup: zzzzz
41 2 Tom Clegg
        Location: centralus
42 3 Tom Clegg
        Network: zzzzz
43 2 Tom Clegg
        Subnet: zzzzz-subnet-private
44 3 Tom Clegg
        StorageAccount: example
45 2 Tom Clegg
        BlobContainer: vhds
46 11 Tom Clegg
        DeleteDanglingResourcesAfter: 20s
47 8 Tom Clegg
        AdminUsername: arvados
48 1 Tom Clegg
    Dispatch:
49 4 Tom Clegg
      PrivateKey: |
50 4 Tom Clegg
        -----BEGIN RSA PRIVATE KEY-----
51 4 Tom Clegg
        MIIEowIBAAKCAQEAqYm4XsQHm8sBSZFwUX5VeW1OkGsfoNzcGPG2nzzYRhNhClYZ
52 4 Tom Clegg
        0ABHhUk82HkaC/8l6d/jpYTf42HrK42nNQ0r0Yzs7qw8yZMQioK4Yk+kFyVLF78E
53 4 Tom Clegg
        GRG4pGAWXFs6pUchs/lm8fo9zcda4R3XeqgI+NO+nEERXmdRJa1FhI+Za3/S/+CV
54 4 Tom Clegg
        mg+6O00wZz2+vKmDPptGN4MCKmQOCKsMJts7wSZGyVcTtdNv7jjfr6yPAIOIL8X7
55 4 Tom Clegg
        ...
56 4 Tom Clegg
        JIBvlVfcHb1IHMA9YG7ZQjrMRmx2Xj3ce4RVPgUGHh8ra7gvLjd72/Tpf0doNClN
57 4 Tom Clegg
        ti/hAoGBAMW5D3LhU05LXWmOqpeT4VDgqk4MrTBcstVe7KdVjwzHrVHCAmI927vI
58 4 Tom Clegg
        pjpphWzpC9m3x4OsTNf8m+g6H7f3IiQS0aiFNtduXYlcuT5FHS2fSATTzg5PBon9
59 4 Tom Clegg
        1E6BudOve+WyFyBs7hFWAqWFBdWujAl4Qk5Ek09U2ilFEPE7RTgJ
60 4 Tom Clegg
        -----END RSA PRIVATE KEY-----
61 1 Tom Clegg
      StaleLockTimeout: 1m
62 1 Tom Clegg
      PollInterval: 10s
63 1 Tom Clegg
      ProbeInterval: 10s
64 1 Tom Clegg
      MaxProbesPerSecond: 10
65 1 Tom Clegg
    InstanceTypes:
66 1 Tom Clegg
      x1lg:
67 1 Tom Clegg
        ProviderType: x1.large
68 1 Tom Clegg
        VCPUs: 16
69 1 Tom Clegg
        RAM: 128G
70 1 Tom Clegg
        Scratch: 128G
71 1 Tom Clegg
        Price: 1.23
72 1 Tom Clegg
    ManagementToken: "example-secret-management-token"
73 1 Tom Clegg
    NodeProfiles:
74 8 Tom Clegg
      dispatcher:                       # references ARVADOS_NODE_PROFILE in environment file (see below).
75 1 Tom Clegg
        arvados-dispatch-cloud:
76 10 Ward Vandewege
          Listen: ":9006"
77 1 Tom Clegg
</code></pre>
78 1 Tom Clegg
79 1 Tom Clegg
Create the host configuration file @/etc/arvados/environment@.
80 1 Tom Clegg
81 1 Tom Clegg
<pre>
82 8 Tom Clegg
ARVADOS_NODE_PROFILE=dispatcher
83 1 Tom Clegg
</pre>
84 1 Tom Clegg
85 1 Tom Clegg
h2. Stop crunch-dispatch-slurm
86 1 Tom Clegg
87 1 Tom Clegg
Stop and disable the crunch-dispatch-slurm service, and uninstall the package to make sure it doesn't start after the next reboot/upgrade.
88 1 Tom Clegg
89 1 Tom Clegg
<pre>
90 1 Tom Clegg
# systemctl stop crunch-dispatch-slurm
91 1 Tom Clegg
# systemctl disable crunch-dispatch-slurm
92 1 Tom Clegg
# apt-get remove crunch-dispatch-slurm
93 1 Tom Clegg
</pre>
94 1 Tom Clegg
95 5 Tom Clegg
Containers that have already been locked and submitted to SLURM will make their way through the SLURM queue, but newly queued containers will be left for arvados-dispatch-cloud to run.
96 1 Tom Clegg
97 5 Tom Clegg
h2. Install arvados-dispatch-cloud
98 1 Tom Clegg
99 1 Tom Clegg
<pre>
100 5 Tom Clegg
# apt-get install arvados-dispatch-cloud
101 1 Tom Clegg
</pre>
102 1 Tom Clegg
103 1 Tom Clegg
h2. Verify the service is running
104 1 Tom Clegg
105 1 Tom Clegg
<pre>
106 1 Tom Clegg
$ token="example-secret-management-token"
107 1 Tom Clegg
$ curl -H "Authorization: Bearer $token" http://localhost:9005/metrics
108 1 Tom Clegg
</pre>
109 1 Tom Clegg
110 1 Tom Clegg
h2. Verify the service is functional
111 5 Tom Clegg
112 5 Tom Clegg
Watch the dispatcher's logs while you run an Arvados container:
113 5 Tom Clegg
114 5 Tom Clegg
<pre>
115 5 Tom Clegg
# journalctl -ocat -fu arvados-dispatch-cloud
116 5 Tom Clegg
</pre>