Setting up an arvbox dev federation » History » Version 6
Ward Vandewege, 08/03/2020 02:14 PM
1 | 1 | Peter Amstutz | h1. Setting up an arvbox dev federation |
---|---|---|---|
2 | |||
3 | For development of federation features, you can run multiple arvbox instances and configure them for federation. |
||
4 | |||
5 | 4 | Peter Amstutz | Make sure you have the latest 'arvbox' script and arvbox-dev image. |
6 | |||
7 | <pre> |
||
8 | 6 | Ward Vandewege | curl -O https://raw.githubusercontent.com/arvados/arvados/master/tools/arvbox/bin/arvbox |
9 | 4 | Peter Amstutz | chmod +x arvbox |
10 | docker pull arvados/arvbox-dev |
||
11 | </pre> |
||
12 | |||
13 | 1 | Peter Amstutz | h2. Create two arvbox instances |
14 | |||
15 | <pre> |
||
16 | $ export ARVBOX_CONTAINER=cluster1 |
||
17 | $ arvbox start dev |
||
18 | $ export ARVBOX_CONTAINER=cluster2 |
||
19 | $ arvbox start dev |
||
20 | </pre> |
||
21 | |||
22 | Make note of the cluster ids and IP addresses. In this example cluster1 is 1b7fr and cluster2 is 2gvh8. |
||
23 | |||
24 | 4 | Peter Amstutz | Note that Docker assigns IP addresses sequentially. To ensure you get the same IP addresses each time you'll need to start cluster1 first, followed by cluster2, and you don't want any other containers running. Your cluster ids will be different than this example. |
25 | 1 | Peter Amstutz | |
26 | h2. Set configuration overrides |
||
27 | |||
28 | Create ~/.arvbox/cluster1/var/cluster_config.yml.override |
||
29 | |||
30 | <pre> |
||
31 | Clusters: |
||
32 | 1b7fr: # cluster1 id |
||
33 | RemoteClusters: |
||
34 | 1b7fr: |
||
35 | Host: 172.17.0.2:8000 |
||
36 | Proxy: true |
||
37 | 2gvh8: |
||
38 | Host: 172.17.0.3:8000 |
||
39 | Proxy: true |
||
40 | </pre> |
||
41 | |||
42 | Create ~/.arvbox/cluster2/var/cluster_config.yml.override |
||
43 | |||
44 | <pre> |
||
45 | Clusters: |
||
46 | 2gvh8: # cluster2 id |
||
47 | RemoteClusters: |
||
48 | 1b7fr: |
||
49 | Host: 172.17.0.2:8000 |
||
50 | Proxy: true |
||
51 | 2gvh8: |
||
52 | Host: 172.17.0.3:8000 |
||
53 | Proxy: true |
||
54 | </pre> |
||
55 | |||
56 | 4 | Peter Amstutz | h2. Copy root certificates |
57 | |||
58 | <pre> |
||
59 | 5 | Peter Amstutz | docker cp ~/.arvbox/cluster2/var/root-cert.pem cluster1:/usr/local/share/ca-certificates/cluster2-root-cert.crt |
60 | docker cp ~/.arvbox/cluster1/var/root-cert.pem cluster2:/usr/local/share/ca-certificates/cluster1-root-cert.crt |
||
61 | 4 | Peter Amstutz | docker exec cluster1 update-ca-certificates |
62 | docker exec cluster2 update-ca-certificates |
||
63 | </pre> |
||
64 | |||
65 | You probably also want to install the root certificates on the host: https://doc.arvados.org/install/arvbox.html |
||
66 | |||
67 | 1 | Peter Amstutz | h2. Restart services |
68 | |||
69 | <pre> |
||
70 | $ export ARVBOX_CONTAINER=cluster1 |
||
71 | $ arvbox sv restart api |
||
72 | 3 | Peter Amstutz | $ arvbox sv restart controller |
73 | $ arvbox sv restart keepstore0 |
||
74 | 1 | Peter Amstutz | $ arvbox sv restart keepstore1 |
75 | $ export ARVBOX_CONTAINER=cluster2 |
||
76 | $ arvbox sv restart api |
||
77 | 3 | Peter Amstutz | $ arvbox sv restart controller |
78 | $ arvbox sv restart keepstore0 |
||
79 | 1 | Peter Amstutz | $ arvbox sv restart keepstore1 |
80 | </pre> |
||
81 | 2 | Peter Amstutz | |
82 | 1 | Peter Amstutz | h2. Testing |
83 | |||
84 | 4 | Peter Amstutz | # Visit workbench2 at 172.17.0.2:3001 and create a user account. |
85 | 1 | Peter Amstutz | # Copy the token |
86 | 4 | Peter Amstutz | # Visit workbench2 at 172.17.0.3:3001 and specify "log in with user from cluster1" |
87 | 1 | Peter Amstutz | # You should be logged into workbench on the cluster2 with the user from cluster1 |
88 | |||
89 | At the command line: |
||
90 | |||
91 | <pre> |
||
92 | $ export ARVADOS_API_HOST=172.17.0.3:8000 |
||
93 | $ export ARVADOS_API_TOKEN=token_copied_in_previous_step |
||
94 | $ arv user current |
||
95 | </pre> |
||
96 | |||
97 | This shows cluster2 accepting a token for cluster1. Look for the "writable_by" field in the response including uuids with both cluster1 and cluster2. |