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

gomod: only support one gomod in tools and integrations respectively #7635

Merged
merged 26 commits into from
Dec 29, 2023

Conversation

HuSharp
Copy link
Member

@HuSharp HuSharp commented Dec 28, 2023

What problem does this PR solve?

Issue Number: Ref #7300

What is changed and how does it work?

nowadays we have too many gomods which are redundant

remove redundant gomods, support only one go mod in integrations/tools/client/server respectively
  • for tools:
$ rm -rf bin && make build && make tools && ls bin                                                                                                                                                                     
        
./scripts/embed-dashboard-ui.sh
+ Clean up existing asset file
+ Fetch TiDB Dashboard Go module
  - TiDB Dashboard directory: /data/nvme0n1/husharp/go/go1.21.0/pkg/mod/github.com/pingcap/tidb-dashboard@v0.0.0-20231218095437-aa621ed4de2c
+ Create download cache directory: /data/nvme0n1/husharp/proj/pd/.dashboard_download_cache
+ Discover TiDB Dashboard release version
  - TiDB Dashboard release version: 2023.12.18.1
+ Check whether pre-built assets are available
  - Cached archive exists: /data/nvme0n1/husharp/proj/pd/.dashboard_download_cache/embedded-assets-golang-2023.12.18.1.zip
+ Unpack embedded asset from archive
Archive:  /data/nvme0n1/husharp/proj/pd/.dashboard_download_cache/embedded-assets-golang-2023.12.18.1.zip
  inflating: embedded_assets_handler.go  
  - Unpacked /data/nvme0n1/husharp/proj/pd/pkg/dashboard/uiserver/embedded_assets_handler.go
