Skip to content

Commit

Permalink
Support gravity log_dir with galaxy_log_dir, and run galaxyctl update as
Browse files Browse the repository at this point in the history
needed
  • Loading branch information
natefoo committed Apr 17, 2022
1 parent 858395e commit 4904d27
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
9 changes: 8 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ __galaxy_privsep_user_name: "{{ galaxy_privsep_user.name | default(galaxy_privse
# If `galaxy_create_user` is enabled, the privsep user will also be created, but you can override this behavior
galaxy_create_privsep_user: "{{ galaxy_create_user if __galaxy_privsep_user_name != 'root' else false }}"

# Where to write Galaxy logs to
galaxy_log_dir: "{{ galaxy_mutable_data_dir }}/log"

# Directories to create as the Galaxy user if galaxy_manage_paths is enabled
galaxy_dirs:
- "{{ galaxy_mutable_data_dir }}"
Expand All @@ -101,6 +104,7 @@ galaxy_dirs:
- "{{ galaxy_file_path }}"
- "{{ galaxy_job_working_directory }}"
- "{{ galaxy_tool_data_path }}"
- "{{ galaxy_log_dir }}"

# Directories to create as the privilege separated user if galaxy_manage_paths is enabled
galaxy_privsep_dirs:
Expand Down Expand Up @@ -247,9 +251,11 @@ galaxy_config_templates: []
galaxy_gravity_state_dir: "{{ (galaxy_mutable_data_dir, 'gravity') | path_join }}"
galaxy_gravity_config_default:
galaxy_root: "{{ galaxy_server_dir }}"
# TODO: log_dir
log_dir: "{{ galaxy_log_dir }}"
virtualenv: "{{ galaxy_venv_dir }}"
app_server: gunicorn
gunicorn:
bind: localhost:8080

# Default uWSGI configuration
galaxy_uwsgi_yaml_parser: internal
Expand Down Expand Up @@ -298,6 +304,7 @@ galaxy_client_build_steps:

# Restart handler is already set if using the systemd options in this role, otherwise you need to define one yourself
galaxy_restart_handler_name: "{{ 'galaxy ' ~ galaxy_systemd_mode ~ ' restart' if galaxy_manage_systemd else 'default restart galaxy handler' }}"
galaxy_galaxyctl_update_handler_name: "{{ 'galaxyctl update' if galaxy_systemd_mode == 'gravity' else 'default galaxyctl update handler' }}"

#
# systemd options
Expand Down
10 changes: 9 additions & 1 deletion handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
---
# defaults file for galaxyproject.galaxy

# TODO: Magical restarters depending on how you're running Galaxy.
- name: default restart galaxy handler
debug:
msg: "RESTARTER NOT IMPLEMENTED - Please restart Galaxy manually. You can define your own handler and enable it with `galaxy_restart_handler_name`"

- name: default galaxyctl update handler
debug:
msg: "No-op for non-Gravity-managed Galaxy, this can be ignored"

- name: daemon reload
systemd:
daemon_reload: yes
Expand Down Expand Up @@ -33,3 +36,8 @@
command: "{{ galaxy_venv_dir }}/bin/galaxyctl graceful"
environment:
GRAVITY_STATE_DIR: "{{ galaxy_gravity_state_dir }}"

- name: galaxyctl update
command: "{{ galaxy_venv_dir }}/bin/galaxyctl update"
environment:
GRAVITY_STATE_DIR: "{{ galaxy_gravity_state_dir }}"
1 change: 1 addition & 0 deletions tasks/static_setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@
backup: "{{ galaxy_backup_configfiles }}"
mode: "{{ galaxy_config_perms }}"
notify:
- "{{ galaxy_galaxyctl_update_handler_name }}"
- "{{ galaxy_restart_handler_name }}"

remote_user: "{{ galaxy_remote_users.privsep | default(__galaxy_remote_user) }}"
Expand Down

0 comments on commit 4904d27

Please sign in to comment.