Skip to content

Commit ea6a171

Browse files
ci(data-sync): split providers into 3 groups (#905)
* ci(data-sync): split providers into 3 groups Previously, there were two groups of providers: multicore-providers and regular providers. However, some of the regular providers are much larger than others. Take advantage of the new "large" tag in vunnel to put large providers in runners with larger volumes, since recent NVD runs have run out of space, and ubuntu and sles providers also deal with large datasets and might not be far behind. Signed-off-by: Will Murphy <willmurphyscode@users.noreply.github.com> * ci(data-sync): define runners centrally, nvme large Define the runners centrally so it's more clear how they're defined. And then update the large runner to use NVMe instances. Signed-off-by: Will Murphy <willmurphyscode@users.noreply.github.com> * ci(data-sync): roll back central configuration Otherwise config changes cannot be tested until after merge, which is inconvenient. Signed-off-by: Will Murphy <willmurphyscode@users.noreply.github.com> --------- Signed-off-by: Will Murphy <willmurphyscode@users.noreply.github.com>
1 parent 84738ab commit ea6a171

File tree

1 file changed

+133
-5
lines changed

1 file changed

+133
-5
lines changed

.github/workflows/daily-data-sync.yaml

Lines changed: 133 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
outputs:
4141
providers: ${{ steps.read-providers.outputs.providers }}
4242
multicore-providers: ${{ steps.split-providers.outputs.multicore-providers }}
43+
large-providers: ${{ steps.split-providers.outputs.large-providers }}
4344
other-providers: ${{ steps.split-providers.outputs.other-providers }}
4445
steps:
4546
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
@@ -71,21 +72,45 @@ jobs:
7172
fi
7273
echo "providers=$content" >> $GITHUB_OUTPUT
7374
74-
- name: Split providers by concurrency needs
75+
- name: Split providers by resource needs
7576
id: split-providers
7677
env:
7778
ALL_PROVIDERS: ${{ steps.read-providers.outputs.providers }}
7879
run: |
79-
multicore_providers=$(echo "$ALL_PROVIDERS" | jq -c '[.[] | select(. == "ubuntu")]')
80-
other_providers=$(echo "$ALL_PROVIDERS" | jq -c '[.[] | select(. != "ubuntu")]')
80+
# use vunnel tags to determine resource requirements
81+
multicore_tagged=$(docker run --rm --pull=always ghcr.io/anchore/vunnel:latest list --tag multicore -o json | jq -c '[.providers[].name]')
82+
large_tagged=$(docker run --rm ghcr.io/anchore/vunnel:latest list --tag large --tag '!multicore' -o json | jq -c '[.providers[].name]')
83+
84+
# intersect with the requested provider list and split into three categories
85+
multicore_providers=$(jq -n -c --argjson all "$ALL_PROVIDERS" --argjson tagged "$multicore_tagged" \
86+
'$all | map(select(. as $p | $tagged | index($p)))')
87+
large_providers=$(jq -n -c --argjson all "$ALL_PROVIDERS" --argjson tagged "$large_tagged" \
88+
'$all | map(select(. as $p | $tagged | index($p)))')
89+
other_providers=$(jq -n -c --argjson all "$ALL_PROVIDERS" --argjson mc "$multicore_tagged" --argjson lg "$large_tagged" \
90+
'$all | map(select(. as $p | ($mc | index($p) | not) and ($lg | index($p) | not)))')
91+
8192
echo "multicore-providers=$multicore_providers" >> $GITHUB_OUTPUT
93+
echo "large-providers=$large_providers" >> $GITHUB_OUTPUT
8294
echo "other-providers=$other_providers" >> $GITHUB_OUTPUT
8395
8496
update-provider-multicore:
8597
name: "Update provider (multicore)"
8698
needs: discover-providers
8799
if: ${{ needs.discover-providers.outputs.multicore-providers != '[]' }}
88-
runs-on: runs-on=${{ github.run_id }}-multicore-${{ strategy.job-index }}/cpu=16/ram=64/family=m5+m6+m7/spot=price-capacity-optimized
100+
# runson family --cpu=16 --mem="32:64" --budget=1.0 --globs -o yaml
101+
# - "c6*" # compute, amd64/arm64/x86_64, 16 CPU, 32GB, NVMe:950GB, $0.54-$0.91/hr
102+
# - "c7*" # compute, amd64/arm64/x86_64, 16 CPU, 32GB, NVMe:950GB, $0.58-$1.00/hr
103+
# - "c5*" # compute, amd64/x86_64, 16 CPU, 32-42GB, NVMe:400-600GB, $0.62-$0.86/hr
104+
# - "m6*" # general, amd64/arm64/x86_64, 16 CPU, 64GB, NVMe:950GB, $0.62-$0.95/hr
105+
# - "m7*" # general, amd64/arm64/x86_64, 16 CPU, 64GB, NVMe:950GB, $0.65-$0.93/hr
106+
# - "m5*" # general, amd64/x86_64, 16 CPU, 64GB, NVMe:600GB, $0.69-$0.95/hr
107+
runs-on:
108+
- runs-on=${{ github.run_id }}-multicore-${{ strategy.job-index }}
109+
- cpu=16
110+
- ram=32+64
111+
- family=c6+c7+c5+m6+m7+m5
112+
- spot=price-capacity-optimized
113+
- extras=s3-cache
89114
timeout-minutes: 480
90115
# set the permissions granted to the github token to publish to ghcr.io
91116
permissions:
@@ -148,11 +173,114 @@ jobs:
148173
PROVIDER: ${{ matrix.provider }}
149174
run: make upload-provider-cache provider="$PROVIDER"
150175

176+
update-provider-large:
177+
name: "Update provider (large)"
178+
needs: discover-providers
179+
if: ${{ needs.discover-providers.outputs.large-providers != '[]' }}
180+
# runson family --cpu=8 --mem="16:64" --budget=0.7 --local-nvme --globs -o yaml
181+
# - "c6gd*" # compute, arm64, 8 CPU, 16GB, NVMe:474GB, $0.31/hr
182+
# - "c5ad*" # compute, amd64, 8 CPU, 16GB, NVMe:300GB, $0.34/hr
183+
# - "m6gd*" # general, arm64, 8 CPU, 32GB, NVMe:474GB, $0.36/hr
184+
# - "c7gd*" # compute, arm64, 8 CPU, 16GB, NVMe:474GB, $0.36/hr
185+
# - "c5d*" # compute, x86_64, 8 CPU, 16GB, NVMe:200GB, $0.38/hr
186+
# - "c6id*" # compute, x86_64, 8 CPU, 16GB, NVMe:474GB, $0.40/hr
187+
# - "m5ad*" # general, amd64, 8 CPU, 32GB, NVMe:300GB, $0.41/hr
188+
# - "m7gd*" # general, arm64, 8 CPU, 32GB, NVMe:474GB, $0.43/hr
189+
# - "m5d*" # general, x86_64, 8 CPU, 32GB, NVMe:300GB, $0.45-$0.54/hr
190+
# - "r6gd*" # memory, arm64, 8 CPU, 64GB, NVMe:474GB, $0.46/hr
191+
# - "m6id*" # general, x86_64, 8 CPU, 32GB, NVMe:474GB, $0.47-$0.64/hr
192+
# - "r5ad*" # memory, amd64, 8 CPU, 64GB, NVMe:300GB, $0.52/hr
193+
# - "r7gd*" # memory, arm64, 8 CPU, 64GB, NVMe:474GB, $0.54/hr
194+
# - "r5d*" # memory, x86_64, 8 CPU, 64GB, NVMe:300GB, $0.58-$0.67/hr
195+
# - "r6id*" # memory, x86_64, 8 CPU, 64GB, NVMe:474GB, $0.60/hr
196+
runs-on:
197+
- runs-on=${{ github.run_id }}-large-${{ strategy.job-index }}
198+
- cpu=8
199+
- ram=16+64
200+
- family=c6gd+c5ad+m6gd+c7gd+c5d+c6id+m5ad+m7gd+m5d+r6gd+m6id+r5ad+r7gd+r5d+r6id
201+
- spot=price-capacity-optimized
202+
- extras=s3-cache
203+
timeout-minutes: 480
204+
# set the permissions granted to the github token to publish to ghcr.io
205+
permissions:
206+
contents: read
207+
packages: write
208+
strategy:
209+
matrix:
210+
provider: ${{fromJson(needs.discover-providers.outputs.large-providers)}}
211+
fail-fast: false
212+
steps:
213+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
214+
with:
215+
persist-credentials: false
216+
217+
- name: Bootstrap environment
218+
uses: ./.github/actions/bootstrap
219+
with:
220+
python: false
221+
222+
- name: Login to ghcr.io
223+
run: make ci-oras-ghcr-login
224+
env:
225+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
226+
GITHUB_USERNAME: ${{ github.actor }}
227+
228+
- name: Download the existing provider state
229+
env:
230+
PROVIDER: ${{ matrix.provider }}
231+
run: bash -c "make download-provider-cache provider=\"$PROVIDER\" date=latest || true"
232+
233+
- name: Update the provider
234+
env:
235+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
236+
PROVIDER: ${{ matrix.provider }}
237+
run: make refresh-provider-cache provider="$PROVIDER"
238+
239+
- name: Notify Slack on failure
240+
uses: slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a #v2.1.1
241+
with:
242+
webhook: ${{ secrets.SLACK_TOOLBOX_WEBHOOK_URL }}
243+
webhook-type: incoming-webhook
244+
payload: |
245+
text: "Daily Data Sync for ${{ matrix.provider }} failed"
246+
blocks:
247+
- type: section
248+
text:
249+
type: mrkdwn
250+
text: |
251+
*Daily Data Sync for ${{ matrix.provider }} failed*
252+
• Workflow: `${{ github.workflow }}`
253+
• Event: `${{ github.event_name }}`
254+
• <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Run>
255+
if: ${{ always() && job.status != 'success' && env.SLACK_NOTIFICATIONS == 'true' }}
256+
257+
- name: Upload the provider workspace state
258+
# even if the job fails, we want to upload yesterdays cache as todays cache to continue the DB build
259+
if: ${{ always() }}
260+
env:
261+
PROVIDER: ${{ matrix.provider }}
262+
run: make upload-provider-cache provider="$PROVIDER"
263+
151264
update-provider:
152265
name: "Update provider"
153266
needs: discover-providers
154267
if: ${{ needs.discover-providers.outputs.other-providers != '[]' }}
155-
runs-on: runs-on=${{ github.run_id }}-provider-${{ strategy.job-index }}/cpu=8/ram=32/family=m5+m6+m7+t3+t4/spot=price-capacity-optimized
268+
# runson family --cpu=8 --mem="16:32" --budget=0.5 --globs -o yaml
269+
# - "t4*" # burstable, arm64, 8 CPU, 32GB, EBS:695Mbps, $0.27/hr
270+
# - "c6*" # compute, amd64/arm64/x86_64, 8 CPU, 16GB, NVMe:474GB, $0.27-$0.45/hr
271+
# - "c7*" # compute, amd64/arm64/x86_64, 8 CPU, 16GB, NVMe:474GB, $0.29-$0.50/hr
272+
# - "t3*" # burstable, amd64/x86_64, 8 CPU, 32GB, EBS:695Mbps, $0.30-$0.33/hr
273+
# - "c5*" # compute, amd64/x86_64, 8 CPU, 16-21GB, NVMe:200-300GB, $0.31-$0.43/hr
274+
# - "m6*" # general, amd64/arm64/x86_64, 8 CPU, 32GB, NVMe:474GB, $0.31-$0.47/hr
275+
# - "m7*" # general, amd64/arm64/x86_64, 8 CPU, 32GB, NVMe:474GB, $0.33-$0.46/hr
276+
# - "m5*" # general, amd64/x86_64, 8 CPU, 32GB, NVMe:300GB, $0.34-$0.48/hr
277+
runs-on:
278+
- runs-on=${{ github.run_id }}-provider-${{ strategy.job-index }}
279+
- cpu=8
280+
- ram=16+32
281+
- family=t4+c6+c7+t3+c5+m6+m7+m5
282+
- spot=price-capacity-optimized
283+
- extras=s3-cache
156284
timeout-minutes: 480
157285
# set the permissions granted to the github token to publish to ghcr.io
158286
permissions:

0 commit comments

Comments
 (0)