Skip to content

Commit a1fd4f4

Browse files
zxiiroclaude
andcommitted
Add LF cluster CI/CD to production workflows
Extend _osdc-deploy.yml and _osdc-plan.yml with an optional aws_role_arn input so LF clusters can use LF_AWS_* secrets without affecting existing Meta cluster workflows (falls back to META_AWS_* when not provided). Add LF cluster jobs directly to osdc-deploy-prod.yml alongside the existing Meta jobs. The all target deploys Meta and LF chains in parallel; all-meta and all-lf deploy only one account's clusters. Individual cluster targets are unchanged. Add LF plan jobs to osdc-plan-prod.yml so PRs run tofu plan against both LF clusters. LF jobs are gated by the osdc-lf-production GitHub environment. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 66a481c commit a1fd4f4

4 files changed

Lines changed: 99 additions & 17 deletions

File tree

.github/workflows/_osdc-deploy.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ on:
1212
required: false
1313
type: string
1414
default: ""
15+
aws_role_arn:
16+
description: "IAM role ARN to assume for AWS operations. Defaults to META_AWS_ACC_ID + META_AWS_DEPLOY_ROLE secrets."
17+
required: false
18+
type: string
19+
default: ""
1520
taint_nodes:
1621
description: "Taint ARC runner nodes with NoSchedule before deploy for graceful refresh"
1722
required: false
@@ -84,7 +89,7 @@ jobs:
8489
- name: Configure AWS credentials
8590
uses: aws-actions/configure-aws-credentials@b47578312673ae6fa5b5096b330d9fbac3d116df # v4.2.1
8691
with:
87-
role-to-assume: arn:aws:iam::${{ secrets.META_AWS_ACC_ID }}:role/${{ secrets.META_AWS_DEPLOY_ROLE }}
92+
role-to-assume: ${{ inputs.aws_role_arn || format('arn:aws:iam::{0}:role/{1}', secrets.META_AWS_ACC_ID, secrets.META_AWS_DEPLOY_ROLE) }}
8893
aws-region: us-west-1
8994
role-duration-seconds: 7200
9095

@@ -134,7 +139,7 @@ jobs:
134139
- name: Configure AWS credentials
135140
uses: aws-actions/configure-aws-credentials@b47578312673ae6fa5b5096b330d9fbac3d116df # v4.2.1
136141
with:
137-
role-to-assume: arn:aws:iam::${{ secrets.META_AWS_ACC_ID }}:role/${{ secrets.META_AWS_DEPLOY_ROLE }}
142+
role-to-assume: ${{ inputs.aws_role_arn || format('arn:aws:iam::{0}:role/{1}', secrets.META_AWS_ACC_ID, secrets.META_AWS_DEPLOY_ROLE) }}
138143
aws-region: us-west-1
139144
role-duration-seconds: 7200
140145

@@ -175,7 +180,7 @@ jobs:
175180
- name: Configure AWS credentials
176181
uses: aws-actions/configure-aws-credentials@b47578312673ae6fa5b5096b330d9fbac3d116df # v4.2.1
177182
with:
178-
role-to-assume: arn:aws:iam::${{ secrets.META_AWS_ACC_ID }}:role/${{ secrets.META_AWS_DEPLOY_ROLE }}
183+
role-to-assume: ${{ inputs.aws_role_arn || format('arn:aws:iam::{0}:role/{1}', secrets.META_AWS_ACC_ID, secrets.META_AWS_DEPLOY_ROLE) }}
179184
aws-region: us-west-1
180185
role-duration-seconds: 7200
181186

.github/workflows/_osdc-plan.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,16 @@ on:
99
pr_number:
1010
required: true
1111
type: number
12+
environment:
13+
description: "GitHub environment for secrets/gating (default: osdc-staging)"
14+
required: false
15+
type: string
16+
default: osdc-staging
17+
aws_role_arn:
18+
description: "IAM role ARN to assume for AWS operations. Defaults to META_AWS_ACC_ID + META_AWS_DEPLOY_PLAN_ROLE secrets."
19+
required: false
20+
type: string
21+
default: ""
1222

