Skip to content

ci: build base image on every pull request#223

Open
TimPietruskyRunPod wants to merge 1 commit into
mainfrom
ci/build-on-pull-request
Open

ci: build base image on every pull request#223
TimPietruskyRunPod wants to merge 1 commit into
mainfrom
ci/build-on-pull-request

Conversation

@TimPietruskyRunPod
Copy link
Copy Markdown
Contributor

Summary

Today the `Development` workflow only runs on manual `workflow_dispatch`, and the `release` workflow only builds images after a `chore: version packages` commit lands on `main`. So PR changes can't be deployed to a real serverless endpoint until they're already merged. That makes it impossible to validate behavior before approval — we're flying blind.

This PR makes `Development` build the `base` image on every PR push (opened / synchronize / reopened / ready_for_review), tagged with the branch slug. So opening this very PR should produce `runpod/worker-comfyui:ci-build-on-pull-request-base` (or whatever the configured DOCKERHUB_REPO/IMG resolves to). Then deploying a serverless endpoint with that image lets us test the PR.

Changes

  • `.github/workflows/dev.yml`
    • Add `pull_request` trigger with `paths-ignore` for docs/changeset-only PRs
    • Compute `RELEASE_VERSION` from `GITHUB_HEAD_REF` first (PR source branch), falling back to `GITHUB_REF` for push/dispatch
    • Slug branch name into Docker-safe tag (replace anything not `[a-zA-Z0-9._-]` with `-`)

Why `paths-ignore`

Builds are heavy (~20-30 min on Blacksmith). Skip the build for PRs that only touch markdown, `docs/`, or `.changeset/` files. Behavior-affecting PRs (anything in `src/`, `handler.py`, `Dockerfile`, workflows, `.runpod/`) still trigger a build.

Risks

  • Every PR now consumes Blacksmith runner minutes for a `base` build. If that becomes too expensive, we can switch to label-gated builds (only build if a `build` label is present).
  • Docker Hub will accumulate one tag per branch. `docker-prune.yml` already exists to clean these up periodically — recommend extending it if needed.

Test plan

  • Push to this branch and confirm `Development` workflow triggers
  • Confirm the produced image tag matches the branch slug
  • Deploy a serverless endpoint from the new image and submit a real job to confirm the worker still functions normally (no behavior change, just CI plumbing)

Enable the Development workflow to trigger on pull_request events so PR
changes can be deployed and tested on a real Runpod endpoint before
merging. Falls back to GITHUB_HEAD_REF for the branch name on PR events
(GITHUB_REF is refs/pull/N/merge there) and slugs the branch name into a
Docker-safe tag.
@TimPietruskyRunPod
Copy link
Copy Markdown
Contributor Author

Validation status: this PR's own workflow works

Used `gh workflow run dev.yml --ref ci/build-on-pull-request` (workflow_dispatch on this branch) which exercises the new trigger / tag logic from this PR. Build succeeded in ~5 min and the image was pushed as expected. Then dispatched the same way on #224 and #225 — both succeeded, tagging cleanly as `runpod/worker-comfyui:fix-pin-boto3-for-non-aws-s3-base` and `runpod/worker-comfyui:fix-enable-png-workflow-metadata-base` respectively.

What I didn't directly validate: that the `pull_request` trigger fires automatically when a PR is opened. That can only be tested by actually opening the next PR after this lands and watching for the workflow. Low risk — the GitHub Actions `pull_request` trigger is well-trodden ground.

Recommend merging. Once merged, all subsequent PR images get built automatically and we can validate #224/#225/#191/#221/#222 etc. on real endpoints without manual dispatches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants