From f53c5198431c0058dde9c0fe7ce93f8d934a7905 Mon Sep 17 00:00:00 2001 From: Mikhail Goncharov Date: Fri, 19 Mar 2021 09:22:21 +0100 Subject: [PATCH] updated docs on windows dev, new setting to skip generated steps --- docs/playbooks.md | 26 +++++++++++++++++++------- scripts/pipeline_main.py | 5 +++-- scripts/pipeline_premerge.py | 5 +++-- 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/docs/playbooks.md b/docs/playbooks.md index e8d5610..1afab0b 100644 --- a/docs/playbooks.md +++ b/docs/playbooks.md @@ -94,11 +94,10 @@ If you want to build/update/test docker container for Windows, you need to do th **Note**: There is an existing *windows-development* machine that you can resume and use for development. Please stop it after use. -Here are the instructions to set up such a machine on GCP. +To setup new machine in GCP: 1. Pick a GCP Windows image with Desktop Support. - * pick a "persistent SSD" as boot Disk. This is much faster - * (optionally) add a "local scratch SSD" and use it as you workspace. This will make builds faster, but you **will not be able to stop** this instance and will have to kill and re-create it again. + * pick a "persistent SSD" as boot Disk. This is much faster. * make sure that you give enough permissions in "Identity and API access" to be able to e.g. push new docker images to GCR. 1. Format the local SSD partition and use it as workspace. @@ -113,6 +112,11 @@ Here are the instructions to set up such a machine on GCP. git config --global user.name git config --global user.email ``` +1. Clone premerge checks sources: + ```powershell + cd c:\ + git clone https://github.com/google/llvm-premerge-checks + ``` 1. Install [Docker Enterprise](https://docs.docker.com/ee/docker-ee/windows/docker-ee/) and reboot: ```powershell Install-Module DockerMsftProvider -Force @@ -125,12 +129,19 @@ Here are the instructions to set up such a machine on GCP. gcloud components install docker-credential-gcr docker-credential-gcr configure-docker ``` -1. To build and run the current agent run: +1. To build and run a dockerfile: + ```powershell + cd llvm-premerge-checks\containers + .\build_deploy.ps1 agent-windows-buildkite +1. To deploy container: ```powershell - cd c:\ - git clone https://github.com/google/llvm-premerge-checks cd llvm-premerge-checks\containers - .\build_deploy.ps1 agent-windows-buildkite + .\build_deploy.ps1 agent-windows-buildkite + ``` + + Test this newly uploaded image: + + ```powershell c:\llvm-premerge-check\scripts\windows_agent_start_buildkite.ps1 ``` @@ -171,6 +182,7 @@ Most commonly used are: - `ph_log_level` ("DEBUG", "INFO", "WARNING" (default) or "ERROR"): log level for build scripts. - `ph_linux_agents`, `ph_windows_agents`: custom JSON constraints on agents. For example you might put one machine to a custom queue if it's errornous and send jobs to it with `ph_windows_agents="{{\"queue\": \"custom\"}}"`. - `ph_skip_linux`, `ph_skip_windows` (if set to any value): skip build on this OS. +- `ph_skip_generated`: don't run custom steps generated from within llvm-project. ## Update HTTP auth credentials diff --git a/scripts/pipeline_main.py b/scripts/pipeline_main.py index 1c40b9c..c2f762c 100755 --- a/scripts/pipeline_main.py +++ b/scripts/pipeline_main.py @@ -39,8 +39,9 @@ if __name__ == '__main__': steps.extend(generic_windows( os.getenv('ph_projects', 'clang;clang-tools-extra;libc;libcxx;libcxxabi;lld;libunwind;mlir;polly'))) - for gen in steps_generators: - steps.extend(from_shell_output(gen)) + if os.getenv('ph_skip_generated') is None: + for gen in steps_generators: + steps.extend(from_shell_output(gen)) notify = [] for e in notify_emails: diff --git a/scripts/pipeline_premerge.py b/scripts/pipeline_premerge.py index cace751..f74e3d6 100755 --- a/scripts/pipeline_premerge.py +++ b/scripts/pipeline_premerge.py @@ -68,8 +68,9 @@ if __name__ == '__main__': if len(windows_projects) > 0: steps.extend(generic_windows(';'.join(sorted(windows_projects)))) # Add custom checks. - for gen in steps_generators: - steps.extend(from_shell_output(gen)) + if os.getenv('ph_skip_generated') is None: + for gen in steps_generators: + steps.extend(from_shell_output(gen)) if phid is None: logging.warning('ph_target_phid is not specified. Skipping "Report" step')