This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
Add scripts that prepares our windows VM image #8446
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| This directory should include scripts to build the docker container image used | ||
| for building flutter/engine in our CI system (currently [Cirrus](cirrus-ci.org)) | ||
| using Windows. | ||
|
|
||
| So far we're still waiting GKE to have Kubernetes 1.14 and Windows containers. | ||
|
|
||
| Before that, we use GCE Windows VMs for our CI tests. This directory includes | ||
| scripts for preparing that VM. |
53 changes: 53 additions & 0 deletions
53
ci/docker/windows_build/prepare_windows_server_2016_core.ps1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| # The following powershell script prepares the VM image | ||
| # flutter-engine-windows-server-2016-core used by Flutter engine's | ||
| # build_windows presubmit tests (see .cirrus.yml). | ||
| # | ||
| # The exact step of generating the VM image is: | ||
| # 1. Create a "Windows Server 2016 Datacenter Core" GCE instance with 50GB disk | ||
| # 2. RDP into that GCE instance to run this script with powershell | ||
| # (e.g., `powershell -File prepare_windows_server_2016_core.ps1`) | ||
| # 3. Shutdown the instance and take an image of that instance | ||
| # | ||
| # Note that ` is the escape character in powershell. | ||
|
|
||
| # Install visual studio 2017 | ||
| curl https://aka.ms/vs/15/release/vs_community.exe -o vs_community.exe | ||
| ./vs_community.exe --passive --wait ` | ||
| --add Microsoft.VisualStudio.Workload.NativeCrossPlat ` | ||
| --add Microsoft.VisualStudio.Workload.NativeDesktop --includeRecommended | ||
|
|
||
| # Install debugger tools | ||
| curl https://download.microsoft.com/download/5/C/3/5C3770A3-12B4-4DB4-BAE7-99C624EB32AD/windowssdk/winsdksetup.exe ` | ||
| -o winsdksetup.exe | ||
| ./winsdksetup.exe /features OptionId.WindowsDesktopDebuggers /q | ||
|
|
||
| # Download depot tools | ||
| curl https://storage.googleapis.com/chrome-infra/depot_tools.zip ` | ||
| -o depot_tools.zip | ||
| Expand-Archive -LiteralPath depot_tools.zip -DestinationPath c:/depot_tools | ||
|
|
||
| # Download git. Although depot_tools has its own git.bat, this is needed for | ||
| # Flutter engine's gn to run correctly. | ||
| # | ||
| # Somehow, curl can't get the MinGit from github. Fortunately, taobo works. | ||
| curl https://npm.taobao.org/mirrors/git-for-windows/v2.21.0.windows.1/MinGit-2.21.0-64-bit.zip ` | ||
| -o MinGit.zip | ||
| Expand-Archive -LiteralPath MinGit.zip -DestinationPath c:/MinGit | ||
|
|
||
| # Restarting the terminal (or even the whole VM) is required to let following | ||
| # environment variables to take effect. | ||
| setx path "c:/depot_tools/;c:/MinGit/cmd;${env:path}" | ||
| setx DEPOT_TOOLS_WIN_TOOLCHAIN 0 | ||
| setx GYP_MSVS_OVERRIDE_PATH "c:/Program Files (x86)/Microsoft Visual Studio/2017/Community" | ||
|
|
||
| mkdir c:/flutter/engine | ||
| curl https://raw.githubusercontent.com/flutter/engine/master/ci/docker/build/engine_gclient ` | ||
| -o c:/flutter/engine/.gclient | ||
|
|
||
| # Once all the environment variables above are loaded correctly, one may test | ||
| # build the engine by: | ||
| # cd c:/flutter/engine | ||
| # gclient sync | ||
| # cd src | ||
| # python flutter/tools/gn | ||
| # ninja -C out/host_debug | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to tell the user what to do next at the end. In this script, probably add:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think thi scomment is in reference to the state of the container rather than what the user should be doing at this point...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Tong and Dan for the comments! I think both of you are kind of correct: the steps that Tong mentioned are the next steps someone would do to test the correctness of the image; on the other hand, one can directly make an image without doing the test, so those next steps are optional.
I'll create another PR to add comments to clarify this. We can discuss there until it's clear what this script is doing and how someone should use it.