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

PMM-12641 Optimize PMM build scripts #3239

Merged
merged 48 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
0ab11ab
PMM-12641 update ansible configs
ademidoff Oct 15, 2024
8595533
PMM-12641 remove redundant playbooks/tasks
ademidoff Oct 15, 2024
3d832bd
PMM-12641 optimize the structure of playbooks, make update.yml redundant
ademidoff Oct 15, 2024
f9a4a59
PMM-12641 trigger the build
ademidoff Oct 15, 2024
66fc782
PMM-12641 fix the playbook name
ademidoff Oct 15, 2024
ae642a6
PMM-12641 pre-pull rpmbuild:3 to the agent
ademidoff Oct 15, 2024
d91a37f
PMM-12641 remove randomwait=1 for faster builds
ademidoff Oct 15, 2024
37efb2f
PMM-12641 put back the init.yml playbook
ademidoff Oct 15, 2024
c66e390
PMM-12641 remove the unused nginx repository
ademidoff Oct 15, 2024
67cb334
PMM-12641 fix pid location for nginx
ademidoff Oct 15, 2024
81d4442
PMM-12641 remove a redundant repository
ademidoff Oct 15, 2024
034c9c8
PMM-12641 fix the startup logic
ademidoff Oct 15, 2024
6c8f698
PMM-12641 simplify version detection
ademidoff Oct 15, 2024
7b77053
PMM-12641 fix an error
ademidoff Oct 15, 2024
aaaf9ee
PMM-12641 fix the client user name
ademidoff Oct 18, 2024
fb31170
Merge branch 'v3' into PMM-12641-optimize-pmm-build-scripts
ademidoff Oct 18, 2024
ef68a7f
PMM-12641 fix nginx being unable to start
ademidoff Oct 18, 2024
6a15fd4
PMM-12641 install Goreleaser on the agent
ademidoff Oct 18, 2024
e7751f3
PMM-12641 cleanup RH7 tweaks
ademidoff Oct 18, 2024
1e1d5a4
PMM-12641 stop Grafana before reinstalling the plugins
ademidoff Oct 18, 2024
5f680d9
PMM-12641 move nginx's pid to /tmp
ademidoff Oct 18, 2024
574ce2f
PMM-12641 stop grafana before provisioning plugins
ademidoff Oct 18, 2024
09c2887
PMM-12641 remove redundant pkg provisioning
ademidoff Oct 18, 2024
f355f5e
PMM-12641 revert moving nginx's pid
ademidoff Oct 18, 2024
5ffd5fc
PMM-12641 remove redundant config reread
ademidoff Oct 18, 2024
e3e9e03
PMM-12641 do not start grafana initially
ademidoff Oct 18, 2024
d3af10c
PMM-12641 cleanup the comments
ademidoff Oct 18, 2024
b87f097
PMM-12641 move post-build.yml to the same playbook
ademidoff Oct 19, 2024
5a4861a
PMM-12641 cleanup the docs
ademidoff Oct 19, 2024
8ae239d
PMM-12641 remove space around block:
ademidoff Oct 19, 2024
119cd6d
PMM-12641 remove another redundant playbook
ademidoff Oct 19, 2024
ba15378
PMM-12641 add an ssh key for a team member
ademidoff Oct 19, 2024
c90825d
PMM-12641 remove redundant build script
ademidoff Oct 19, 2024
19f1801
PMM-12641 fix the padding
ademidoff Oct 19, 2024
3463ac3
Merge branch 'v3' into PMM-12641-optimize-pmm-build-scripts
ademidoff Oct 21, 2024
7ae4322
PMM-12641 don't add ssh keys to the agent
ademidoff Oct 21, 2024
741c33d
Merge branch 'PMM-12641-optimize-pmm-build-scripts' of ssh://github.c…
ademidoff Oct 21, 2024
332bb78
Apply suggestions from code review
ademidoff Oct 21, 2024
25a7814
PMM-12641 Refine the task descriptions
ademidoff Oct 21, 2024
ee2b0d5
PMM-12641 Refine the task descriptions
ademidoff Oct 21, 2024
2515dc9
Update build/docker/client/Dockerfile
ademidoff Oct 22, 2024
8fd8ce5
Merge branch 'v3' into PMM-12641-optimize-pmm-build-scripts
ademidoff Oct 22, 2024
58f6d51
PMM-12641 Remove the encryption key
ademidoff Oct 22, 2024
de9ab29
PMM-12641 Fix duplicate psycopg2 installation
ademidoff Oct 22, 2024
6a14a2f
Merge branch 'PMM-12642-optimize-pmm-build-scripts' of ssh://github.c…
ademidoff Oct 22, 2024
23fecdc
PMM-12641 move psycopg2 installation to pg playbook
ademidoff Oct 23, 2024
4a3a55c
Merge branch 'v3' into PMM-12641-optimize-pmm-build-scripts
ademidoff Nov 8, 2024
913a0fa
Merge branch 'v3' into PMM-12641-optimize-pmm-build-scripts
ademidoff Nov 8, 2024
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
9 changes: 5 additions & 4 deletions build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ pmm-ami:
build -var 'pmm_server_image_name=${PMM_SERVER_IMAGE}' -only amazon-ebs -color=false packer/pmm.json | tee build.log
## ----------------- PACKER ------------------

