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

Support PD with Dashboard #2086

Merged
merged 15 commits into from
Jan 15, 2020
Merged

Support PD with Dashboard #2086

merged 15 commits into from
Jan 15, 2020

Conversation

breezewish
Copy link
Member

@breezewish breezewish commented Jan 8, 2020

What problem does this PR solve?

This PR integrates dashboard into PD.

What is changed and how it works?

Dashboard is integrated using go module. Since no extra dependencies is needed, Dashboard UI and Dashboard API is built into PD by default without any extra configurations:

make

After build, you must specify --enable-dashboard to start a PD server with Dashboard UI and Dashboard API:

bin/pd-server --enable-dashboard

The dashboard can be accessed via http://127.0.0.1:2379/dashboard.

Notice that unlike PD, each dashboard instance is independent, which does not know each other and keeps independent and inconsistent local data.

Check List

  • Manual test (add detailed scripts or steps below)

Signed-off-by: Breezewish <me@breeswish.org>
Signed-off-by: Breezewish <me@breeswish.org>
Signed-off-by: Breezewish <me@breeswish.org>
@claassistantio
Copy link

claassistantio commented Jan 8, 2020

CLA assistant check
All committers have signed the CLA.

Signed-off-by: Breezewish <me@breeswish.org>
Signed-off-by: Breezewish <me@breeswish.org>
Signed-off-by: Breezewish <me@breeswish.org>
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.

CI Failed.

Logs