1323
permissions:
1424
id-token: write
@@ -23,7 +33,7 @@ jobs:
2333
plan:
2434
name: tofu plan (${{ inputs.cluster }})
2535
runs-on: ubuntu-latest
26-
environment: osdc-staging
36+
environment: ${{ inputs.environment }}
2737
timeout-minutes: 45
2838
# Serialize all tofu state-locking work per cluster. Shared with
2939
# _osdc-deploy.yml so plan and deploy against the same cluster never
@@ -50,7 +60,7 @@ jobs:
5060
- name: Configure AWS credentials
5161
uses: aws-actions/configure-aws-credentials@b47578312673ae6fa5b5096b330d9fbac3d116df # v4.2.1
5262
with:
53-
role-to-assume: arn:aws:iam::${{ secrets.META_AWS_ACC_ID }}:role/${{ secrets.META_AWS_DEPLOY_PLAN_ROLE }}
63+
role-to-assume: ${{ inputs.aws_role_arn || format('arn:aws:iam::{0}:role/{1}', secrets.META_AWS_ACC_ID, secrets.META_AWS_DEPLOY_PLAN_ROLE) }}
5464
aws-region: us-west-2
5565
role-duration-seconds: 3600
5666

.github/workflows/osdc-deploy-prod.yml

Lines changed: 53 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
name: "OSDC: Deploy production"
22

3-
# Manual rollout for prod. Protected by the `osdc-production` GitHub
4-
# environment (configure required reviewers in repo Settings → Environments) —
5-
# the prod IAM role additionally trusts only tokens with
6-
# `environment:osdc-production` in the sub claim, so IAM enforces the gate too.
3+
# Manual rollout for prod. Protected by per-account GitHub environments:
4+
# - Meta clusters: `osdc-production` environment
5+
# - LF clusters: `osdc-lf-production` environment
6+
# Each environment's IAM role trusts only tokens carrying that environment
7+
# name in the sub claim, so IAM enforces the gate independently.
78
#
8-
# Default behavior (target = all): sequential rollout.
9-
# 1. Deploy arc-cbr-production-uw1 + smoke.
10-
# 2. Deploy arc-cbr-production (ue2) + smoke.
11-
# 3. Deploy meta-prod-aws-ue1 + smoke.
9+
# Default behavior (target = all): sequential rollout of all clusters.
10+
# Meta: arc-cbr-production-uw1 → arc-cbr-production → meta-prod-aws-ue1
11+
# LF: lf-prod-aws-ue1 → lf-prod-aws-ue2 (runs in parallel with Meta)
12+
#
13+
# Use `all-meta` or `all-lf` to deploy only one account's clusters.
1214
#
1315
# Picking a specific cluster from the dropdown bypasses the sequencing and
1416
# deploys only that one — useful for hotfixes or to recover from a partial
@@ -27,9 +29,13 @@ on:
2729
default: all
2830
options:
2931
- all
30-
- meta-prod-aws-ue1
32+
- all-meta
33+
- all-lf
3134
- arc-cbr-production-uw1
3235
- arc-cbr-production
36+
- meta-prod-aws-ue1
37+
- lf-prod-aws-ue1
38+
- lf-prod-aws-ue2
3339
taint_nodes:
3440
description: "Taint ARC runner nodes before deploy (graceful refresh)"
3541
required: false
@@ -55,8 +61,10 @@ permissions:
5561
contents: read
5662

