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

Tom Clegg, 02/14/2019 01:33 AM

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 3 Tom Clegg
        subscription_id: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX        # not needed after #14745
37 2 Tom Clegg
        ClientID: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
38 3 Tom Clegg
        key: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX                    # not needed after #14745 (same value as ClientID)
39 8 Tom Clegg
        ClientSecret: 2WyXt0XFbEtutnf2hp528t6Wk9S5bOHWkRaaWwavKQo=
40 8 Tom Clegg
        secret: 2WyXt0XFbEtutnf2hp528t6Wk9S5bOHWkRaaWwavKQo=         # not needed after #14745 (same value as ClientSecret)
41 2 Tom Clegg
        TenantID: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
42 3 Tom Clegg
        tenant_id: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX              # not needed after #14745
43 2 Tom Clegg
        CloudEnv: AzurePublicCloud
44 3 Tom Clegg
        cloud_environment: AzurePublicCloud                          # not needed after #14745
45 2 Tom Clegg
        ResourceGroup: zzzzz
46 6 Ward Vandewege
        resource_group: zzzzz                                        # not needed after #14745
47 2 Tom Clegg
        Location: centralus
48 3 Tom Clegg
        region: centralus                                            # not needed after #14745 (same value as Location)
49 2 Tom Clegg
        Network: zzzzz
50 2 Tom Clegg
        Subnet: zzzzz-subnet-private
51 3 Tom Clegg
        StorageAccount: example
52 2 Tom Clegg
        storage_account: example                                     # not needed after #14745
53 1 Tom Clegg
        BlobContainer: vhds
54 3 Tom Clegg
        blob_container: vhds                                         # not needed after #14745
55 2 Tom Clegg
        DeleteDanglingResourcesAfter: 20
56 3 Tom Clegg
        delete_dangling_resources_after: 20                          # not needed after #14745
57 8 Tom Clegg
        AdminUsername: arvados
58 1 Tom Clegg
    Dispatch:
59 4 Tom Clegg
      PrivateKey: |
60 4 Tom Clegg
        -----BEGIN RSA PRIVATE KEY-----
61 4 Tom Clegg
        MIIEowIBAAKCAQEAqYm4XsQHm8sBSZFwUX5VeW1OkGsfoNzcGPG2nzzYRhNhClYZ
62 4 Tom Clegg
        0ABHhUk82HkaC/8l6d/jpYTf42HrK42nNQ0r0Yzs7qw8yZMQioK4Yk+kFyVLF78E
63 4 Tom Clegg
        GRG4pGAWXFs6pUchs/lm8fo9zcda4R3XeqgI+NO+nEERXmdRJa1FhI+Za3/S/+CV
64 4 Tom Clegg
        mg+6O00wZz2+vKmDPptGN4MCKmQOCKsMJts7wSZGyVcTtdNv7jjfr6yPAIOIL8X7
65 4 Tom Clegg
        ...
66 4 Tom Clegg
        JIBvlVfcHb1IHMA9YG7ZQjrMRmx2Xj3ce4RVPgUGHh8ra7gvLjd72/Tpf0doNClN
67 4 Tom Clegg
        ti/hAoGBAMW5D3LhU05LXWmOqpeT4VDgqk4MrTBcstVe7KdVjwzHrVHCAmI927vI
68 4 Tom Clegg
        pjpphWzpC9m3x4OsTNf8m+g6H7f3IiQS0aiFNtduXYlcuT5FHS2fSATTzg5PBon9
69 4 Tom Clegg
        1E6BudOve+WyFyBs7hFWAqWFBdWujAl4Qk5Ek09U2ilFEPE7RTgJ
70 4 Tom Clegg
        -----END RSA PRIVATE KEY-----
71 1 Tom Clegg
      StaleLockTimeout: 1m
72 1 Tom Clegg
      PollInterval: 10s
73 1 Tom Clegg
      ProbeInterval: 10s
74 1 Tom Clegg
      MaxProbesPerSecond: 10
75 1 Tom Clegg
    InstanceTypes:
76 1 Tom Clegg
      x1lg:
77 1 Tom Clegg
        ProviderType: x1.large
78 1 Tom Clegg
        VCPUs: 16
79 1 Tom Clegg
        RAM: 128G
80 1 Tom Clegg
        Scratch: 128G
81 1 Tom Clegg
        Price: 1.23
82 1 Tom Clegg
    ManagementToken: "example-secret-management-token"
83 1 Tom Clegg
    NodeProfiles:
84 8 Tom Clegg
      dispatcher:                       # references ARVADOS_NODE_PROFILE in environment file (see below).
85 1 Tom Clegg
        arvados-dispatch-cloud:
86 1 Tom Clegg
          Listen: ":9005"
87 1 Tom Clegg
</code></pre>
88 1 Tom Clegg
89 1 Tom Clegg
Create the host configuration file @/etc/arvados/environment@.
90 1 Tom Clegg
91 1 Tom Clegg
<pre>
92 8 Tom Clegg
ARVADOS_NODE_PROFILE=dispatcher
93 1 Tom Clegg
</pre>
94 1 Tom Clegg
95 1 Tom Clegg
h2. Stop crunch-dispatch-slurm
96 1 Tom Clegg
97 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.
98 1 Tom Clegg
99 1 Tom Clegg
<pre>
100 1 Tom Clegg
# systemctl stop crunch-dispatch-slurm
101 1 Tom Clegg
# systemctl disable crunch-dispatch-slurm
102 1 Tom Clegg
# apt-get remove crunch-dispatch-slurm
103 1 Tom Clegg
</pre>
104 1 Tom Clegg
105 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.
106 1 Tom Clegg
107 5 Tom Clegg
h2. Install arvados-dispatch-cloud
108 1 Tom Clegg
109 1 Tom Clegg
<pre>
110 5 Tom Clegg
# apt-get install arvados-dispatch-cloud
111 1 Tom Clegg
</pre>
112 1 Tom Clegg
113 1 Tom Clegg
h2. Verify the service is running
114 1 Tom Clegg
115 1 Tom Clegg
<pre>
116 1 Tom Clegg
$ token="example-secret-management-token"
117 1 Tom Clegg
$ curl -H "Authorization: Bearer $token" http://localhost:9005/metrics
118 1 Tom Clegg
</pre>
119 1 Tom Clegg
120 1 Tom Clegg
h2. Verify the service is functional
121 5 Tom Clegg
122 5 Tom Clegg
Watch the dispatcher's logs while you run an Arvados container:
123 5 Tom Clegg
124 5 Tom Clegg
<pre>
125 5 Tom Clegg
# journalctl -ocat -fu arvados-dispatch-cloud
126 5 Tom Clegg
</pre>