GOEXPERIMENT= CGO_ENABLED=1 go build  -gcflags '' -ldflags '-X "github.com/tikv/pd/pkg/versioninfo.PDReleaseVersion=v6.2.0-alpha-1161-gc5f2cb600" -X "github.com/tikv/pd/pkg/versioninfo.PDBuildTS=2023-12-29 09:08:29" -X "github.com/tikv/pd/pkg/versioninfo.PDGitHash=c5f2cb6002d533ade8df4e6c6c021b163d6491bf" -X "github.com/tikv/pd/pkg/versioninfo.PDGitBranch=replace_ctl_test_gomod" -X "github.com/tikv/pd/pkg/versioninfo.PDEdition=Community" -X "github.com/pingcap/tidb-dashboard/pkg/utils/version.InternalVersion=2023.12.18.1" -X "github.com/pingcap/tidb-dashboard/pkg/utils/version.Standalone=No" -X "github.com/pingcap/tidb-dashboard/pkg/utils/version.PDVersion=v6.2.0-alpha-1161-gc5f2cb600" -X "github.com/pingcap/tidb-dashboard/pkg/utils/version.BuildTime=2023-12-29 09:08:29" -X "github.com/pingcap/tidb-dashboard/pkg/utils/version.BuildGitHash=aa621ed4de2c"' -tags "" -o /data/nvme0n1/husharp/proj/pd/bin/pd-server cmd/pd-server/main.go
cd tools && GOEXPERIMENT= CGO_ENABLED=0 go build -gcflags '' -ldflags '-X "github.com/tikv/pd/pkg/versioninfo.PDReleaseVersion=v6.2.0-alpha-1161-gc5f2cb600" -X "github.com/tikv/pd/pkg/versioninfo.PDBuildTS=2023-12-29 09:08:36" -X "github.com/tikv/pd/pkg/versioninfo.PDGitHash=c5f2cb6002d533ade8df4e6c6c021b163d6491bf" -X "github.com/tikv/pd/pkg/versioninfo.PDGitBranch=replace_ctl_test_gomod" -X "github.com/tikv/pd/pkg/versioninfo.PDEdition=Community" -X "github.com/pingcap/tidb-dashboard/pkg/utils/version.InternalVersion=2023.12.18.1" -X "github.com/pingcap/tidb-dashboard/pkg/utils/version.Standalone=No" -X "github.com/pingcap/tidb-dashboard/pkg/utils/version.PDVersion=v6.2.0-alpha-1161-gc5f2cb600" -X "github.com/pingcap/tidb-dashboard/pkg/utils/version.BuildTime=2023-12-29 09:08:36" -X "github.com/pingcap/tidb-dashboard/pkg/utils/version.BuildGitHash=aa621ed4de2c"' -o /data/nvme0n1/husharp/proj/pd/bin/pd-ctl pd-ctl/main.go
cd tools && GOEXPERIMENT= CGO_ENABLED=0 go build -gcflags '' -ldflags '-X "github.com/tikv/pd/pkg/versioninfo.PDReleaseVersion=v6.2.0-alpha-1161-gc5f2cb600" -X "github.com/tikv/pd/pkg/versioninfo.PDBuildTS=2023-12-29 09:08:38" -X "github.com/tikv/pd/pkg/versioninfo.PDGitHash=c5f2cb6002d533ade8df4e6c6c021b163d6491bf" -X "github.com/tikv/pd/pkg/versioninfo.PDGitBranch=replace_ctl_test_gomod" -X "github.com/tikv/pd/pkg/versioninfo.PDEdition=Community" -X "github.com/pingcap/tidb-dashboard/pkg/utils/version.InternalVersion=2023.12.18.1" -X "github.com/pingcap/tidb-dashboard/pkg/utils/version.Standalone=No" -X "github.com/pingcap/tidb-dashboard/pkg/utils/version.PDVersion=v6.2.0-alpha-1161-gc5f2cb600" -X "github.com/pingcap/tidb-dashboard/pkg/utils/version.BuildTime=2023-12-29 09:08:38" -X "github.com/pingcap/tidb-dashboard/pkg/utils/version.BuildGitHash=aa621ed4de2c"' -o /data/nvme0n1/husharp/proj/pd/bin/pd-recover pd-recover/main.go
cd tools && CGO_ENABLED=0 go build -o /data/nvme0n1/husharp/proj/pd/bin/pd-tso-bench pd-tso-bench/main.go
cd tools && CGO_ENABLED=0 go build -gcflags '' -ldflags '-X "github.com/tikv/pd/pkg/versioninfo.PDReleaseVersion=v6.2.0-alpha-1161-gc5f2cb600" -X "github.com/tikv/pd/pkg/versioninfo.PDBuildTS=2023-12-29 09:08:40" -X "github.com/tikv/pd/pkg/versioninfo.PDGitHash=c5f2cb6002d533ade8df4e6c6c021b163d6491bf" -X "github.com/tikv/pd/pkg/versioninfo.PDGitBranch=replace_ctl_test_gomod" -X "github.com/tikv/pd/pkg/versioninfo.PDEdition=Community" -X "github.com/pingcap/tidb-dashboard/pkg/utils/version.InternalVersion=2023.12.18.1" -X "github.com/pingcap/tidb-dashboard/pkg/utils/version.Standalone=No" -X "github.com/pingcap/tidb-dashboard/pkg/utils/version.PDVersion=v6.2.0-alpha-1161-gc5f2cb600" -X "github.com/pingcap/tidb-dashboard/pkg/utils/version.BuildTime=2023-12-29 09:08:40" -X "github.com/pingcap/tidb-dashboard/pkg/utils/version.BuildGitHash=aa621ed4de2c"' -o /data/nvme0n1/husharp/proj/pd/bin/pd-heartbeat-bench pd-heartbeat-bench/main.go
cd tools && CGO_ENABLED=0 go build -gcflags '' -ldflags '-X "github.com/tikv/pd/pkg/versioninfo.PDReleaseVersion=v6.2.0-alpha-1161-gc5f2cb600" -X "github.com/tikv/pd/pkg/versioninfo.PDBuildTS=2023-12-29 09:08:42" -X "github.com/tikv/pd/pkg/versioninfo.PDGitHash=c5f2cb6002d533ade8df4e6c6c021b163d6491bf" -X "github.com/tikv/pd/pkg/versioninfo.PDGitBranch=replace_ctl_test_gomod" -X "github.com/tikv/pd/pkg/versioninfo.PDEdition=Community" -X "github.com/pingcap/tidb-dashboard/pkg/utils/version.InternalVersion=2023.12.18.1" -X "github.com/pingcap/tidb-dashboard/pkg/utils/version.Standalone=No" -X "github.com/pingcap/tidb-dashboard/pkg/utils/version.PDVersion=v6.2.0-alpha-1161-gc5f2cb600" -X "github.com/pingcap/tidb-dashboard/pkg/utils/version.BuildTime=2023-12-29 09:08:42" -X "github.com/pingcap/tidb-dashboard/pkg/utils/version.BuildGitHash=aa621ed4de2c"' -o /data/nvme0n1/husharp/proj/pd/bin/regions-dump regions-dump/main.go
cd tools && CGO_ENABLED=0 go build -gcflags '' -ldflags '-X "github.com/tikv/pd/pkg/versioninfo.PDReleaseVersion=v6.2.0-alpha-1161-gc5f2cb600" -X "github.com/tikv/pd/pkg/versioninfo.PDBuildTS=2023-12-29 09:08:43" -X "github.com/tikv/pd/pkg/versioninfo.PDGitHash=c5f2cb6002d533ade8df4e6c6c021b163d6491bf" -X "github.com/tikv/pd/pkg/versioninfo.PDGitBranch=replace_ctl_test_gomod" -X "github.com/tikv/pd/pkg/versioninfo.PDEdition=Community" -X "github.com/pingcap/tidb-dashboard/pkg/utils/version.InternalVersion=2023.12.18.1" -X "github.com/pingcap/tidb-dashboard/pkg/utils/version.Standalone=No" -X "github.com/pingcap/tidb-dashboard/pkg/utils/version.PDVersion=v6.2.0-alpha-1161-gc5f2cb600" -X "github.com/pingcap/tidb-dashboard/pkg/utils/version.BuildTime=2023-12-29 09:08:43" -X "github.com/pingcap/tidb-dashboard/pkg/utils/version.BuildGitHash=aa621ed4de2c"' -o /data/nvme0n1/husharp/proj/pd/bin/stores-dump stores-dump/main.go
cd tools && CGO_ENABLED=0 go build -o /data/nvme0n1/husharp/proj/pd/bin/pd-api-bench pd-api-bench/main.go
pd-api-bench  pd-ctl  pd-heartbeat-bench  pd-recover  pd-server  pd-tso-bench  regions-dump  stores-dump

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)

