From 000db4b461181074209fcbbc38df1ce6964e3a5a Mon Sep 17 00:00:00 2001 From: Alex Demidoff Date: Mon, 18 Nov 2024 17:09:57 +0300 Subject: [PATCH 1/5] PMM-13553 Revert update kong from 1.3.0 to 1.4.0 (#3282)" --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 101d927227..574561ea1a 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/ClickHouse/clickhouse-go/v2 v2.30.0 github.com/DATA-DOG/go-sqlmock v1.5.0 github.com/alecthomas/kingpin/v2 v2.4.0 - github.com/alecthomas/kong v1.4.0 + github.com/alecthomas/kong v1.3.0 github.com/alecthomas/units v0.0.0-20231202071711-9a357b53e9c9 github.com/aws/aws-sdk-go v1.55.5 github.com/blang/semver v3.5.1+incompatible diff --git a/go.sum b/go.sum index 5b6597d217..2b06a19ce1 100644 --- a/go.sum +++ b/go.sum @@ -46,8 +46,8 @@ github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBK github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/alecthomas/assert/v2 v2.11.0 h1:2Q9r3ki8+JYXvGsDyBXwH3LcJ+WK5D0gc5E8vS6K3D0= github.com/alecthomas/assert/v2 v2.11.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k= -github.com/alecthomas/kong v1.4.0 h1:UL7tzGMnnY0YRMMvJyITIRX1EpO6RbBRZDNcCevy3HA= -github.com/alecthomas/kong v1.4.0/go.mod h1:p2vqieVMeTAnaC83txKtXe8FLke2X07aruPWXyMPQrU= +github.com/alecthomas/kong v1.3.0 h1:YJKuU6/TV2XOBtymafSeuzDvLAFR8cYMZiXVNLhAO6g= +github.com/alecthomas/kong v1.3.0/go.mod h1:IDc8HyiouDdpdiEiY81iaEJM8rSIW6LzX8On4FCO0bE= github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc= github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= From 9c8d908d7510521f2dd423c84c0dbf435b99cb4e Mon Sep 17 00:00:00 2001 From: Alex Demidoff Date: Mon, 18 Nov 2024 18:03:15 +0300 Subject: [PATCH 2/5] PMM-13553 Fix grafana restart --- build/ansible/roles/dashboards/tasks/main.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/build/ansible/roles/dashboards/tasks/main.yml b/build/ansible/roles/dashboards/tasks/main.yml index cb02cfafc6..7cb496ff03 100644 --- a/build/ansible/roles/dashboards/tasks/main.yml +++ b/build/ansible/roles/dashboards/tasks/main.yml @@ -1,12 +1,21 @@ --- -- name: Stop and remove Grafana from Supervisor - shell: "supervisorctl {{ item }} grafana" +- name: Stop Grafana + shell: supervisorctl stop grafana become: true become_user: pmm become_method: su - loop: - - stop - - remove + retries: 3 + delay: 10 + until: result.rc == 0 + +- name: Remove Grafana from Supervisor jobs + shell: supervisorctl remove grafana + become: true + become_user: pmm + become_method: su + retries: 3 + delay: 10 + until: result.rc == 0 - name: Retrieve Percona plugins find: From 22ee7aec513752f4e978a677fffb2c9def389496 Mon Sep 17 00:00:00 2001 From: Alex Demidoff Date: Mon, 18 Nov 2024 18:45:06 +0300 Subject: [PATCH 3/5] PMM-13553 Wait until grafana has started --- build/ansible/roles/dashboards/tasks/main.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/build/ansible/roles/dashboards/tasks/main.yml b/build/ansible/roles/dashboards/tasks/main.yml index 7cb496ff03..3e7c0b77f3 100644 --- a/build/ansible/roles/dashboards/tasks/main.yml +++ b/build/ansible/roles/dashboards/tasks/main.yml @@ -1,21 +1,23 @@ --- +- name: Wait until Grafana starts + community.general.supervisorctl: + name: grafana + state: started + become: true + become_user: pmm + become_method: su + - name: Stop Grafana shell: supervisorctl stop grafana become: true become_user: pmm become_method: su - retries: 3 - delay: 10 - until: result.rc == 0 - name: Remove Grafana from Supervisor jobs shell: supervisorctl remove grafana become: true become_user: pmm become_method: su - retries: 3 - delay: 10 - until: result.rc == 0 - name: Retrieve Percona plugins find: @@ -54,9 +56,7 @@ remote_src: yes - name: Restart Grafana service with new plugins - shell: "supervisorctl {{ item }} grafana" + shell: supervisorctl add grafana become: true become_user: pmm become_method: su - loop: - - add From 94b1e1ba4d8a22cd16ce09301c8b28a5eb9d5c4d Mon Sep 17 00:00:00 2001 From: Alex Demidoff Date: Mon, 18 Nov 2024 19:16:47 +0300 Subject: [PATCH 4/5] PMM-13553 Wait until grafana stops --- build/ansible/roles/dashboards/tasks/main.yml | 24 ++++++------------- build/ansible/roles/pmm-images/tasks/main.yml | 9 ++++++- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/build/ansible/roles/dashboards/tasks/main.yml b/build/ansible/roles/dashboards/tasks/main.yml index 3e7c0b77f3..fdf0effcc1 100644 --- a/build/ansible/roles/dashboards/tasks/main.yml +++ b/build/ansible/roles/dashboards/tasks/main.yml @@ -1,20 +1,8 @@ --- -- name: Wait until Grafana starts +- name: Stop Grafana community.general.supervisorctl: name: grafana - state: started - become: true - become_user: pmm - become_method: su - -- name: Stop Grafana - shell: supervisorctl stop grafana - become: true - become_user: pmm - become_method: su - -- name: Remove Grafana from Supervisor jobs - shell: supervisorctl remove grafana + state: stopped become: true become_user: pmm become_method: su @@ -53,10 +41,12 @@ owner: pmm group: pmm mode: 0644 - remote_src: yes + remote_src: yes -- name: Restart Grafana service with new plugins - shell: supervisorctl add grafana +- name: Start Grafana + community.general.supervisorctl: + name: grafana + state: started become: true become_user: pmm become_method: su diff --git a/build/ansible/roles/pmm-images/tasks/main.yml b/build/ansible/roles/pmm-images/tasks/main.yml index 124e147c6f..6145ee9db0 100644 --- a/build/ansible/roles/pmm-images/tasks/main.yml +++ b/build/ansible/roles/pmm-images/tasks/main.yml @@ -157,6 +157,13 @@ option: autostart value: "false" +- name: Disable grafana + ini_file: + path: /etc/supervisord.d/grafana.ini + section: program:grafana + option: autostart + value: "false" + # During build time, this will be the first start of supervisord. - name: Start supervisord shell: supervisord -c /etc/supervisord.conf & @@ -166,7 +173,7 @@ - name: Run initialization playbook include_role: - name: initialization + name: initialization - name: Check supervisord logs shell: sleep 10 && tail -n 200 /srv/logs/supervisord.log From f83b6394268352d310304bb68fe0526a16642a7e Mon Sep 17 00:00:00 2001 From: Alex Demidoff Date: Tue, 19 Nov 2024 10:11:34 +0300 Subject: [PATCH 5/5] Update main.yml --- build/ansible/roles/pmm-images/tasks/main.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/build/ansible/roles/pmm-images/tasks/main.yml b/build/ansible/roles/pmm-images/tasks/main.yml index 6145ee9db0..4462a88678 100644 --- a/build/ansible/roles/pmm-images/tasks/main.yml +++ b/build/ansible/roles/pmm-images/tasks/main.yml @@ -157,13 +157,6 @@ option: autostart value: "false" -- name: Disable grafana - ini_file: - path: /etc/supervisord.d/grafana.ini - section: program:grafana - option: autostart - value: "false" - # During build time, this will be the first start of supervisord. - name: Start supervisord shell: supervisord -c /etc/supervisord.conf &