[2020-01-08T03:57:47.821Z] ==================
[2020-01-08T03:57:47.821Z] WARNING: DATA RACE
[2020-01-08T03:57:47.821Z] Write at 0x000003ea8a60 by goroutine 180:
[2020-01-08T03:57:47.821Z] github.com/pingcap-incubator/tidb-dashboard/pkg/apiserver.Handler()
[2020-01-08T03:57:47.821Z] /home/jenkins/agent/workspace/pd_test/go/pkg/mod/github.com/gin-gonic/gin@v1.5.0/mode.go:57 +0x7e
[2020-01-08T03:57:47.821Z] github.com/pingcap/pd/server.CreateServer()
[2020-01-08T03:57:47.821Z] /home/jenkins/agent/workspace/pd_test/go/src/github.com/pingcap/pd/server/server.go:216 +0xed2
[2020-01-08T03:57:47.821Z] github.com/pingcap/pd/server/api.mustNewCluster.func1()
[2020-01-08T03:57:47.821Z] /home/jenkins/agent/workspace/pd_test/go/src/github.com/pingcap/pd/server/api/server_test.go:86 +0x1d8
[2020-01-08T03:57:47.821Z]
[2020-01-08T03:57:47.821Z] Previous write at 0x000003ea8a60 by goroutine 181:
[2020-01-08T03:57:47.821Z] github.com/pingcap-incubator/tidb-dashboard/pkg/apiserver.Handler()
[2020-01-08T03:57:47.821Z] /home/jenkins/agent/workspace/pd_test/go/pkg/mod/github.com/gin-gonic/gin@v1.5.0/mode.go:57 +0x7e
[2020-01-08T03:57:47.821Z] github.com/pingcap/pd/server.CreateServer()
[2020-01-08T03:57:47.821Z] /home/jenkins/agent/workspace/pd_test/go/src/github.com/pingcap/pd/server/server.go:216 +0xed2
[2020-01-08T03:57:47.821Z] github.com/pingcap/pd/server/api.mustNewCluster.func1()
[2020-01-08T03:57:47.821Z] /home/jenkins/agent/workspace/pd_test/go/src/github.com/pingcap/pd/server/api/server_test.go:86 +0x1d8
[2020-01-08T03:57:47.821Z]
[2020-01-08T03:57:47.821Z] Goroutine 180 (running) created at:
[2020-01-08T03:57:47.821Z] github.com/pingcap/pd/server/api.mustNewCluster()
[2020-01-08T03:57:47.821Z] /home/jenkins/agent/workspace/pd_test/go/src/github.com/pingcap/pd/server/api/server_test.go:77 +0x1d8
[2020-01-08T03:57:47.821Z] github.com/pingcap/pd/server/api.(*testDiagnoseAPISuite).TestDiagnoseSlice()
[2020-01-08T03:57:47.821Z] /home/jenkins/agent/workspace/pd_test/go/src/github.com/pingcap/pd/server/api/diagnose_test.go:40 +0x6d
[2020-01-08T03:57:47.821Z] runtime.call32()
[2020-01-08T03:57:47.821Z] /usr/local/go/src/runtime/asm_amd64.s:539 +0x3a
[2020-01-08T03:57:47.821Z] reflect.Value.Call()
[2020-01-08T03:57:47.821Z] /usr/local/go/src/reflect/value.go:321 +0xd3
[2020-01-08T03:57:47.821Z] github.com/pingcap/check.(*suiteRunner).forkTest.func1()
[2020-01-08T03:57:47.821Z] /home/jenkins/agent/workspace/pd_test/go/pkg/mod/github.com/pingcap/check@v0.0.0-20191107115940-caf2b9e6ccf4/check.go:836 +0x9aa
[2020-01-08T03:57:47.821Z] github.com/pingcap/check.(*suiteRunner).forkCall.func1()
[2020-01-08T03:57:47.821Z] /home/jenkins/agent/workspace/pd_test/go/pkg/mod/github.com/pingcap/check@v0.0.0-20191107115940-caf2b9e6ccf4/check.go:730 +0xc4
[2020-01-08T03:57:47.821Z]
[2020-01-08T03:57:47.821Z] Goroutine 181 (running) created at:
[2020-01-08T03:57:47.821Z] github.com/pingcap/pd/server/api.mustNewCluster()
[2020-01-08T03:57:47.821Z] /home/jenkins/agent/workspace/pd_test/go/src/github.com/pingcap/pd/server/api/server_test.go:77 +0x1d8
[2020-01-08T03:57:47.821Z] github.com/pingcap/pd/server/api.(*testDiagnoseAPISuite).TestDiagnoseSlice()
[2020-01-08T03:57:47.821Z] /home/jenkins/agent/workspace/pd_test/go/src/github.com/pingcap/pd/server/api/diagnose_test.go:40 +0x6d
[2020-01-08T03:57:47.821Z] runtime.call32()
[2020-01-08T03:57:47.821Z] /usr/local/go/src/runtime/asm_amd64.s:539 +0x3a
[2020-01-08T03:57:47.821Z] reflect.Value.Call()
[2020-01-08T03:57:47.821Z] /usr/local/go/src/reflect/value.go:321 +0xd3
[2020-01-08T03:57:47.821Z] github.com/pingcap/check.(*suiteRunner).forkTest.func1()
[2020-01-08T03:57:47.821Z] /home/jenkins/agent/workspace/pd_test/go/pkg/mod/github.com/pingcap/check@v0.0.0-20191107115940-caf2b9e6ccf4/check.go:836 +0x9aa
[2020-01-08T03:57:47.821Z] github.com/pingcap/check.(*suiteRunner).forkCall.func1()
[2020-01-08T03:57:47.821Z] /home/jenkins/agent/workspace/pd_test/go/pkg/mod/github.com/pingcap/check@v0.0.0-20191107115940-caf2b9e6ccf4/check.go:730 +0xc4
[2020-01-08T03:57:47.821Z] ==================
[2020-01-08T03:57:47.821Z] [2020/01/08 11:56:23.715 +08:00] [INFO] [etcd.go:117] ["configuring peer listeners"] [listen-peer-urls="[http://127.0.0.1:13552]"]
[2020-01-08T03:57:47.821Z] ==================
[2020-01-08T03:57:47.821Z] WARNING: DATA RACE
[2020-01-08T03:57:47.821Z] Write at 0x00000348d150 by goroutine 180:
[2020-01-08T03:57:47.821Z] github.com/pingcap-incubator/tidb-dashboard/pkg/apiserver.Handler()
[2020-01-08T03:57:47.821Z] /home/jenkins/agent/workspace/pd_test/go/pkg/mod/github.com/gin-gonic/gin@v1.5.0/mode.go:66 +0x99
[2020-01-08T03:57:47.821Z] [2020/01/08 11:56:23.715 +08:00] [INFO] [systime_mon.go:26] ["start system time monitor"]
[2020-01-08T03:57:47.821Z] github.com/pingcap/pd/server.CreateServer()
[2020-01-08T03:57:47.822Z] /home/jenkins/agent/workspace/pd_test/go/src/github.com/pingcap/pd/server/server.go:216 +0xed2
[2020-01-08T03:57:47.822Z] github.com/pingcap/pd/server/api.mustNewCluster.func1()
[2020-01-08T03:57:47.822Z] /home/jenkins/agent/workspace/pd_test/go/src/github.com/pingcap/pd/server/api/server_test.go:86 +0x1d8
[2020-01-08T03:57:47.822Z]
[2020-01-08T03:57:47.822Z] Previous write at 0x00000348d150 by goroutine 181:
[2020-01-08T03:57:47.822Z] github.com/pingcap-incubator/tidb-dashboard/pkg/apiserver.Handler()
[2020-01-08T03:57:47.822Z] /home/jenkins/agent/workspace/pd_test/go/pkg/mod/github.com/gin-gonic/gin@v1.5.0/mode.go:66 +0x99
[2020-01-08T03:57:47.822Z] github.com/pingcap/pd/server.CreateServer()
[2020-01-08T03:57:47.822Z] /home/jenkins/agent/workspace/pd_test/go/src/github.com/pingcap/pd/server/server.go:216 +0xed2
[2020-01-08T03:57:47.822Z] github.com/pingcap/pd/server/api.mustNewCluster.func1()
[2020-01-08T03:57:47.822Z] /home/jenkins/agent/workspace/pd_test/go/src/github.com/pingcap/pd/server/api/server_test.go:86 +0x1d8
[2020-01-08T03:57:47.822Z]
[2020-01-08T03:57:47.822Z] Goroutine 180 (running) created at:
[2020-01-08T03:57:47.822Z] github.com/pingcap/pd/server/api.mustNewCluster()
[2020-01-08T03:57:47.822Z] /home/jenkins/agent/workspace/pd_test/go/src/github.com/pingcap/pd/server/api/server_test.go:77 +0x1d8
[2020-01-08T03:57:47.822Z] github.com/pingcap/pd/server/api.(*testDiagnoseAPISuite).TestDiagnoseSlice()
[2020-01-08T03:57:47.822Z] /home/jenkins/agent/workspace/pd_test/go/src/github.com/pingcap/pd/server/api/diagnose_test.go:40 +0x6d
[2020-01-08T03:57:47.822Z] runtime.call32()
[2020-01-08T03:57:47.822Z] /usr/local/go/src/runtime/asm_amd64.s:539 +0x3a
[2020-01-08T03:57:47.822Z] reflect.Value.Call()
[2020-01-08T03:57:47.822Z] /usr/local/go/src/reflect/value.go:321 +0xd3
[2020-01-08T03:57:47.822Z] github.com/pingcap/check.(*suiteRunner).forkTest.func1()
[2020-01-08T03:57:47.822Z] /home/jenkins/agent/workspace/pd_test/go/pkg/mod/github.com/pingcap/check@v0.0.0-20191107115940-caf2b9e6ccf4/check.go:836 +0x9aa
[2020-01-08T03:57:47.822Z] github.com/pingcap/check.(*suiteRunner).forkCall.func1()
[2020-01-08T03:57:47.822Z] /home/jenkins/agent/workspace/pd_test/go/pkg/mod/github.com/pingcap/check@v0.0.0-20191107115940-caf2b9e6ccf4/check.go:730 +0xc4
[2020-01-08T03:57:47.822Z]
[2020-01-08T03:57:47.822Z] Goroutine 181 (running) created at:
[2020-01-08T03:57:47.822Z] github.com/pingcap/pd/server/api.mustNewCluster()
[2020-01-08T03:57:47.822Z] /home/jenkins/agent/workspace/pd_test/go/src/github.com/pingcap/pd/server/api/server_test.go:77 +0x1d8
[2020-01-08T03:57:47.822Z] github.com/pingcap/pd/server/api.(*testDiagnoseAPISuite).TestDiagnoseSlice()
[2020-01-08T03:57:47.822Z] /home/jenkins/agent/workspace/pd_test/go/src/github.com/pingcap/pd/server/api/diagnose_test.go:40 +0x6d
[2020-01-08T03:57:47.822Z] runtime.call32()
[2020-01-08T03:57:47.822Z] /usr/local/go/src/runtime/asm_amd64.s:539 +0x3a
[2020-01-08T03:57:47.822Z] reflect.Value.Call()
[2020-01-08T03:57:47.822Z] /usr/local/go/src/reflect/value.go:321 +0xd3
[2020-01-08T03:57:47.822Z] github.com/pingcap/check.(*suiteRunner).forkTest.func1()
[2020-01-08T03:57:47.822Z] /home/jenkins/agent/workspace/pd_test/go/pkg/mod/github.com/pingcap/check@v0.0.0-20191107115940-caf2b9e6ccf4/check.go:836 +0x9aa
[2020-01-08T03:57:47.822Z] github.com/pingcap/check.(*suiteRunner).forkCall.func1()
[2020-01-08T03:57:47.822Z] /home/jenkins/agent/workspace/pd_test/go/pkg/mod/github.com/pingcap/check@v0.0.0-20191107115940-caf2b9e6ccf4/check.go:730 +0xc4
[2020-01-08T03:57:47.822Z] ==================