Release note

None.

Signed-off-by: husharp <jinhao.hu@pingcap.com>
Signed-off-by: husharp <jinhao.hu@pingcap.com>
Signed-off-by: husharp <jinhao.hu@pingcap.com>
Signed-off-by: husharp <jinhao.hu@pingcap.com>
Signed-off-by: husharp <jinhao.hu@pingcap.com>
Signed-off-by: husharp <jinhao.hu@pingcap.com>
Signed-off-by: husharp <jinhao.hu@pingcap.com>
Signed-off-by: husharp <jinhao.hu@pingcap.com>
Signed-off-by: husharp <jinhao.hu@pingcap.com>
Signed-off-by: husharp <jinhao.hu@pingcap.com>
Signed-off-by: husharp <jinhao.hu@pingcap.com>
Copy link
Contributor

ti-chi-bot bot commented Dec 28, 2023

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • CabinfeverB
  • nolouch

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Dec 28, 2023
@HuSharp HuSharp requested review from CabinfeverB and removed request for JmPotato December 28, 2023 06:29
@HuSharp HuSharp changed the title pdctl: support go mod and replace PD HTTP SDK pdctl: support go mod and introduce PD HTTP SDK in pdctl Dec 28, 2023
tools/pd-ctl/go.mod Outdated Show resolved Hide resolved
Signed-off-by: husharp <jinhao.hu@pingcap.com>
Signed-off-by: husharp <jinhao.hu@pingcap.com>
@HuSharp HuSharp changed the title pdctl: support go mod and introduce PD HTTP SDK in pdctl pdctl: support go mod and move tests to pdctl Dec 28, 2023
Signed-off-by: husharp <jinhao.hu@pingcap.com>
Signed-off-by: husharp <jinhao.hu@pingcap.com>
@HuSharp HuSharp changed the title pdctl: support go mod and move tests to pdctl pdctl: support go mod and move related tests to pdctl Dec 28, 2023
@HuSharp
Copy link
Member Author

