Setting up an arvbox dev federation » History » Version 1
Peter Amstutz, 10/26/2018 02:02 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 | h2. Create two arvbox instances |
||
6 | |||
7 | <pre> |
||
8 | $ export ARVBOX_CONTAINER=cluster1 |
||
9 | $ arvbox start dev |
||
10 | $ export ARVBOX_CONTAINER=cluster2 |
||
11 | $ arvbox start dev |
||
12 | </pre> |
||
13 | |||
14 | Make note of the cluster ids and IP addresses. In this example cluster1 is 1b7fr and cluster2 is 2gvh8. |
||
15 | |||
16 | 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. |
||
17 | |||
18 | h2. Set configuration overrides |
||
19 | |||
20 | Create files ~/.arvbox/cluster[1,2]/arvados/services/api/config/application.yml.override |
||
21 | |||
22 | <pre> |
||
23 | development: |
||
24 | remote_hosts: |
||
25 | 1b7fr: 172.17.0.2:8000 |
||
26 | 2gvh8: 172.17.0.3:8000 |
||
27 | sso_insecure: true |
||
28 | </pre> |
||
29 | |||
30 | Create ~/.arvbox/cluster1/var/cluster_config.yml.override |
||
31 | |||
32 | <pre> |
||
33 | Clusters: |
||
34 | 1b7fr: # cluster1 id |
||
35 | RemoteClusters: |
||
36 | 1b7fr: |
||
37 | Host: 172.17.0.2:8000 |
||
38 | Proxy: true |
||
39 | Insecure: true |
||
40 | 2gvh8: |
||
41 | Host: 172.17.0.3:8000 |
||
42 | Proxy: true |
||
43 | Insecure: true |
||
44 | </pre> |
||
45 | |||
46 | Create ~/.arvbox/cluster2/var/cluster_config.yml.override |
||
47 | |||
48 | <pre> |
||
49 | Clusters: |
||
50 | 2gvh8: # cluster2 id |
||
51 | RemoteClusters: |
||
52 | 1b7fr: |
||
53 | Host: 172.17.0.2:8000 |
||
54 | Proxy: true |
||
55 | Insecure: true |
||
56 | 2gvh8: |
||
57 | Host: 172.17.0.3:8000 |
||
58 | Proxy: true |
||
59 | Insecure: true |
||
60 | </pre> |
||
61 | |||
62 | h2. Restart services |
||
63 | |||
64 | <pre> |
||
65 | $ export ARVBOX_CONTAINER=cluster1 |
||
66 | $ arvbox sv restart api |
||
67 | $ arvbox sv restart controller |
||
68 | $ export ARVBOX_CONTAINER=cluster2 |
||
69 | $ arvbox sv restart api |
||
70 | $ arvbox sv restart controller |
||
71 | </pre> |
||
72 | |||
73 | h3. Testing |
||
74 | |||
75 | # Visit workbench at 172.17.0.2 and create a user account. |
||
76 | # Copy the token |
||
77 | # Visit workbench at 172.17.0.3?api_token=token_copied_in_previous_step |
||
78 | # You should be logged into workbench on the cluster2 with the user from cluster1 |
||
79 | |||
80 | At the command line: |
||
81 | |||
82 | <pre> |
||
83 | $ export ARVADOS_API_HOST=172.17.0.3:8000 |
||
84 | $ export ARVADOS_API_HOST_INSECURE=true |
||
85 | $ export ARVADOS_API_TOKEN=token_copied_in_previous_step |
||
86 | $ arv user current |
||
87 | </pre> |
||
88 | |||
89 | This shows cluster2 accepting a token for cluster1. Look for the "writable_by" field in the response including uuids with both cluster1 and cluster2. |