Skip to content

ci: move workflows onto org self-hosted runners - #382

Draft
loverustfs wants to merge 1 commit into
mainfrom
cursor/self-hosted-runners-aacb
Draft

loverustfs wants to merge 1 commit into
mainfrom
cursor/self-hosted-runners-aacb

Conversation

@loverustfs

Copy link
Copy Markdown
Contributor

Related issue

Stops GitHub-hosted (billed) Actions usage on automatic runs. There is no tracked issue for this change.

Problem

Every job in .github/workflows used a GitHub-hosted label (ubuntu-latest, macos-latest, or windows-latest). ci.yml ran test and build on Ubuntu, macOS, and Windows for pushes to main/develop and for pull requests. integration.yml also runs on a daily cron. Tag pushes built macOS and Windows release binaries on GitHub-hosted runners.

The org already has self-hosted Linux runners (sm-standard-2, sm-standard-4, dind-sm-standard-2). It has no self-hosted macOS or Windows runners.

Solution

Linux jobs now run on those org runners. Jobs that need a Docker daemon use dind-sm-standard-2: cargo-deny-action is a container action, cross builds run in Docker, integration tests start RustFS with docker run, and the image workflow uses Buildx.

The sm-standard images do not ship the C toolchain, CMake, or several tools that GitHub-hosted Ubuntu includes. .github/actions/setup-self-hosted installs what each job actually needs (linker, CMake, Perl, libssl-dev for aws-lc-sys; Python 3 and OpenSSL for the compatibility probes; file and shasum for packaging; GitHub CLI; AWS CLI v2 for R2). Test commands are unchanged.

macOS and Windows are not cross-compiled:

  • CI cargo test / cargo build must execute on that OS. A Linux cross-compile would not run those tests. Windows coverage is cfg(windows) and would not be exercised.
  • Release macOS targets (x86_64-apple-darwin, aarch64-apple-darwin) need the Apple SDK and linker, which are not on the Linux images.
  • The Windows release target is x86_64-pc-windows-msvc. A gnu or zig/xwin build would ship a different binary than the current artifact.

Those jobs remain on macos-latest / windows-latest and run only for workflow_dispatch. Each one prints a warning that it is a billed, manual-only runner. Tag pushes build Linux artifacts only. Dispatching Build and Release still builds macOS and Windows and uploads them with the Linux artifacts. DEB/RPM packaging only needs the Linux musl archives, so tag-push packaging is unchanged.

Pull requests cancel the previous run of the same PR (ci.yml, integration.yml). Scheduled and push runs are not cancelled by that. Every job has a timeout.

Runner group access

sm-standard-2, sm-standard-4, and dind-sm-standard-2 are org runners. The runner group may not yet allow rustfs/cli. An org admin needs to grant this repository access to that group. Until then, these jobs will queue with no runner.

Job runners

Workflow Job Old runner New runner When it runs
CI Dependency Advisories ubuntu-latest dind-sm-standard-2 push, pull_request, workflow_dispatch
CI Format Check ubuntu-latest sm-standard-2 same
CI Clippy ubuntu-latest sm-standard-4 same
CI Test (linux) — was Test (ubuntu-latest) ubuntu-latest sm-standard-4 same
CI Test (macos-latest, manual) — was Test (macos-latest) macos-latest macos-latest workflow_dispatch only
CI Test (windows-latest, manual) — was Test (windows-latest) windows-latest windows-latest workflow_dispatch only
CI Build (linux) — was Build (ubuntu-latest) ubuntu-latest sm-standard-4 push, pull_request, workflow_dispatch
CI Build (macos-latest, manual) — was Build (macos-latest) macos-latest macos-latest workflow_dispatch only
CI Build (windows-latest, manual) — was Build (windows-latest) windows-latest windows-latest workflow_dispatch only
CI Documentation ubuntu-latest sm-standard-4 push, pull_request, workflow_dispatch
CI Protected Files Check ubuntu-latest sm-standard-2 pull_request
CI Minimum Supported Rust Version ubuntu-latest sm-standard-4 push, pull_request, workflow_dispatch
Integration CLI Contract (Commands and Options) ubuntu-latest sm-standard-4 pull_request, push, schedule, workflow_dispatch
Integration Smoke (RustFS …) ubuntu-latest dind-sm-standard-2 same
Integration Full Integration (RustFS 1.0.0-beta.10) ubuntu-latest dind-sm-standard-2 schedule, workflow_dispatch (unchanged)
Integration Golden Tests ubuntu-latest sm-standard-4 pull_request, push, schedule, workflow_dispatch
Package Resolve Build ubuntu-latest sm-standard-2 workflow_call, workflow_dispatch
Package Package (amd64 / arm64) ubuntu-latest sm-standard-2 same
Package Publish packages to GitHub Release ubuntu-latest sm-standard-2 same
Package Publish packages to Cloudflare R2 ubuntu-latest sm-standard-2 same
Package Summary ubuntu-latest sm-standard-2 same
Release Build Strategy Check ubuntu-latest sm-standard-2 tag push, workflow_dispatch
Release Release Verification ubuntu-latest sm-standard-4 same. Advisory check moved to its own job; fmt, clippy, and tests are unchanged
Release Release Advisories (previously a step of Release Verification) ubuntu-latest dind-sm-standard-2 same cargo deny check advisories
Release Select Build Targets (new) — sm-standard-2 chooses the matrix; no compile
Release Build (linux-amd64-gnu) ubuntu-latest sm-standard-4 tag push, workflow_dispatch
Release Build (linux-arm64-gnu) ubuntu-latest dind-sm-standard-2 cross needs Docker
Release Build (linux-amd64) musl ubuntu-latest sm-standard-4 tag push, workflow_dispatch
Release Build (linux-arm64) musl ubuntu-latest dind-sm-standard-2 cross needs Docker
Release Build (macos-amd64) macos-latest macos-latest workflow_dispatch only
Release Build (macos-arm64) macos-latest macos-latest workflow_dispatch only
Release Build (windows-amd64) windows-latest windows-latest workflow_dispatch only
Release Generate Shell Completions ubuntu-latest sm-standard-4 tag push, workflow_dispatch
Release Upload Release Assets ubuntu-latest sm-standard-2 release runs
Release Package DEB/RPM called workflow on ubuntu-latest called workflow on the Package runners above release runs
Release Publish to crates.io ubuntu-latest sm-standard-4 release runs with a crates.io token
Docker build-and-push ubuntu-latest dind-sm-standard-2 successful tag-push release, or workflow_dispatch

No ubuntu-* label remains. macos-latest and windows-latest appear only on jobs that workflow_dispatch includes.

Branch protection

Linux check names changed from Test (ubuntu-latest) / Build (ubuntu-latest) to Test (linux) / Build (linux). macOS and Windows checks are renamed with a , manual suffix and are skipped on pull requests. If branch protection requires the old names, update it. A skipped required check is treated as success, so do not require the manual macOS/Windows checks if they should not gate merges.

Test status

Workflow YAML parses, and the release matrix selector was executed locally: tag push emits only the four Linux targets; workflow_dispatch adds the three GitHub-hosted targets.

  • cargo fmt --all --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace

All three passed on stable 1.98.1. These workflows were not executed on the org runners from this environment.

Open in Web Open in Cursor 

Stop automatic GitHub-hosted Actions usage. Linux jobs run on
sm-standard-2, sm-standard-4, or dind-sm-standard-2, with host tools
installed that those images do not ship. macOS and Windows stay on
GitHub-hosted runners and run only from workflow_dispatch.

Co-authored-by: RustFS <hello@rustfs.com>
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