HuSharp commented Dec 28, 2023

/test ?

@HuSharp
Copy link
Member Author

HuSharp commented Dec 29, 2023

/test pull-integration-realcluster-test

@HuSharp
Copy link
Member Author

HuSharp commented Dec 29, 2023

/test pull-integration-realcluster-test

scripts/update-dashboard.sh Outdated Show resolved Hide resolved
pd.code-workspace Outdated Show resolved Hide resolved
@HuSharp HuSharp requested a review from nolouch December 29, 2023 03:10
Signed-off-by: husharp <jinhao.hu@pingcap.com>
@HuSharp
Copy link
Member Author

HuSharp commented Dec 29, 2023

/test pull-integration-realcluster-test

Copy link
Contributor

ti-chi-bot bot commented Dec 29, 2023

@HuSharp: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-integration-realcluster-test 491a859 link false /test pull-integration-realcluster-test

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

tools/go.mod Show resolved Hide resolved
tools/pd-ctl/README.md Show resolved Hide resolved
Signed-off-by: husharp <jinhao.hu@pingcap.com>
Copy link
Member

@CabinfeverB CabinfeverB left a comment

Choose a reason for hiding this comment

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

mostly LGTM

Copy link
Contributor

@nolouch nolouch left a comment

Choose a reason for hiding this comment

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

lgtm! great works.

@ti-chi-bot ti-chi-bot bot added the status/LGT1 Indicates that a PR has LGTM 1. label Dec 29, 2023
@CabinfeverB
Copy link
Member

Pls add some test results.

@HuSharp
Copy link
Member Author

HuSharp commented Dec 29, 2023

Pls add some test results.

added in pr description

@ti-chi-bot ti-chi-bot bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Dec 29, 2023
@CabinfeverB
Copy link
Member

/merge

Copy link
Contributor

ti-chi-bot bot commented Dec 29, 2023

@CabinfeverB: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and if the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

If you have any questions about the PR merge process, please refer to pr process.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

Copy link
Contributor

ti-chi-bot bot commented Dec 29, 2023

This pull request has been accepted and is ready to merge.

Commit hash: c5f2cb6

@ti-chi-bot ti-chi-bot bot added the status/can-merge Indicates a PR has been approved by a committer. label Dec 29, 2023
Copy link
Contributor

ti-chi-bot bot commented Dec 29, 2023

@HuSharp: Your PR was out of date, I have automatically updated it for you.

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@HuSharp HuSharp changed the title gomod: only support one gomod in tools and integrations gomod: only support one gomod in tools and integrations respectively Dec 29, 2023
@ti-chi-bot ti-chi-bot bot merged commit 7af8b81 into tikv:master Dec 29, 2023
25 of 26 checks passed
@HuSharp HuSharp deleted the replace_ctl_test_gomod branch December 29, 2023 09:27
pingandb pushed a commit to pingandb/pd that referenced this pull request Jan 18, 2024
…ikv#7635)

ref tikv#7300

nowadays we have too many gomods which are redundant

remove redundant gomods, support only one go mod in integrations/tools/client/server respectively

Signed-off-by: husharp <jinhao.hu@pingcap.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
Signed-off-by: pingandb <songge102@pingan.com.cn>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants