forked from smartcontractkit/chainlink
-
Notifications
You must be signed in to change notification settings - Fork 0
288 lines (275 loc) · 11.6 KB
/
docker-build.yml
File metadata and controls
288 lines (275 loc) · 11.6 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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
name: Docker Build
on:
schedule:
- cron: "0 3 * * *" # daily at 03:00 UTC
pull_request:
push:
branches:
- develop
workflow_dispatch:
inputs:
git-ref:
description: "The git ref to check out"
required: true
concurrency:
group: "docker-build-${{ github.ref_name }}"
cancel-in-progress: true
jobs:
init:
runs-on: ubuntu-24.04
outputs:
# To get an image from a feature branch, do one of the following:
# 1. Use a workflow dispatch
# 2. Add the `build-publish` label to your PR, and re-run the workflow (or push a commit)
should-run: >-
${{
steps.pr-labels.outputs.check-label-found == 'true' ||
github.event_name == 'push' ||
github.event_name == 'schedule' ||
github.event_name == 'workflow_dispatch'
}}
runner-arm64: ${{ steps.runner-labels.outputs.runner-arm64 }}
runner-amd64: ${{ steps.runner-labels.outputs.runner-amd64 }}
steps:
- name: Get PR Labels
id: pr-labels
uses: smartcontractkit/.github/actions/get-pr-labels@get-pr-labels/v1
with:
check-label: "build-publish"
skip-merge-group: "true"
- name: Set runner labels
id: runner-labels
shell: bash
env:
SH_RUNNER_LABEL_ARM64: runs-on=${{ github.run_id }}/cpu=8/ram=16/family=c7g/disk=large/spot=false/image=ubuntu24-full-arm64
SH_RUNNER_LABEL_AMD64: runs-on=${{ github.run_id }}/cpu=8/ram=16/family=c7a/disk=large/spot=false/image=ubuntu24-full-x64
GH_RUNNER_LABEL_ARM64: ubuntu-24.04-arm
GH_RUNNER_LABEL_AMD64: ubuntu-24.04
run: |
if [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]]; then
echo "runner-arm64=${SH_RUNNER_LABEL_ARM64}" | tee -a "$GITHUB_OUTPUT"
echo "runner-amd64=${SH_RUNNER_LABEL_AMD64}" | tee -a "$GITHUB_OUTPUT"
else
# Use GitHub runner labels for non-PR events
echo "runner-arm64=${GH_RUNNER_LABEL_ARM64}" | tee -a "$GITHUB_OUTPUT"
echo "runner-amd64=${GH_RUNNER_LABEL_AMD64}" | tee -a "$GITHUB_OUTPUT"
fi
docker-core:
needs: [init]
if: ${{ needs.init.outputs.should-run == 'true' }}
permissions:
contents: read
id-token: write
uses: smartcontractkit/.github/.github/workflows/reusable-docker-build-publish.yml@a89ebdd9d9cabda77c5f7ea7523af5707afb7786 # 2025-08-25
with:
aws-ecr-name: chainlink
aws-region-ecr: us-west-2
aws-region-gati: us-west-2
dockerfile: core/chainlink.Dockerfile
docker-build-context: .
docker-build-args: |
CHAINLINK_USER=chainlink
COMMIT_SHA=${{ github.sha }}
docker-manifest-sign: true
git-sha: ${{ inputs.git-ref || github.sha }}
github-event-name: ${{ github.event_name }}
github-ref-name: ${{ github.ref_name }}
github-ref-type: ${{ github.ref_type}}
github-workflow-repository: ${{ github.repository }}
github-runner-arm64: ${{ needs.init.outputs.runner-arm64 }}
github-runner-amd64: ${{ needs.init.outputs.runner-amd64 }}
secrets:
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID_SDLC }}
AWS_ROLE_PUBLISH_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_BUILD_PUBLISH_DEVELOP_PR }}
AWS_ROLE_GATI_ARN: ${{ secrets.AWS_OIDC_GLOBAL_READ_ONLY_TOKEN_ISSUER_ROLE_ARN }}
AWS_LAMBDA_GATI_URL: ${{ secrets.AWS_INFRA_RELENG_TOKEN_ISSUER_LAMBDA_URL }}
docker-core-plugins:
needs: [init]
if: ${{ needs.init.outputs.should-run == 'true' }}
permissions:
contents: read
id-token: write
uses: smartcontractkit/.github/.github/workflows/reusable-docker-build-publish.yml@a89ebdd9d9cabda77c5f7ea7523af5707afb7786 # 2025-08-25
with:
aws-ecr-name: chainlink
aws-region-ecr: us-west-2
aws-region-gati: us-west-2
dockerfile: plugins/chainlink.Dockerfile
docker-build-context: .
docker-build-args: |
CHAINLINK_USER=chainlink
COMMIT_SHA=${{ github.sha }}
CL_INSTALL_PRIVATE_PLUGINS=true
docker-manifest-sign: true
docker-tag-custom-suffix: "-plugins"
git-sha: ${{ inputs.git-ref || github.sha }}
github-event-name: ${{ github.event_name }}
github-ref-name: ${{ github.ref_name }}
github-ref-type: ${{ github.ref_type}}
github-workflow-repository: ${{ github.repository }}
github-runner-arm64: ${{ needs.init.outputs.runner-arm64 }}
github-runner-amd64: ${{ needs.init.outputs.runner-amd64 }}
secrets:
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID_SDLC }}
AWS_ROLE_PUBLISH_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_BUILD_PUBLISH_DEVELOP_PR }}
AWS_ROLE_GATI_ARN: ${{ secrets.AWS_OIDC_GLOBAL_READ_ONLY_TOKEN_ISSUER_ROLE_ARN }}
AWS_LAMBDA_GATI_URL: ${{ secrets.AWS_INFRA_RELENG_TOKEN_ISSUER_LAMBDA_URL }}
docker-core-plugins-testing:
needs: [init]
if: ${{ needs.init.outputs.should-run == 'true' }}
permissions:
contents: read
id-token: write
uses: smartcontractkit/.github/.github/workflows/reusable-docker-build-publish.yml@a89ebdd9d9cabda77c5f7ea7523af5707afb7786 # 2025-08-25
with:
aws-ecr-name: chainlink
aws-region-ecr: us-west-2
aws-region-gati: us-west-2
dockerfile: plugins/chainlink.Dockerfile
docker-build-context: .
docker-build-args: |
CHAINLINK_USER=chainlink
COMMIT_SHA=${{ github.sha }}
CL_INSTALL_PRIVATE_PLUGINS=true
CL_INSTALL_TESTING_PLUGINS=true
docker-manifest-sign: true
docker-tag-custom-suffix: "-plugins-testing"
git-sha: ${{ inputs.git-ref || github.sha }}
github-event-name: ${{ github.event_name }}
github-ref-name: ${{ github.ref_name }}
github-ref-type: ${{ github.ref_type}}
github-workflow-repository: ${{ github.repository }}
github-runner-arm64: ${{ needs.init.outputs.runner-arm64 }}
github-runner-amd64: ${{ needs.init.outputs.runner-amd64 }}
secrets:
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID_SDLC }}
AWS_ROLE_PUBLISH_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_BUILD_PUBLISH_DEVELOP_PR }}
AWS_ROLE_GATI_ARN: ${{ secrets.AWS_OIDC_GLOBAL_READ_ONLY_TOKEN_ISSUER_ROLE_ARN }}
AWS_LAMBDA_GATI_URL: ${{ secrets.AWS_INFRA_RELENG_TOKEN_ISSUER_LAMBDA_URL }}
docker-ccip:
needs: [init]
if: ${{ needs.init.outputs.should-run == 'true' }}
permissions:
contents: read
id-token: write
uses: smartcontractkit/.github/.github/workflows/reusable-docker-build-publish.yml@a89ebdd9d9cabda77c5f7ea7523af5707afb7786 # 2025-08-25
with:
aws-ecr-name: ccip
aws-region-ecr: us-west-2
aws-region-gati: us-west-2
dockerfile: core/chainlink.Dockerfile
docker-build-context: .
docker-build-args: |
CHAINLINK_USER=chainlink
COMMIT_SHA=${{ github.sha }}
CL_INSTALL_PRIVATE_PLUGINS=true
CL_CHAIN_DEFAULTS=/ccip-config
CL_SOLANA_CMD=
docker-manifest-sign: true
git-sha: ${{ inputs.git-ref || github.sha }}
github-event-name: ${{ github.event_name }}
github-ref-name: ${{ github.ref_name }}
github-ref-type: ${{ github.ref_type}}
github-workflow-repository: ${{ github.repository }}
github-runner-arm64: ${{ needs.init.outputs.runner-arm64 }}
github-runner-amd64: ${{ needs.init.outputs.runner-amd64 }}
secrets:
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID_SDLC }}
AWS_ROLE_PUBLISH_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_BUILD_PUBLISH_DEVELOP_PR }}
AWS_ROLE_GATI_ARN: ${{ secrets.AWS_OIDC_GLOBAL_READ_ONLY_TOKEN_ISSUER_ROLE_ARN }}
AWS_LAMBDA_GATI_URL: ${{ secrets.AWS_INFRA_RELENG_TOKEN_ISSUER_LAMBDA_URL }}
docker-ccip-plugins:
needs: [init]
if: ${{ needs.init.outputs.should-run == 'true' }}
permissions:
contents: read
id-token: write
uses: smartcontractkit/.github/.github/workflows/reusable-docker-build-publish.yml@a89ebdd9d9cabda77c5f7ea7523af5707afb7786 # 2025-08-25
with:
aws-ecr-name: ccip
aws-region-ecr: us-west-2
aws-region-gati: us-west-2
dockerfile: plugins/chainlink.Dockerfile
docker-build-context: .
docker-build-args: |
CHAINLINK_USER=chainlink
COMMIT_SHA=${{ github.sha }}
CL_INSTALL_PRIVATE_PLUGINS=true
CL_CHAIN_DEFAULTS=/ccip-config
docker-manifest-sign: true
docker-tag-custom-suffix: "-plugins"
git-sha: ${{ inputs.git-ref || github.sha }}
github-event-name: ${{ github.event_name }}
github-ref-name: ${{ github.ref_name }}
github-ref-type: ${{ github.ref_type}}
github-workflow-repository: ${{ github.repository }}
github-runner-arm64: ${{ needs.init.outputs.runner-arm64 }}
github-runner-amd64: ${{ needs.init.outputs.runner-amd64 }}
secrets:
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID_SDLC }}
AWS_ROLE_PUBLISH_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_BUILD_PUBLISH_DEVELOP_PR }}
AWS_ROLE_GATI_ARN: ${{ secrets.AWS_OIDC_GLOBAL_READ_ONLY_TOKEN_ISSUER_ROLE_ARN }}
AWS_LAMBDA_GATI_URL: ${{ secrets.AWS_INFRA_RELENG_TOKEN_ISSUER_LAMBDA_URL }}
call-cre-local-env-tests:
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
needs: [docker-core-plugins]
uses: ./.github/workflows/cre-local-env-tests.yaml
with:
chainlink_image_tag: ${{ needs.docker-core-plugins.outputs.docker-manifest-tag }}
chainlink_version: ${{ github.ref_name != '' && github.ref_name || 'develop' }}
secrets: inherit
call-cre-workflow-don-benchmark:
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
needs: [docker-core-plugins-testing]
permissions:
contents: read
id-token: write
uses: ./.github/workflows/cre-workflow-don-benchmark.yaml
with:
chainlink_image_tag: ${{ needs.docker-core-plugins-testing.outputs.docker-manifest-tag }}
chainlink_version: ${{ github.ref_name != '' && github.ref_name || 'develop' }}
secrets: inherit
deploy-nightly-core:
if: false
# temporarily disabled
# if: ${{ github.event_name == 'schedule' }}
needs: [docker-core]
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Deploy
uses: ./.github/actions/deploy-image
with:
aws-role-arn: ${{ secrets.AWS_RELENG_PROD_GATI_WORKFLOW_INVOKE_ARN }}
aws-lambda-url: ${{ secrets.AWS_INFRA_RELENG_TOKEN_ISSUER_LAMBDA_URL }}
aws-region: ${{ secrets.AWS_REGION }}
repo-destination: ${{ secrets.REPO_K8S_DEPLOY }}
oci-image-tag: ${{ needs.docker-core.outputs.docker-manifest-tag }}
oci-repository-url: ${{ format('{0}.dkr.ecr.{1}.amazonaws.com/chainlink', secrets.AWS_ACCOUNT_ID_SDLC, secrets.AWS_REGION) }}
pr-close-enabled: false
products: |
cre
deploy-nightly-ccip:
if: ${{ github.event_name == 'schedule' }}
needs: [docker-ccip]
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Deploy
uses: ./.github/actions/deploy-image
with:
aws-role-arn: ${{ secrets.AWS_RELENG_PROD_GATI_WORKFLOW_INVOKE_ARN }}
aws-lambda-url: ${{ secrets.AWS_INFRA_RELENG_TOKEN_ISSUER_LAMBDA_URL }}
aws-region: ${{ secrets.AWS_REGION }}
repo-destination: ${{ secrets.REPO_K8S_DEPLOY }}
oci-image-tag: ${{ needs.docker-ccip.outputs.docker-manifest-tag }}
oci-repository-url: ${{ format('{0}.dkr.ecr.{1}.amazonaws.com/ccip', secrets.AWS_ACCOUNT_ID_SDLC, secrets.AWS_REGION) }}
pr-close-enabled: false
products: |
ccip-nightlies