Skip to content

Commit cb65cc3

Browse files
committed
Merge branch 'main' of https://github.com/artbio/ansible-galaxy into main
2 parents 37ddb62 + e07b036 commit cb65cc3

22 files changed

+567
-59
lines changed

.github/workflows/molecule.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ jobs:
2222
- ubuntu:20.04
2323
- ubuntu:22.04
2424
galaxy-version:
25-
- '21.01'
2625
- '22.01'
2726
- '22.05'
27+
- '23.0'
2828
- 'dev'
2929
exclude:
3030
# wheels often don't exist in the combination of old package versions in older galaxy releases for newer

.github/workflows/release.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# See: https://github.com/marketplace/actions/publish-ansible-role-to-galaxy
66
# See: https://github.com/ansible/galaxy/issues/46
77

8-
name: Release
8+
name: Release (by Tag Push)
99

1010
'on':
1111
push:
@@ -18,10 +18,10 @@ jobs:
1818
runs-on: ubuntu-latest
1919
steps:
2020
- name: Check out the codebase.
21-
uses: actions/checkout@v2
21+
uses: actions/checkout@v3
2222

2323
- name: Set up Python 3.
24-
uses: actions/setup-python@v2
24+
uses: actions/setup-python@v3
2525
with:
2626
python-version: '3.x'
2727

.github/workflows/slugger.yml

+21-14
Original file line numberDiff line numberDiff line change
@@ -16,50 +16,57 @@ name: "Automatic Regular Releases"
1616
on:
1717
workflow_dispatch:
1818
schedule:
19-
- cron: '0 0 * * 1'
19+
- cron: '0 0 * * 1'
2020

2121
jobs:
2222
release:
2323
name: Release
2424
runs-on: ubuntu-latest
2525
steps:
2626
- name: Check out the codebase.
27-
uses: actions/checkout@v2
27+
uses: actions/checkout@v3
2828
with:
2929
fetch-depth: 0
3030

3131
- name: Set up Python 3.
32-
uses: actions/setup-python@v2
32+
uses: actions/setup-python@v3
3333
with:
3434
python-version: '3.x'
3535

3636
- name: Install Ansible.
37-
run: pip3 install ansible-base
37+
run: pip3 install six ansible-base
3838

3939
- name: Check for changes
4040
run: |
41-
MOST_RECENT_TAG=$(git describe --tags --abbrev=0)
42-
CHANGES=$(git diff ${MOST_RECENT_TAG} --name-only | wc -l)
43-
echo "Found ${CHANGES} files"
44-
git diff ${MOST_RECENT_TAG} --name-only
41+
LATEST_TAG=$(git describe --tags --abbrev=0)
42+
echo "The last released tag was ${LATEST_TAG}"
43+
CHANGES=$(git diff ${LATEST_TAG} --name-only | wc -l)
44+
echo "Found ${CHANGES} changed files"
45+
git diff ${LATEST_TAG} --name-only
4546
echo "changed_files=${CHANGES}" >> $GITHUB_ENV
4647
4748
- name: Create a new git tag
4849
run: |
49-
MOST_RECENT_TAG=$(git describe --tags --abbrev=0)
50-
major_minor=$(echo "$MOST_RECENT_TAG" | sed 's/\(.*\..*\.\)\(.*\)/\1/')
51-
patch=$(echo "$MOST_RECENT_TAG" | sed 's/\(.*\..*\.\)\(.*\)/\2/')
50+
LATEST_TAG=$(git describe --tags --abbrev=0)
51+
major_minor=$(echo "$LATEST_TAG" | sed 's/\(.*\..*\.\)\(.*\)/\1/')
52+
patch=$(echo "$LATEST_TAG" | sed 's/\(.*\..*\.\)\(.*\)/\2/')
5253
newpatch=$(echo "$patch + 1" | bc)
5354
NEW_TAG="${major_minor}${newpatch}"
54-
echo "$MOST_RECENT_TAG -> $NEW_TAG"
55+
echo "$LATEST_TAG -> $NEW_TAG"
5556
5657
git config user.name github-actions
5758
git config user.email [email protected]
5859
git tag "$NEW_TAG"
5960
git push --tags
61+
echo "Creating new tag $NEW_TAG" >> $GITHUB_STEP_SUMMARY
6062
if: env.changed_files > 0
6163

