[WIP] Add nightly GitHub CI workflow to fetch main artifact#1532
[WIP] Add nightly GitHub CI workflow to fetch main artifact#1532
Conversation
…GitHub release Co-authored-by: stmatengss <11641725+stmatengss@users.noreply.github.com>
Co-authored-by: stmatengss <11641725+stmatengss@users.noreply.github.com>
|
/gemini review |
There was a problem hiding this comment.
Pull request overview
Adds a scheduled GitHub Actions workflow to automatically publish a nightly pre-release by downloading wheel artifacts from the latest successful CI runs on main.
Changes:
- Introduces
.github/workflows/nightly.ymlscheduled + manual workflow to fetch artifacts fromci.ymlandci_cu13.yml. - Extracts downloaded artifacts and creates/overwrites a same-day
nightly-YYYYMMDDGitHub pre-release with wheel assets.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| console.log(`Downloading artifact: ${artifact.name}`); | ||
| const download = await github.rest.actions.downloadArtifact({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| artifact_id: artifact.id, | ||
| archive_format: 'zip', | ||
| }); | ||
|
|
||
| const artifactDir = path.join('nightly-wheels', artifact.name); | ||
| fs.mkdirSync(artifactDir, { recursive: true }); | ||
| const zipPath = path.join(artifactDir, `${artifact.name}.zip`); | ||
| fs.writeFileSync(zipPath, Buffer.from(download.data)); | ||
| console.log(`Saved to ${zipPath}`); |
There was a problem hiding this comment.
The artifact download loop doesn’t handle per-artifact download failures. If a single artifact download fails (expired artifact, transient API issue, etc.), the whole step will throw and the workflow will abort without a clear summary. Consider wrapping downloadArtifact/writeFileSync in a try/catch, logging the failure, and continuing while still enforcing the final downloaded === 0 guard.
| try { | ||
| const release = await github.rest.repos.getReleaseByTag({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| tag: tag, | ||
| }); | ||
| await github.rest.repos.deleteRelease({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| release_id: release.data.id, | ||
| }); | ||
| console.log(`Deleted existing release for tag ${tag}`); | ||
| } catch (e) { | ||
| console.log(`No existing release found for tag ${tag}`); | ||
| } |
There was a problem hiding this comment.
Both deletion try/catch blocks treat any error as “not found”. This can mask real failures (permissions, rate limiting, API outage) and lead to confusing downstream errors when creating the new release/tag. Please only swallow 404/Not Found and rethrow (or core.setFailed) for other statuses.
| try { | ||
| await github.rest.git.deleteRef({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| ref: `tags/${tag}`, | ||
| }); | ||
| console.log(`Deleted existing tag ${tag}`); | ||
| } catch (e) { | ||
| console.log(`No existing tag found: ${tag}`); | ||
| } |
There was a problem hiding this comment.
Same as above for tag deletion: catching all exceptions and logging “No existing tag found” will hide non-404 errors. Please check the error status/code and only ignore the expected not-found case.
| } | ||
|
|
||
| - name: Upload wheels to GitHub Nightly Release | ||
| uses: softprops/action-gh-release@v1 |
There was a problem hiding this comment.
For supply-chain security, consider pinning third-party actions (e.g., softprops/action-gh-release) to a specific commit SHA (or at least a full semver tag) instead of a moving major tag. This reduces the risk of a compromised upstream release affecting your release automation.
| uses: softprops/action-gh-release@v1 | |
| uses: softprops/action-gh-release@v1.10.0 |
| echo "Found wheel files:" | ||
| ls -la nightly-release/*.whl | ||
|
|
There was a problem hiding this comment.
The artifacts uploaded from CI preserve their relative paths (e.g., mooncake-wheel/dist-py…/*.whl), so after unzip the wheels will typically be under subdirectories of nightly-release/, not directly in nightly-release/. This ls nightly-release/*.whl will fail even when wheels exist (your preceding find check would pass). Consider either flattening wheels into a single directory (like the release workflows do with find … -exec cp) or updating the listing command to use find.
| Generated at: ${{ steps.tag.outputs.nightly_tag }} | ||
| This is an automated nightly release and may be unstable. | ||
| prerelease: true | ||
| files: nightly-release/*.whl |
There was a problem hiding this comment.
softprops/action-gh-release is configured to upload nightly-release/*.whl, but after unzipping CI artifacts the wheels are likely nested under subdirectories (because CI uploads from mooncake-wheel/dist-py…/*.whl). As written, the release can be created with zero uploaded assets. Suggest flattening wheels into a dedicated folder (and upload from there) or using a recursive glob that the action supports.
| jobs: | ||
| nightly-release: | ||
| runs-on: ubuntu-22.04 | ||
| permissions: | ||
| contents: write | ||
| actions: read |
There was a problem hiding this comment.
Because this workflow deletes and recreates a shared tag/release (nightly-YYYYMMDD), concurrent runs (e.g., a manual dispatch overlapping the scheduled run) can race and interfere with each other. Consider adding a concurrency group (and possibly cancel-in-progress: true) to ensure only one nightly-release job runs at a time.
|
|
||
| on: | ||
| schedule: | ||
| # Run at 08:00 UTC every day (midnight PST) |
There was a problem hiding this comment.
The schedule comment is inaccurate during daylight saving time: 08:00 UTC is midnight PST only in winter, but 01:00 PDT in summer. Please update the comment to a DST-agnostic phrasing (e.g., “00:00 Pacific Time (08:00 UTC)” or just “08:00 UTC”).
| # Run at 08:00 UTC every day (midnight PST) | |
| # Run at 08:00 UTC every day (00:00 Pacific Time) |
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
nightly.yml) that:ci.yml(CUDA 12.8) andci_cu13.yml(CUDA 13) workflow runsnightly-YYYYMMDDtag naming convention✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.