Project

General

Profile

Hacking prerequisites » History » Version 89

Lisa Knox, 10/01/2025 07:27 PM

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 87 Brett Smith
As of June 2025/Arvados 3.1, these instructions and the entire test suite are known to work on Debian 12 "bookworm."
14 1 Tom Clegg
15 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.
16 1 Tom Clegg
17 87 Brett Smith
These instructions are not suitable for any Red Hat-based distribution. Our Ansible playbook will refuse to run on them.
18 1 Tom Clegg
19 83 Brett Smith
h3. Base configuration
20 1 Tom Clegg
21 83 Brett Smith
On your development system, you should have a user account with full permission to use sudo.
22 1 Tom Clegg
23 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").
24 69 Ward Vandewege
25 83 Brett Smith
h3. Virtual machine requirements
26 1 Tom Clegg
27 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.
28 1 Tom Clegg
29 83 Brett Smith
* It must be able to create and manage FUSE mounts (@/dev/fuse@)
30
* It must be able to create and run Docker containers
31
* It must be able to create and run Singularity containers—this requires creating and managing block loopback devices (@/dev/block-loop@)
32
* 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.
33 78 Brett Smith
34 83 Brett Smith
h2. Install development environment with Ansible
35 1 Tom Clegg
36 87 Brett Smith
h3. Clone Arvados source
37 1 Tom Clegg
38 87 Brett Smith
You will need the Arvados source code to follow this process.
39 78 Brett Smith
40 87 Brett Smith
<pre><code class="sh">$ git clone https://git.arvados.org/arvados.git</code></pre>
41 1 Tom Clegg
42 87 Brett Smith
If you want to switch to a specific branch or revision like @3.1-release@, do that here.
43 1 Tom Clegg
44 87 Brett Smith
h3. Install Ansible
45 1 Tom Clegg
46 87 Brett Smith
Install Ansible following the instructions in @arvados/tools/ansible/README.md@. This ensures you get the right versions of everything.
47
48
Make sure you have your Ansible virtualenv activated when you run the steps below.
49
50 1 Tom Clegg
h3. Write an Arvados database configuration
51
52 87 Brett Smith
Make a copy of the default test configuration:
53 1 Tom Clegg
54 89 Lisa Knox
<pre><code class="sh">$ cp arvados/tools/ansible/files/default-test-config.yml ~/zzzzz-config.yml</code></pre>
55 78 Brett Smith
56 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.
57 1 Tom Clegg
58 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.
59
60 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.
61 83 Brett Smith
62 1 Tom Clegg
h3. Write an Ansible inventory
63 78 Brett Smith
64 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:
65 1 Tom Clegg
66 87 Brett Smith
<pre><code class="yaml">arvados_test_all:
67
  # This is the list of host(s) where we're installing the test environment.
68
  # This example installs on the same system running Ansible.
69
  # If you want to manage remote hosts, you can write your own host list:
70
  # <https://docs.ansible.com/ansible/latest/getting_started/get_started_inventory.html>
71
  hosts:
72
    localhost:
73
      ansible_connection: local
74
  vars:
75
    # The path to the Arvados cluster configuration you wrote in the previous section.
76
    arvados_config_file: "{{ lookup('env', 'HOME') }}/zzzzz-config.yml"
77 72 Ward Vandewege
78 87 Brett Smith
    # The primary user doing Arvados development and tests.
79
    # This user will be added to the `docker` group.
80
    # It defaults to the name of the user running `ansible-playbook`.
81
    # If you want to configure a different user, set that here:
82
    #arvados_dev_user: USERNAME
83 83 Brett Smith
84 87 Brett Smith
    # The authentication mechanism to allow in `pg_hba.conf`.
85
    # The default is `scram-sha-256`, which is the most secure method on the most
86
    # recent versions of PostgreSQL.
87
    # If your development system is running Debian 11, set this to `md5` here.
88
    #arvados_postgresql_hba_method: md5
89 84 Brett Smith
</code></pre>
90 77 Tom Clegg
91 83 Brett Smith
h3. Run the playbook
92
93
The basic command to run the playbook is:
94
95 87 Brett Smith
<pre><code class="sh">$ source ~/ansible/bin/activate
96
$ cd arvados/tools/ansible
97
$ ansible-playbook -K -i ~/zzzzz-inventory.yml install-dev-tools.yml
98
</code></pre>
99 1 Tom Clegg
100 85 Brett Smith
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.
101
102 83 Brett Smith
@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.
103 1 Tom Clegg
104 83 Brett Smith
After the playbook runs successfully, you should be able to run the Arvados tests from a source checkout on your development host. e.g.,
105 9 Joshua Randall
106 87 Brett Smith
<pre><code class="sh">$ cd arvados
107
$ WORKSPACE="$PWD" build/run-tests.sh --temp ~/arvados-test --interactive
108 83 Brett Smith
</code></pre>
109 60 Peter Amstutz
110 83 Brett Smith
Refer to [[Running tests]] for details.
111 60 Peter Amstutz
112 84 Brett Smith
h3. Troubleshooting
113 60 Peter Amstutz
114 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:
115 1 Tom Clegg
116 87 Brett Smith
<pre><code class="sh">$ echo "${CONFIGSRC:-UNSET}"</code>
117 83 Brett Smith
/home/you/.config/arvados
118 1 Tom Clegg
</pre>
119 67 Tom Clegg
120 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@:
121 1 Tom Clegg
122 87 Brett Smith
<pre><code class="sh">$ WORKSPACE="$PWD" CONFIGSRC="$HOME/.config/arvados" build/run-tests.sh ...
123 83 Brett Smith
</code></pre>
124 1 Tom Clegg
125 84 Brett Smith
h3. Notes
126 67 Tom Clegg
127 83 Brett Smith
The playbook will install symlinks for Go, Node, 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.