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

Add native Windows build script #1540

Merged
merged 3 commits into from
May 21, 2019
Merged

Conversation

Hoverbear
Copy link
Contributor

What problem does this PR solve?

Adds native Windows build script for developer usage.

It's possible to build pd in the WSL (Linux for Windows) but it's not possible to run it due to memmap differences that are known and reported. (etcd-io/bbolt#144)

This script requires only Go, Git, and powershell to be available on the machine as far as I can tell. (I'm using a pretty basic windows machine)

Here's a demo running pd on native Windows powershell, tikv on wsl, and the client-rust on wsl as well:
image

Here's the --version output:

image

We shouldn't announce/advertise this though because we haven't done any serious benchmarking or support testing. This is simply to enable Windows users to develop on pd/tikv without needing Docker.

What is changed and how it works?

A build.ps1 file was added since a minimal windows environment does not include make (nmake is available if you use the C++ dev tools but it's not fully compatible, we might try to use it and have errors later).

A Windows user using Powershell can invoke this with ./build and will find familiar binaries at bin/*. They'll see from the script when they run it that these are created:

image

Check List

Tests

  • No code

Code changes

Side effects

  • Increased code complexity

Related changes

  • Need to be included in the release notes

@Hoverbear Hoverbear added type/enhancement The issue or PR belongs to an enhancement. status/tests-passed The PR has passed all tests. labels May 19, 2019
@Hoverbear Hoverbear requested review from brson, nrc and disksing May 19, 2019 18:02
@Hoverbear Hoverbear self-assigned this May 19, 2019
@Hoverbear Hoverbear removed the status/tests-passed The PR has passed all tests. label May 19, 2019
Signed-off-by: Ana Hobden <operator@hoverbear.org>
@nrc
Copy link

nrc commented May 19, 2019

I don't think I can review this sorry, I don't know the powershell syntax, nor PD.

@nrc nrc removed their request for review May 19, 2019 20:28
@Hoverbear
Copy link
Contributor Author

Ok, sorry. :)

@Hoverbear
Copy link
Contributor Author

@disksing I don't really understand how this PR is causing the CI to be red. Could you PTAL?

@disksing
Copy link
Contributor

@Hoverbear Tests are not stable. Not your fault :)

@codecov-io
Copy link

Codecov Report

Merging #1540 into master will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1540      +/-   ##
==========================================
+ Coverage   67.82%   67.83%   +0.01%     
==========================================
  Files         159      159              
  Lines       15777    15777              
==========================================
+ Hits        10701    10703       +2     
+ Misses       4117     4106      -11     
- Partials      959      968       +9
Impacted Files Coverage Δ
pkg/tempurl/tempurl.go 57.14% <0%> (-14.29%) ⬇️
server/schedulers/shuffle_hot_region.go 64.1% <0%> (-6.42%) ⬇️
server/etcd_kv.go 65.95% <0%> (-4.26%) ⬇️
server/namespace_cluster.go 81.81% <0%> (-3.9%) ⬇️
server/schedule/basic_cluster.go 88.67% <0%> (-3.78%) ⬇️
server/core/kv.go 73.91% <0%> (-1.45%) ⬇️
server/grpc_service.go 58.79% <0%> (-1.29%) ⬇️
server/leader.go 82.04% <0%> (-1.23%) ⬇️
server/option.go 90.41% <0%> (-0.84%) ⬇️
server/schedulers/hot_region.go 75.45% <0%> (-0.74%) ⬇️
... and 8 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 9ffc18f...a813307. Read the comment docs.

@nolouch nolouch merged commit cdc23ae into tikv:master May 21, 2019
nolouch added a commit that referenced this pull request May 23, 2019
* tiny clean up code (#1526)

Signed-off-by: Ryan Leung <rleungx@gmail.com>

* config:  enable use region storage by default (#1524)

* config: default enable use region storage

* schedulers: let hot region balance not affect by balance-region-scheduler-limit (#1522)

Signed-off-by: nolouch <nolouch@gmail.com>

* log: do not add stack to error log (#1532)

* *: replace gofail with pingcap/failpoint (#1534)

* *: replace gofail with pingcap/failpoint

Signed-off-by: disksing <i@disksing.com>

* fix typo

Signed-off-by: disksing <i@disksing.com>

* fix typo

Signed-off-by: disksing <i@disksing.com>

* Update server/cluster_test.go

Co-Authored-By: Lonng <chris@lonng.org>

* Update server/tso.go

Co-Authored-By: Lonng <chris@lonng.org>

* Update server/tso.go

Co-Authored-By: Lonng <chris@lonng.org>

* check enable failpoint result

Signed-off-by: disksing <i@disksing.com>

* Update server/cluster.go

Co-Authored-By: Lonng <chris@lonng.org>

* server: set timeout for MoveLeader (#1533)

* server: set timeout for MoveLeader

Signed-off-by: disksing <i@disksing.com>

* client, server: add ScanRegions gRPC protocol support (#1535)

* client, server: support ScanRegions gRPC protocol

Signed-off-by: disksing <i@disksing.com>

* schedule: actively push operator  (#1536)

* schedule: actively push operator

Signed-off-by: nolouch <nolouch@gmail.com>

* *: update some dead links (#1543)

* update links

Signed-off-by: Ryan Leung <rleungx@gmail.com>

* Add windows build script (#1540)

Signed-off-by: Ana Hobden <operator@hoverbear.org>

* fix operator timeout metrics (#1541)

Signed-off-by: Ryan Leung <rleungx@gmail.com>

* *:Rollback config in store when kv.persist failed (#1476)

* tests: independent region sync test (#1545)

* tests: independent syncer region test

Signed-off-by: nolouch <nolouch@gmail.com>

* schedule: operator limit for stores (#1474)

* add store limit for scheduling

Signed-off-by: Ryan Leung <rleungx@gmail.com>

* statistic: add the statistic of flow (#1548)

* store_statistic: add the statistic of flow

Signed-off-by: nolouch <nolouch@gmail.com>
@kennytm
Copy link

kennytm commented Oct 27, 2019

Interestingly the pd-server.exe can be executed directly inside WSL 1, so you don't need to launch PowerShell to run PD.

@Hoverbear
Copy link
Contributor Author

Indeed! You can run it directly in wsl2 too. :) You could also launch it from CMD.

@kennytm
Copy link

kennytm commented Nov 5, 2019

I believe etcd-io/bbolt#144 is already fixed in WSL 2 so we could keep using the Linux version there 😅

@Hoverbear
Copy link
Contributor Author

Sure!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants