1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: Apache-2.0
5 # install-test-env.yml - Ansible playbook to set up a host to run Arvados tests
7 # After you run this playbook on a host, you should be able to clone the
8 # Arvados git repository and run `build/run-tests.sh`.
9 # As of April 2025 this has been tested to work on Debian 12.
11 # In order to use this playbook, you must write an Arvados `config.yml` with
12 # PostgreSQL connection details for the `zzzzz` cluster.
13 # `files/default-test-config.yml` has the default credentials used by tests.
14 # You can copy that file and edit `dbname`, `user`, and `password` to taste.
15 # Pass the path of your file to `ansible-playbook` with
16 # `-e arvados_config_file=config.yml`.
18 - name: Bootstrap nodes
22 - name: Load Arvados configuration file
23 delegate_to: localhost
24 ansible.builtin.include_vars:
26 file: "{{ arvados_config_file }}"
27 - name: Load Arvados cluster configuration
28 ansible.builtin.set_fact:
29 arvados_cluster: "{{ arvados_config.Clusters.zzzzz }}"
30 failed_when: arvados_cluster is undefined
31 - ansible.builtin.include_role:
32 name: distro_bootstrap
36 arvados_dev_user: "{{ ansible_user_id }}"
39 - name: Install all required development packages
43 # Common build and test tools
60 - libcurl4-openssl-dev
65 # build/run-build-packages*.sh
76 - default-jdk-headless
103 # services/workbench2
104 # <https://docs.cypress.io/app/get-started/install-cypress#Linux-Prerequisites>
117 - ansible.builtin.include_role:
119 - ansible.builtin.include_role:
120 name: arvados_compute
122 arvados_compute_packages: []
123 arvados_compute_docker: true
124 arvados_compute_singularity: true
126 # RailsAPI tests depend on the en_US.UTF-8 locale.
127 # It must be generated before starting the PostgreSQL server.
128 - name: Configure en_US.UTF-8 locale
130 ansible.builtin.lineinfile:
131 path: /etc/locale.gen
132 regexp: "^[# ]*en_US.UTF-8 +UTF-8 *$"
133 line: en_US.UTF-8 UTF-8
135 - name: Run locale-gen
136 when: locale_gen.changed
138 ansible.builtin.command:
140 - ansible.builtin.include_role:
141 name: arvados_postgresql
143 arvados_postgresql_config: {}
144 arvados_postgresql_hba_sources:
149 - ansible.builtin.include_role:
151 # Configuration to run Workbench
152 - name: Check fs.inotify.max_user_watches sysctl value
153 ansible.builtin.command:
154 cmd: /sbin/sysctl --values fs.inotify.max_user_watches
155 register: max_user_watches_value
156 - name: Increase fs.inotify.max_user_watches
158 max_user_watches_wanted: 524288
159 when: "max_user_watches_value.stdout|int < max_user_watches_wanted"
161 ansible.builtin.command:
164 - "fs.inotify.max_user_watches={{ max_user_watches_wanted }}"
165 register: max_user_watches_set
166 - name: Set fs.inotify.max_user_watches permanently
167 when: max_user_watches_set.changed
169 ansible.builtin.copy:
171 ### This file is managed by Ansible
172 # React sets many inotify watchers and needs the limit increased.
173 {{ max_user_watches_set.stdout }}
174 dest: /etc/sysctl.d/arvados-workbench.conf
179 - ansible.builtin.include_role:
180 name: arvados_database
182 arvados_database_login_host: ""
183 # Let the test user drop and recreate the database wholesale
184 arvados_database_role_attr_flags: CREATEDB
186 - name: Set up Arvados development user
188 ansible.builtin.user:
189 name: "{{ arvados_dev_user }}"
194 - name: Set up .config/arvados
196 become_user: "{{ arvados_dev_user }}"
197 ansible.builtin.file:
198 path: "{{ (dev_user.home, item)|path_join }}"
203 - name: Write arvados/config.yml for testing
205 become_user: "{{ arvados_dev_user }}"
206 ansible.builtin.copy:
207 src: "{{ arvados_config_file }}"
208 dest: "{{ (dev_user.home, '.config/arvados/config.yml')|path_join }}"
210 - name: Add Arvados test configuration to profile.d
212 ansible.builtin.copy:
214 if [ -z "${CONFIGSRC:-}" ] && [ -e ~/.config/arvados/config.yml ]; then
215 export CONFIGSRC="$HOME/.config/arvados"
217 dest: /etc/profile.d/arvados-test.sh
219 - ansible.builtin.include_role:
220 name: arvados_ansible
222 arvados_ansible_galaxy_user: "{{ arvados_dev_user }}"