Skip to content

Commit

Permalink
idk
Browse files Browse the repository at this point in the history
  • Loading branch information
hexylena committed Jul 19, 2022
1 parent 8ef1614 commit e972706
Show file tree
Hide file tree
Showing 5 changed files with 145 additions and 0 deletions.
1 change: 1 addition & 0 deletions defaults/main.yml
Expand Up @@ -316,6 +316,7 @@ galaxy_systemd_root: true
galaxy_systemd_command: "{{ __galaxy_systemd_command[galaxy_systemd_mode] }}"
__galaxy_systemd_command:
mule: "{{ galaxy_venv_dir }}/bin/uwsgi {{ '--yaml' if galaxy_config_style in ('yaml', 'yml') else '--ini' }} {{ galaxy_config_file }}"
systemd: "gunicorn 'galaxy.webapps.galaxy.fast_factory:factory()' --timeout 300 --pythonpath lib -k galaxy.webapps.galaxy.workers.Worker -b {{ galaxy_config.galaxy.gravity.gunicorn.bind }} --workers={{ galaxy_config.galaxy.gravity.gunicorn.workers | default(2) }} {{ galaxy_config.galaxy.gravity.gunicorn.extra_args }}"
gravity: "{{ galaxy_venv_dir }}/bin/galaxyctl start --foreground --quiet"

# TimeoutStartSec is unfortunately also the timeout used for reload operations, which take longer
Expand Down
34 changes: 34 additions & 0 deletions templates/systemd/galaxy-celery-beat.service
@@ -0,0 +1,34 @@
[Unit]
Description=Galaxy Celery Beat
After=network.target
After=time-sync.target

[Service]
UMask=022
Type=simple
{% if galaxy_systemd_root %}
User={{ __galaxy_user_name }}
Group={{ __galaxy_user_group }}
{% endif %}
WorkingDirectory={{ galaxy_server_dir }}
TimeoutStartSec={{ galaxy_systemd_timeout_start_sec }}
ExecStart=celery --app galaxy.celery beat --loglevel DEBUG --schedule {{ galaxy_gravity_state_dir }}/celery-beat-schedule

Environment=HOME={{ galaxy_root }}
Environment=VIRTUAL_ENV={{ galaxy_venv_dir }}
Environment=PATH={{ galaxy_venv_dir }}/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin
Environment=DOCUTILSCONFIG=
Environment=PYTHONPATH=lib
Environment=GALAXY_CONFIG_FILE={{ galaxy_config_file }}
{% for env in galaxy_systemd_env %}
Environment={{ env }}
{% endfor %}
MemoryLimit={{ __galaxy_systemd_memory_limit_merged.celery_beat }}G
Restart=always

MemoryAccounting=yes
CPUAccounting=yes
BlockIOAccounting=yes

[Install]
WantedBy=multi-user.target
34 changes: 34 additions & 0 deletions templates/systemd/galaxy-celery.service
@@ -0,0 +1,34 @@
[Unit]
Description=Galaxy Celery Beat
After=network.target
After=time-sync.target

[Service]
UMask=022
Type=simple
{% if galaxy_systemd_root %}
User={{ __galaxy_user_name }}
Group={{ __galaxy_user_group }}
{% endif %}
WorkingDirectory={{ galaxy_server_dir }}
TimeoutStartSec={{ galaxy_systemd_timeout_start_sec }}
ExecStart=celery --app galaxy.celery worker --concurrency 2 --loglevel DEBUG --pool threads --queues celery,galaxy.internal,galaxy.external

Environment=HOME={{ galaxy_root }}
Environment=VIRTUAL_ENV={{ galaxy_venv_dir }}
Environment=PATH={{ galaxy_venv_dir }}/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin
Environment=DOCUTILSCONFIG=
Environment=PYTHONPATH=lib
Environment=GALAXY_CONFIG_FILE={{ galaxy_config_file }}
{% for env in galaxy_systemd_env %}
Environment={{ env }}
{% endfor %}
MemoryLimit={{ __galaxy_systemd_memory_limit_merged.celery }}G
Restart=always

MemoryAccounting=yes
CPUAccounting=yes
BlockIOAccounting=yes

[Install]
WantedBy=multi-user.target
38 changes: 38 additions & 0 deletions templates/systemd/galaxy-gunicorn.service
@@ -0,0 +1,38 @@
[Unit]
Description=Galaxy
After=network.target
After=time-sync.target

[Service]
UMask=022
Type=simple
{% if galaxy_systemd_root %}
User={{ __galaxy_user_name }}
Group={{ __galaxy_user_group }}
{% endif %}
WorkingDirectory={{ galaxy_server_dir }}
TimeoutStartSec={{ galaxy_systemd_timeout_start_sec }}
ExecStart={{ galaxy_systemd_command }}
{% if galaxy_systemd_mode == 'gravity' %}
ExecReload={{ galaxy_venv_dir }}/bin/galaxyctl graceful
ExecStop={{ galaxy_venv_dir }}/bin/galaxyctl shutdown
{% endif %}

Environment=HOME={{ galaxy_root }}
Environment=VIRTUAL_ENV={{ galaxy_venv_dir }}
Environment=PATH={{ galaxy_venv_dir }}/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin
Environment=DOCUTILSCONFIG=
Environment=PYTHONPATH={{ galaxy_dynamic_job_rules_dir }}
Environment=GRAVITY_STATE_DIR={{ galaxy_gravity_state_dir }}
{% for env in galaxy_systemd_env %}
Environment={{ env }}
{% endfor %}
MemoryLimit={{ __galaxy_systemd_memory_limit_merged.mule }}G
Restart=always

MemoryAccounting=yes
CPUAccounting=yes
BlockIOAccounting=yes

[Install]
WantedBy=multi-user.target
38 changes: 38 additions & 0 deletions templates/systemd/galaxy-handler.service
@@ -0,0 +1,38 @@
[Unit]
Description=Galaxy
After=network.target
After=time-sync.target

[Service]
UMask=022
Type=simple
{% if galaxy_systemd_root %}
User={{ __galaxy_user_name }}
Group={{ __galaxy_user_group }}
{% endif %}
WorkingDirectory={{ galaxy_server_dir }}
TimeoutStartSec={{ galaxy_systemd_timeout_start_sec }}
ExecStart=python ./lib/galaxy/main.py -c {{ galaxy_config_file }} --server-name=handler_%I --attach-to-pool=job-handler --attach-to-pool=workflow-scheduler
{% if galaxy_systemd_mode == 'gravity' %}
ExecReload={{ galaxy_venv_dir }}/bin/galaxyctl graceful
ExecStop={{ galaxy_venv_dir }}/bin/galaxyctl shutdown
{% endif %}

Environment=HOME={{ galaxy_root }}
Environment=VIRTUAL_ENV={{ galaxy_venv_dir }}
Environment=PATH={{ galaxy_venv_dir }}/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin
Environment=DOCUTILSCONFIG=
Environment=PYTHONPATH={{ galaxy_dynamic_job_rules_dir }}
Environment=GRAVITY_STATE_DIR={{ galaxy_gravity_state_dir }}
{% for env in galaxy_systemd_env %}
Environment={{ env }}
{% endfor %}
MemoryLimit={{ __galaxy_systemd_memory_limit_merged.handler }}G
Restart=always

MemoryAccounting=yes
CPUAccounting=yes
BlockIOAccounting=yes

[Install]
WantedBy=multi-user.target

0 comments on commit e972706

Please sign in to comment.