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

pack: skip unavailable configs from etcd and tcs #1066

Merged
merged 2 commits into from
Jan 20, 2025

Conversation

patapenka-alexey
Copy link
Contributor

@patapenka-alexey patapenka-alexey commented Dec 16, 2024

Closes #1038

@TarantoolBot document
Title: pack: skip unavailable configs from etcd and tcs

This patch fixes the tt pack error if etcd or tcs are unavailable during package creation.

@patapenka-alexey patapenka-alexey changed the title pack: skip configs from etcd and tcs pack: skip unavailable configs from etcd and tcs Dec 16, 2024
@patapenka-alexey patapenka-alexey force-pushed the patapenka-alexey/gh-1038-tt-pack-error-etcd branch from ddf6386 to c75c205 Compare December 16, 2024 14:07
Copy link
Contributor

@oleg-jukovec oleg-jukovec left a comment

Choose a reason for hiding this comment

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

Please, add an entry into CHANGELOG.md.

cli/pack/opts.go Outdated
@@ -49,7 +49,7 @@ func initAppsInfo(cliOpts *config.CliOpts, cmdCtx *cmdcontext.CmdCtx, packCtx *P
}
packCtx.AppList = appList
packCtx.AppsInfo, err = running.CollectInstancesForApps(packCtx.AppList, cliOpts,
cmdCtx.Cli.ConfigDir, cmdCtx.Integrity, true)
cmdCtx.Cli.ConfigDir, cmdCtx.Integrity, false)
Copy link
Contributor

@elhimov elhimov Dec 18, 2024

Choose a reason for hiding this comment

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

It looks like the same approach is to be applied to both instances scripts and cluster config. So both of them are required or both of them are optional and it seems wrong in case of tt pack. I'm not sure about cluster config, maybe it's correct that we treat it as configuration and thus able to drop from package, but it seems we are not able to treat instances scripts in the same way because they contain business logic and thus look like the essential part of the package.

Copy link
Contributor

Choose a reason for hiding this comment

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

And regardless of our ability to drop some part of package while preparing it, it looks quite weird that content of the package depends on current availability of some items. What if next time one pack the same application but etcd/tcs config is available? As the content is changed we will get another package for the same application. Do we expect such a behavior?

test/integration/pack/test_pack.py Outdated Show resolved Hide resolved
test/integration/pack/test_pack.py Outdated Show resolved Hide resolved
@patapenka-alexey patapenka-alexey force-pushed the patapenka-alexey/gh-1038-tt-pack-error-etcd branch 3 times, most recently from 30ff7e3 to b64c71a Compare December 23, 2024 13:15
@oleg-jukovec oleg-jukovec added the full-ci Enables full ci tests label Dec 23, 2024
@patapenka-alexey patapenka-alexey force-pushed the patapenka-alexey/gh-1038-tt-pack-error-etcd branch from b64c71a to bfb7321 Compare December 26, 2024 08:18
CHANGELOG.md Outdated Show resolved Hide resolved
cli/cmd/replicaset.go Outdated Show resolved Hide resolved
cli/cmd/replicaset.go Outdated Show resolved Hide resolved
cli/running/running.go Outdated Show resolved Hide resolved
@patapenka-alexey patapenka-alexey force-pushed the patapenka-alexey/gh-1038-tt-pack-error-etcd branch from bfb7321 to 460b4fa Compare December 27, 2024 12:12
Copy link
Contributor

@oleg-jukovec oleg-jukovec left a comment

Choose a reason for hiding this comment

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

We still not skip a config load, but load a config and skip an error.

@patapenka-alexey patapenka-alexey force-pushed the patapenka-alexey/gh-1038-tt-pack-error-etcd branch 2 times, most recently from bcefd0a to f729a21 Compare January 3, 2025 12:12
@patapenka-alexey patapenka-alexey force-pushed the patapenka-alexey/gh-1038-tt-pack-error-etcd branch from f729a21 to 48559b6 Compare January 8, 2025 11:06
@patapenka-alexey patapenka-alexey removed the full-ci Enables full ci tests label Jan 9, 2025
@patapenka-alexey patapenka-alexey force-pushed the patapenka-alexey/gh-1038-tt-pack-error-etcd branch from 48559b6 to bf7ba6c Compare January 9, 2025 11:08
@patapenka-alexey patapenka-alexey marked this pull request as draft January 9, 2025 11:09
@patapenka-alexey patapenka-alexey force-pushed the patapenka-alexey/gh-1038-tt-pack-error-etcd branch 3 times, most recently from 4bb9df1 to cd71f6f Compare January 15, 2025 11:09
Copy link
Contributor

@oleg-jukovec oleg-jukovec left a comment

Choose a reason for hiding this comment

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

You still tries to load the config even ConfigLoadSkip == true.

cli/running/running_test.go Outdated Show resolved Hide resolved
cli/running/running.go Outdated Show resolved Hide resolved
Copy link
Contributor

@oleg-jukovec oleg-jukovec left a comment

Choose a reason for hiding this comment

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

Ok, let's merge it now. And left the proper code for the future refactoring. Please, update tests (see a comment above).

@patapenka-alexey patapenka-alexey force-pushed the patapenka-alexey/gh-1038-tt-pack-error-etcd branch 2 times, most recently from 41dc8f2 to 6c0c5f6 Compare January 16, 2025 11:48
cli/running/running_test.go Outdated Show resolved Hide resolved
cli/running/running_test.go Show resolved Hide resolved
@oleg-jukovec
Copy link
Contributor

Please, rebase on the master branch to fix the CI.

@patapenka-alexey patapenka-alexey force-pushed the patapenka-alexey/gh-1038-tt-pack-error-etcd branch 2 times, most recently from e606a21 to 808a902 Compare January 17, 2025 07:39
cli/pack/opts.go Outdated Show resolved Hide resolved
@TarantoolBot document
Title: pack: skip configs from etcd and tcs

This patch fixes the `tt pack` error if `etcd` or `tcs` are unavailable
during package creation.

Part of #1038
@patapenka-alexey patapenka-alexey force-pushed the patapenka-alexey/gh-1038-tt-pack-error-etcd branch from 808a902 to 3328b6e Compare January 17, 2025 10:40
@@ -126,6 +126,21 @@ type providerImpl struct {
instanceCtx *InstanceCtx
}

type ConfigLoad int
Copy link
Contributor

@oleg-jukovec oleg-jukovec Jan 17, 2025

Choose a reason for hiding this comment

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

Comment missed.

Copy link
Contributor

@elhimov elhimov left a comment

Choose a reason for hiding this comment

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

Thanks for the patch! LGTM.

From now on `build`, `completion`, `kill`, `log`, `logrotate`, `stop`,
`list`, `pack` commands skip instance config generation from local,
etcs/tcs and env sources.

Closes #1038
@patapenka-alexey patapenka-alexey force-pushed the patapenka-alexey/gh-1038-tt-pack-error-etcd branch from 3328b6e to 0845d96 Compare January 17, 2025 14:30
@oleg-jukovec oleg-jukovec merged commit 0d17f18 into master Jan 20, 2025
24 checks passed
@oleg-jukovec oleg-jukovec deleted the patapenka-alexey/gh-1038-tt-pack-error-etcd branch January 20, 2025 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
full-ci Enables full ci tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tt pack завершается ошибкой при недоступном etcd
5 participants