Skip to content

Commit ef1fed9

Browse files
committed
several small cleanups
1 parent 1f3c05c commit ef1fed9

File tree

4 files changed

+60
-24
lines changed

4 files changed

+60
-24
lines changed

galaxy/ansible/galaxy_job_conf.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22
connection: local
33
remote_user: root
44
tasks:
5+
- name: "Ensure dynamic handler assignment method is configured"
6+
lineinfile:
7+
path: "{{ galaxy_config_file }}"
8+
regexp: '^job_handler_assignment_method:'
9+
line: 'job_handler_assignment_method: db-skip-locked'
10+
insertafter: EOF
11+
create: true
12+
when: galaxy_dynamic_handlers | bool
13+
514
- name: "Install Galaxy job conf"
615
template: src=job_conf.xml.j2 dest={{ galaxy_job_conf_path }} owner={{ galaxy_user_name }} group={{ galaxy_user_name }}
716

galaxy/ansible/templates/supervisor.conf.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,5 +166,5 @@ autostart = {{ supervisor_flower_autostart }}
166166
autorestart = true
167167
startsecs = 10
168168
user = {{ galaxy_user_name }}
169-
environment = PATH={{ galaxy_venv_dir }}:{{ galaxy_venv_dir }}/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin,PYTHONPATH=lib,GALAXY_CONFIG_FILE={{ galaxy_config_file }}
169+
environment = PATH={{ galaxy_venv_dir }}:{{ galaxy_venv_dir }}/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin,PYTHONPATH={{ galaxy_server_dir }}/lib,GALAXY_ROOT_DIR={{ galaxy_server_dir }},GALAXY_CONFIG_FILE={{ galaxy_config_file }}
170170
{% endif %}

galaxy/startup.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,10 @@ if $PRIVILEGED; then
166166
fi
167167
done
168168
else
169-
echo "CVMFS client not available; install CVMFS or use the sidecar via docker-compose --profile cvmfs."
169+
echo "Info: CVMFS client not available; install CVMFS or use the sidecar via docker-compose --profile cvmfs."
170170
fi
171171
else
172-
echo "CVMFS mounts disabled (not running privileged). Use --privileged or the CVMFS sidecar in docker-compose."
172+
echo "Info: CVMFS mounts disabled (not running privileged). Use --privileged or the CVMFS sidecar in docker-compose."
173173
fi
174174

