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

Import configuration when migrating a cluster from Ansible #766

Merged
merged 15 commits into from
Nov 17, 2020

Conversation

yuzhibotao
Copy link
Contributor

@yuzhibotao yuzhibotao commented Sep 9, 2020

What problem does this PR solve?

From ansible to tiup ,there is no configuration parameter for the import action.

What is changed and how it works?

  1. If the monitored_server is configured with deploy_dir and they are all the same, import deploy_dir into monitored_servers.
  2. Add information about global parameters and component parameters of TiDB PD TiKV .
    After backing up the configuration files, parse the configuration files for each component, extract the same parameters into Server_Configs and put different parameters into the service's own Config.

Check List

Tests

  • Manual test (add detailed scripts or steps below)

old_meta.txt
new_meta.txt

Code changes

  • Has exported function/method change
  • Has exported variable/fields change
  • Has interface methods change
  • Has persistent data change

Side effects

  • Possible performance regression
  • Increased code complexity
  • Breaking backward compatibility

Related changes

  • Need to cherry-pick to the release branch
  • Need to update the documentation

Release notes:

Import configs to cluster topology when migrating from tidb-ansible

@CLAassistant
Copy link

CLAassistant commented Sep 9, 2020

CLA assistant check
All committers have signed the CLA.

@lonng lonng changed the title Importconfig Import configuration when migrating a cluster from Ansible Sep 10, 2020
@lonng
Copy link
Contributor

lonng commented Sep 10, 2020

@yuzhibotao Please add some tests and format your code.
@AstroProfundis PTAL

Copy link
Contributor

@AstroProfundis AstroProfundis left a comment

Choose a reason for hiding this comment

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

You may use go fmt to format your code, and use make check && make test for basic code formatting and unit test checks.

pkg/cluster/ansible/import.go Outdated Show resolved Hide resolved
pkg/cluster/ansible/import.go Outdated Show resolved Hide resolved
pkg/cluster/ansible/import.go Outdated Show resolved Hide resolved
pkg/cluster/ansible/import.go Outdated Show resolved Hide resolved
pkg/cluster/ansible/import.go Outdated Show resolved Hide resolved
pkg/cluster/ansible/import.go Outdated Show resolved Hide resolved
pkg/cluster/ansible/import.go Outdated Show resolved Hide resolved
pkg/cluster/ansible/import.go Outdated Show resolved Hide resolved
pkg/cluster/ansible/import.go Outdated Show resolved Hide resolved
pkg/cluster/spec/spec_manager.go Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Sep 14, 2020

Codecov Report

Merging #766 into master will decrease coverage by 4.50%.
The diff coverage is 1.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #766      +/-   ##
==========================================
- Coverage   53.97%   49.46%   -4.51%     
==========================================
  Files         257      258       +1     
  Lines       20965    21158     +193     
==========================================
- Hits        11316    10466     -850     
- Misses       8124     9226    +1102     
+ Partials     1525     1466      -59     
Flag Coverage Δ
#cluster 46.36% <1.66%> (-0.41%) ⬇️
#dm 26.67% <1.68%> (-0.26%) ⬇️
#integrate 49.46% <1.66%> (-0.66%) ⬇️
#playground 22.92% <ø> (ø)
#tiup 19.80% <ø> (?)
#unittest ?

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

Impacted Files Coverage Δ
components/cluster/command/import.go 19.54% <0.00%> (-0.46%) ⬇️
pkg/cluster/ansible/import.go 0.00% <0.00%> (-56.90%) ⬇️
pkg/cluster/spec/spec_manager.go 68.67% <75.00%> (+1.17%) ⬆️
pkg/utils/semver.go 0.00% <0.00%> (-100.00%) ⬇️
components/dm/ansible/worker.go 0.00% <0.00%> (-100.00%) ⬇️
pkg/telemetry/scrub.go 8.57% <0.00%> (-80.00%) ⬇️
pkg/telemetry/telemetry.go 0.00% <0.00%> (-70.00%) ⬇️
components/dm/ansible/import.go 0.00% <0.00%> (-63.93%) ⬇️
pkg/cluster/executor/local.go 0.00% <0.00%> (-57.54%) ⬇️
pkg/repository/v1manifest/keys.go 5.71% <0.00%> (-57.15%) ⬇️
... and 51 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8aacd48...eec8893. Read the comment docs.

@codecov-io
Copy link

codecov-io commented Oct 12, 2020

Codecov Report

Merging #766 (796e730) into master (eacd119) will decrease coverage by 0.09%.
The diff coverage is 45.39%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #766      +/-   ##
==========================================
- Coverage   53.26%   53.16%   -0.10%     
==========================================
  Files         259      260       +1     
  Lines       18786    18909     +123     
==========================================
+ Hits        10006    10053      +47     
- Misses       7246     7318      +72     
- Partials     1534     1538       +4     
Flag Coverage Δ
cluster 45.19% <11.34%> (-0.33%) ⬇️
dm 25.12% <7.19%> (-0.16%) ⬇️
integrate 47.75% <11.34%> (-0.27%) ⬇️
playground 22.17% <0.00%> (-0.09%) ⬇️
tiup 10.70% <0.00%> (-0.05%) ⬇️
unittest 21.52% <45.39%> (+0.13%) ⬆️

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

Impacted Files Coverage Δ
components/cluster/command/import.go 17.64% <0.00%> (-0.43%) ⬇️
pkg/set/any_set.go 29.16% <29.16%> (ø)
pkg/cluster/ansible/import.go 41.98% <35.36%> (-15.43%) ⬇️
pkg/cluster/spec/tikv.go 57.42% <66.66%> (+0.06%) ⬆️
pkg/cluster/spec/server_config.go 67.37% <88.88%> (+2.29%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update eacd119...796e730. Read the comment docs.

@lucklove lucklove added the type/new-feature Categorizes pr as related to a new feature. label Oct 19, 2020
@lucklove lucklove added this to the v1.2.1 milestone Oct 19, 2020
Copy link
Contributor

@AstroProfundis AstroProfundis left a comment

Choose a reason for hiding this comment

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

Rest LGTM

pkg/cluster/ansible/import.go Outdated Show resolved Hide resolved
pkg/cluster/ansible/import.go Show resolved Hide resolved
pkg/cluster/ansible/import.go Outdated Show resolved Hide resolved
pkg/cluster/ansible/import_test.go Show resolved Hide resolved
pkg/cluster/spec/tikv.go Outdated Show resolved Hide resolved
pkg/set/string_set.go Outdated Show resolved Hide resolved
@lucklove lucklove modified the milestones: v1.2.1, v1.2.3, v1.3.0 Oct 23, 2020
@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Nov 13, 2020
@AstroProfundis AstroProfundis merged commit cd971a5 into pingcap:master Nov 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/LGT1 Indicates that a PR has LGTM 1. type/new-feature Categorizes pr as related to a new feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tiup doesn't handle the label setting when import from ansible inventory.ini
8 participants