Arvbox » History » Version 9

Peter Amstutz, 03/03/2016 04:25 PM

1 1 Peter Amstutz
h1. Arvbox
2 1 Peter Amstutz
3 3 Peter Amstutz
We recommend using "Arvbox":http://doc.arvados.org/install/arvbox.html to set up self-contained Arvados development environment.
4 1 Peter Amstutz
5 3 Peter Amstutz
h2. Running Arvados in development mode
6 3 Peter Amstutz
7 3 Peter Amstutz
<pre>
8 3 Peter Amstutz
$ arvbox reboot dev
9 3 Peter Amstutz
</pre>
10 3 Peter Amstutz
11 3 Peter Amstutz
This performs the following operations:
12 3 Peter Amstutz
13 3 Peter Amstutz
# Rebuild the arvbox-dev docker image (typically the layers are cached so this is a no-op unless you are working on arvbox itself)
14 3 Peter Amstutz
# Create @~/.arvbox/arvbox@ to store arvbox state
15 3 Peter Amstutz
# Clone the arvados git repository to @~/.arvbox/arvbox/arvados@
16 3 Peter Amstutz
# Place stateful container data in @~/.arvbox/arvbox/postgres@ and @~/.arvbox/arvbox/var@
17 3 Peter Amstutz
# Start the container
18 3 Peter Amstutz
19 3 Peter Amstutz
The container will then:
20 3 Peter Amstutz
# Download and cache various packages (Ruby gems, Passenger)
21 5 Peter Amstutz
# Compile and install Arvados server binaries
22 5 Peter Amstutz
# Build and install Arvados SDK packages (such as arvados-python-client)
23 3 Peter Amstutz
# Start the Arvados services
24 3 Peter Amstutz
25 3 Peter Amstutz
The directories inside @~/.arvbox/arvbox@ are all bind-mounted inside the container.  This means that you may edit files on the host file system and the changes will be seen inside the container immediately.  For example, if you edit a page template in @~/.arvbox/arvbox/arvados/apps/workbench/app/views@ you only need to reload the page in your browser to see the change.
26 3 Peter Amstutz
27 6 Peter Amstutz
You can restart individual services without restarting the whole container.  For compiled services, the startup script always recompiles the server before starting it.  For example, if you are working on @keepproxy@
28 3 Peter Amstutz
29 3 Peter Amstutz
<pre>
30 3 Peter Amstutz
$ arvbox sv restart keepproxy
31 3 Peter Amstutz
</pre>
32 3 Peter Amstutz
33 3 Peter Amstutz
If any service fails to come up, you can see the debug log using @arvbox log@.  This log will include compilation or install errors:
34 3 Peter Amstutz
35 3 Peter Amstutz
<pre>
36 3 Peter Amstutz
$ arvbox log keepproxy
37 3 Peter Amstutz
</pre>
38 3 Peter Amstutz
39 3 Peter Amstutz
Finally, you can get a root shell inside the container using @arvbox sh@
40 3 Peter Amstutz
41 3 Peter Amstutz
<pre>
42 3 Peter Amstutz
$ arvbox sh
43 3 Peter Amstutz
</pre>
44 3 Peter Amstutz
45 9 Peter Amstutz
h2. Running multiple Arvbox containers
46 9 Peter Amstutz
47 9 Peter Amstutz
To run multiple Arvbox containers, give them different names by setting the environment variable @ARVBOX_CONTAINER@.
48 9 Peter Amstutz
49 9 Peter Amstutz
<pre>
50 9 Peter Amstutz
$ arvbox status
51 9 Peter Amstutz
Selected: arvbox
52 9 Peter Amstutz
Status: running
53 9 Peter Amstutz
IP: 172.17.0.2
54 9 Peter Amstutz
Data: /home/peter/.arvbox/arvbox
55 9 Peter Amstutz
56 9 Peter Amstutz
$ export ARVBOX_CONTAINER=arvbox2
57 9 Peter Amstutz
58 9 Peter Amstutz
$ arvbox status
59 9 Peter Amstutz
Selected: arvbox2
60 9 Peter Amstutz
Status: not running
61 9 Peter Amstutz
Data: /home/peter/.arvbox/arvbox2
62 9 Peter Amstutz
</pre>
63 9 Peter Amstutz
64 3 Peter Amstutz
h2. Running the test suite
65 1 Peter Amstutz
66 9 Peter Amstutz
Arvbox can also be used to run the Arvados test suite in an isolated environment.
67 3 Peter Amstutz
68 3 Peter Amstutz
<pre>
69 3 Peter Amstutz
$ arvbox restart test
70 3 Peter Amstutz
</pre>
71 7 Peter Amstutz
72 8 Peter Amstutz
You can pass parameters to the test suite as described in [[Running tests#Save-time-by-skipping-install]]:
73 7 Peter Amstutz
74 7 Peter Amstutz
<pre>
75 7 Peter Amstutz
$ arvbox restart test --only services/keepproxy
76 7 Peter Amstutz
</pre>