check: ## Run required checks and linters
ansible-playbook --syntax-check ansible/pmm-docker/update.yml
ansible-playbook --check ansible/pmm-docker/update.yml
ansible-lint ansible/pmm-docker/update.yml
check:
echo "TODO: Since update.yml has been deprecated, see if other playbooks need to be linted"
# ansible-playbook --syntax-check ansible/pmm-docker/update.yml
# ansible-playbook --check ansible/pmm-docker/update.yml
# ansible-lint ansible/pmm-docker/update.yml
1 change: 1 addition & 0 deletions build/ansible/ansible.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Otherwise, it will fail with 'Permission denied' error since the default paths are '/root/.ansible/tmp'
# Ref: https://github.com/ansible/ansible/blob/stable-2.9/examples/ansible.cfg
[defaults]
interpreter_python = /usr/bin/python

remote_tmp = /tmp
local_tmp = /tmp
Expand Down
11 changes: 11 additions & 0 deletions build/ansible/hosts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# This is the default ansible 'hosts' file.
#
# It should live in /etc/ansible/hosts
#
# - Comments begin with the '#' character
# - Blank lines are ignored
# - Groups of hosts are delimited by [header] elements
# - You can enter hostnames or ip addresses
# - A hostname/ip can be a member of multiple groups

127.0.0.1 ansible_connection=local
4 changes: 2 additions & 2 deletions build/ansible/pmm-docker/init.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# This playbook contains tasks executed during initialization PMM Server
- hosts: localhost
# This playbook gets executed by pmm-update-perform-init
- hosts: all
become: true
become_method: su
become_user: pmm
Expand Down
1 change: 1 addition & 0 deletions build/ansible/pmm-docker/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
- hosts: all
become: yes
gather_facts: yes

roles:
- pmm-images
Original file line number Diff line number Diff line change
Expand Up @@ -27,38 +27,19 @@
--server-address=127.0.0.1:8443
--server-insecure-tls

- name: Reread supervisord configuration
command: supervisorctl reread
become: true
become_user: pmm
become_method: su
register: reread_result
changed_when: "'No config updates to processes' not in reread_result.stdout"

- name: See which service configs changed
debug: var=reread_result.stdout_lines

- name: Stop pmm-managed before deleting the database
supervisorctl:
name: pmm-managed
state: stopped
become: true
become_user: pmm
become_method: su

- name: Remove pmm-managed database
- name: Remove pmm-managed database from PostgreSQL
postgresql_db:
login_user: postgres
name: pmm-managed
force: true
state: absent

- name: Remove pmm-managed role from postgres
- name: Remove pmm-managed role from PostgreSQL database
postgresql_user:
name: pmm-managed
state: absent

- name: Stop supervisord service for docker
- name: Stop supervisord service
command: supervisorctl shutdown
become: true
become_user: pmm
Expand Down Expand Up @@ -87,6 +68,7 @@
- /var/log/clickhouse-server
- /var/log/nginx
- /var/lib/pgsql
- /srv/pmm-encryption.key

- name: Remove users created by installers
user:
Expand All @@ -106,7 +88,7 @@
# This is due to the way OverlayFS and kernel works. More info https://github.com/moby/moby/issues/25409
# This step ensures the directory is empty on startup and the contents are recreated.
# This is not an issue if the folder is in a volume or mounted from the host OS.
- name: Recreate /srv/victoriametrics folder
- name: Recreate '/srv/victoriametrics' directory
file:
state: "{{ item }}"
path: /srv/victoriametrics
Expand Down
172 changes: 0 additions & 172 deletions build/ansible/pmm-docker/update.yml

This file was deleted.

65 changes: 0 additions & 65 deletions build/ansible/pmm/create-lvm.yml

This file was deleted.

Loading
Loading