Skip to content

Commit 77069de

Browse files
authored
feat(ci): add weekly scheduled wheel build matrix (#941)
- new workflow build_in_container_scheduled.yml runs weekly (mon 06:00 utc) and on manual dispatch, fanning out across [ubuntu-22.04, ubuntu-22.04-arm] x last 7 ngc pytorch images x last 3 upstream releases - new helper check_for_releases.sh resolves the last 3 stable release tags via gh Signed-off-by: oliver könig <okoenig@nvidia.com>
1 parent 48582f0 commit 77069de

2 files changed

Lines changed: 73 additions & 0 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
3+
set -eo pipefail
4+
5+
UPSTREAM_REPO="${UPSTREAM_REPO:?UPSTREAM_REPO must be set, e.g. state-spaces/mamba}"
6+
LIMIT="${LIMIT:-3}"
7+
OUTPUT_FILE="${OUTPUT_FILE:-releases.json}"
8+
9+
echo "Fetching last ${LIMIT} stable releases of ${UPSTREAM_REPO}..."
10+
echo "---------------------------------------------------------------------"
11+
12+
gh release list \
13+
--repo "$UPSTREAM_REPO" \
14+
--limit "$LIMIT" \
15+
--exclude-drafts \
16+
--exclude-pre-releases \
17+
--json tagName \
18+
--jq '[.[].tagName]' \
19+
> "$OUTPUT_FILE"
20+
21+
echo "Resolved release tags:"
22+
cat "$OUTPUT_FILE"
23+
echo
24+
echo "---"
25+
echo "Check complete."
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Build wheels in a container (scheduled)
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: "0 6 * * 1"
7+
8+
jobs:
9+
compute_matrix:
10+
runs-on: ubuntu-latest
11+
outputs:
12+
runners: ${{ steps.compute.outputs.RUNNERS }}
13+
container-images: ${{ steps.compute.outputs.IMAGES }}
14+
release-versions: ${{ steps.compute.outputs.RELEASES }}
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Check for NGC PyTorch images
20+
run: bash ./.github/scripts/check_for_ngc_images.sh
21+
22+
- name: Check for upstream releases
23+
env:
24+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
UPSTREAM_REPO: state-spaces/mamba
26+
run: bash ./.github/scripts/check_for_releases.sh
27+
28+
- name: Build matrix outputs
29+
id: compute
30+
run: |
31+
echo "RUNNERS=$(jq -cn '["ubuntu-22.04","ubuntu-22.04-arm"]')" | tee -a "$GITHUB_OUTPUT"
32+
echo "IMAGES=$(jq -cr . ngc_images.json)" | tee -a "$GITHUB_OUTPUT"
33+
echo "RELEASES=$(jq -cr . releases.json)" | tee -a "$GITHUB_OUTPUT"
34+
35+
build-wheels:
36+
needs: [compute_matrix]
37+
strategy:
38+
fail-fast: false
39+
matrix:
40+
runner: ${{ fromJson(needs.compute_matrix.outputs.runners) }}
41+
container-image: ${{ fromJson(needs.compute_matrix.outputs.container-images) }}
42+
release-version: ${{ fromJson(needs.compute_matrix.outputs.release-versions) }}
43+
uses: ./.github/workflows/_build_in_container.yml
44+
with:
45+
runs-on: ${{ matrix.runner }}
46+
container-image: ${{ matrix.container-image }}
47+
upload-to-release: false
48+
release-version: ${{ matrix.release-version }}

0 commit comments

Comments
 (0)