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-11658 move the exporter configs away from /tmp #2341

Merged
merged 25 commits into from
Jul 24, 2023

Conversation

ademidoff
Copy link
Member

@ademidoff ademidoff commented Jul 3, 2023

PMM-11658

Link to the Feature Build: SUBMODULES-3336

Other PRs:
Percona-Lab/jenkins-pipelines#2213

@@ -126,7 +126,6 @@ jobs:

- name: Setup tools
run: |
sudo apt-get install -y wget jq
Copy link
Member Author

Choose a reason for hiding this comment

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

This was redundant as both binaries are already installed by default.

@codecov
Copy link

codecov bot commented Jul 3, 2023

Codecov Report

Merging #2341 (bf45cfa) into main (b8ead6d) will decrease coverage by 0.04%.
The diff coverage is 41.17%.

@@            Coverage Diff             @@
##             main    #2341      +/-   ##
==========================================
- Coverage   42.94%   42.91%   -0.04%     
==========================================
  Files         385      385              
  Lines       48147    48167      +20     
==========================================
- Hits        20677    20671       -6     
- Misses      25535    25557      +22     
- Partials     1935     1939       +4     
Flag Coverage Δ
admin 10.45% <ø> (+0.04%) ⬆️
agent 52.69% <58.33%> (-0.13%) ⬇️
vmproxy 69.69% <ø> (ø)

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

Impacted Files Coverage Δ
agent/commands/run.go 0.00% <0.00%> (ø)
managed/cmd/pmm-managed/main.go 0.00% <0.00%> (ø)
agent/agents/supervisor/supervisor.go 57.25% <50.00%> (-0.17%) ⬇️
agent/config/config.go 81.51% <84.61%> (+0.40%) ⬆️

... and 3 files with indirect coverage changes

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

@@ -596,9 +597,14 @@ func setup(ctx context.Context, deps *setupDeps) bool {
}

func getQANClient(ctx context.Context, sqlDB *sql.DB, dbName, qanAPIAddr string) *qan.Client {
bc := backoff.DefaultConfig
Copy link
Member Author

Choose a reason for hiding this comment

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

This migrates from the deprecated grpc.WithBackoffMaxDelay.

@@ -558,15 +559,15 @@ func setup(ctx context.Context, deps *setupDeps) bool {
deps.l.Infof("Updating supervisord configuration...")
settings, err := models.GetSettings(db.Querier)
if err != nil {
deps.l.Warnf("Failed to get settings: %+v.", err)
deps.l.Warnf("Failed to get settings: %s.", err)
Copy link
Member Author

@ademidoff ademidoff Jul 3, 2023

Choose a reason for hiding this comment

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

It was a bit weird to see a part of the stack trace printed at the start of pmm-managed. Done like this, it will only print a clean error message.

[2023-06-26T14:35:15.947+00:00] Failed to get Percona SSO Details: PMM Server is not connected to Portal github.com/percona/pmm/managed/models.init /home/builder/rpm/BUILD/pmm-7a7431afdc35098f665dbd8d33ccf914fad8b0b5/src/github.com/percona/pmm/managed/models/percona_sso_model_helpers.go:35 runtime.doInit /usr/local/go/src/runtime/proc.go:6507 runtime.doInit /usr/local/go/src/runtime/proc.go:6484 runtime.main /usr/local/go/src/runtime/proc.go:233 runtime.goexit /usr/local/go/src/runtime/asm_amd64.s:1598. component=setup

agent/config/config.go Outdated Show resolved Hide resolved
.golangci.yml Outdated Show resolved Hide resolved
@@ -474,7 +489,7 @@ func Application(cfg *Config) (*kingpin.Application, *string) {
// Other errors are returned if file exists, but configuration can't be loaded due to permission problems,
// YAML parsing problems, etc.
func loadFromFile(path string) (*Config, error) {
if _, err := os.Stat(path); os.IsNotExist(err) {
if _, err := os.Stat(path); errors.Is(err, fs.ErrNotExist) {
Copy link
Member Author

Choose a reason for hiding this comment

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

os.IsNotExist is deprecated

@ademidoff ademidoff force-pushed the PMM-11658-move-exporter-configs-elsewhere branch 8 times, most recently from 96c146c to 4077ece Compare July 7, 2023 14:45
@ademidoff ademidoff force-pushed the PMM-11658-move-exporter-configs-elsewhere branch from 4ff6003 to c055c8f Compare July 7, 2023 15:34
agent/config/config.go Outdated Show resolved Hide resolved
agent/config/config.go Outdated Show resolved Hide resolved
agent/config/config.go Outdated Show resolved Hide resolved
agent/config/config_test.go Outdated Show resolved Hide resolved
agent/config/config_test.go Outdated Show resolved Hide resolved
agent/config/config_test.go Outdated Show resolved Hide resolved
@ademidoff ademidoff requested a review from BupycHuk July 9, 2023 23:56
@@ -6,6 +6,7 @@ ARG BUILD_DATE
ENV LANG=en_US.utf8
ENV LC_ALL=en_US.utf8
ENV GF_PLUGIN_DIR=/srv/grafana/plugins
ENV PS1="[\u@\h \W]\$ "
Copy link
Member Author

@ademidoff ademidoff Jul 10, 2023

Choose a reason for hiding this comment

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

Make the shell prompt more informative.
Before: bash-5.1#
Now: [root@pmm-server pmm] #

agent/config/config.go Outdated Show resolved Hide resolved
agent/config/config.go Outdated Show resolved Hide resolved
.golangci.yml Outdated Show resolved Hide resolved
agent/config/config.go Outdated Show resolved Hide resolved
@ademidoff ademidoff force-pushed the PMM-11658-move-exporter-configs-elsewhere branch from 7aebdd3 to 1985d6b Compare July 10, 2023 13:05
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.

Great job

@ademidoff ademidoff merged commit 46ecd31 into main Jul 24, 2023
31 checks passed
@ademidoff ademidoff deleted the PMM-11658-move-exporter-configs-elsewhere branch July 24, 2023 16:00
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.

4 participants