Project

General

Profile

Hacking prerequisites » History » Version 90

Brett Smith, 12/03/2025 07:10 PM
modernize for Arvados 3.2/#22310

1 1 Tom Clegg
{{>toc}}
2
3
h1. Hacking prerequisites
4
5 83 Brett Smith
This page describes how to install all the software necessary to develop Arvados and run tests.
6 1 Tom Clegg
7
h2. Host options
8
9 83 Brett Smith
You must have a system running a supported distribution. That system can be installed directly on hardware; running on a cloud instance; or in a virtual machine.
10 1 Tom Clegg
11 83 Brett Smith
h3. Supported distributions
12 1 Tom Clegg
13 90 Brett Smith
As of December 2025/Arvados 3.2, these instructions and the entire test suite are known to work on Debian 12 "bookworm."
14 1 Tom Clegg
15 90 Brett Smith
The Ansible playbook works on Debian 13 "trixie" but some test suites fail because of configuration drift.
16
17 87 Brett Smith
You may try to run these instructions and tests on Ubuntu 22.04 "jammy"/24.04 "noble," but they have not been tested and you may find some bugs throughout.
18 1 Tom Clegg
19 87 Brett Smith
These instructions are not suitable for any Red Hat-based distribution. Our Ansible playbook will refuse to run on them.
20 1 Tom Clegg
21 83 Brett Smith
h3. Base configuration
22 1 Tom Clegg
23 83 Brett Smith
On your development system, you should have a user account with full permission to use sudo.
24 1 Tom Clegg
25 83 Brett Smith
You can run the Ansible playbook to install your development system on a different system. To do this, you must have permission to SSH into your user account from the system running Ansible (the "control node") to the development system you're installing (the "target node").
26 69 Ward Vandewege
27 83 Brett Smith
h3. Virtual machine requirements
28 1 Tom Clegg
29 83 Brett Smith
If you run your development system in a virtual machine, it needs some permissions. Many environments will allow these operations by default, but they could be limited by your virtual machine setup.
30 1 Tom Clegg
31 83 Brett Smith
* It must be able to create and manage FUSE mounts (@/dev/fuse@)
32
* It must be able to create and run Docker containers
33
* It must be able to create and run Singularity containers—this requires creating and managing block loopback devices (@/dev/block-loop@)
34
* It must have the @fs.inotify.max_user_watches@ sysctl set to at least 524288. Our Ansible playbook will try to set this on the managed host, but if it is unable to do so, you may need to set it on the parent host instead.
35 78 Brett Smith
36 83 Brett Smith
h2. Install development environment with Ansible
37 1 Tom Clegg
38 87 Brett Smith
h3. Clone Arvados source
39 1 Tom Clegg
40 87 Brett Smith
You will need the Arvados source code to follow this process.
41
42 1 Tom Clegg
<pre><code class="sh">$ git clone https://git.arvados.org/arvados.git</code></pre>
43
44 90 Brett Smith
If you want to switch to a specific branch or revision like @3.2-release@, do that here.
45 1 Tom Clegg
46 87 Brett Smith
h3. Install Ansible
47 1 Tom Clegg
48 87 Brett Smith
Install Ansible following the instructions in @arvados/tools/ansible/README.md@. This ensures you get the right versions of everything.
49
50
Make sure you have your Ansible virtualenv activated when you run the steps below.
51
52 1 Tom Clegg
h3. Write an Arvados database configuration
53
54 87 Brett Smith
Make a copy of the default test configuration:
55 1 Tom Clegg
56 89 Lisa Knox
<pre><code class="sh">$ cp arvados/tools/ansible/files/default-test-config.yml ~/zzzzz-config.yml</code></pre>
57 78 Brett Smith
58 89 Lisa Knox
You can copy the file to a different location if you like. This page will use @~/zzzzz-config.yml@ as the placeholder path throughout.
59 1 Tom Clegg
60 87 Brett Smith
Edit this file with the database configuration you'd like to use. The cluster ID *must* be @zzzzz@. You can change the @user@, @password@, and @dbname@ settings freely. Our Ansible playbook will configure PostgreSQL so your settings here work.
61
62 1 Tom Clegg
The playbook will always install the @postgresql@ server package. It will *not* change any PostgreSQL configuration except to add @pg_hba.conf@ entries for this user. You should only change @host@ and @port@ if you need to use a PostgreSQL server that is already installed and running somewhere else.
63 83 Brett Smith
64 1 Tom Clegg
h3. Write an Ansible inventory
65 78 Brett Smith
66 87 Brett Smith
An inventory file tells Ansible what host(s) to manage, how to connect to them, and what settings they use. Write an inventory file to @~/zzzzz-inventory.yml@ like this:
67 1 Tom Clegg
68 87 Brett Smith
<pre><code class="yaml">arvados_test_all:
69
  # This is the list of host(s) where we're installing the test environment.
