Skip to content

Commit

Permalink
Add XB1 builders and runner
Browse files Browse the repository at this point in the history
b/266878119
  • Loading branch information
kaidokert authored and isarkis committed Aug 10, 2023
1 parent ff06e1c commit 74c21f9
Show file tree
Hide file tree
Showing 5 changed files with 135 additions and 2 deletions.
16 changes: 16 additions & 0 deletions .github/config/xb1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"docker_service": "build-xb1",
"__comment" : "TODO: Deploy a runner and change this",
"docker_runner_service": "runner-xb1",
"platforms": [
"xb1"
],
"includes": [
{
"name":"xb1",
"platform":"xb1",
"target_platform":"xb1",
"extra_gn_arguments":"is_clang=false"
}
]
}
32 changes: 32 additions & 0 deletions .github/workflows/xb1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: win32

on:
pull_request:
types: [opened, reopened, synchronize, labeled]
branches:
- main
- feature/*
push:
branches:
- main
- feature/*
schedule:
# GTM timezone.
- cron: '0 4 * * *'
workflow_dispatch:
inputs:
nightly:
description: 'Nightly workflow.'
required: true
type: boolean
default: false

jobs:
xb1:
uses: ./.github/workflows/main_win.yaml
permissions:
packages: write
pull-requests: write
with:
platform: xb1
nightly: ${{ github.event.inputs.nightly }}
36 changes: 35 additions & 1 deletion docker-compose-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,17 @@ services:
- cobalt-build-win32-base
image: cobalt-build-win-win32

build-xb1:
<<: *common-definitions
build:
context: ./docker/windows/xb1
dockerfile: ./Dockerfile
args:
- FROM_IMAGE=cobalt-build-win32-base
depends_on:
- cobalt-build-win32-base
image: cobalt-build-xb1

# -----------------------------------------
# Win32 Platform Images for Building Cobalt
# -----------------------------------------
Expand All @@ -115,13 +126,36 @@ services:
PLATFORM: win-win32
image: cobalt-build-win32

xb1:
<<: *common-definitions
environment:
<<: *shared-build-env
PLATFORM: xb1
COBALT_CONCURRENT_LINKS: ${COBALT_CONCURRENT_LINKS:-2}
image: cobalt-build-xb1
depends_on:
- build-xb1

runner-win-win32:
<<: *common-definitions
build:
context: ./docker/windows/runner
dockerfile: ./Dockerfile
args:
- RUNNER_VERSION=2.294.0
- FROM_IMAGE=${FROM_IMAGE:-cobalt-build-win32}
depends_on:
- cobalt-build-win32-base
- win-win32
image: cobalt-runner-win-win32

runner-xb1:
<<: *common-definitions
build:
context: ./docker/windows/runner
dockerfile: ./Dockerfile
args:
- RUNNER_VERSION=2.294.0
- FROM_IMAGE=${FROM_IMAGE:-cobalt-build-xb1}
depends_on:
- xb1
image: cobalt-runner-xb1
3 changes: 2 additions & 1 deletion docker/windows/runner/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM cobalt-build-win32-base
ARG FROM_IMAGE
FROM ${FROM_IMAGE}

SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';$ProgressPreference='silentlyContinue';"]

Expand Down
50 changes: 50 additions & 0 deletions docker/windows/xb1/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# escape=`

# Copyright 2021 The Cobalt Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
ARG FROM_IMAGE
FROM ${FROM_IMAGE}

SHELL ["powershell", "-ExecutionPolicy", "Unrestricted", "-Command", `
"$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

# Note: Visual Studio is installed as part of cobalt-build-win-base

# Windows SDK
RUN Invoke-WebRequest -Uri https://go.microsoft.com/fwlink/p/?linkid=2173743 `
-OutFile C:\win_sdk_installer.exe ; `
Write-Host 'Installing win_sdk_installer.exe ...' ; `
C:\win_sdk_installer.exe /ceip off /quiet /features + | Out-Null ; `
Write-Host 'Install of win_sdk_installer.exe completed. Cleaning up ...' ; `
Remove-Item -Force -Recurse $env:TEMP\* ; `
Remove-Item C:\win_sdk_installer.exe

# MSVC sdk
ARG vs_buildtools_version="15"
ARG windows_11_sdk_version="22000"
RUN Write-Host 'Downloading vs_buildtools.exe' ; `
Invoke-WebRequest -Uri https://aka.ms/vs/${env:vs_buildtools_version}/release/vs_buildtools.exe `
-OutFile C:\vs_buildtools.exe ; `
Write-Host 'Installing vs_buildtools.exe ...' ;`
Start-Process -Wait -FilePath C:\vs_buildtools.exe -ArgumentList "--quiet","--wait","--norestart","--nocache","--installPath","C:\BuildTools","--add","Microsoft.VisualStudio.Component.Windows11SDK.${env:windows_11_sdk_version}","--add","Microsoft.VisualStudio.Component.VC.Redist.14.Latest" ; `
Write-Host 'Install of vs_buildtools.exe completed. Cleaning up ...' ; `
Remove-Item C:\vs_buildtools.exe


WORKDIR "C:\code"

CMD python3 cobalt/build/gn.py -p $env:PLATFORM -c $env:CONFIG out/${env:PLATFORM}_${env:CONFIG};`
if ($?) {`
ninja $env:NINJA_FLAGS -C out/${env:PLATFORM}_$env:CONFIG $env:TARGET;`
}

0 comments on commit 74c21f9

Please sign in to comment.