Skip to content

[CI] mismatch between available backend and dispatch #935

@sayakpaul

Description

@sayakpaul

Currently, the bot checks out from main when a comment is made on a PR:

ref: ${{ github.event.repository.default_branch }}

Then dispatch.py is called through:

python3 .github/scripts/pr_comment_kernel_bot.py

We have the following LOC in dispatch.py:

def read_backends(kernel_name: str) -> list[str] | None:
"""Read the backends list from a kernel's build.toml. Returns None if not found."""
build_toml = Path(kernel_name) / "build.toml"
if not build_toml.exists():
return None
with open(build_toml, "rb") as f:
config = tomllib.load(f)
backends = config.get("general", {}).get("backends")
if backends is None:
backends = config.get("backends")
if isinstance(backends, list):
return backends
return None

Since it's invoked from main, it means all release workflows will get triggered since backends can be none for kernels that don't exist on main yet:

backends = read_backends(kernel_name)
if backends is None:
print(f"Could not read backends for {kernel_name}, dispatching all workflows")
return set(RELEASE_WORKFLOWS)

I think this is what happened here:
#919

The said kernel doesn't declare a "metal" backend but still, a build-mac.yaml was dispatched and it failed here: https://github.com/huggingface/kernels-community/actions/runs/27025228114 because it couldn't find metadata.

My comments are:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions