diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index c7a960654..11e236aeb 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -10,12 +10,17 @@ steps: - wait - - label: "Trigger Tests" + # ============================================================ + # Fastcheck: Runs on every PR (~10-15 min parallel) + # Core component validation: encoders, VAEs, transformers, + # CUDA kernels, and unit tests. + # ============================================================ + - label: "Trigger Fastcheck" plugins: - monorepo-diff#v1.4.0: diff: 'git fetch origin "$BUILDKITE_PULL_REQUEST_BASE_BRANCH" && git diff --name-only origin/"$BUILDKITE_PULL_REQUEST_BASE_BRANCH"...HEAD' watch: - - path: + - path: - "fastvideo/models/encoders/**" - "fastvideo/models/loader/**" - "fastvideo/tests/encoders/**" @@ -23,7 +28,7 @@ steps: - "docker/Dockerfile.python3.12" config: command: "timeout 20m .buildkite/scripts/pr_test.sh" - label: "Encoder Tests" + label: ":microscope: Encoder Tests" env: - TEST_TYPE=encoder agents: @@ -36,7 +41,7 @@ steps: - "docker/Dockerfile.python3.12" config: command: "timeout 20m .buildkite/scripts/pr_test.sh" - label: "VAE Tests" + label: ":microscope: VAE Tests" env: - TEST_TYPE=vae agents: @@ -51,18 +56,53 @@ steps: - "docker/Dockerfile.python3.12" config: command: "timeout 15m .buildkite/scripts/pr_test.sh" - label: "Transformer Tests" + label: ":microscope: Transformer Tests" env: - TEST_TYPE=transformer agents: queue: "default" - - path: + - path: + - "fastvideo-kernel/**" + - "pyproject.toml" + - "docker/Dockerfile.python3.12" + config: + command: "timeout 15m .buildkite/scripts/pr_test.sh" + label: ":microscope: Kernel Tests" + env: + - TEST_TYPE=kernel_tests + agents: + queue: "default" + - path: + - "fastvideo/**" + - "pyproject.toml" + - "docker/Dockerfile.python3.12" + config: + command: "timeout 15m .buildkite/scripts/pr_test.sh" + label: ":microscope: Unit Tests" + env: + - TEST_TYPE=unit_test + agents: + queue: "default" + + # ============================================================ + # Full Suite: Runs only when FULL_SUITE=true + # Triggered by adding the 'ready' label to a PR (via GitHub + # Actions → Buildkite API). Includes integration tests, SSIM + # regression, training pipelines, and performance benchmarks. + # ============================================================ + - label: "Trigger Full Suite" + if: build.env("FULL_SUITE") == "true" + plugins: + - monorepo-diff#v1.4.0: + diff: 'git fetch origin "$BUILDKITE_PULL_REQUEST_BASE_BRANCH" && git diff --name-only origin/"$BUILDKITE_PULL_REQUEST_BASE_BRANCH"...HEAD' + watch: + - path: - "fastvideo/**/*.py" - "pyproject.toml" - "docker/Dockerfile.python3.12" config: command: "timeout 90m .buildkite/scripts/pr_test.sh" - label: "SSIM Tests" + label: ":bar_chart: SSIM Tests" env: - TEST_TYPE=ssim agents: @@ -77,7 +117,7 @@ steps: - "docker/Dockerfile.python3.12" config: command: "timeout 20m .buildkite/scripts/pr_test.sh" - label: "LoRA Inference Tests" + label: ":test_tube: LoRA Inference Tests" env: - TEST_TYPE=inference_lora agents: @@ -88,7 +128,7 @@ steps: - "docker/Dockerfile.python3.12" config: command: "timeout 15m .buildkite/scripts/pr_test.sh" - label: "Training Tests" + label: ":test_tube: Training Tests" env: - TEST_TYPE=training agents: @@ -99,7 +139,7 @@ steps: - "docker/Dockerfile.python3.12" config: command: "timeout 15m .buildkite/scripts/pr_test.sh" - label: "Distillation DMDTests" + label: ":test_tube: Distillation DMD Tests" env: - TEST_TYPE=distillation_dmd agents: @@ -111,7 +151,7 @@ steps: - "docker/Dockerfile.python3.12" config: command: "timeout 15m .buildkite/scripts/pr_test.sh" - label: "Self-Forcing Tests" + label: ":test_tube: Self-Forcing Tests" env: - TEST_TYPE=self_forcing agents: @@ -122,7 +162,7 @@ steps: - "docker/Dockerfile.python3.12" config: command: "timeout 15m .buildkite/scripts/pr_test.sh" - label: "LoRA Training Tests" + label: ":test_tube: LoRA Training Tests" env: - TEST_TYPE=training_lora agents: @@ -134,20 +174,11 @@ steps: - "docker/Dockerfile.python3.12" config: command: "timeout 15m .buildkite/scripts/pr_test.sh" - label: "Training Tests VSA" + label: ":test_tube: Training Tests VSA" env: - TEST_TYPE=training_vsa agents: queue: "default" - - path: - - "fastvideo-kernel/**" - - "pyproject.toml" - - "docker/Dockerfile.python3.12" - config: - command: "timeout 15m .buildkite/scripts/pr_test.sh" - label: "Kernel Tests" - env: - - TEST_TYPE=kernel_tests - path: - "fastvideo-kernel/**" - "fastvideo/attention/backends/vmoba.py" @@ -155,20 +186,9 @@ steps: - "docker/Dockerfile.python3.12" config: command: "timeout 15m .buildkite/scripts/pr_test.sh" - label: "Inference Tests VMoBA" - env: - - TEST_TYPE=inference_vmoba - agents: - queue: "default" - - path: - - "fastvideo/**" - - "pyproject.toml" - - "docker/Dockerfile.python3.12" - config: - command: "timeout 15m .buildkite/scripts/pr_test.sh" - label: "Unit Tests" + label: ":test_tube: Inference Tests VMoBA" env: - - TEST_TYPE=unit_test + - TEST_TYPE=inference_vmoba agents: queue: "default" - path: @@ -184,7 +204,7 @@ steps: - "docker/Dockerfile.python3.12" config: command: "timeout 30m .buildkite/scripts/pr_test.sh" - label: "Performance Tests" + label: ":test_tube: Performance Tests" env: - TEST_TYPE=performance agents: @@ -197,19 +217,8 @@ steps: - "docker/Dockerfile.python3.12" config: command: "timeout 30m .buildkite/scripts/pr_test.sh" - label: "API Server Tests" + label: ":test_tube: API Server Tests" env: - TEST_TYPE=api_server agents: queue: "default" - # - path: - # - "scripts/lora_extraction/**" - # - "pyproject.toml" - # - "docker/Dockerfile.python3.12" - # config: - # command: "timeout 90m .buildkite/scripts/pr_test.sh" - # label: "LoRA Extraction Tests" - # env: - # - TEST_TYPE=lora_extraction - # agents: - # queue: "default" diff --git a/.github/mergify.yml b/.github/mergify.yml index 318e465c7..a577719ef 100644 --- a/.github/mergify.yml +++ b/.github/mergify.yml @@ -233,11 +233,23 @@ pull_request_rules: # Auto-rebase stale PRs # ============================================================ + - name: auto-merge when ready and approved + conditions: + - label=ready + - "#approved-reviews-by>=1" + - check-success~=pre-commit + - -conflict + - -closed + - -draft + actions: + merge: + method: squash + - name: auto-rebase on ready label conditions: - label=ready + - "#approved-reviews-by>=1" - -conflict - -closed - - "#approved-reviews-by>=1" actions: rebase: {} diff --git a/.github/workflows/matchers/ruff.json b/.github/workflows/matchers/ruff.json new file mode 100644 index 000000000..421131363 --- /dev/null +++ b/.github/workflows/matchers/ruff.json @@ -0,0 +1,17 @@ +{ + "problemMatcher": [ + { + "owner": "ruff", + "pattern": [ + { + "regexp": "^(.+):(\\d+):(\\d+): (\\w+) (.+)$", + "file": 1, + "line": 2, + "column": 3, + "code": 4, + "message": 5 + } + ] + } + ] +} diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 6ba2d01d6..8fd2e2853 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -24,6 +24,7 @@ jobs: python-version: "3.12" - run: echo "::add-matcher::.github/workflows/matchers/actionlint.json" - run: echo "::add-matcher::.github/workflows/matchers/mypy.json" + - run: echo "::add-matcher::.github/workflows/matchers/ruff.json" - uses: pre-commit/action@v3.0.1 with: extra_args: --all-files --hook-stage manual diff --git a/.github/workflows/trigger-full-suite.yml b/.github/workflows/trigger-full-suite.yml new file mode 100644 index 000000000..873c71147 --- /dev/null +++ b/.github/workflows/trigger-full-suite.yml @@ -0,0 +1,26 @@ +name: Trigger Full Test Suite + +on: + pull_request: + types: [labeled] + +jobs: + trigger-buildkite: + if: >- + github.repository == 'hao-ai-lab/FastVideo' + && github.event.label.name == 'ready' + runs-on: ubuntu-latest + permissions: + pull-requests: read + steps: + - name: Trigger Buildkite build with FULL_SUITE + uses: buildkite/trigger-pipeline-action@v2.4.1 + with: + buildkite_api_access_token: ${{ secrets.BUILDKITE_API_TOKEN }} + pipeline: "${{ vars.BUILDKITE_ORG_SLUG }}/${{ vars.BUILDKITE_PIPELINE_SLUG }}" + branch: "${{ github.event.pull_request.head.ref }}" + commit: "${{ github.event.pull_request.head.sha }}" + message: "Full suite for PR #${{ github.event.pull_request.number }}" + send_pull_request: "true" + pull_request_base_branch: "${{ github.event.pull_request.base.ref }}" + build_env_vars: '{"FULL_SUITE": "true"}' diff --git a/.github/workflows/welcome.yml b/.github/workflows/welcome.yml index 62919fa58..65610e132 100644 --- a/.github/workflows/welcome.yml +++ b/.github/workflows/welcome.yml @@ -36,17 +36,21 @@ jobs: pr-message: | Welcome to FastVideo! Thanks for your first pull request. - Here's how our CI works: - 1. **Pre-commit checks** run first (formatting, linting, type checking) - 2. **GPU tests** run on RunPod if your changes touch relevant paths — these may take a few minutes to provision + **How our CI works:** - Before your PR is reviewed, please make sure: + PRs run a two-tier CI system: + 1. **Pre-commit** — formatting (yapf), linting (ruff), type checking (mypy). Runs immediately on every PR. + 2. **Fastcheck** — core GPU tests (encoders, VAEs, transformers, kernels, unit tests). Runs automatically via Buildkite on relevant file changes (~10-15 min). + 3. **Full Suite** — integration tests, training pipelines, SSIM regression. Runs only when a reviewer adds the `ready` label. + + **Before your PR is reviewed:** - [ ] `pre-commit run --all-files` passes locally - [ ] You've added or updated tests for your changes - [ ] The PR description explains what and why - If pre-commit fails, check the bot comment for fix instructions. + If pre-commit fails, a bot comment will explain how to fix it. Fastcheck and Full Suite results appear in the Checks section below. - Useful links: + **Useful links:** - [Contributing Guide](https://hao-ai-lab.github.io/FastVideo/contributing/overview/) - [Development Roadmap](https://github.com/hao-ai-lab/FastVideo/issues/899) + - [Slack](https://join.slack.com/t/fastvideo/shared_invite/zt-3f4lao1uq-u~Ipx6Lt4J27AlD2y~IdLQ)