@siddontang
Copy link
Contributor

so now we don't have PD_WEB, right?

@breezewish
Copy link
Member Author

@siddontang In this PR, PD Web is still kept in pd. After we migrated all features from PD Web to Dashboard (especially KeyVis), maybe PD Web can be removed.

@lhy1024 lhy1024 added the component/visualization Visualization. label Jan 8, 2020
Signed-off-by: Breezewish <me@breeswish.org>
Signed-off-by: Breezewish <me@breeswish.org>
Signed-off-by: Breezewish <me@breeswish.org>
@codecov-io
Copy link

codecov-io commented Jan 8, 2020

Codecov Report

❗ No coverage uploaded for pull request base (master@e7f7d39). Click here to learn what that means.
The diff coverage is 89.04%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #2086   +/-   ##
=========================================
  Coverage          ?   77.16%           
=========================================
  Files             ?      194           
  Lines             ?    19572           
  Branches          ?        0           
=========================================
  Hits              ?    15103           
  Misses            ?     3346           
  Partials          ?     1123
Impacted Files Coverage Δ
server/schedule/operator/builder.go 95.12% <ø> (ø)
server/region_syncer/server.go 79.48% <ø> (ø)
server/cluster/cluster.go 81.31% <ø> (ø)
client/client.go 69% <ø> (ø)
server/cluster/cluster_worker.go 72.26% <0%> (ø)
server/schedulers/shuffle_hot_region.go 69.79% <100%> (ø)
server/server.go 83.51% <100%> (ø)
server/config/config.go 87.5% <100%> (ø)
server/api/scheduler.go 40.93% <100%> (ø)
pkg/grpcutil/grpcutil.go 43.47% <37.5%> (ø)
... and 7 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 e7f7d39...909ea83. Read the comment docs.