175175
if ! mountpoint -q /cvmfs 2>/dev/null; then
@@ -426,7 +426,7 @@ function start_supervisor {
426426
else
427427
echo "Starting munge"
428428
mkdir -p /var/run/munge && chown -R root:root /var/run/munge
429-
/usr/sbin/munged -f -F --num-threads=10 &
429+
/usr/sbin/munged -f -F --num-threads="${MUNGE_NUM_THREADS:-2}" &
430430
wait_for_munge || true
431431

432432
if [[ $NONUSE != *"slurmctld"* ]]

galaxy/startup2.sh

Lines changed: 47 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,29 @@ log_error() {
7171
print_log "$COLOR_ERROR" "Error: $*"
7272
}
7373

74+
show_runtime_summary() {
75+
local gunicorn_workers="${GUNICORN_WORKERS:-2}"
76+
local handler_processes="${GALAXY_HANDLER_NUMPROCS:-2}"
77+
local celery_workers="${CELERY_WORKERS:-2}"
78+
local destination_default="${GALAXY_DESTINATIONS_DEFAULT:-slurm_cluster}"
79+
local slurm_enabled="${GALAXY_RUNNERS_ENABLE_SLURM:-default}"
80+
local condor_enabled="${GALAXY_RUNNERS_ENABLE_CONDOR:-default}"
81+
local docker_enabled="${GALAXY_DOCKER_ENABLED:-default}"
82+
local mulled_enabled="${GALAXY_CONFIG_ENABLE_MULLED_CONTAINERS:-default}"
83+
local conda_auto="${GALAXY_CONFIG_CONDA_AUTO_INSTALL:-default}"
84+
local conda_prefix="${GALAXY_CONDA_PREFIX:-/tool_deps/_conda}"
85+
86+
log_info "Runtime summary:"
87+
log_info " Web workers (gunicorn): ${gunicorn_workers}"
88+
log_info " Job handlers: ${handler_processes}"
89+
log_info " Celery workers: ${celery_workers}"
90+
log_info " Default destination: ${destination_default}"
91+
log_info " Runners: slurm=${slurm_enabled}, condor=${condor_enabled}"
92+
log_info " Containers: docker=${docker_enabled}, mulled=${mulled_enabled}"
93+
log_info " Conda: auto_install=${conda_auto}, prefix=${conda_prefix}"
94+
log_info " Docs: https://github.com/bgruening/docker-galaxy"
95+
}
96+
7497
show_startup_log_tail() {
7598
tail -n "$STARTUP_LOG_TAIL" "$STARTUP_LOG" >&${STARTUP_OUT_FD} || true
7699
}
@@ -258,10 +281,10 @@ if $PRIVILEGED; then
258281
fi
259282
done
260283
else
261-
log_warn "CVMFS client not available; install CVMFS or use the sidecar via docker-compose --profile cvmfs."
284+
log_info "CVMFS client not available; install CVMFS or use the sidecar via docker-compose --profile cvmfs."
262285
fi
263286
else
264-
log_warn "CVMFS mounts disabled (not running privileged). Use --privileged or the CVMFS sidecar in docker-compose."
287+
log_info "CVMFS mounts disabled (not running privileged). Use --privileged or the CVMFS sidecar in docker-compose."
265288
fi
266289

267290
if ! mountpoint -q /cvmfs 2>/dev/null; then
@@ -275,6 +298,8 @@ if ! mountpoint -q /cvmfs 2>/dev/null; then
275298
chown -R "$GALAXY_USER:$GALAXY_USER" /cvmfs
276299
fi
277300

301+
show_runtime_summary
302+
278303
if [[ ! -z $STARTUP_EXPORT_USER_FILES ]]; then
279304
# If /export/ is mounted, export_user_files file moving all data to /export/
280305
# symlinks will point from the original location to the new path under /export/
@@ -566,57 +591,59 @@ function start_supervisor {
566591
wait_services
567592

568593
if [[ ! -z $SUPERVISOR_MANAGE_SLURM ]]; then
569-
echo "Starting munge"
594+
log_info "Starting munge"
595+
mkdir -p /tmp/slurm && chown -R "${GALAXY_USER:-galaxy}:${GALAXY_USER:-galaxy}" /tmp/slurm
570596
supervisorctl start munge
571597
wait_for_munge || true
572598

573599
if [[ $NONUSE != *"slurmctld"* ]]
574600
then
575-
echo "Starting slurmctld"
601+
log_info "Starting slurmctld"
576602
supervisorctl start slurmctld
577603
fi
578604
if [[ $NONUSE != *"slurmd"* ]]
579605
then
580-
echo "Starting slurmd"
606+
log_info "Starting slurmd"
581607
supervisorctl start slurmd
582608
fi
583609
else
584-
echo "Starting munge"
610+
log_info "Starting munge"
585611
mkdir -p /var/run/munge && chown -R root:root /var/run/munge
586-
/usr/sbin/munged -f -F --num-threads=10 &
612+
mkdir -p /tmp/slurm && chown -R "${GALAXY_USER:-galaxy}:${GALAXY_USER:-galaxy}" /tmp/slurm
613+
/usr/sbin/munged -f -F --num-threads="${MUNGE_NUM_THREADS:-2}" &
587614
wait_for_munge || true
588615

589616
if [[ $NONUSE != *"slurmctld"* ]]
590617
then
591-
echo "Starting slurmctld"
618+
log_info "Starting slurmctld"
592619
/usr/sbin/slurmctld -L $GALAXY_LOGS_DIR/slurmctld.log
593620
fi
594621
if [[ $NONUSE != *"slurmd"* ]]
595622
then
596-
echo "Starting slurmd"
623+
log_info "Starting slurmd"
597624
/usr/sbin/slurmd -L $GALAXY_LOGS_DIR/slurmd.log
598625
fi
599626
fi
600627

601628
if [[ ! -z $SUPERVISOR_MANAGE_RABBITMQ ]]; then
602629
if [[ $NONUSE != *"rabbitmq"* ]]
603630
then
604-
echo "Starting rabbitmq"
631+
log_info "Starting rabbitmq"
605632
supervisorctl start rabbitmq
606633

607634
wait_for_rabbitmq
608-
echo "Configuring rabbitmq users"
635+
log_info "Configuring rabbitmq users"
609636
ansible-playbook -c local /usr/local/bin/configure_rabbitmq_users.yml &> /dev/null
610637

611-
echo "Restarting rabbitmq"
638+
log_info "Restarting rabbitmq"
612639
supervisorctl restart rabbitmq
613640
fi
614641
fi
615642

616643
if [[ ! -z $SUPERVISOR_MANAGE_FLOWER ]]; then
617644
if [[ $NONUSE != *"flower"* && $NONUSE != *"celery"* && $NONUSE != *"rabbitmq"* ]]
618645
then
619-
echo "Starting flower"
646+
log_info "Starting flower"
620647
supervisorctl start flower
621648
fi
622649
fi
@@ -626,7 +653,7 @@ function start_gravity {
626653
if [[ ! -z $GRAVITY_MANAGE_CELERY ]]; then
627654
if [[ $NONUSE == *"celery"* ]]
628655
then
629-
echo "Disabling Galaxy celery app"
656+
log_info "Disabling Galaxy celery app"
630657
python3 /usr/local/bin/update_yaml_value "${GRAVITY_CONFIG_FILE}" "gravity.celery.enable" "false" &> /dev/null
631658
python3 /usr/local/bin/update_yaml_value "${GRAVITY_CONFIG_FILE}" "gravity.celery.enable_beat" "false" &> /dev/null
632659
else
@@ -643,7 +670,7 @@ function start_gravity {
643670
if [[ ! -z $GRAVITY_MANAGE_GX_IT_PROXY ]]; then
644671
if [[ $NONUSE == *"nodejs"* ]]
645672
then
646-
echo "Disabling nodejs"
673+
log_info "Disabling nodejs"
647674
python3 /usr/local/bin/update_yaml_value "${GRAVITY_CONFIG_FILE}" "gravity.gx_it_proxy.enable" "false" &> /dev/null
648675
else
649676
# TODO: Remove this after gravity config manager is updated to handle env vars properly
@@ -654,7 +681,7 @@ function start_gravity {
654681
if [[ ! -z $GRAVITY_MANAGE_TUSD ]]; then
655682
if [[ $NONUSE == *"tusd"* ]]
656683
then
657-
echo "Disabling Galaxy tusd app"
684+
log_info "Disabling Galaxy tusd app"
658685
python3 /usr/local/bin/update_yaml_value "${GRAVITY_CONFIG_FILE}" "gravity.tusd.enable" "false" &> /dev/null
659686
cp /etc/nginx/delegated_uploads.conf /etc/nginx/delegated_uploads.conf.source
660687
echo "# No delegated uploads" > /etc/nginx/delegated_uploads.conf
@@ -667,7 +694,7 @@ function start_gravity {
667694
if [[ ! -z $GRAVITY_MANAGE_REPORTS ]]; then
668695
if [[ $NONUSE == *"reports"* ]]
669696
then
670-
echo "Disabling Galaxy reports webapp"
697+
log_info "Disabling Galaxy reports webapp"
671698
python3 /usr/local/bin/update_yaml_value "${GRAVITY_CONFIG_FILE}" "gravity.reports.enable" "false" &> /dev/null
672699
fi
673700
fi
@@ -716,7 +743,7 @@ if $PRIVILEGED; then
716743
bash /root/cgroupfs_mount.sh
717744
log_info "Starting services (supervisord)"
718745
start_supervisor
719-
log_info "Starting Galaxy"
746+
log_info "Starting Galaxy (gunicorn=${GUNICORN_WORKERS:-2}, handlers=${GALAXY_HANDLER_NUMPROCS:-2}, celery=${CELERY_WORKERS:-2})"
720747
start_gravity
721748
supervisorctl start docker
722749
wait_for_docker
@@ -726,7 +753,7 @@ if $PRIVILEGED; then
726753
echo "$GALAXY_USER ALL = NOPASSWD : ALL" >> /etc/sudoers
727754
log_info "Starting services (supervisord)"
728755
start_supervisor
729-
log_info "Starting Galaxy"
756+
log_info "Starting Galaxy (gunicorn=${GUNICORN_WORKERS:-2}, handlers=${GALAXY_HANDLER_NUMPROCS:-2}, celery=${CELERY_WORKERS:-2})"
730757
start_gravity
731758
fi
732759
if [[ ! -z $PULL_IT_IMAGES ]]; then
@@ -747,7 +774,7 @@ else
747774
export GALAXY_CONFIG_INTERACTIVETOOLS_ENABLE=False
748775
log_info "Starting services (supervisord)"
749776
start_supervisor
750-
log_info "Starting Galaxy"
777+
log_info "Starting Galaxy (gunicorn=${GUNICORN_WORKERS:-2}, handlers=${GALAXY_HANDLER_NUMPROCS:-2}, celery=${CELERY_WORKERS:-2})"
751778
start_gravity
752779
fi
753780

0 commit comments

Comments
 (0)