|
8 | 8 | name: |
9 | 9 | - python3-pip |
10 | 10 | - python-is-python3 |
11 | | - update_cache: yes |
| 11 | + # this is not needed often and can fail the run since the machines have many repos |
| 12 | + # update_cache: yes |
12 | 13 | when: ansible_os_family == 'Debian' |
13 | 14 |
|
14 | 15 | - hosts: production |
|
176 | 177 | - git: |
177 | 178 | repo: 'https://github.com/usegalaxy-eu/libraries-training-repo' |
178 | 179 | dest: /libraries/ |
| 180 | + |
179 | 181 | - name: stop galaxy to free mem for client build |
180 | 182 | become: true |
181 | 183 | become_user: root |
182 | 184 | ansible.builtin.command: galaxyctl stop |
183 | 185 | when: "inventory_hostname in ['galaxy-qa1.galaxy.cloud.e-infra.cz', 'galaxy-qa2.galaxy.cloud.e-infra.cz']" |
| 186 | + |
| 187 | + # this needs to be in the correct spot, not here, either via fork or enabling this configuration upstream |
| 188 | + |
| 189 | + # - name: client building optimization for small machines |
| 190 | + # replace: |
| 191 | + # path: "{{ galaxy_root }}/server/client/webpack.config.js" |
| 192 | + # regexp: 'TerserPlugin\(\)' |
| 193 | + # replace: 'TerserPlugin({parallel: false,})' |
| 194 | + # when: "inventory_hostname in ['galaxy-qa1.galaxy.cloud.e-infra.cz', 'galaxy-qa2.galaxy.cloud.e-infra.cz']" |
| 195 | + |
184 | 196 | roles: |
185 | 197 | - galaxyproject.tusd |
186 | 198 | - usegalaxy_eu.apptainer |
|
214 | 226 | state: restarted |
215 | 227 | name: nginx |
216 | 228 |
|
| 229 | + # not detected automatically due to a bug: https://github.com/galaxyproject/galaxy/issues/20483 |
| 230 | + - name: Install conditional dependencies |
| 231 | + pip: |
| 232 | + name: fs.onedatarestfs==21.2.5.2 |
| 233 | + virtualenv: "{{ galaxy_venv_dir }}" |
| 234 | + when: "inventory_hostname in ['galaxy-qa1.galaxy.cloud.e-infra.cz','usegalaxy.cz']" |
| 235 | + |
217 | 236 | - name: Creates entry in crontab "chmod on _files for ngnix access" |
218 | 237 | ansible.builtin.cron: |
219 | 238 | name: "chmod on _files for ngnix access" |
|
246 | 265 | when: "inventory_hostname in ['galaxy-qa1.galaxy.cloud.e-infra.cz', 'usegalaxy.cz', 'galaxy-umsa.grid.cesnet.cz']" |
247 | 266 | no_log: true |
248 | 267 |
|
| 268 | + # set up cron to propagate einfra users to einfra galaxy group |
| 269 | + - name: Ensure the user_group cron script directory exists |
| 270 | + ansible.builtin.file: |
| 271 | + path: "{{ galaxy_root }}/cron/user_group" |
| 272 | + state: directory |
| 273 | + owner: postgres |
| 274 | + group: postgres |
| 275 | + mode: '0755' |
| 276 | + when: "'usegalaxy.cz' in inventory_hostname" |
| 277 | + tags: cron |
249 | 278 | - name: Copy user - group association script |
250 | 279 | ansible.builtin.copy: |
251 | 280 | src: "{{ playbook_dir }}/extra_scripts/add_group_users.py" |
252 | | - dest: "/var/lib/postgresql/add_group_users.py" |
| 281 | + dest: "{{ galaxy_root }}/cron/user_group/add_group_users.py" |
253 | 282 | owner: postgres |
| 283 | + group: postgres |
254 | 284 | when: "'usegalaxy.cz' in inventory_hostname" |
255 | 285 | tags: cron |
256 | 286 | - name: Setup user - group association rutine |
|
259 | 289 | user: postgres |
260 | 290 | minute: "0" |
261 | 291 | hour: "*" # every hour |
262 | | - job: "python3 /var/lib/postgresql/add_group_users.py {{ inventory_hostname }} $(cat /home/{{ galaxy_user_name }}/.galaxy_api_key)" |
| 292 | + job: "python3 {{ galaxy_root }}/cron/user_group/add_group_users.py {{ inventory_hostname }} $(cat /home/{{ galaxy_user_name }}/.galaxy_api_key)" |
263 | 293 | when: "'usegalaxy.cz' in inventory_hostname" |
264 | 294 | tags: cron |
265 | 295 |
|
| 296 | + # set up cron to shadow some shed_tools contents to minimize space consumption |
| 297 | + - name: Ensure the shadow cron script directory exists |
| 298 | + ansible.builtin.file: |
| 299 | + path: "{{ galaxy_root }}/cron/shadow" |
| 300 | + state: directory |
| 301 | + owner: "{{ galaxy_user_name }}" |
| 302 | + group: "{{ galaxy_user_group_name }}" |
| 303 | + mode: '0755' |
| 304 | + when: "shed_tools_shadowing" |
| 305 | + tags: cron |
| 306 | + - name: Copy shed_tools shadowing script |
| 307 | + ansible.builtin.copy: |
| 308 | + src: "{{ playbook_dir }}/extra_scripts/shed_tools_shadow_script.sh" |
| 309 | + dest: "{{ galaxy_root }}/cron/shadow/shed_tools_shadow_script.sh" |
| 310 | + owner: "{{ galaxy_user_name }}" |
| 311 | + group: "{{ galaxy_user_group_name }}" |
| 312 | + mode: '0755' |
| 313 | + when: "shed_tools_shadowing" |
| 314 | + tags: cron |
| 315 | + - name: Setup shed_tools shadowing rutine |
| 316 | + ansible.builtin.cron: |
| 317 | + name: "Shadow shed-tools directories" |
| 318 | + user: "{{ galaxy_user_name }}" |
| 319 | + minute: "0" |
| 320 | + hour: "2" # 2 am daily |
| 321 | + job: "{{ galaxy_root }}/cron/shadow/shed_tools_shadow_script.sh {{ galaxy_root }}/var {{ galaxy_mutable_data_dir }} 2>&1 | logger -t shed_tools_shadowing" |
| 322 | + when: "shed_tools_shadowing" |
| 323 | + tags: cron |
| 324 | + |
| 325 | + # set up cron to automate tool installation from https://github.com/CESNET/galaxy_tools repository |
266 | 326 | - name: Ensure the tools cron script directory exists |
267 | 327 | ansible.builtin.file: |
268 | 328 | path: "{{ galaxy_root }}/cron/tools" |
|
291 | 351 | tags: cron |
292 | 352 | when: "inventory_hostname in ['galaxy-qa1.galaxy.cloud.e-infra.cz', 'usegalaxy.cz', 'galaxy-umsa.grid.cesnet.cz']" |
293 | 353 |
|
| 354 | + |
294 | 355 | - name: RE Galaxy instance patch in lib/galaxy/webapps/galaxy/api/job_files.py |
295 | 356 | replace: |
296 | 357 | path: "{{ galaxy_root }}/server/lib/galaxy/webapps/galaxy/api/job_files.py" |
|
311 | 372 | user: "{{ galaxy_user_name }}" |
312 | 373 | state: present |
313 | 374 | key: "{{ lookup('file','files/{{ inventory_hostname }}/pulsar.pub') }}" |
| 375 | + |
314 | 376 | - name: Restart galaxy |
315 | 377 | become: true |
316 | 378 | become_user: root |
|
0 commit comments