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-13487 Ability to build PMM locally #3299

Draft
wants to merge 214 commits into
base: v3
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 193 commits
Commits
Show all changes
214 commits
Select commit Hold shift + click to select a range
1ef83f3
PMM-12899 Use module and build cache
ademidoff Mar 21, 2024
32c8fa8
PMM-12899 update grafana spec
ademidoff Mar 21, 2024
37e005a
PMM-12899 fix the build_command
ademidoff Mar 21, 2024
c863f50
PMM-12899 fix builddeps
ademidoff Mar 21, 2024
853be6e
PMM-12899 use rpmbuild:3
ademidoff Mar 21, 2024
d57ec55
PMM-12641 Fix the dashboard upgrade (#2926)
ademidoff Mar 26, 2024
5c7821f
PMM-12899 prevent grafana from using own GOPATH
ademidoff Mar 31, 2024
42a02a9
PMM-12899 use a dedicated folder for yarn cache
ademidoff Mar 31, 2024
6d0b02b
PMM-12899 extract server rpm script
ademidoff Apr 1, 2024
0a32c59
Merge branch 'v3' into PMM-12899-use-module-and-build-cache
ademidoff Apr 1, 2024
098e894
PMM-12899 fix server param evaluation
ademidoff Apr 1, 2024
c80fe45
Merge branch 'PMM-12899-use-module-and-build-cache' of github.com:per…
ademidoff Apr 1, 2024
aa5729f
PMM-12899 clean up server RPM specs
ademidoff Apr 1, 2024
aa5e8b8
PMM-12899 fix directory permissions
ademidoff Apr 1, 2024
ee45fd6
PMM-12899 remove unnecessary macro
ademidoff Apr 1, 2024
afde65a
PMM-12899 revert QAN package name
ademidoff Apr 1, 2024
f28cbcc
PMM-12899 merge update.sh to build.sh
ademidoff Apr 2, 2024
66dc390
Merge branch 'v3' into PMM-12899-use-module-and-build-cache
ademidoff Apr 2, 2024
093179a
PMM-12899 reorganize the script structure
ademidoff Apr 2, 2024
12fd453
PMM-12899 get rid of `exit 0` in callee scripts
ademidoff Apr 2, 2024
9587f21
PMM-12899 clean up pmm-update.spec
ademidoff Apr 2, 2024
13b4f65
PMM-12899 send exec time to the log file
ademidoff Apr 2, 2024
6f9eac8
PMM-12899 remove a redundant directory
ademidoff Apr 2, 2024
3eb50f8
PMM-12899 add total exec time
ademidoff Apr 2, 2024
36869b7
PMM-12899 reorg some variables
ademidoff Apr 2, 2024
bf640ca
PMM-12899 fix the regexp
ademidoff Apr 3, 2024
f28202a
PMM-12899 structure the code
ademidoff Apr 3, 2024
a0f7b50
PMM-12899 add a flag to skip building server docker
ademidoff Apr 3, 2024
988cfb0
PMM-12899 fix a failure of find when no files are found
ademidoff Apr 3, 2024
8216d65
Merge branch 'v3' into PMM-12899-use-module-and-build-cache
ademidoff Apr 3, 2024
d2c4ecb
Merge branch 'v3' into PMM-12899-use-module-and-build-cache
ademidoff Apr 6, 2024
0582998
PMM-12899 update the documentation
ademidoff Apr 10, 2024
0e0bde7
Merge branch 'v3' into PMM-12899-use-module-and-build-cache
ademidoff Apr 16, 2024
ccf3bf0
Merge branch 'v3' into PMM-12899-use-module-and-build-cache
ademidoff Jul 14, 2024
ea42fe7
PMM-12899 update README.md
ademidoff Oct 12, 2024
87cc6a2
Merge branch 'v3' into PMM-12899-use-module-and-build-cache
ademidoff Oct 12, 2024
fc248de
PMM-12899 fix duplicate labels in Dockerfile
ademidoff Oct 12, 2024
4b469bd
PMM-12899 add a config file for all PMM components
ademidoff Oct 14, 2024
6d590ce
Merge branch 'v3' into PMM-12899-use-module-and-build-cache
ademidoff Oct 19, 2024
f35a85f
PMM-12899 simplify init, add usage
ademidoff Oct 19, 2024
1aad3f7
PMM-12899 fix architecture for the client
ademidoff Oct 19, 2024
23aaaf6
PMM-12899 fix the build time for MacOS
ademidoff Oct 19, 2024
c2357c5
PMM-12899 fix git commit variable
ademidoff Oct 20, 2024
7925079
PMM-12899 don't use S3 cache for local builds
ademidoff Oct 20, 2024
1d8fe37
PMM-12899 dont chown with an id external to the container
ademidoff Nov 1, 2024
48d481f
PMM-12899 refactor the log output
ademidoff Nov 1, 2024
dd2779a
Merge branch 'v3' into PMM-12899-use-module-and-build-cache
ademidoff Nov 1, 2024
e8e3f0f
PMM-12899 don't chown with builder id outside of container
ademidoff Nov 1, 2024
01427fc
Merge branch 'PMM-12899-use-module-and-build-cache' of github.com:per…
ademidoff Nov 1, 2024
344b783
PMM-12899 add aarch to grafana.spec
ademidoff Nov 1, 2024
7aa9a30
PMM-12899 add aarch64 to grafana.spec
ademidoff Nov 1, 2024
f28ecde
PMM-12899 add the platform
ademidoff Nov 1, 2024
87d75a7
PMM-12899 use docker volumes for caching
ademidoff Nov 1, 2024
15d9344
PMM-12899 exit if the spec cannot be found
ademidoff Nov 1, 2024
5a8f6e4
PMM-12899 fix yarn cache
ademidoff Nov 1, 2024
e326d94
PMM-12899 fix the platform
ademidoff Nov 1, 2024
9010f42
PMM-12899 chown the cache dirs before starting
ademidoff Nov 1, 2024
0ff180f
PMM-12899 remove GOARCH setting
ademidoff Nov 1, 2024
c9d8e35
PMM-12899 add --platform to --help
ademidoff Nov 1, 2024
46c8934
PMM-12899 do not upload to S3 when building locally
ademidoff Nov 1, 2024
10ea625
PMM-12899 fix a typo
ademidoff Nov 1, 2024
891a2f0
PMM-12899 clean up scripts
ademidoff Nov 3, 2024
b193355
PMM-12899 revert changes to grafana.spec
ademidoff Nov 4, 2024
53de284
PMM-12899 revert changes to grafana.spec
ademidoff Nov 4, 2024
a7ebc00
PMM-12899 update goreleaser to latest
ademidoff Nov 4, 2024
6ea7125
PMM-12899 use a different Go version for grafana
ademidoff Nov 4, 2024
f3b7ece
PMM-12899 fix copying ansible files
ademidoff Nov 4, 2024
3293ab5
PMM-12899 fix copying Dockerfile
ademidoff Nov 4, 2024
d501abc
PMM-12899 fix legacy Docker label format
ademidoff Nov 4, 2024
15be815
PMM-12899 do not use the repo subpaths for mutations
ademidoff Nov 4, 2024
eeccd8a
PMM-12899 use a dedicated spec directory
ademidoff Nov 4, 2024
8c8bf03
PMM-12899 fix the spec directory evaluation
ademidoff Nov 4, 2024
4aa5012
PMM-12899 create rpms directories first
ademidoff Nov 4, 2024
eaaeaf2
PMM-12899 fix find syntax
ademidoff Nov 4, 2024
2325c53
PMM-12899 fix find syntax to search for both files and dirs
ademidoff Nov 4, 2024
dc6cadd
PMM-12899 revert changes made to grafana.spec
ademidoff Nov 5, 2024
2819fc9
PMM-12899 try not to use cache for grafana
ademidoff Nov 5, 2024
cd0df5c
PMM-12899 try not to use cache for grafana
ademidoff Nov 5, 2024
f5dc745
PMM-12899 fix the cache directory not being writable
ademidoff Nov 5, 2024
a28edba
PMM-12899 use no Go cache for grafana
ademidoff Nov 5, 2024
44fc04b
PMM-12899 use no Go cache for grafana
ademidoff Nov 5, 2024
e1fbeca
PMM-12899 remove docker tarballs
ademidoff Nov 5, 2024
c94b549
PMM-12899 add --client-only parameter
ademidoff Nov 5, 2024
687d3b6
Merge branch 'v3' into PMM-12899-use-module-and-build-cache
ademidoff Nov 5, 2024
8944ef5
PMM-12899 rename build.sh to build
ademidoff Nov 5, 2024
69899db
PMM-12899 purge more files before starting
ademidoff Nov 5, 2024
a8756ab
PMM-12899 pass NO_VCS parameter to go build
ademidoff Nov 5, 2024
be7405e
PMM-12899 add dist directory to .gitignore
ademidoff Nov 5, 2024
93d5d7c
PMM-12899 create cache directories in rpmbuild
ademidoff Nov 5, 2024
45fd300
PMM-12899 fix "build_command" extrapolation
ademidoff Nov 5, 2024
ce911e1
PMM-12899 major code cleanup, remove redundancies
ademidoff Nov 6, 2024
8eb2600
PMM-12899 fix the build logic
ademidoff Nov 6, 2024
b9e05a5
PMM-12899 refactor the directory structure
ademidoff Nov 6, 2024
170d53c
PMM-12899 fix the cd syntax
ademidoff Nov 6, 2024
8f95477
PMM-12899 fix the build_command syntax
ademidoff Nov 6, 2024
0f37c72
PMM-12899 fix the build_command syntax
ademidoff Nov 6, 2024
95f74ca
PMM-12899 fix the build_command syntax
ademidoff Nov 6, 2024
418e2fa
PMM-12899 fix the build_command syntax
ademidoff Nov 6, 2024
7d28db4
PMM-12899 fix the build_command syntax
ademidoff Nov 6, 2024
c8b3075
PMM-12899 fix the build_command syntax
ademidoff Nov 6, 2024
13a2dab
PMM-12899 rename tmp_dir to build_dir
ademidoff Nov 7, 2024
96296c8
PMM-12899 refactor server rpm caching
ademidoff Nov 7, 2024
b5f6a58
PMM-12899 fix the architecture detection
ademidoff Nov 7, 2024
9232350
PMM-12899 use short commit for FB docker tags
ademidoff Nov 7, 2024
b170e71
PMM-13487 clean up rpm specs
ademidoff Nov 8, 2024
958b818
PMM-13487 promote the use of build_dir
ademidoff Nov 8, 2024
65ab5f5
PMM-13487 rename image from users to base
ademidoff Nov 8, 2024
5617382
PMM-13487 refactor check_files
ademidoff Nov 9, 2024
8863854
PMM-13487 simplify build_client_binary
ademidoff Nov 10, 2024
85c58a3
PMM-13487 avoid creating duplicate client archives
ademidoff Nov 10, 2024
47bd176
PMM-13487 simplify build_client_packages
ademidoff Nov 10, 2024
6f17fad
PMM-13487 fix finding tarball in get_tar
ademidoff Nov 10, 2024
c39179c
PMM-13487 simplify build-client-packages
ademidoff Nov 10, 2024
5015275
Merge branch 'v3' into PMM-13487-build-pmm-locally
ademidoff Nov 10, 2024
61b9bc4
PMM-13487 revert back to sources dir
ademidoff Nov 10, 2024
651092a
PMM-13487 update README
ademidoff Nov 11, 2024
3016c0d
PMM-13487 consistency fixes in install_tarball
ademidoff Nov 11, 2024
5200859
PMM-13487 fix nomad builds
ademidoff Nov 12, 2024
4cdea41
PMM-13487 Install jq and yq into rpmbuild
ademidoff Nov 12, 2024
b24820c
PMM-13487 Bump up gimme
ademidoff Nov 13, 2024
56c7d11
PMM-13487 Do not require yq
ademidoff Nov 13, 2024
829f652
PMM-13487 clean yum once all packages are installed
ademidoff Nov 13, 2024
bdecc73
Merge branch 'v3' into PMM-13487-build-pmm-locally
ademidoff Nov 13, 2024
ed87c67
PMM-13487 fix the platform for nomad
ademidoff Nov 13, 2024
031d5dd
PMM-13487 install tree package required by nomad
ademidoff Nov 13, 2024
c2d3af9
PMM-13487 fix the bin_dir path for nomad
ademidoff Nov 14, 2024
52e8c94
PMM-13487 combine srpm with rpm pkgs
ademidoff Nov 14, 2024
e82ec43
PMM-13487 Deprecate RPM_EPOCH for server RPMs
ademidoff Nov 15, 2024
ecf0216
PMM-13487 Refactor and clean up build-client-packages
ademidoff Nov 16, 2024
eaee27a
PMM-13487 Remove debian:buster docker image
ademidoff Nov 17, 2024
510f1c3
PMM-13487 Bump up pip dependencies
ademidoff Nov 17, 2024
107999e
PMM-13487 Remove the commented code
ademidoff Nov 17, 2024
9184473
PMM-13487 Add pmm-ui.spec
ademidoff Nov 21, 2024
5174e3f
PMM-13487 FIx the BUILD_DATE for Mac
ademidoff Nov 21, 2024
c71328c
PMM-13487 Fix the boolean logic
ademidoff Nov 21, 2024
12dfdf1
PMM-13487 Add pmm-ui to the list of installed rpm packages
ademidoff Nov 21, 2024
cbe9406
Merge branch 'v3' into PMM-13487-build-pmm-locally
ademidoff Nov 21, 2024
1454a6d
PMM-13487 Do not run builddep on dashboars
ademidoff Nov 21, 2024
9073099
PMM-13487 Cache pmm-ui as well
ademidoff Nov 21, 2024
db2904d
PMM-13487 Do not warn about missing build IDs
ademidoff Nov 21, 2024
0ba4b93
PMM-13487 Fix path to pmm-ui
ademidoff Nov 21, 2024
7823542
PMM-13487 Use full_commit for the hash as well
ademidoff Nov 22, 2024
6c5114e
PMM-13487 Minor refactor
ademidoff Nov 27, 2024
9cbcfba
PMM-13487 Move the workflow to pmm from pmm-submodules
ademidoff Nov 28, 2024
583b527
PMM-13487 Add the --init command
ademidoff Nov 28, 2024
b26f4cc
PMM-13487 Add prerequisite checks
ademidoff Nov 28, 2024
c1d0de5
PMM-13487 Create cache directories at image build time
ademidoff Nov 29, 2024
242dba7
PMM-13487 Move volume checks to the main script
ademidoff Nov 30, 2024
ca80750
PMM-13487 Do not build rpm sources for server
ademidoff Nov 30, 2024
cb75e46
PMM-13487 Pretty print the execution time
ademidoff Nov 30, 2024
34a22e5
Merge branch 'v3' into PMM-13487-build-pmm-locally
ademidoff Nov 30, 2024
7df0b44
PMM-13487 Use set_options everywhere
ademidoff Nov 30, 2024
28e1d2c
PMM-13487 Remove redundant export in the specs
ademidoff Nov 30, 2024
5af5e59
PMM-13487 Remove PUSH_DOCKER
ademidoff Dec 1, 2024
34c0a19
PMM-13487 Fix parsing params
ademidoff Dec 1, 2024
a414704
PMM-13487 Rename percona-qan-api2 to pmm-qan-api
ademidoff Dec 1, 2024
8186aef
PMM-13487 Clean up global vars
ademidoff Dec 1, 2024
6f7f957
PMM-13487 Fix set_options in build-client-packages
ademidoff Dec 1, 2024
21910eb
PMM-13487 Fix passing pmm_release to the client script
ademidoff Dec 1, 2024
95fe536
PMM-13487 Do not sed the release attr in Server RPMs
ademidoff Dec 1, 2024
d9a4e09
PMM-13487 Set FORCE_COLOR to 0 in grafana.spec
ademidoff Dec 1, 2024
d8f0268
PMM-13487 Rename percona-victoriametrics to pmm-victoriametrics
ademidoff Dec 1, 2024
9b614bb
PMM-13487 Update readme
ademidoff Dec 2, 2024
790c21a
PMM-13487 Update readme
ademidoff Dec 2, 2024
83b3444
PMM-13487 Rename vmproxy to pmm-vmproxy
ademidoff Dec 2, 2024
657843c
PMM-13487 Remove redundant variables from Dockerfile
ademidoff Dec 2, 2024
72e8609
PMM-13487 Install pip and modules for working with yaml and git
ademidoff Dec 2, 2024
69f1fcc
PMM-13487 Clean up rpmbuild Dockerfile
ademidoff Dec 3, 2024
9ef7aa3
PMM-13487 Get rid of `jq` prerequisite
ademidoff Dec 3, 2024
3c7479e
PMM-13487 Update support matrix
ademidoff Dec 4, 2024
69b4ba8
PMM-13487 Remove client tarball from docker context dir
ademidoff Dec 4, 2024
8800e17
PMM-13487 Replace LOCAL_BUILD with USE_S3_CACHE var
ademidoff Dec 5, 2024
4c8ebe5
PMM-13487 Set xtrace option in the var file
ademidoff Dec 5, 2024
430dfb1
PMM-13487 Fix copying from the docker dir
ademidoff Dec 5, 2024
e3295b1
PMM-13487 Update the caching logic
ademidoff Dec 6, 2024
c1fa2a2
PMM-13487 Use ECR for non-local builds
ademidoff Dec 6, 2024
7bbb980
PMM-13487 Do not hardcode the directory path to pmm repo
ademidoff Dec 6, 2024
51e1432
PMM-13487 Log debug messages by default when in CI env
ademidoff Dec 6, 2024
f4a42d1
PMM-13487 Provide an rpmbuild docker image in the main script
ademidoff Dec 6, 2024
55d3bef
PMM-13487 Migrate to ansible dnf module
ademidoff Dec 6, 2024
cfb0b8b
PMM-13487 Fix the rpm cache path
ademidoff Dec 6, 2024
581341c
PMM-13487 Fix indentation
ademidoff Dec 6, 2024
2faef9c
PMM-13487 Move entrypoint to build/local
ademidoff Dec 6, 2024
7ce5466
PMM-13487 Upload the client tarball to s3
ademidoff Dec 7, 2024
eec75e1
PMM-13487 Fix a typo
ademidoff Dec 7, 2024
1d77ef1
PMM-13487 Use native submodule api, not grep
ademidoff Dec 7, 2024
1944317
PMM-13487 Purge the binary folder as well
ademidoff Dec 7, 2024
6d35e2d
PMM-13487 Require the HEAD to be a feature branch
ademidoff Dec 7, 2024
f4f48d0
PMM-13487 Construct docker tags for feature builds
ademidoff Dec 7, 2024
1d86080
PMM-13487 Emit no EOL to docker tags
ademidoff Dec 7, 2024
a0044ac
PMM-13487 Create ci.yml if it doesn't exist
ademidoff Dec 8, 2024
37dc2c7
PMM-13487 Find the branch in all submodules
ademidoff Dec 9, 2024
a2fa2a0
PMM-13487 Exit on missing prereq
ademidoff Dec 9, 2024
53828de
PMM-13487 Update README
ademidoff Dec 9, 2024
d75b6f6
PMM-13487 Refactor the entrypoint
ademidoff Dec 10, 2024
da2cc77
PMM-13487 Fix the use of shasum binary
ademidoff Dec 10, 2024
d5cf4db
PMM-13487 Fix the use of shasum binary
ademidoff Dec 10, 2024
49b9319
PMM-13487 Move rewinding branches to the entrypoint
ademidoff Dec 14, 2024
bfda007
PMM-13487 Package build.json with the docker image
ademidoff Dec 14, 2024
040c579
PMM-13487 Update README
ademidoff Dec 15, 2024
22c3dd8
PMM-13487 Fix the branch detection from ci.yml
ademidoff Dec 15, 2024
a6e7c04
PMM-13487 Cut out .git from URLs
ademidoff Dec 15, 2024
45f6d23
PMM-13487 Reorganize and clean up the scripts
ademidoff Dec 15, 2024
be3b1cd
PMM-13487 Implement --clean parameter
ademidoff Dec 15, 2024
fb2045b
PMM-13487 Adjust echos
ademidoff Dec 16, 2024
c9df906
Merge branch 'v3' into PMM-13487-build-pmm-locally
ademidoff Dec 18, 2024
34c8c04
PMM-13487 Optimize the image size
ademidoff Dec 21, 2024
471d1dd
Merge branch 'PMM-13487-build-pmm-locally' of github.com:percona/pmm …
ademidoff Dec 21, 2024
f710bf1
PMM-13487 Fix var parsing issue
ademidoff Dec 21, 2024
a8d09e4
PMM-13487 Fix Dockerfile copy command
ademidoff Dec 21, 2024
b9f5b3c
PMM-13487 Update rpmbuild Dockerfile
ademidoff Dec 21, 2024
009e756
PMM-13487 Use a mounted dnf cache directory
ademidoff Dec 21, 2024
dde0bbe
PMM-13487 Don't remove the mounted client tarball
ademidoff Dec 21, 2024
9b1350a
PMM-13487 Update readme, add incompatible Docker Desktop versions
ademidoff Dec 21, 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
2 changes: 1 addition & 1 deletion .devcontainer/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def install_go():
"""Installs Go toolchain."""

run_commands([
"curl -sS https://raw.githubusercontent.com/travis-ci/gimme/v1.5.5/gimme -o /usr/local/bin/gimme",
"curl -sS https://raw.githubusercontent.com/travis-ci/gimme/v1.5.6/gimme -o /usr/local/bin/gimme",
"chmod +x /usr/local/bin/gimme"
])

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ jobs:
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_TOKEN_PMM_CI }}
SLACK_CHANNEL: "pmm-ci"
SLACK_USERNAME: "PR pipelines bot"
SLACK_ICON_EMOJI: ":chestnut:"
SLACK_USERNAME: "Build bot"
SLACK_ICON_EMOJI: ":octocat:"
SLACK_COLOR: "#00FF00"
SLACK_TITLE: "Finished ${{ github.event.repository.name }} workflow"
SLACK_MESSAGE: "${{ github.event.inputs.repo || github.repository }}:${{ github.event.inputs.branch || github.head_ref }}"
Expand All @@ -179,8 +179,8 @@ jobs:
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_TOKEN_PMM_CI }}
SLACK_CHANNEL: "pmm-ci"
SLACK_USERNAME: "PR pipelines bot"
SLACK_ICON_EMOJI: ":chestnut:"
SLACK_USERNAME: "Build bot"
SLACK_ICON_EMOJI: ":octocat:"
SLACK_COLOR: "#FF0000"
SLACK_TITLE: "Finished ${{ github.event.repository.name }} workflow"
SLACK_MESSAGE: "Workflow failed: ${{ github.event.inputs.repo || github.repository }}:${{ github.event.inputs.branch || github.head_ref }}"
Expand Down
54 changes: 25 additions & 29 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,46 +1,42 @@
/.idea/
/.vscode/
*.iml

