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 142 commits into
base: v3
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
142 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
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,6 @@ api-tests/pmm-api-tests-output.txt
api-tests/pmm-api-tests-junit-report.xml

packer.log

# Goreleaser
dist/
3 changes: 0 additions & 3 deletions Makefile.devcontainer
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ run-qan: release-qan

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
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
1 change: 1 addition & 0 deletions build/ansible/roles/pmm-images/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
- percona-qan-api2
- percona-dashboards
- pmm-managed
- pmm-ui
- pmm-update
- pmm-dump
- vmproxy
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"]
21 changes: 14 additions & 7 deletions build/docker/rpmbuild/Dockerfile.el9
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,28 @@ RUN yum install -y gcc gcc-c++ \
automake autoconf \
rpmdevtools createrepo_c epel-release \
bison yum-utils rpm-build \
tree \
jq \
rsync \
wget && \
yum install -y --enablerepo=ol9_codeready_builder glibc-static && \
yum clean all && rm -rf /var/cache/yum
yum install -y --enablerepo=ol9_codeready_builder glibc-static

# keep that format for easier search
ENV GO_VERSION 1.23.2
ENV GO_RELEASER_VERSION 1.24.0
ARG GO_VERSION
ENV GO_VERSION=${GO_VERSION:-1.23.2}
ENV GO_RELEASER_VERSION=2.4.1
ENV NODE_OPTIONS=--max_old_space_size=8000

RUN if [ `uname -i` == "x86_64" ]; then ARCH=amd64; else ARCH=arm64; fi && \
curl -fSsL -o /tmp/golang.tar.gz https://dl.google.com/go/go${GO_VERSION}.linux-${ARCH}.tar.gz && \
curl -fSsL -o /tmp/goreleaser.rpm https://github.com/goreleaser/goreleaser/releases/download/v${GO_RELEASER_VERSION}/goreleaser-${GO_RELEASER_VERSION}-1.`uname -i`.rpm && \
tar -C /usr/local -xzf /tmp/golang.tar.gz && \
yum install -y /tmp/goreleaser.rpm && \
rm /tmp/golang.tar.gz /tmp/goreleaser.rpm
yum install -y --disablerepo="*" /tmp/goreleaser.rpm && \
rm /tmp/golang.tar.gz /tmp/goreleaser.rpm && \
curl -o /usr/bin/yq -fSsL https://github.com/mikefarah/yq/releases/latest/download/yq_linux_${ARCH} && \
chmod +x /usr/bin/yq && \
yum clean all && rm -rf /var/cache/yum


RUN update-alternatives --install "/usr/bin/go" "go" "/usr/local/go/bin/go" 0
RUN update-alternatives --set go /usr/local/go/bin/go
Expand All @@ -47,7 +54,7 @@ RUN useradd builder -u 1000 -m -G users,wheel && \
echo "builder ALL=(ALL:ALL) NOPASSWD:ALL" >> /etc/sudoers && \
echo "# macros" > /home/builder/.rpmmacros && \
echo "%_topdir /home/builder/rpm" >> /home/builder/.rpmmacros && \
mkdir /home/builder/rpm && \
mkdir -p /home/builder/rpm /home/builder/.cache/go-build /home/builder/go/pkg/mod && \
chmod 755 /home/builder && \
chown -R builder:builder /home/builder

Expand Down
2 changes: 2 additions & 0 deletions build/docker/server/Dockerfile.el9
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ LABEL org.opencontainers.image.licenses=AGPL-3.0
LABEL org.opencontainers.image.title="Percona Monitoring and Management"
LABEL org.opencontainers.image.vendor="Percona LLC"
LABEL org.opencontainers.image.version=${VERSION}
LABEL org.opencontainers.image.source=https://github.com/percona/pmm/blob/main/build/docker/server/Dockerfile.el9
LABEL org.opencontainers.image.docs=https://docs.percona.com/percona-monitoring-and-management/setting-up/server/docker.html

USER pmm

Expand Down
Loading
Loading