Skip to content

PMM-14934 Fix admin pass creation#5220

Draft
ademidoff wants to merge 18 commits intov3from
PMM-14934-fix-admin-password-creation
Draft

PMM-14934 Fix admin pass creation#5220
ademidoff wants to merge 18 commits intov3from
PMM-14934-fix-admin-password-creation

Conversation

@ademidoff
Copy link
Copy Markdown
Member

@ademidoff ademidoff commented Apr 7, 2026

PMM-14934

Link to the Feature Build: SUBMODULES-4295

This pull request introduces significant changes to how temporary and initialization directories are managed in the Docker build and runtime for PMM, especially for Nginx and /srv. It standardizes temp directory locations, simplifies initialization logic, and cleans up legacy and redundant steps in the Ansible and entrypoint scripts.

Directory and Temp File Management Improvements:

  • Nginx temporary directories are now created under /srv/nginx/tmp instead of /usr/share/pmm-server/nginx, and all related configuration and Ansible tasks have been updated accordingly. (build/ansible/roles/nginx/files/nginx.conf, build/ansible/roles/nginx/tasks/main.yml, build/docker/server/entrypoint.sh [1] [2] [3] [4]
  • The /srv directory is now cleaned and re-initialized more robustly during the build, removing legacy cleanup logic and ensuring a fresh state on container start. (build/ansible/pmm-docker/post-build.yml [1] [2] [3] [4] [5]

Entrypoint and Initialization Logic:

  • The Docker entrypoint script no longer creates Nginx temp directories under /usr/share/pmm-server and instead ensures /srv/nginx/tmp exists, aligning with the new standard. It also improves /srv initialization and temp directory creation for pmm-agent. (build/docker/server/entrypoint.sh [1] [2]

Code Simplification and Cleanup:

  • Removes legacy and redundant tasks from the Ansible post-build script, including PostgreSQL cleanup, old directory removals, and unnecessary file ownership steps, streamlining the build process. (build/ansible/pmm-docker/post-build.yml [1] [2] [3] [4] [5]
  • Minor refactor in Go code to use wg.Go for running a goroutine, improving code clarity. (managed/cmd/pmm-managed/main.go managed/cmd/pmm-managed/main.goL1120-R1122)

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 7, 2026

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 42.11%. Comparing base (b4e5544) to head (bd82305).

Files with missing lines Patch % Lines
managed/cmd/pmm-managed/main.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##               v3    #5220      +/-   ##
==========================================
+ Coverage   41.49%   42.11%   +0.61%     
==========================================
  Files         410      410              
  Lines       41992    41990       -2     
==========================================
+ Hits        17424    17682     +258     
+ Misses      22814    22523     -291     
- Partials     1754     1785      +31     
Flag Coverage Δ
admin 34.89% <ø> (ø)
agent 49.12% <ø> (+2.49%) ⬆️
managed 40.62% <0.00%> (+0.01%) ⬆️
vmproxy 72.09% <ø> (ø)

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ademidoff ademidoff force-pushed the PMM-14934-fix-admin-password-creation branch from 807aa15 to 2d272fa Compare April 10, 2026 21:58
echo "NSS wrapper enabled with $NSS_WRAPPER_LIB"
fi

# Check /usr/share/pmm-server directory on every start
Copy link
Copy Markdown
Member Author

@ademidoff ademidoff Apr 12, 2026

Choose a reason for hiding this comment

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

This section was preceding "/srv" initialization below, which is wrong timing. Moved below it.

}

http {
# Configure temporary directories to use /usr/share/pmm-server/nginx
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This moves Nginx temp directories to a mutable storage, which is where it should be.

- clickhouse
- nginx

- name: Clean Clickhouse dir
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The removals in this play are no longer necessary, since we clean up the whole "/srv" down below.

- hosts: all
become: yes
gather_facts: yes
vars:
Copy link
Copy Markdown
Member Author

@ademidoff ademidoff Apr 12, 2026

Choose a reason for hiding this comment

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

This was redundant.

owner: pmm
group: root

- name: Remove pmm-managed database from PostgreSQL
Copy link
Copy Markdown
Member Author

@ademidoff ademidoff Apr 29, 2026

Choose a reason for hiding this comment

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

This whole set of tasks is now redundant since we wipe out the whole "/srv" directory, where the DB is stored.

@ademidoff
Copy link
Copy Markdown
Member Author

@pmm-bot build all

@ademidoff
Copy link
Copy Markdown
Member Author

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.

1 participant