Setting up an arvbox dev federation » History » Revision 2
Revision 1 (Peter Amstutz, 10/26/2018 02:02 PM) → Revision 2/7 (Peter Amstutz, 10/26/2018 02:03 PM)
h1. Setting up an arvbox dev federation
For development of federation features, you can run multiple arvbox instances and configure them for federation.
h2. Create two arvbox instances
<pre>
$ export ARVBOX_CONTAINER=cluster1
$ arvbox start dev
$ export ARVBOX_CONTAINER=cluster2
$ arvbox start dev
</pre>
Make note of the cluster ids and IP addresses. In this example cluster1 is 1b7fr and cluster2 is 2gvh8.
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.
h2. Set configuration overrides
Create files ~/.arvbox/cluster[1,2]/arvados/services/api/config/application.yml.override
<pre>
development:
remote_hosts:
1b7fr: 172.17.0.2:8000
2gvh8: 172.17.0.3:8000
sso_insecure: true
</pre>
Create ~/.arvbox/cluster1/var/cluster_config.yml.override
<pre>
Clusters:
1b7fr: # cluster1 id
RemoteClusters:
1b7fr:
Host: 172.17.0.2:8000
Proxy: true
Insecure: true
2gvh8:
Host: 172.17.0.3:8000
Proxy: true
Insecure: true
</pre>
Create ~/.arvbox/cluster2/var/cluster_config.yml.override
<pre>
Clusters:
2gvh8: # cluster2 id
RemoteClusters:
1b7fr:
Host: 172.17.0.2:8000
Proxy: true
Insecure: true
2gvh8:
Host: 172.17.0.3:8000
Proxy: true
Insecure: true
</pre>
h2. Restart services
<pre>
$ export ARVBOX_CONTAINER=cluster1
$ arvbox sv restart api
$ arvbox sv restart controller
$ export ARVBOX_CONTAINER=cluster2
$ arvbox sv restart api
$ arvbox sv restart controller
</pre>
h2. h3. Testing
# Visit workbench at 172.17.0.2 and create a user account.
# Copy the token
# Visit workbench at 172.17.0.3?api_token=token_copied_in_previous_step
# You should be logged into workbench on the cluster2 with the user from cluster1
At the command line:
<pre>
$ export ARVADOS_API_HOST=172.17.0.3:8000
$ export ARVADOS_API_HOST_INSECURE=true
$ export ARVADOS_API_TOKEN=token_copied_in_previous_step
$ arv user current
</pre>
This shows cluster2 accepting a token for cluster1. Look for the "writable_by" field in the response including uuids with both cluster1 and cluster2.