Project

General

Profile

Setting up an arvbox dev federation » History » Version 3

Peter Amstutz, 10/26/2018 06:21 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 3 Peter Amstutz
$ arvbox sv restart keepstore0
69
$ arvbox sv restart keepstore1
70 1 Peter Amstutz
$ export ARVBOX_CONTAINER=cluster2
71
$ arvbox sv restart api
72
$ arvbox sv restart controller
73 3 Peter Amstutz
$ arvbox sv restart keepstore0
74
$ arvbox sv restart keepstore1
75 1 Peter Amstutz
</pre>
76
77 2 Peter Amstutz
h2. Testing
78 1 Peter Amstutz
79
# Visit workbench at 172.17.0.2 and create a user account.
80
# Copy the token
81
# Visit workbench at 172.17.0.3?api_token=token_copied_in_previous_step
82
# You should be logged into workbench on the cluster2 with the user from cluster1
83
84
At the command line:
85
86
<pre>
87
$ export ARVADOS_API_HOST=172.17.0.3:8000
88
$ export ARVADOS_API_HOST_INSECURE=true
89
$ export ARVADOS_API_TOKEN=token_copied_in_previous_step
90
$ arv user current
91
</pre>
92
93
This shows cluster2 accepting a token for cluster1.  Look for the "writable_by" field in the response including uuids with both cluster1 and cluster2.