62-
# We have to do this step as GHA prevents triggering it's own actions, to prevent runaway loops.
64+
# We have to do this step as GHA prevents triggering it's own actions, to
65+
# prevent runaway loops.
6366
- name: Trigger a new import on Galaxy.
64-
run: ansible-galaxy role import --api-key ${{ secrets.GALAXY_API_KEY }} $(echo ${{ github.repository }} | cut -d/ -f1) $(echo ${{ github.repository }} | cut -d/ -f2) --branch main
67+
run: |
68+
org=$(echo ${{ github.repository }} | cut -d/ -f1)
69+
repo=$(echo ${{ github.repository }} | cut -d/ -f2)
70+
key=${{ secrets.GALAXY_API_KEY }}
71+
ansible-galaxy role import --api-key $key $org $repo --branch main
6572
if: env.changed_files > 0

README.md

+39
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,44 @@ The handler should "listen" to the topic `"restart galaxy"`.
105105

106106
[gravity]: https://github.com/galaxyproject/gravity
107107

108+
From release 22.01 Galaxy can serve different static content per host (e.g. subdomain) and you can set [themes][themes] per host.
109+
110+
By setting `galaxy_manage_subdomain_static: yes` you enable the creation of static directories and configuration per host and by setting `galaxy_manage_themes: yes` the role will append your themes_config.yml file specified under `galaxy_themes_conf_path` to your themes files after coping them over to your galaxy server and create the respective configuration.
111+
112+
In order to use this feature, you need to create the following directory structure under files/ (customizable with the `galaxy_themes_ansible_file_path` variable):
113+
114+
~~~bash
115+
files/galaxy/static
116+
├──<subdomain-name-1>
117+
│   ├── static
118+
│   │   ├── dist (optional)
119+
│   │   │   └── some-image.png
120+
│   │   ├── images (optional)
121+
│   │   │   └── more-content.jpg
122+
│   │   └── welcome.html (optional, galaxyproject.org will be displayed otherwise.)
123+
│   └── themes
124+
│   └── <subdomain-name-1>.yml
125+
├── <subdomain-name-2>
126+
│   ├── static
127+
│   │   ├── dist (optional)
128+
│   │   │   ├── another-static-image.svg
129+
│   │   │   └── more-static-content-2.svg
130+
│   │   └── welcome.html (optional)
131+
│   └── themes
132+
│   └── <subdomain-name-2>.yml
133+
... (and many more subdomains)
134+
~~~
135+
136+
Where the <subdomain-name-1> should exactly match your subdomain's name. The subdirectories `static` and `themes` are mandatory, as well as the correctly named theme file (if you enabled `galaxy_manage_themes`), while all subdirectories in `static` are optional.
137+
Which subdirectories and files are copied is managed by the `static_galaxy_themes_keys` variable.
138+
139+
Also make sure that you set `galaxy_themes_welcome_url_prefix`, so your welcome pages are templated correctly.
140+
141+
It is mandatory to set the variables under `galaxy_themes_subdomains` as shown in the example in [defaults/main.yml](defaults/main.yml). If you enabled the `galaxy_manage_host_filters` variable, you can also specify the tool sections that should be shown for each individual subdomain.
142+
143+
144+
145+
[themes]: https://training.galaxyproject.org/training-material/topics/admin/tutorials/customization/tutorial.html
108146
**New options for Galaxy 18.01 and later**
109147