pkg/dashboard/uiserver/empty_assets_handler.go Outdated Show resolved Hide resolved
Makefile Show resolved Hide resolved
scripts/.gitignore Outdated Show resolved Hide resolved
scripts/embed-dashboard-ui.sh Outdated Show resolved Hide resolved
scripts/embed-dashboard-ui.sh Outdated Show resolved Hide resolved
scripts/embed-dashboard-ui.sh Outdated Show resolved Hide resolved
scripts/embed-dashboard-ui.sh Outdated Show resolved Hide resolved
scripts/embed-dashboard-ui.sh Outdated Show resolved Hide resolved
server/config/config.go Show resolved Hide resolved
scripts/embed-dashboard-ui.sh Show resolved Hide resolved
Co-Authored-By: 混沌DM <hundundm@gmail.com>
@nolouch nolouch modified the milestones: v4.0.0-beta, v4.0.0-beta.1 Jan 14, 2020
breezewish and others added 3 commits January 14, 2020 23:06
Signed-off-by: Breezewish <me@breeswish.org>
Signed-off-by: Breezewish <me@breeswish.org>
@breezewish
Copy link
Member Author

@HunDunDM Hi, I tried to move the generated Go source code into a standalone package to minimize the scope to skip in CI today, and found that due to assetFS() was exported as a private function in https://github.com/elazarl/go-bindata-assetfs , actually we will always need another source file that re-exports it to public. Thus I abandoned this solution, but made the uiserver package itself simple enough like a re-export. Hope this helps "minimize" the skipping in another way. PTAL.

Signed-off-by: Breezewish <me@breeswish.org>
Copy link
Member

@HunDunDM HunDunDM left a comment

Choose a reason for hiding this comment

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

LGTM.

@HunDunDM
Copy link
Member

/merge

@sre-bot sre-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jan 15, 2020
@sre-bot
Copy link
Contributor

sre-bot commented Jan 15, 2020

/run-all-tests

@sre-bot sre-bot merged commit 67898dc into master Jan 15, 2020
@disksing disksing deleted the with-dashboard branch January 28, 2020 04:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/visualization Visualization. status/can-merge Indicates a PR has been approved by a committer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants