From 17022922cb4ef2f689e075a29a84c0773267da5e Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Thu, 21 Oct 2021 10:34:50 -0400 Subject: [PATCH] Separate out cloudbuild 'all' vs smoke test (smaller build subset). (#10719) * Separatte out cloudbuild 'all' vs smoke test (smaller build subset). This allows cloudbuild to selectively 'build evetyhing' vs a smaller subset. Smaller subset (smoke test) allows for: - less chances for failed builds due to new platforms being added - faster builds because not taking into account as many platform and build variations (like ipv6 or rpc) Build all is still available for scheduled builds * Restyle fixes * Add ids to each step - the ids are shown in the UI and useful * Use more CPU for build-all as we already reach the 2 hour time limit --- integrations/cloudbuild/build-all.yaml | 39 ++++++--- integrations/cloudbuild/smoke-test.yaml | 107 ++++++++++++++++++++++++ 2 files changed, 135 insertions(+), 11 deletions(-) create mode 100644 integrations/cloudbuild/smoke-test.yaml diff --git a/integrations/cloudbuild/build-all.yaml b/integrations/cloudbuild/build-all.yaml index 7205a560de68cf..161fe181ab740e 100644 --- a/integrations/cloudbuild/build-all.yaml +++ b/integrations/cloudbuild/build-all.yaml @@ -1,14 +1,31 @@ -# NOTE: /workspace/ is the persistent directory across steps steps: - name: "connectedhomeip/chip-build-vscode:0.5.18" - id: "CompileAll" - entrypoint: "./scripts/run_in_build_env.sh" + env: + - PW_ENVIRONMENT_ROOT=/pwenv args: - [ - "./scripts/build/build_examples.py --enable-flashbundle build - --create-archives /workspace/artifacts/", - ] - timeout: 7200s + - "-c" + - source ./scripts/bootstrap.sh + id: Bootstrap + entrypoint: /usr/bin/bash + volumes: + - name: pwenv + path: /pwenv + timeout: 900s + + - name: "connectedhomeip/chip-build-vscode:0.5.18" + env: + - PW_ENVIRONMENT_ROOT=/pwenv + args: + - >- + ./scripts/build/build_examples.py --enable-flashbundle build + --create-archives /workspace/artifacts/ + id: CompileAll + waitFor: + - Bootstrap + entrypoint: ./scripts/run_in_build_env.sh + volumes: + - name: pwenv + path: /pwenv logsBucket: matter-build-automation-build-logs @@ -20,7 +37,7 @@ artifacts: location: "gs://matter-build-automation-artifacts/$PROJECT_ID/$COMMIT_SHA/" paths: ["/workspace/artifacts/*.tar.gz"] -# Using higher CPU machines generally speeds up builds by > 4x (faster as we spend more time -# building instead of docker download/checkout/bootstrap) +# Using higher CPU machines generally speeds up builds, except bootstrap is always +# slow. options: - machineType: "E2_HIGHCPU_8" + machineType: "E2_HIGHCPU_32" diff --git a/integrations/cloudbuild/smoke-test.yaml b/integrations/cloudbuild/smoke-test.yaml new file mode 100644 index 00000000000000..ee690e35bfa8a4 --- /dev/null +++ b/integrations/cloudbuild/smoke-test.yaml @@ -0,0 +1,107 @@ +steps: + - name: "connectedhomeip/chip-build-vscode:0.5.18" + env: + - PW_ENVIRONMENT_ROOT=/pwenv + args: + - "-c" + - source ./scripts/bootstrap.sh + id: Bootstrap + entrypoint: /usr/bin/bash + volumes: + - name: pwenv + path: /pwenv + timeout: 900s + + - name: "connectedhomeip/chip-build-vscode:0.5.18" + id: ESP32 + env: + - PW_ENVIRONMENT_ROOT=/pwenv + args: + - >- + ./scripts/build/build_examples.py --enable-flashbundle + --target-glob '*-m5stack-*' build --create-archives + /workspace/artifacts/ + waitFor: + - Bootstrap + entrypoint: ./scripts/run_in_build_env.sh + volumes: + - name: pwenv + path: /pwenv + + - name: "connectedhomeip/chip-build-vscode:0.5.18" + id: NRFConnect + env: + - PW_ENVIRONMENT_ROOT=/pwenv + args: + - >- + ./scripts/build/build_examples.py --enable-flashbundle + --target-glob '*-nrf52840-{lock,light}' build --create-archives + /workspace/artifacts/ + waitFor: + - Bootstrap + entrypoint: ./scripts/run_in_build_env.sh + volumes: + - name: pwenv + path: /pwenv + + - name: "connectedhomeip/chip-build-vscode:0.5.18" + id: EFR32 + env: + - PW_ENVIRONMENT_ROOT=/pwenv + args: + - >- + ./scripts/build/build_examples.py --enable-flashbundle + --target-glob '*-brd4161a-{lock,light}' build --create-archives + /workspace/artifacts/ + waitFor: + - Bootstrap + entrypoint: ./scripts/run_in_build_env.sh + volumes: + - name: pwenv + path: /pwenv + + - name: "connectedhomeip/chip-build-vscode:0.5.18" + id: Linux + env: + - PW_ENVIRONMENT_ROOT=/pwenv + args: + - >- + ./scripts/build/build_examples.py --enable-flashbundle + --target-glob 'linux-*' build --create-archives + /workspace/artifacts/ + waitFor: + - Bootstrap + entrypoint: ./scripts/run_in_build_env.sh + volumes: + - name: pwenv + path: /pwenv + + - name: "connectedhomeip/chip-build-vscode:0.5.18" + env: + - PW_ENVIRONMENT_ROOT=/pwenv + args: + - >- + ./scripts/build/build_examples.py --enable-flashbundle + --target-glob 'android-{arm64,x64}-chip-tool' build + --create-archives /workspace/artifacts/ + waitFor: + - Bootstrap + entrypoint: ./scripts/run_in_build_env.sh + volumes: + - name: pwenv + path: /pwenv + +logsBucket: matter-build-automation-build-logs + +# Global timeout for all steps +timeout: 7200s + +artifacts: + objects: + location: "gs://matter-build-automation-artifacts/$PROJECT_ID/$COMMIT_SHA/" + paths: ["/workspace/artifacts/*.tar.gz"] + +# Using higher CPU machines generally speeds up builds by > 4x (faster as we spend more time +# building instead of docker download/checkout/bootstrap) +options: + machineType: "E2_HIGHCPU_8"