110148
- `galaxy_config_style` (default: `yaml`): The type of Galaxy configuration file to write, `yaml` for the YAML format supported by uWSGI or `ini-paste` for the traditional PasteDeploy-style INI file
@@ -503,3 +541,4 @@ This role was written and contributed to by the following people:
503541
- [John Chilton](https://github.com/jmchilton)
504542
- [Nate Coraor](https://github.com/natefoo)
505543
- [Helena Rasche](https://github.com/hexylena)
544+
- [Mira Kuntz](https://github.com/mira-miracoli)

defaults/main.yml

+150-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ galaxy_manage_gravity: "{{ false if __galaxy_major_version is version('22.05', '
2323
galaxy_manage_systemd: no # For Galaxy
2424
galaxy_manage_systemd_reports: no # For Reports
2525
galaxy_manage_cleanup: no
26+
galaxy_manage_themes: no
27+
galaxy_manage_subdomain_static: no
28+
galaxy_manage_host_filters: no
29+
galaxy_auto_brand: no # automatically sets the subdomain name as brand
2630

2731

2832
# Control whether to output verbose task diffs (e.g. when performing a git update) when running Ansible with --diff.
@@ -107,13 +111,19 @@ galaxy_dirs:
107111
- "{{ galaxy_tool_data_path }}"
108112
- "{{ galaxy_log_dir }}"
109113

114+
# Additional directories to create as the Galaxy user, so you don't have to copy the default galaxy_dirs
115+
galaxy_extra_dirs: []
116+
110117
# Directories to create as the privilege separated user if galaxy_manage_paths is enabled
111118
galaxy_privsep_dirs:
112119
- "{{ galaxy_venv_dir }}"
113120
- "{{ galaxy_server_dir }}"
114121
- "{{ galaxy_config_dir }}"
115122
- "{{ galaxy_local_tools_dir }}"
116123

124+
# Additional directories to create as the privilege separated user, so you don't have to copy the default galaxy_dirs
125+
galaxy_extra_privsep_dirs: []
126+
117127
# Local (relative to playbook) path to local tools
118128
galaxy_local_tools_src_dir: files/galaxy/tools
119129

@@ -182,7 +192,7 @@ _galaxy_tmpclean_command:
182192

183193
galaxy_tmpclean_verbose_statement: "{{ galaxy_tmpclean_verbose | ternary(' -v', '') }}"
184194
galaxy_tmpclean_log_statement: >-
185-
{{ (galaxy_tmpclean_log is not true) | ternary(
195+
{{ (galaxy_tmpclean_log != true) | ternary(
186196
((galaxy_tmpclean_log is none) | ternary(
187197
'>/dev/null',
188198
'>>' ~ galaxy_tmpclean_log
@@ -246,6 +256,7 @@ galaxy_app_config_section: "{{ 'galaxy' if galaxy_config_style in ('yaml', 'yml'
246256

247257
# Galaxy configuration files will be written with these permissions (mode argument to Ansible copy/template module)
248258
galaxy_config_perms: 0640
259+
galaxy_config_perms_public: 0644
249260

250261
# The default Galaxy configuration, ensures that Galaxy can find all of the configs if galaxy_config_dir !=
251262
# galaxy_server_dir
@@ -288,6 +299,64 @@ galaxy_app_config_default:
288299
# Everything else
289300
visualization_plugins_directory: "config/plugins/visualizations"
290301

302+
# Static and themes configuration, will only be added if galaxy_manage_themes
303+
static_enabled: "{{ galaxy_manage_subdomain_static }}"
304+
static_dir_by_host: >
305+
{ {% if galaxy_manage_subdomain_static %}
306+
'{{ galaxy_themes_instance_domain }}': '{{ galaxy_themes_static_path }}/static/',
307+
{% for subdomain in galaxy_themes_subdomains %}
308+
'{{ subdomain.name }}.{{ galaxy_themes_instance_domain}}': '{{ galaxy_themes_static_path }}/static-{{ subdomain.name }}/',
309+
{% endfor %}
310+
{% endif %} }
311+
static_images_dir_by_host: >
312+
{ {% if galaxy_manage_subdomain_static %}
313+
'{{ galaxy_themes_instance_domain }}': '{{ galaxy_themes_static_path }}/static/images',
314+
{% for subdomain in galaxy_themes_subdomains %}
315+
'{{ subdomain.name }}.{{ galaxy_themes_instance_domain}}': '{{ galaxy_themes_static_path }}/static-{{ subdomain.name }}/images',
316+
{% endfor %}
317+
{% endif %} }
318+
static_welcome_html_by_host: >
319+
{ {% if galaxy_manage_subdomain_static %}
320+
'{{ galaxy_themes_instance_domain }}': '{{ galaxy_themes_static_path }}/static/welcome.html',
321+
{% for subdomain in galaxy_themes_subdomains %}
322+
'{{ subdomain.name }}.{{ galaxy_themes_instance_domain}}': '{{ galaxy_themes_static_path }}/static-{{ subdomain.name }}/welcome.html',
323+
{% endfor %}
324+
{% endif %} }
325+
static_scripts_dir_by_host: >
326+
{ {% if galaxy_manage_subdomain_static %}
327+
'{{ galaxy_themes_instance_domain }}': '{{ galaxy_themes_static_path }}/static/scripts',
328+
{% for subdomain in galaxy_themes_subdomains %}
329+
'{{ subdomain.name }}.{{ galaxy_themes_instance_domain}}': '{{ galaxy_themes_static_path }}/static-{{ subdomain.name }}/scripts',
330+
{% endfor %}
331+
{% endif %} }
332+
static_favicon_dir_by_host: >
333+
{ {% if galaxy_manage_subdomain_static %}
334+
'{{ galaxy_themes_instance_domain }}': '{{ galaxy_themes_static_path }}/static',
335+
{% for subdomain in galaxy_themes_subdomains %}
336+
'{{ subdomain.name }}.{{ galaxy_themes_instance_domain}}': '{{ galaxy_themes_static_path }}/static-{{ subdomain.name }}',
337+
{% endfor %}
338+
{% endif %} }
339+
static_robots_txt_by_host: >
340+
{ {% if galaxy_manage_subdomain_static %}
341+
'{{ galaxy_themes_instance_domain }}': '{{ galaxy_themes_static_path }}/static',
342+
{% for subdomain in galaxy_themes_subdomains %}
343+
'{{ subdomain.name }}.{{ galaxy_themes_instance_domain}}': '{{ galaxy_themes_static_path }}/static-{{ subdomain.name }}',
344+
{% endfor %}
345+
{% endif %} }
346+
themes_config_file_by_host: >
347+
{ {% if galaxy_manage_themes %}
348+
'{{ galaxy_themes_instance_domain }}': '{{ galaxy_themes_conf_file_name }}',
349+
{% for subdomain in galaxy_themes_subdomains %}
350+
'{{ subdomain.name }}.{{ galaxy_themes_instance_domain}}': '{{ subdomain.name }}.yml',
351+
{% endfor %}
352+
{% endif %} }
353+
brand_by_host: >
354+
{ {% if galaxy_auto_brand %}
355+
'{{ galaxy_themes_instance_domain }}': '{{ galaxy_themes_instance_domain }}',
356+
{% for subdomain in galaxy_themes_subdomains %}
357+
'{{ subdomain.name }}.{{ galaxy_themes_instance_domain}}': '{{ subdomain.name[0]|upper }}{{ subdomain.name[1:] }}',
358+
{% endfor %}
359+
{% endif %} }
291360
# Need to set galaxy_config_default[galaxy_app_config_section] dynamically but Ansible/Jinja2 does not make this easy
292361
galaxy_config_default: "{{ {} | combine({galaxy_app_config_section: galaxy_app_config_default}) }}"
293362
galaxy_config_merged: "{{ galaxy_config_default | combine(galaxy_config | default({}), recursive=True) }}"
@@ -313,6 +382,8 @@ galaxy_errordocs_prefix: /error
313382
# templates to be installed on the managed host.
314383
galaxy_config_files: []
315384
galaxy_config_templates: []
385+
# Like above, except with world readable permissions
386+
galaxy_config_files_public: []
316387

317388
# Default Gravity configuration
318389
galaxy_gravity_state_dir: "{{ (galaxy_mutable_data_dir, 'gravity') | path_join }}"
@@ -358,6 +429,9 @@ galaxy_uwsgi_config_default:
358429
# build separately, but this is not guaranteed to work for all version of Galaxy - using `make` is the safer choice.
359430
galaxy_client_make_target: client-production-maps
360431

432+
# Build the client even if it is not out of date
433+
galaxy_client_force_build: false
434+
361435
# If galaxy_client_make_target is null, you can set this to `development` to build the client for development
362436
galaxy_client_node_env: production
363437
galaxy_client_build_steps:
@@ -369,10 +443,21 @@ galaxy_client_build_steps:
369443
- stageLibs
370444
- plugins
371445

446+
__galaxy_node_version_max:
447+
"redhat7": "16.19.1"
448+
galaxy_node_version_max: >-
449+
{{
450+
(__galaxy_node_version_max[(ansible_os_family | lower) ~ ansible_distribution_major_version]) | default(galaxy_node_version)
451+
}}
452+
372453
#
373454
# systemd options
374455
#
375456

457+
__galaxy_gravity_pm: "{{ (galaxy_config_merged.gravity | default({})).process_manager | default('supervisor') }}"
458+
__galaxy_gravity_instance_name: "{{ (galaxy_config_merged.gravity | default({})).instance_name | default(none) }}"
459+
galaxy_gravity_wrapper_path: "/usr/local/bin/galaxyctl{{ __galaxy_gravity_instance_name | ternary('-' ~ __galaxy_gravity_instance_name, '') }}"
460+
376461
# Currently `mule` (aka uWSGI) and `gravity` (runs Galaxy 22.01+ under gunicorn) are supported
377462
galaxy_systemd_mode: "{{ 'mule' if __galaxy_major_version is version('22.05', '<') else 'gravity' }}"
378463

@@ -405,3 +490,67 @@ galaxy_systemd_env: []
405490

406491
# A list of additional python packages to install into galaxy's virtual environment
407492
galaxy_additional_venv_packages: []
493+
494+
# galaxy themes variables
495+
galaxy_themes_subdomains: {}
496+
# - name: assembly
497+
# tool_sections:
498+
# - "hicexplorer"
499+
# - "graph_display_data"
500+
# - "peak_calling"
501+
# - "assembly"
502+
# - "annotation"
503+
# - "genome_diversity"
504+
# - "multiple_alignments"
505+
# extra_tool_labels:
506+
# - "proteomics"
507+
galaxy_themes_conf_file_name: "{{ galaxy_themes_conf_path | basename }}"
508+
galaxy_themes_static_keys:
509+
static_dir: ""
510+
static_images_dir: "images/"
511+
static_scripts_dir: "scripts/"
512+
static_welcome_html: "welcome.html/"
513+
static_favicon_dir: "favicon.ico"
514+
static_robots_txt: "robots.txt"
515+
galaxy_themes_conf_path: files/galaxy/config/themes_conf.yml
516+
galaxy_themes_static_path: "{{ galaxy_root }}/server"
517+
galaxy_themes_static_dir: "{{ galaxy_root }}/server/static"
518+
galaxy_themes_symlinks: true
519+
galaxy_themes_symlinks_no_log: false # Hides extended logs for the symlink task in static/dist
520+
galaxy_themes_welcome_url_prefix: https://usegalaxy-eu.github.io/index-
521+
galaxy_themes_default_welcome: https://galaxyproject.org
522+
galaxy_themes_ansible_file_path: files/galaxy/static
523+
galaxy_themes_instance_domain: usegalaxy.eu
524+
galaxy_themes_global_host_filters_path: "{{ galaxy_root }}/server/lib/galaxy/tool_util/toolbox/filters/global_host_filters.py"
525+
galaxy_themes_tool_base_labels:
526+
- "file_and_meta_tools"
527+
- "general_text_tools"
528+
- "genomic_file_manipulation"
529+
- "gff"
530+
- "common_genomics"
531+
galaxy_themes_tool_ngs_labels:
532+
- "specific_genomics"
533+
- "genomics_toolkits"
534+
535+
# These sections will be displayed in the tool panel for every subdomain
536+
galaxy_themes_tool_base_sections:
537+
- "getext"
538+
- "send"
539+
- "collection_operations"
540+
- "textutil"
541+
- "convert"
542+
- "filter"
543+
- "group"
544+
- "expression_tools"
545+
546+
# There sections are a collection of general NGS tools and will be used in most but not all subdomains
547+
galaxy_themes_tool_ngs_sections:
548+
- "deeptools"
549+
- "bed"
550+
- "sambam"
551+
- "bxops"
552+
- "fastafastq"
553+
- "fastq_quality_control"
554+
- "picard"
555+
- "mapping"
556+
- "sambam"

0 commit comments

Comments
 (0)