From 578c3ef6f55b888a46576f6ac4eeb9ffe89f70d0 Mon Sep 17 00:00:00 2001 From: liyuqian Date: Mon, 30 Jul 2018 11:59:54 -0700 Subject: [PATCH] Use container and GKE to accelerate build (flutter/engine#5897) This reduces the build time from 5 minutes to 3 minutes as we no longer need to cold start a GCE instance. Moreover, we can now compile the host engine using this container. --- engine/src/flutter/.cirrus.yml | 35 +++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/engine/src/flutter/.cirrus.yml b/engine/src/flutter/.cirrus.yml index 8e1be2de95..d4121214c8 100644 --- a/engine/src/flutter/.cirrus.yml +++ b/engine/src/flutter/.cirrus.yml @@ -1,27 +1,32 @@ gcp_credentials: ENCRYPTED[987a78af29b91ce8489594c9ab3fec21845bbe5ba68294b8f6def3cf0d380830f06687a89ea69c87344c5ade369700fe] -gce_instance: - image_project: flutter-cirrus - image_name: flutter-engine-ubuntu1604 - zone: us-central1-a - cpu: 24 - memory: 32Gb - disk: 60 +gke_container: + image: gcr.io/flutter-cirrus/build-engine-image:latest + cluster_name: build-32-cluster + zone: us-central1-a + namespace: default + cpu: 30 # can't use all 30-cores; system pods needs cores too + memory: 100Gb # similarly, can't use all 100Gb memory -build_android_task: +task: env: CIRRUS_WORKING_DIR: "/tmp/github_repo" - ENGINE_PATH: "/var/tmp/flutter/engine" - PATH: $PATH:/var/tmp/depot_tools replace_engine_script: | cd $ENGINE_PATH/src rm -r flutter - cp $CIRRUS_WORKING_DIR -r ./flutter + mv $CIRRUS_WORKING_DIR flutter gclient sync - compile_android_script: | - cd $ENGINE_PATH/src - ./flutter/tools/gn --android --unoptimized - ninja -C out/android_debug_unopt + matrix: + - name: build_host + compile_host_script: | + cd $ENGINE_PATH/src + ./flutter/tools/gn --unoptimized + ninja -C out/host_debug_unopt + - name: build_android + compile_host_script: | + cd $ENGINE_PATH/src + ./flutter/tools/gn --android --unoptimized + ninja -C out/android_debug_unopt