70
  # This example installs on the same system running Ansible.
71
  # If you want to manage remote hosts, you can write your own host list:
72
  # <https://docs.ansible.com/ansible/latest/getting_started/get_started_inventory.html>
73
  hosts:
74
    localhost:
75
      ansible_connection: local
76
  vars:
77
    # The path to the Arvados cluster configuration you wrote in the previous section.
78
    arvados_config_file: "{{ lookup('env', 'HOME') }}/zzzzz-config.yml"
79 72 Ward Vandewege
80 87 Brett Smith
    # The primary user doing Arvados development and tests.
81
    # This user will be added to the `docker` group.
82 1 Tom Clegg
    # It defaults to the name of the user running `ansible-playbook`.
83
    # If you want to configure a different user, set that here:
84 87 Brett Smith
    #arvados_dev_user: USERNAME
85 83 Brett Smith
86 90 Brett Smith
    # By default, the playbook installs old versions of Python and Ruby from source.
87
    # This helps you make sure you don't accidentally use too-new features during
88
    # development. If you're sure you don't need that—for example, you specifically
89
    # want to test a distribution's packaged version—set this flag:
90
    #arvados_dev_from_pkgs: true
91 77 Tom Clegg
</code></pre>
92 83 Brett Smith
93
h3. Run the playbook
94
95
The basic command to run the playbook is:
96 87 Brett Smith
97 90 Brett Smith
<pre><code class="sh">$ cd arvados/tools/ansible
98 1 Tom Clegg
$ ansible-playbook -K -i ~/zzzzz-inventory.yml install-dev-tools.yml
99
</code></pre>
100 87 Brett Smith
101 1 Tom Clegg
When you are prompted for the @BECOME password:@, enter the password for your user account on the development host that lets you run @sudo@ commands.
102 85 Brett Smith
103
@ansible-playbook@ has many options to control how it runs that you can add if you like. Refer to "the @ansible-playbook@ documentation":https://docs.ansible.com/ansible/latest/cli/ansible-playbook.html for more information.
104 83 Brett Smith
105 1 Tom Clegg
After the playbook runs successfully, you should be able to run the Arvados tests from a source checkout on your development host. e.g.,
106 83 Brett Smith
107 9 Joshua Randall
<pre><code class="sh">$ cd arvados
108 90 Brett Smith
$ mkdir -p tmp/run-tests
109
$ WORKSPACE="$PWD" build/run-tests.sh --temp "$PWD/tmp/run-tests" --interactive
110 83 Brett Smith
</code></pre>
111 60 Peter Amstutz
112 83 Brett Smith
Refer to [[Running tests]] for details.
113 60 Peter Amstutz
114 84 Brett Smith
h3. Troubleshooting
115 60 Peter Amstutz
116 83 Brett Smith
The playbook writes your database configuration at @~/.config/arvados/config.yml@ and sets up a hook @/etc/profile.d/arvados-test.sh@ to set your @CONFIGSRC@ environment variable to that directory. If most tests fail with a database connection error, check that this variable is set:
117 87 Brett Smith
118 1 Tom Clegg
<pre><code class="sh">$ echo "${CONFIGSRC:-UNSET}"</code>
119 83 Brett Smith
/home/you/.config/arvados
120 1 Tom Clegg
</pre>
121 67 Tom Clegg
122 83 Brett Smith
If that reports @UNSET@, add a line to set @CONFIGSRC="$HOME/.config/arvados"@ to your shell configuration, or set it manually when you run @run-tests.sh@:
123 1 Tom Clegg
124 87 Brett Smith
<pre><code class="sh">$ WORKSPACE="$PWD" CONFIGSRC="$HOME/.config/arvados" build/run-tests.sh ...
125 83 Brett Smith
</code></pre>
126 1 Tom Clegg
127 84 Brett Smith
h3. Notes
128 67 Tom Clegg
129 90 Brett Smith
The playbook will install symlinks for Go, Node, Python, Ruby, Singularity, and Yarn under @/usr/local/bin@. The actual tools are installed under @/opt@. If you need different versions of these tools for other work on this system, you'll need to customize your @PATH@ environment variable so the Arvados versions are found first when you're doing Arvados work.