-
Notifications
You must be signed in to change notification settings - Fork 68
181 lines (154 loc) · 6.91 KB
/
metadata-extract-extractors.yml
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
name: Metadata Extract - Singer Extractors
on:
workflow_dispatch:
inputs:
environment:
description: 'The environment to run the workflow in'
required: true
type: choice
default: 'preview'
options:
- 'preview'
- 'production'
schedule:
- cron: '0 9 * * 1' # Run at midnight UTC on Mondays
jobs:
get_variants_list:
runs-on: ubuntu-latest
outputs:
sdk_ex_p1_matrix: ${{ steps.setmatrix_sdk_ex_p1.outputs.sdk_ex_p1_matrix }}
sdk_ex_p2_matrix: ${{ steps.setmatrix_sdk_ex_p2.outputs.sdk_ex_p2_matrix }}
steps:
- uses: actions/[email protected]
- uses: astral-sh/setup-uv@v4
with:
version: ">=0.4.30"
- name: Install hub-utils
run: uv tool install git+https://github.com/meltano/hub-utils.git@main
- name: Get Variants List - SDK Extractors (p1)
id: get-variants-list-sdk-ex-p1
run: echo "VARIANTS_SDK_EX_P1=$(hub-utils get-variant-names $(pwd) --plugin-type=extractors --metadata-type=sdk --limit=200)" >> $GITHUB_OUTPUT
- name: Set Dynamic Matrix - SDK Extractors (p1)
id: setmatrix_sdk_ex_p1
run: |
matrixStringifiedObject="{\"include\": ${{ steps.get-variants-list-sdk-ex-p1.outputs.VARIANTS_SDK_EX_P1 }}}"
echo "sdk_ex_p1_matrix=$matrixStringifiedObject" >> $GITHUB_OUTPUT
- name: Get Variants List - SDK Extractors (p2)
id: get-variants-list-sdk-ex-p2
run: echo "VARIANTS_SDK_EX_P2=$(hub-utils get-variant-names $(pwd) --plugin-type=extractors --metadata-type=sdk --skip=200)" >> $GITHUB_OUTPUT
- name: Set Dynamic Matrix - SDK Extractors (p2)
id: setmatrix_sdk_ex_p2
run: |
matrixStringifiedObject="{\"include\": ${{ steps.get-variants-list-sdk-ex-p2.outputs.VARIANTS_SDK_EX_P2 }}}"
echo "sdk_ex_p2_matrix=$matrixStringifiedObject" >> $GITHUB_OUTPUT
metadata_extract_sdk_ex_p1:
name: SDK Extractors - Metadata Extract (p1)
needs: get_variants_list
runs-on: ubuntu-latest
environment: ${{ github.event.inputs.environment || github.event_name == 'schedule' && 'production' || 'preview' }}
env:
AWS_S3_BUCKET: "${{secrets.HUB_METADATA_S3_BUCKET }}"
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.get_variants_list.outputs.sdk_ex_p1_matrix) }}
permissions:
id-token: write # This is required for requesting the JWT
steps:
- uses: actions/[email protected]
- name: Configure AWS credentials
uses: aws-actions/[email protected]
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-region: us-west-2
role-session-name: "GitHubActions"
- uses: astral-sh/setup-uv@v4
with:
version: ">=0.4.30"
- name: Install hub-utils
run: uv tool install git+https://github.com/meltano/hub-utils.git@main
# This starts the attempts to install and extract metadata. Since we don't
# know what python versions are accepted we start with the latest and continue
# decreasing until we have a success or run out of python versions to attempt.
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: |
3.13
3.12
3.11
3.10
3.9
3.8
- name: Extract Metadata (3.13)
id: extract_313
run: hub-utils extract-sdk-metadata-to-s3 "/home/runner/work/hub/hub/_data/meltano/${{ matrix.plugin-name }}" $(pwd)/extract_data --python=python3.13
continue-on-error: true
- name: Extract Metadata (3.12)
if: always() && (steps.extract_313.outcome == 'failure')
id: extract_312
run: hub-utils extract-sdk-metadata-to-s3 "/home/runner/work/hub/hub/_data/meltano/${{ matrix.plugin-name }}" $(pwd)/extract_data --python=python3.12
continue-on-error: true
- name: Extract Metadata (3.11)
if: always() && (steps.extract_312.outcome == 'failure')
id: extract_311
run: hub-utils extract-sdk-metadata-to-s3 "/home/runner/work/hub/hub/_data/meltano/${{ matrix.plugin-name }}" $(pwd)/extract_data --python=python3.11
continue-on-error: true
- name: Extract Metadata (3.10)
if: always() && (steps.extract_311.outcome == 'failure')
id: extract_310
run: hub-utils extract-sdk-metadata-to-s3 "/home/runner/work/hub/hub/_data/meltano/${{ matrix.plugin-name }}" $(pwd)/extract_data --python=python3.10
continue-on-error: true
- name: Extract Metadata (3.9)
if: always() && (steps.extract_310.outcome == 'failure')
id: extract_39
run: hub-utils extract-sdk-metadata-to-s3 "/home/runner/work/hub/hub/_data/meltano/${{ matrix.plugin-name }}" $(pwd)/extract_data --python=python3.9
continue-on-error: true
- name: Extract Metadata (3.8)
if: always() && (steps.extract_39.outcome == 'failure')
id: extract_38
run: hub-utils extract-sdk-metadata-to-s3 "/home/runner/work/hub/hub/_data/meltano/${{ matrix.plugin-name }}" $(pwd)/extract_data --python=python3.8
metadata_extract_sdk_ex_p2:
name: SDK Extractors - Metadata Extract (p2)
needs: get_variants_list
runs-on: ubuntu-latest
environment: ${{ github.event.inputs.environment || github.event_name == 'schedule' && 'production' || 'preview' }}
env:
AWS_S3_BUCKET: "${{secrets.HUB_METADATA_S3_BUCKET }}"
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.get_variants_list.outputs.sdk_ex_p2_matrix) }}
permissions:
id-token: write # This is required for requesting the JWT
steps:
- uses: actions/[email protected]
- name: Configure AWS credentials
uses: aws-actions/[email protected]
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-region: us-west-2
role-session-name: "GitHubActions"
- uses: astral-sh/setup-uv@v4
with:
version: ">=0.4.30"
- name: Install hub-utils
run: uv tool install git+https://github.com/meltano/hub-utils.git@main
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: |
3.10
3.9
3.8
- name: Extract Metadata (3.10)
id: extract_310
run: hub-utils extract-sdk-metadata-to-s3 "/home/runner/work/hub/hub/_data/meltano/${{ matrix.plugin-name }}" $(pwd)/extract_data --python=python3.10
continue-on-error: true
- name: Extract Metadata (3.9)
if: always() && (steps.extract_310.outcome == 'failure')
id: extract_39
run: hub-utils extract-sdk-metadata-to-s3 "/home/runner/work/hub/hub/_data/meltano/${{ matrix.plugin-name }}" $(pwd)/extract_data --python=python3.9
continue-on-error: true
- name: Extract Metadata (3.8)
if: always() && (steps.extract_39.outcome == 'failure')
id: extract_38
run: hub-utils extract-sdk-metadata-to-s3 "/home/runner/work/hub/hub/_data/meltano/${{ matrix.plugin-name }}" $(pwd)/extract_data --python=python3.8