Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support external (outside the venv) Gravity #203

Merged
merged 1 commit into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ galaxy_node_version_max: >-
__galaxy_gravity_pm: "{{ (galaxy_config_merged.gravity | default({})).process_manager | default('supervisor') }}"
__galaxy_gravity_instance_name: "{{ (galaxy_config_merged.gravity | default({})).instance_name | default(none) }}"
galaxy_gravity_wrapper_path: "/usr/local/bin/galaxyctl{{ __galaxy_gravity_instance_name | ternary('-' ~ __galaxy_gravity_instance_name, '') }}"
galaxy_gravity_command: "{{ galaxy_venv_dir }}/bin/galaxyctl"

# Currently `mule` (aka uWSGI) and `gravity` (runs Galaxy 22.01+ under gunicorn) are supported
galaxy_systemd_mode: "{{ 'mule' if __galaxy_major_version is version('22.05', '<') else 'gravity' }}"
Expand Down
4 changes: 2 additions & 2 deletions handlers/gravity_22.05.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
# handlers for gravity as used in galaxy version 22.05

- name: galaxy gravity restart
command: "{{ galaxy_venv_dir }}/bin/galaxyctl graceful"
command: "{{ galaxy_gravity_command }} graceful"
environment:
GRAVITY_STATE_DIR: "{{ galaxy_gravity_state_dir }}"
listen: "restart galaxy"

- name: galaxyctl update
command: "{{ galaxy_venv_dir }}/bin/galaxyctl update"
command: "{{ galaxy_gravity_command }} update"
environment:
GRAVITY_STATE_DIR: "{{ galaxy_gravity_state_dir }}"
listen: "galaxyctl update"
4 changes: 2 additions & 2 deletions handlers/gravity_23.0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
# handlers for gravity as used in galaxy version 23.0

- name: galaxyctl update
command: "{{ galaxy_venv_dir }}/bin/galaxyctl -c {{ galaxy_config_file }} update"
command: "{{ galaxy_gravity_command }} -c {{ galaxy_config_file }} update"
listen: "galaxyctl update"
become: yes
become_user: "{{ (__galaxy_gravity_pm == 'systemd' and galaxy_systemd_root) | ternary('root', __galaxy_user_name) }}"

- name: galaxy gravity restart
command: "{{ galaxy_venv_dir }}/bin/galaxyctl -c {{ galaxy_config_file }} graceful"
command: "{{ galaxy_gravity_command }} -c {{ galaxy_config_file }} graceful"
listen: "restart galaxy"
become: yes
become_user: "{{ (__galaxy_gravity_pm == 'systemd' and galaxy_systemd_root) | ternary('root', __galaxy_user_name) }}"
4 changes: 2 additions & 2 deletions tasks/gravity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
block:

- name: Register Galaxy config with Gravity (Gravity < 1)
command: "{{ galaxy_venv_dir }}/bin/galaxyctl register {{ galaxy_config_file }}"
command: "{{ galaxy_gravity_command }} register {{ galaxy_config_file }}"
args:
creates: "{{ galaxy_gravity_state_dir }}/configstate.yaml"

Expand All @@ -21,7 +21,7 @@
content: |
#!/usr/bin/env sh
export GRAVITY_CONFIG_FILE={{ galaxy_config_file | quote }}
exec {{ (galaxy_venv_dir ~ '/bin/galaxyctl') | quote }} "$@"
exec {{ galaxy_gravity_command | quote }} "$@"
dest: "{{ galaxy_gravity_wrapper_path }}"
mode: "0755"
when: galaxy_gravity_wrapper_path is not none
Expand Down
Loading