Repository navigation
158 lines (153 loc) · 5.85 KB
/
Copy pathpixel-host.yml
File metadata and controls
158 lines (153 loc) · 5.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
name: pixel-host
run-name: Pixel release host for ${{ inputs.source || github.sha }}
on:
push:
branches: [main]
paths:
- eliza.lock.json
- pnpm-lock.yaml
- package.json
- .nvmrc
- apps/app/aosp/pixel10a-release.json
- infra/pixel-release/image/**
- .github/actions/pixel-vm/guest.sh
workflow_dispatch:
inputs:
snapshot:
description: Explicit alternate snapshot name (otherwise use the reviewed inputs.json)
required: false
type: string
snapshot_id:
description: Its numeric ID
required: false
type: string
otatools_sha256:
description: SHA-256 of the OTA tools archive on that snapshot
required: false
type: string
ubuntu_image:
description: An Ubuntu 24.04 amd64 image name in ubuntu-os-cloud
required: false
type: string
ubuntu_image_id:
description: Its numeric ID
required: false
type: string
workflow_call:
inputs:
source:
description: The admitted Pixel product commit, whose lockfile the host must also carry offline
required: true
type: string
outputs:
image:
description: The host image link for the caller's controller and product
value: ${{ jobs.image.outputs.image }}
image_id:
description: Its numeric image ID
value: ${{ jobs.image.outputs.image_id }}
permissions: {}
env:
BAKE: infra/pixel-release/image/bake.sh
jobs:
bake:
if: github.repository_id == '1396333361' && github.ref == 'refs/heads/main'
runs-on: ubuntu-24.04
timeout-minutes: 355
environment: pixel-build
concurrency:
group: alpha-pixel-host-bake
queue: max
permissions:
contents: read
id-token: write
outputs:
plan: ${{ steps.resolve.outputs.plan }}
machine: ${{ steps.start.outputs.machine }}
ready: ${{ steps.wait.outputs.ready }}
image: ${{ steps.wait.outputs.image || steps.resolve.outputs.image }}
image_id: ${{ steps.wait.outputs.image_id || steps.resolve.outputs.image_id }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
persist-credentials: false
- uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093
with:
project_id: alpha-aosp-lab-20261024
workload_identity_provider: projects/484320254111/locations/global/workloadIdentityPools/alpha-pixel-release/providers/github-host
service_account: alpha-pixel-bake@alpha-aosp-lab-20261024.iam.gserviceaccount.com
- uses: google-github-actions/setup-gcloud@aa5489c8933f4cc7a4f7d45035b3b1440c9c10db
- id: resolve
env:
GH_TOKEN: ${{ github.token }}
PIXEL_SOURCE: ${{ inputs.source }}
SNAPSHOT: ${{ inputs.snapshot }}
SNAPSHOT_ID: ${{ inputs.snapshot_id }}
OTATOOLS_SHA256: ${{ inputs.otatools_sha256 }}
UBUNTU_IMAGE: ${{ inputs.ubuntu_image }}
UBUNTU_IMAGE_ID: ${{ inputs.ubuntu_image_id }}
run: bash "$BAKE" resolve
- id: start
if: steps.resolve.outputs.image_id == ''
env:
PIXEL_HOST_PLAN: ${{ steps.resolve.outputs.plan }}
run: bash "$BAKE" start
- id: wait
if: steps.resolve.outputs.image_id == ''
env:
PIXEL_HOST_PLAN: ${{ steps.resolve.outputs.plan }}
MACHINE: ${{ steps.start.outputs.machine }}
run: bash "$BAKE" wait "$MACHINE" 19800
- if: always() && steps.start.outputs.machine != '' && (steps.wait.outputs.ready != 'false' || failure() || cancelled())
env:
MACHINE: ${{ steps.start.outputs.machine }}
run: bash "$BAKE" clean "$MACHINE"
finish:
needs: bake
if: needs.bake.outputs.ready == 'false'
runs-on: ubuntu-24.04
timeout-minutes: 345
environment: pixel-build
permissions:
contents: read
id-token: write
outputs:
image: ${{ steps.wait.outputs.image }}
image_id: ${{ steps.wait.outputs.image_id }}
env:
PIXEL_HOST_PLAN: ${{ needs.bake.outputs.plan }}
MACHINE: ${{ needs.bake.outputs.machine }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
persist-credentials: false
- uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093
with:
project_id: alpha-aosp-lab-20261024
workload_identity_provider: projects/484320254111/locations/global/workloadIdentityPools/alpha-pixel-release/providers/github-host
service_account: alpha-pixel-bake@alpha-aosp-lab-20261024.iam.gserviceaccount.com
- uses: google-github-actions/setup-gcloud@aa5489c8933f4cc7a4f7d45035b3b1440c9c10db
- id: wait
run: bash "$BAKE" wait "$MACHINE" 19200
- run: test "$READY" = true
env:
READY: ${{ steps.wait.outputs.ready }}
- if: always()
run: bash "$BAKE" clean "$MACHINE"
image:
needs: [bake, finish]
if: ${{ !cancelled() && needs.bake.result == 'success' && (needs.bake.outputs.ready != 'false' || needs.finish.result == 'success') }}
runs-on: ubuntu-24.04
outputs:
image: ${{ steps.host.outputs.image }}
image_id: ${{ steps.host.outputs.image_id }}
steps:
- id: host
env:
IMAGE: ${{ needs.finish.outputs.image || needs.bake.outputs.image }}
IMAGE_ID: ${{ needs.finish.outputs.image_id || needs.bake.outputs.image_id }}
run: |
set -euo pipefail
[[ "$IMAGE" =~ ^https://www\.googleapis\.com/compute/v1/projects/alpha-aosp-lab-20261024/global/images/alpha-pixel-builder-[0-9a-f]{40}$ && "$IMAGE_ID" =~ ^[1-9][0-9]*$ ]]
printf 'image=%s\nimage_id=%s\n' "$IMAGE" "$IMAGE_ID" >> "$GITHUB_OUTPUT"
printf 'Pixel release host `%s` (ID %s).\n' "${IMAGE##*/}" "$IMAGE_ID" >> "$GITHUB_STEP_SUMMARY"