/api/nginx/*.pem
bin/
.idea/
.vscode/
*.sw[o,p]

# System Files
.DS_Store

cover.out
crosscover.out
# development
.modules/
bin/
dist/
.env
.netrc
pmm-agent-dev.yaml
compose.yml
ci.yml
sbom.json
*.log

agent/testdata/
api/nginx/*.pem
api-tests/pmm-api-tests-output.txt
api-tests/pmm-api-tests-junit-report.xml

agent/testdata/
agent/agents/mysql/slowlog/parser/corpus/
agent/agents/mysql/slowlog/parser/crashers/
agent/agents/mysql/slowlog/parser/suppressions/
agent/agents/mysql/slowlog/parser/parser-fuzz.zip

update/*.runcover.out
update/*.test

fuzzing/
*-fuzz.zip
*.bench

backoff.png
pmm-agent-dev.yaml
compose.yml

/qan-api2/logs/

# ViM temporary files
*.sw[o,p]

.env
.netrc

cli-tests/node_modules/
cli-tests/playwright-report/

api-tests/pmm-api-tests-output.txt
api-tests/pmm-api-tests-junit-report.xml
qan-api2/logs/

packer.log
cover.out
crosscover.out

fuzzing/
*-fuzz.zip
*.bench
5 changes: 1 addition & 4 deletions Makefile.devcontainer
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,12 @@ run-vmproxy: release-vmproxy

run-qan: release-qan
supervisorctl stop qan-api2
cp $(PMM_RELEASE_PATH)/qan-api2 /usr/sbin/percona-qan-api2
cp $(PMM_RELEASE_PATH)/qan-api2 /usr/sbin/pmm-qan-api
echo -n > /srv/logs/qan-api2.log
supervisorctl start qan-api2

run-all: run-agent run-managed ## Run pmm-managed and pmm-agent

run: ## Deprecated
echo "Deprecated: please use run-all"

# TODO https://jira.percona.com/browse/PMM-3484, see maincover_test.go
# run-race-cover: install-race ## Run pmm-managed with race detector and collect coverage information.
# go test -coverpkg="github.com/percona/pmm/managed/..." \
Expand Down
13 changes: 9 additions & 4 deletions Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ gen: clean ## Generate files
make -C admin gen
make -C managed gen

make gen-mocks ## Generate mocks
make gen-mocks

make format
make format ## TODO: One formatting run is not enough, figure out why.
go install -v ./...

clean: ## Remove generated files
clean: ## Remove generated files
make -C api clean

gen-mocks:
gen-mocks: ## Generate mocks
find . -name mock_*.go -delete
./bin/mockery --config .mockery.yaml

Expand All @@ -55,7 +55,7 @@ check: ## Run required checkers and linters
bin/go-sumtype ./...
bin/go-consistent -pedantic ./...

check-license: ## Run license header checks against source files
check-license: ## Run license header checks against source files
bin/license-eye -c .licenserc.yaml header check

check-all: check-license check ## Run golangci linter to check for changes against main
Expand All @@ -69,5 +69,10 @@ format: ## Format source code
bin/goimports -local github.com/percona/pmm -l -w $(FILES)
bin/gci write --section Standard --section Default --section "Prefix(github.com/percona/pmm)" $(FILES)

tidy: ## Tidy up the go mod files
@echo "==> Tidy up submodules"
@go mod tidy
@cd tools && go mod tidy

serve: ## Serve API documentation with nginx
nginx -p . -c api/nginx/nginx.conf
8 changes: 6 additions & 2 deletions admin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ PMM_RELEASE_VERSION ?= $(shell git describe --always --dirty | cut -b2-)
PMM_RELEASE_TIMESTAMP ?= $(shell date '+%s')
PMM_RELEASE_FULLCOMMIT ?= $(shell git rev-parse HEAD)
PMM_RELEASE_BRANCH ?= $(shell git describe --always --contains --all)

ifdef NO_VCS
NO_VCS = -buildvcs=false
endif
ifeq ($(GOBIN),)
GOBIN := $(shell go env GOPATH)/bin
endif
Expand All @@ -31,8 +35,8 @@ clean: ## Remove generated files
find . -name *_reform.go -delete

release: ## Build pmm-admin release binary
env CGO_ENABLED=0 go build -v $(LD_FLAGS) -o $(PMM_RELEASE_PATH)/pmm-admin ./cmd/pmm-admin/
env CGO_ENABLED=0 go build -v $(LD_FLAGS) -o $(PMM_RELEASE_PATH)/pmm ./cmd/pmm/
env CGO_ENABLED=0 go build -v $(NO_VCS) $(LD_FLAGS) -o $(PMM_RELEASE_PATH)/pmm-admin ./cmd/pmm-admin/
env CGO_ENABLED=0 go build -v $(NO_VCS) $(LD_FLAGS) -o $(PMM_RELEASE_PATH)/pmm ./cmd/pmm/

install: ## Install pmm & pmm-admin binary
go build -v $(LD_FLAGS) -o $(GOBIN)/pmm-admin ./cmd/pmm-admin/
Expand Down
10 changes: 7 additions & 3 deletions agent/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ PMM_RELEASE_VERSION ?= $(shell git describe --always --dirty | cut -b2-)
PMM_RELEASE_TIMESTAMP ?= $(shell date '+%s')
PMM_RELEASE_FULLCOMMIT ?= $(shell git rev-parse HEAD)
PMM_RELEASE_BRANCH ?= $(shell git describe --always --contains --all)
PMM_DEV_SERVER_PORT ?= 443
PMM_DEV_SERVER_PORT ?= 8443

ifdef NO_VCS
NO_VCS = -buildvcs=false
endif
ifeq ($(GOBIN),)
GOBIN := $(shell go env GOPATH)/bin
endif
Expand All @@ -25,8 +29,8 @@ VERSION_FLAGS = -X 'github.com/percona/pmm/version.ProjectName=pmm-agent' \
-X 'github.com/percona/pmm/version.Branch=$(PMM_RELEASE_BRANCH)'

release: ## Build static pmm-agent release binary (Linux only)
env CGO_ENABLED=1 go build -v -ldflags "-extldflags '-static' $(VERSION_FLAGS)" -tags 'osusergo netgo static_build' -o $(PMM_RELEASE_PATH)/pmm-agent
go build -v -ldflags "-extldflags '-static' $(VERSION_FLAGS)" -tags 'osusergo netgo static_build' -o $(PMM_RELEASE_PATH)/pmm-agent-entrypoint ./cmd/pmm-agent-entrypoint
env CGO_ENABLED=1 go build -v $(NO_VCS) -ldflags "-extldflags '-static' $(VERSION_FLAGS)" -tags 'osusergo netgo static_build' -o $(PMM_RELEASE_PATH)/pmm-agent
go build -v $(NO_VCS) -ldflags "-extldflags '-static' $(VERSION_FLAGS)" -tags 'osusergo netgo static_build' -o $(PMM_RELEASE_PATH)/pmm-agent-entrypoint ./cmd/pmm-agent-entrypoint
$(PMM_RELEASE_PATH)/pmm-agent --version
ldd $(PMM_RELEASE_PATH)/pmm-agent 2>&1 | grep -Fq 'not a dynamic executable'

Expand Down
1 change: 1 addition & 0 deletions build.sh
3 changes: 1 addition & 2 deletions build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ export CENTOS_ISO := 2004.01
fetch:
mkdir -p ${PACKER_CACHE_DIR}/box
test -f ${PACKER_CACHE_DIR}/id_rsa_vagrant \
|| curl -L https://raw.githubusercontent.com/hashicorp/vagrant/master/keys/vagrant \
-o ${PACKER_CACHE_DIR}/id_rsa_vagrant
|| curl -L https://raw.githubusercontent.com/hashicorp/vagrant/master/keys/vagrant -o ${PACKER_CACHE_DIR}/id_rsa_vagrant
chmod 600 ${PACKER_CACHE_DIR}/id_rsa_vagrant

# Add the box using Vagrant
Expand Down
7 changes: 4 additions & 3 deletions build/ansible/roles/pmm-images/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,14 @@
yum:
name:
- percona-grafana
- percona-victoriametrics
- percona-qan-api2
- percona-dashboards
- pmm-victoriametrics
- pmm-qan-api
- pmm-managed
- pmm-ui
- pmm-update
- pmm-dump
- vmproxy
- pmm-vmproxy
state: installed
enablerepo: local

Expand Down
60 changes: 0 additions & 60 deletions build/docker/client/Dockerfile

This file was deleted.

62 changes: 62 additions & 0 deletions build/docker/client/Dockerfile.el9
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
FROM redhat/ubi9-minimal AS base

RUN microdnf install shadow-utils jq tar -y

RUN groupadd -g 1002 pmm-agent && \
useradd -u 1002 -r -g pmm-agent -s /sbin/nologin \
-d /usr/local/percona/pmm \
-c "PMM 3.x Client User" pmm-agent

FROM redhat/ubi9-micro

ARG VERSION
ARG BUILD_DATE

COPY LICENSE /licenses/
COPY --from=base --chown=0:0 /etc/passwd /etc/passwd
COPY --from=base --chown=0:0 /etc/group /etc/group

# Install jq along with its dependencies
COPY --from=base --chown=0:0 /usr/bin/jq /usr/bin/
COPY --from=base --chown=0:0 /usr/bin/tar /usr/bin/
COPY --from=base --chown=0:0 /usr/bin/curl /usr/bin/

COPY --from=base --chown=0:0 /usr/lib64/libjq.so.1.0.4 /lib64/libjq.so.1
COPY --from=base --chown=0:0 /usr/lib64/libonig.so.5.1.0 /lib64/libonig.so.5

# Dependencies of curl
COPY --from=base --chown=0:0 /usr/lib64/libkeyutils.so* /lib64/
COPY --from=base --chown=0:0 /usr/lib64/libz.so* /lib64/
COPY --from=base --chown=0:0 /usr/lib64/libkrb5support.so* /lib64/
COPY --from=base --chown=0:0 /usr/lib64/libkrb5.so* /lib64/
COPY --from=base --chown=0:0 /usr/lib64/libk5crypto.so* /lib64/
COPY --from=base --chown=0:0 /usr/lib64/libgssapi_krb5.so* /lib64/
COPY --from=base --chown=0:0 /usr/lib64/libcom_err.so* /lib64/
COPY --from=base --chown=0:0 /usr/lib64/libssl.so* /lib64/
COPY --from=base --chown=0:0 /usr/lib64/libcrypto.so* /lib64/
COPY --from=base --chown=0:0 /usr/lib64/libcurl.so* /lib64/
COPY --from=base --chown=0:0 /usr/lib64/libnghttp2.so* /lib64/
COPY --from=base --chown=0:0 /usr/lib64/libresolv.so* /lib64/

RUN install -d -o pmm-agent -g pmm-agent -m 0775 /usr/local/percona/pmm

ADD pmm-client.tar.gz /tmp/

RUN cd /tmp/pmm-client-* \
&& PMM_USER=pmm-agent PMM_GROUP=root ./install_tarball \
&& cd /tmp \
&& rm -rf /tmp/pmm-client*

LABEL org.opencontainers.image.created=${BUILD_DATE}
LABEL org.opencontainers.image.licenses=Apache-2.0
LABEL org.opencontainers.image.title="Percona Monitoring and Management Client"
LABEL org.opencontainers.image.vendor=Percona
LABEL org.opencontainers.image.version=${VERSION}
LABEL org.opencontainers.image.source=https://github.com/percona/pmm/blob/main/build/docker/client/Dockerfile
LABEL org.opencontainers.image.docs=https://docs.percona.com/percona-monitoring-and-management/setting-up/client/index.html#docker

USER pmm-agent
WORKDIR /usr/local/percona/pmm/
ENV PATH=/usr/local/percona/pmm/bin/:$PATH

ENTRYPOINT ["/usr/local/percona/pmm/bin/pmm-agent-entrypoint"]
Loading
Loading