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-10900: custom image and option to run pmm with external clickhouse #1314

Merged
merged 5 commits into from
Oct 19, 2022

Conversation

ritbl
Copy link
Contributor

@ritbl ritbl commented Oct 18, 2022

PMM-10900

Fully backward-compatible way to allow developers to override used Devcontainer and option to use external ClickHouse DB

@@ -2,28 2,40 @@

include Makefile.include

ifeq ($(PROFILES),)
PROFILES := 'pmm'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

by default run as it runs now

hostname: ${CH_HOSTNAME:-ch}
ports:
- ${CH_PORT:-9500}:9500
pmm-managed-server-ch:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ch and pmm-managed-server-ch will be used when develop runs container the following way:

PROFILES=pmm-ch make env-up

- root-cache:/root/.cache

# PMM with external ClickHouse DB
ch:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

use external ClickHouse (force AMD64), as DBaaS fails (in arm64 builds, amd64 works fine) with one that is running in container.

release-dev:
go build -race -gcflags="all=-N -l" -v $(PMM_LD_FLAGS) -o $(PMM_RELEASE_PATH)/ ./cmd/...
@if [ $(ARCH) = "aarch64" ]; then\
go build -gcflags="all=-N -l" -v $(PMM_LD_FLAGS) -o $(PMM_RELEASE_PATH)/ ./cmd/...
Copy link
Contributor Author

@ritbl ritbl Oct 18, 2022

Choose a reason for hiding this comment

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

for ARM do not run with -race

-race causes crash building pmm-managed binaries

# github.com/percona/pmm/managed/cmd/pmm-managed
reflect.methodValueCall: nosplit stack over 792 byte limit
reflect.methodValueCall<0>
    grows 448 bytes, calls reflect.moveMakeFuncArgPtrs<1>
        grows 288 bytes, calls internal/abi.(*IntArgRegBitmap).Get<1>
            grows 48 bytes, calls runtime.racefuncenter<1>
                grows 0 bytes, calls racefuncenter<121>
                    grows 16 bytes, calls racecall<121>
                        grows 0 bytes, calls indirect
                            grows 0 bytes, calls runtime.morestack<0>
                            8 bytes over limit

@ritbl ritbl marked this pull request as ready for review October 18, 2022 13:23
@ritbl ritbl requested review from BupycHuk, artemgavrilov and a team as code owners October 18, 2022 13:23
@codecov
Copy link

codecov bot commented Oct 18, 2022

Codecov Report

Merging #1314 (530b1e6) into main (815adfa) will decrease coverage by 0.03%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #1314       /-   ##
==========================================
- Coverage   43.64%   43.60%   -0.04%     
==========================================
  Files         344      344              
  Lines       40458    40458              
==========================================
- Hits        17656    17640      -16     
- Misses      21279    21295       16     
  Partials     1523     1523              
Flag Coverage Δ
admin 9.17% <ø> (ø)
agent 54.06% <ø> (-0.17%) ⬇️
managed 44.78% <ø> (ø)

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

Impacted Files Coverage Δ
.../agents/mongodb/internal/profiler/sender/sender.go 79.03% <0.00%> (-3.23%) ⬇️
agent/agents/mysql/slowlog/slowlog.go 48.18% <0.00%> (-2.99%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

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.

will it work if user runs just docker-compose up?

env-up: ## Start devcontainer.
COMPOSE_PROFILES=$(PROFILES) \
Copy link
Member

Choose a reason for hiding this comment

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

do we really need to set it for each item?
can we extract it outside of items?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I need to pass default profile (pmm), for some reason it does'n work with default
image

image

@@ -27,3 27,5 @@ pmm-agent-dev.yaml

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

.env
Copy link
Contributor Author

Choose a reason for hiding this comment

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

docker compose uses .env by default, it should not be committed

@@ -2,7 2,9 @@
version: '3.7'
services:
pmm-managed-server:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this section was not changed, only profiles section is added

@ritbl ritbl force-pushed the PMM-10900-custom-image-and-ch branch from 0df2d38 to 249267e Compare October 18, 2022 13:29
@ritbl ritbl merged commit 4e5131b into main Oct 19, 2022
@ritbl ritbl deleted the PMM-10900-custom-image-and-ch branch October 19, 2022 12:37
@ritbl ritbl mentioned this pull request Oct 20, 2022
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