-
Notifications
You must be signed in to change notification settings - Fork 14
90 lines (80 loc) · 2.98 KB
/
Copy pathosdc-undrain.yml
File metadata and controls
90 lines (80 loc) · 2.98 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
name: "OSDC: Undrain cluster"
# Reverses osdc-drain.yml.
#
# Two independent checkboxes: untaint-nodes and resume-runners.
# Default is both enabled (full undrain).
#
# Per-cluster concurrency group serializes against deploy/plan/drain
# on the same cluster (shared osdc-tofu-<cluster> lock family).
on:
workflow_dispatch:
inputs:
cluster:
description: "Cluster to undrain"
required: true
type: choice
default: "-- select cluster --"
options:
- "-- select cluster --"
- meta-staging-aws-uw1
- meta-staging-aws-ue1
- meta-staging-aws-ue2
- meta-prod-aws-uw1
- meta-prod-aws-ue2
- meta-prod-aws-ue1
- lf-prod-aws-ue1
- lf-prod-aws-ue2
run_untaint_nodes:
description: "Remove deploy.osdc.io/refresh-pending:NoSchedule taint from runner nodes"
required: false
type: boolean
default: true
run_resume_runners:
description: "Restore AutoscalingRunnerSet maxRunners from def files"
required: false
type: boolean
default: true
concurrency:
group: osdc-tofu-${{ inputs.cluster }}
cancel-in-progress: false
permissions:
id-token: write
contents: read
jobs:
undrain:
name: Undrain ${{ inputs.cluster }}
runs-on: ubuntu-latest
environment: ${{ contains(inputs.cluster, '-staging-') && 'osdc-staging' || 'osdc-production' }}
timeout-minutes: 60
defaults:
run:
working-directory: osdc
steps:
- name: Validate inputs
working-directory: ${{ github.workspace }}
run: |
if [ "${{ inputs.cluster }}" = "-- select cluster --" ]; then
echo "::error::No cluster selected. Pick a cluster from the dropdown before running."
exit 1
fi
if [ "${{ inputs.run_untaint_nodes }}" != "true" ] && [ "${{ inputs.run_resume_runners }}" != "true" ]; then
echo "::error::Both run_untaint_nodes and run_resume_runners are disabled — nothing to do."
exit 1
fi
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Set up OSDC toolchain
uses: ./.github/actions/osdc-setup
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@b47578312673ae6fa5b5096b330d9fbac3d116df # v4.2.1
with:
role-to-assume: ${{ startsWith(inputs.cluster, 'lf-') && secrets.LF_AWS_DEPLOY_ROLE_ARN || format('arn:aws:iam::{0}:role/{1}', secrets.META_AWS_ACC_ID, secrets.META_AWS_DEPLOY_ROLE) }}
aws-region: us-west-1
role-duration-seconds: 7200
- name: Untaint runner nodes
if: ${{ inputs.run_untaint_nodes }}
run: just untaint-nodes "${{ inputs.cluster }}"
- name: Resume runners (restore maxRunners from def files)
if: ${{ !cancelled() && inputs.run_resume_runners }}
run: just resume-runners "${{ inputs.cluster }}"
env:
OSDC_UNTAINT_NODES: "no"