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-12530 run supervisor as non root #2643

Merged
merged 38 commits into from
Dec 18, 2023
Merged

Conversation

ademidoff
Copy link
Member

@ademidoff ademidoff commented Nov 24, 2023

PMM-12530

Link to the Feature Build: SUBMODULES-3462

With this PR we:

  • move all ansible scripts to one place: /build/ansible directory located in the root of this repo
  • start the container as pmm user (it has a number of implications, we'll detail them in the documentation when releasing)

Copy link

codecov bot commented Nov 24, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (b6acd98) 43.30% compared to head (03d2f50) 43.32%.

Additional details and impacted files
@@            Coverage Diff             @@
##               v3    #2643      +/-   ##
==========================================
+ Coverage   43.30%   43.32%   +0.01%     
==========================================
  Files         361      361              
  Lines       42323    42323              
==========================================
+ Hits        18329    18337       +8     
+ Misses      22447    22440       -7     
+ Partials     1547     1546       -1     
Flag Coverage Δ
admin 10.43% <ø> (-0.05%) ⬇️
agent 53.37% <ø> (+0.14%) ⬆️
managed 44.76% <100.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ademidoff ademidoff force-pushed the PMM-12530-run-supervisor-as-non-root branch 5 times, most recently from 65d5f14 to 71e32c6 Compare November 26, 2023 06:31
@ademidoff ademidoff closed this Dec 12, 2023
@ademidoff ademidoff force-pushed the PMM-12530-run-supervisor-as-non-root branch from eff2e66 to b6acd98 Compare December 12, 2023 12:55
@ademidoff ademidoff reopened this Dec 12, 2023
@ademidoff ademidoff force-pushed the PMM-12530-run-supervisor-as-non-root branch from 29cd3cc to dbfa806 Compare December 12, 2023 23:28
@ademidoff ademidoff force-pushed the PMM-12530-run-supervisor-as-non-root branch from ba3abef to 9958160 Compare December 15, 2023 16:20
@ademidoff ademidoff force-pushed the PMM-12530-run-supervisor-as-non-root branch from 9958160 to f9ada73 Compare December 15, 2023 18:00
@@ -179,8 +179,8 @@
}

# Swagger UI
rewrite ^/swagger/swagger.json$ /swagger.json permanent;
rewrite ^(/swagger)/(.*)$ /swagger permanent;
rewrite ^/swagger/swagger.json$ $scheme://$http_host/swagger.json permanent;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nginx was trying to connect to port :8080 otherwise :)

- name: Remove the default nginx config files
file:
path: /etc/nginx/*.default
path: "{{ item }}"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ansible's file module doesn't work with patterns :|

@ademidoff ademidoff force-pushed the PMM-12530-run-supervisor-as-non-root branch from ff6bc21 to 769479a Compare December 17, 2023 12:24
Copy link
Member

@BupycHuk BupycHuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Outstanding work!

docker run --rm -v ${HOME}/.aws:/root/.aws -v `pwd`:/build -w /build hashicorp/packer:${PACKER_VERSION} \
build -var 'pmm_client_repos=original testing' \
-var 'pmm_client_repo_name=percona-testing-x86_64' \
sed -i 's|become_method: su|become_method: sudo|g' ./roles/postgres/tasks/main.yml && \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not related to PR: why do we need these seds? don't we have this kind of logic in ansible?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nevermind, anyway it will be dropped

Copy link
Member Author

@ademidoff ademidoff Dec 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't much know what to do with the seds, so just ended up updating the paths.
We needed these seds because in AMI we have to use sudo instead of su.

Now it will be a totally different story, as you mentioned )

Comment on lines +101 to +104
check: ## Run required checkers 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼

@ademidoff ademidoff marked this pull request as ready for review December 18, 2023 07:09
@ademidoff ademidoff requested review from a team and talhabinrizwan as code owners December 18, 2023 07:09
@ademidoff ademidoff requested review from artemgavrilov, idoqo and JiriCtvrtka and removed request for a team December 18, 2023 07:09
build/ansible/pmm/systemd.yml Outdated Show resolved Hide resolved
@ademidoff ademidoff merged commit 0c90f57 into v3 Dec 18, 2023
30 checks passed
@ademidoff ademidoff deleted the PMM-12530-run-supervisor-as-non-root branch December 18, 2023 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants