From 5d1f556c2ebccfa79b9950bc107b6aff3df1da93 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Sat, 25 Apr 2020 10:47:01 -0500 Subject: [PATCH] Run smart-reconfigure instead of HUP We don't want to HUP all the processes in the container, we just want zuul to reconfigure. Use the smart-reconfigure command. Also - start the scheduler in the gate job. Change-Id: I66754ed168165d2444930ab1110e95316f7307a7 --- playbooks/roles/zuul-scheduler/handlers/main.yaml | 4 +++- playbooks/roles/zuul-scheduler/tasks/main.yaml | 6 +++--- playbooks/roles/zuul-scheduler/tasks/start.yaml | 9 +++++++++ .../zuul/templates/group_vars/zuul-scheduler.yaml.j2 | 2 ++ 4 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 playbooks/roles/zuul-scheduler/tasks/start.yaml diff --git a/playbooks/roles/zuul-scheduler/handlers/main.yaml b/playbooks/roles/zuul-scheduler/handlers/main.yaml index 924765cc19..5a70b4c1ee 100644 --- a/playbooks/roles/zuul-scheduler/handlers/main.yaml +++ b/playbooks/roles/zuul-scheduler/handlers/main.yaml @@ -1,4 +1,6 @@ - name: Reload Zuul Scheduler shell: - cmd: docker-compose kill -s HUP scheduler + cmd: docker-compose exec -T scheduler zuul-scheduler smart-reconfigure chdir: /etc/zuul-scheduler + # Don't run a restart if we're starting zuul with the playbook + when: not zuul_scheduler_start|bool diff --git a/playbooks/roles/zuul-scheduler/tasks/main.yaml b/playbooks/roles/zuul-scheduler/tasks/main.yaml index 3498c03232..592f314044 100644 --- a/playbooks/roles/zuul-scheduler/tasks/main.yaml +++ b/playbooks/roles/zuul-scheduler/tasks/main.yaml @@ -68,6 +68,6 @@ cmd: docker-compose pull chdir: /etc/zuul-scheduler -- name: Run docker prune to cleanup unneeded images - shell: - cmd: docker image prune -f +- name: Start containers + include_tasks: start.yaml + when: zuul_scheduler_start | bool diff --git a/playbooks/roles/zuul-scheduler/tasks/start.yaml b/playbooks/roles/zuul-scheduler/tasks/start.yaml new file mode 100644 index 0000000000..05902c7158 --- /dev/null +++ b/playbooks/roles/zuul-scheduler/tasks/start.yaml @@ -0,0 +1,9 @@ +- name: Run docker-compose up + shell: + cmd: docker-compose up -d + chdir: /etc/zuul-scheduler + +# TODO: put this in a handler +- name: Run docker prune to cleanup unneeded images + shell: + cmd: docker image prune -f diff --git a/playbooks/zuul/templates/group_vars/zuul-scheduler.yaml.j2 b/playbooks/zuul/templates/group_vars/zuul-scheduler.yaml.j2 index 2e5ec84abf..6ec6ab1d60 100644 --- a/playbooks/zuul/templates/group_vars/zuul-scheduler.yaml.j2 +++ b/playbooks/zuul/templates/group_vars/zuul-scheduler.yaml.j2 @@ -1,3 +1,5 @@ +zuul_scheduler_start: true + gearman_server_ssl_key: | -----BEGIN RSA PRIVATE KEY----- MIIJKAIBAAKCAgEAsma7rv193P35/Wg1Um3ARP66iLWc3Z3ZLAM6LVbr4AXo0Eww