From e0e8f64f54b78562999ae615f5c90928aa9638f6 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Thu, 2 May 2019 00:00:21 -0400 Subject: [PATCH] Move windows and mac nightly builds to taskcluster. --- etc/ci/buildbot_steps.yml | 22 ++-------------- etc/ci/update-wpt-checkout | 3 ++- etc/taskcluster/decision_task.py | 45 ++++++++++++++++++++++++++++++++ etc/taskcluster/decisionlib.py | 12 ++++----- 4 files changed, 55 insertions(+), 27 deletions(-) diff --git a/etc/ci/buildbot_steps.yml b/etc/ci/buildbot_steps.yml index 0f1b5245b1c..7ee31c790c2 100644 --- a/etc/ci/buildbot_steps.yml +++ b/etc/ci/buildbot_steps.yml @@ -43,16 +43,6 @@ mac-rel-css2: - ./mach test-wpt --release --processes 4 --total-chunks 6 --this-chunk 6 --log-raw test-wpt.log --log-errorsummary wpt-errorsummary.log --always-succeed - ./mach filter-intermittents wpt-errorsummary.log --log-intermittents intermittents.log --log-filteredsummary filtered-wpt-errorsummary.log --tracker-api default --reporter-api default -mac-nightly: - - ./mach clean-nightlies --keep 3 --force - - ./mach clean-cargo-cache --keep 3 --force - - env PKG_CONFIG_PATH=/usr/local/opt/zlib/lib/pkgconfig ./mach build --release - - ./mach package --release - - ./mach upload-nightly mac - - ./etc/ci/update-wpt-checkout fetch-and-update-expectations - - ./etc/ci/update-wpt-checkout open-pr - - ./etc/ci/update-wpt-checkout cleanup - linux-rel-intermittent: env: CC: gcc-5 @@ -231,16 +221,6 @@ arm64: - bash ./etc/ci/lockfile_changed.sh - ./etc/ci/clean_build_artifacts.sh -windows-msvc-nightly: - env: - CARGO_HOME: C:\buildbot\.cargo - commands: - - mach.bat clean-cargo-cache --keep 3 --force - - mach.bat clean-nightlies --keep 3 --force - - mach.bat build --release - - mach.bat package --release - - mach.bat upload-nightly windows-msvc - # Moved to Taskcluster linux-dev: [] mac-dev-unit: [] @@ -249,3 +229,5 @@ android: [] android-x86: [] mac-rel-wpt1: [] android-nightly: [] +windows-msvc-nightly: [] +mac-nightly: [] diff --git a/etc/ci/update-wpt-checkout b/etc/ci/update-wpt-checkout index b83db2fa373..015018f7ab1 100755 --- a/etc/ci/update-wpt-checkout +++ b/etc/ci/update-wpt-checkout @@ -85,6 +85,7 @@ function unsafe_update_metadata() { # against servo/servo. function unsafe_open_pull_request() { WPT_SYNC_USER=servo-wpt-sync + WPT_SYNC_TOKEN=`cat .wpt-token` # If the branch doesn't exist, we'll silently exit. This deals with the # case where an earlier step either failed or discovered that syncing @@ -92,7 +93,7 @@ function unsafe_open_pull_request() { git checkout "${BRANCH_NAME}" || return 0 if [[ -z "${WPT_SYNC_TOKEN+set}" ]]; then - echo "Github auth token missing from WPT_SYNC_TOKEN." + echo "Github auth token missing from .wpt-token file." return 1 fi diff --git a/etc/taskcluster/decision_task.py b/etc/taskcluster/decision_task.py index 8e45e4fd509..0bc77b599e4 100644 --- a/etc/taskcluster/decision_task.py +++ b/etc/taskcluster/decision_task.py @@ -92,6 +92,8 @@ def main(task_for): linux_nightly() android_nightly("arm") android_nightly("x86") + windows_nightly() + macos_nightly() # These are disabled in a "real" decision task, @@ -391,6 +393,20 @@ def windows_release(): ) +def windows_nightly(): + return ( + windows_build_task("Release build") + .with_treeherder("Windows x64", "Nightly") + .with_script("mach build --release", + "mach package --release") + .with_s3_upload_secret() + .with_script("mach upload-nightly windows-msvc") + .with_artifacts("repo/target/release/msi/Servo.exe", + "repo/target/release/msi/Servo.zip") + .find_or_create("build.windows_x64_nightly." + CONFIG.git_sha) + ) + + def linux_nightly(): return ( linux_build_task("Nightly build and upload") @@ -431,6 +447,35 @@ def linux_wpt(): total_chunks=2, processes=24) +def macos_nightly(): + return ( + macos_build_task("Release build") + .with_treeherder("macOS x64", "Nightly") + .with_features("taskclusterProxy") + .with_script(""" + ./mach build --release + ./mach package --release + """) + .with_s3_upload_secret() + .with_script("./mach upload-nightly mac") + .with_artifacts("repo/target/release/servo-tech-demo.dmg") + .with_scopes("secrets:get:project/servo/wpt-sync") + .with_env(PY2="""if 1: + import urllib, json + url = "http://taskcluster/secrets/v1/secret/project/servo/wpt-sync" + token = json.load(urllib.urlopen(url))["secret"]["token"] + open(".wpt-token", "w").write(token) + """) + .with_script(""" + python -c "$PY2" + ./etc/ci/update-wpt-checkout fetch-and-update-expectations + ./etc/ci/update-wpt-checkout open-pr + ./etc/ci/update-wpt-checkout cleanup + """) + .find_or_create("build.mac_x64_nightly." + CONFIG.git_sha) + ) + + def macos_wpt(): build_task = ( macos_build_task("Release build") diff --git a/etc/taskcluster/decisionlib.py b/etc/taskcluster/decisionlib.py index b729c9c369c..1bb662a24c2 100644 --- a/etc/taskcluster/decisionlib.py +++ b/etc/taskcluster/decisionlib.py @@ -178,15 +178,15 @@ class Task: self .with_scopes("secrets:get:project/servo/s3-upload") .with_env(PY=r"""if 1: - import urllib, json + import urllib, json, os + from os.path import expanduser, join url = "http://taskcluster/secrets/v1/secret/project/servo/s3-upload" secret = json.load(urllib.urlopen(url))["secret"] - open("/root/.aws/credentials", "w").write(secret["credentials_file"]) - """) - .with_script(""" - mkdir /root/.aws - python -c "$PY" + aws_dir = expanduser("~/.aws") + os.mkdir(aws_dir) + open(join(aws_dir, "credentials"), "w").write(secret["credentials_file"]) """) + .with_script('python -c "$PY"') ) def build_worker_payload(self): # pragma: no cover