5763
jobs:
64+
# --- Meta clusters ---
65+
5866
deploy_uw1:
59-
if: ${{ inputs.target == 'all' || inputs.target == 'arc-cbr-production-uw1' }}
67+
if: ${{ inputs.target == 'all' || inputs.target == 'all-meta' || inputs.target == 'arc-cbr-production-uw1' }}
6068
uses: ./.github/workflows/_osdc-deploy.yml
6169
with:
6270
cluster: arc-cbr-production-uw1
@@ -72,7 +80,7 @@ jobs:
7280
if: |
7381
!cancelled() && (
7482
inputs.target == 'arc-cbr-production' ||
75-
(inputs.target == 'all' && needs.deploy_uw1.result == 'success')
83+
((inputs.target == 'all' || inputs.target == 'all-meta') && needs.deploy_uw1.result == 'success')
7684
)
7785
uses: ./.github/workflows/_osdc-deploy.yml
7886
with:
@@ -89,7 +97,7 @@ jobs:
8997
if: |
9098
!cancelled() && (
9199
inputs.target == 'meta-prod-aws-ue1' ||
92-
(inputs.target == 'all' && needs.deploy_ue2.result == 'success')
100+
((inputs.target == 'all' || inputs.target == 'all-meta') && needs.deploy_ue2.result == 'success')
93101
)
94102
uses: ./.github/workflows/_osdc-deploy.yml
95103
with:
@@ -100,3 +108,36 @@ jobs:
100108
skip_lint_test: ${{ inputs.skip_lint_test }}
101109
run_smoke: true
102110
secrets: inherit
111+
112+
# --- LF clusters ---
113+
114+
deploy_lf_ue1:
115+
if: ${{ inputs.target == 'all' || inputs.target == 'all-lf' || inputs.target == 'lf-prod-aws-ue1' }}
116+
uses: ./.github/workflows/_osdc-deploy.yml
117+
with:
118+
cluster: lf-prod-aws-ue1
119+
environment: osdc-lf-production
120+
aws_role_arn: ${{ secrets.LF_AWS_DEPLOY_ROLE_ARN }}
121+
taint_nodes: ${{ inputs.taint_nodes }}
122+
restart_listeners: ${{ inputs.restart_listeners }}
123+
skip_lint_test: ${{ inputs.skip_lint_test }}
124+
run_smoke: true
125+
secrets: inherit
126+
127+
deploy_lf_ue2:
128+
needs: deploy_lf_ue1
129+
if: |
130+
!cancelled() && (
131+
inputs.target == 'lf-prod-aws-ue2' ||
132+
((inputs.target == 'all' || inputs.target == 'all-lf') && needs.deploy_lf_ue1.result == 'success')
133+
)
134+
uses: ./.github/workflows/_osdc-deploy.yml
135+
with:
136+
cluster: lf-prod-aws-ue2
137+
environment: osdc-lf-production
138+
aws_role_arn: ${{ secrets.LF_AWS_DEPLOY_ROLE_ARN }}
139+
taint_nodes: ${{ inputs.taint_nodes }}
140+
restart_listeners: ${{ inputs.restart_listeners }}
141+
skip_lint_test: ${{ inputs.skip_lint_test }}
142+
run_smoke: true
143+
secrets: inherit

.github/workflows/osdc-plan-prod.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,29 @@ jobs:
4747
cluster: meta-prod-aws-ue1
4848
pr_number: ${{ github.event.pull_request.number }}
4949
secrets: inherit
50+
51+
plan_lf_ue1:
52+
needs: plan_ue1
53+
if: |
54+
!cancelled() &&
55+
github.event.pull_request.head.repo.full_name == github.repository
56+
uses: ./.github/workflows/_osdc-plan.yml
57+
with:
58+
cluster: lf-prod-aws-ue1
59+
environment: osdc-lf-production
60+
aws_role_arn: ${{ secrets.LF_AWS_PLAN_ROLE_ARN }}
61+
pr_number: ${{ github.event.pull_request.number }}
62+
secrets: inherit
63+
64+
plan_lf_ue2:
65+
needs: plan_lf_ue1
66+
if: |
67+
!cancelled() &&
68+
github.event.pull_request.head.repo.full_name == github.repository
69+
uses: ./.github/workflows/_osdc-plan.yml
70+
with:
71+
cluster: lf-prod-aws-ue2
72+
environment: osdc-lf-production
73+
aws_role_arn: ${{ secrets.LF_AWS_PLAN_ROLE_ARN }}
74+
pr_number: ${{ github.event.pull_request.number }}
75+
secrets: inherit

0 commit comments

Comments
 (0)