Skip to content

bug(trainer): container runtime discovery picks up repo-root dotfiles (.coderabbit.yaml, .kube-linter.yaml, .readthedocs.yaml) as runtimes #978

Todo

Description

@debojyoti-dev

What happened?

While following the Local Development guide with the Docker container backend, the debug log shows the runtime loader requesting three files that are not runtimes:

Discovered 8 runtime files: ['deepspeed_distributed.yaml', 'jax_distributed.yaml', 'mlx_distributed.yaml', 'torch_distributed.yaml', 'xgboost_distributed.yaml', 'coderabbit.yaml', 'kube-linter.yaml', 'readthedocs.yaml']
...
Failed to fetch coderabbit.yaml from GitHub: HTTP Error 404: Not Found
Failed to fetch kube-linter.yaml from GitHub: HTTP Error 404: Not Found
Failed to fetch readthedocs.yaml from GitHub: HTTP Error 404: Not Found

Minimal repro (no container engine needed):

from kubeflow.trainer.backends.container.runtime_loader import _discover_github_runtime_files
print(_discover_github_runtime_files())

Cause. _discover_github_runtime_files runs re.findall(r"([\w-]+\.yaml)", html) over the whole GitHub tree page. That page embeds the repository's root file list as JSON ({"name":".coderabbit.yaml","path":".coderabbit.yaml",...}), so every root *.yaml dotfile matches with its leading dot dropped. exclude_files already lists golangci.yaml and pre-commit-config.yaml for this reason: those are kubeflow/trainer's .golangci.yaml and .pre-commit-config.yaml. The list goes stale whenever trainer adds a root config file; .coderabbit.yaml was the most recent.

Impact. Each discovery makes extra requests that always 404 (three today), each with a 5s timeout. Per #783, discovery currently runs for every job in list_jobs(), so the waste multiplies. Results are still correct because the 404s are skipped.

What did you expect to happen?

Only files that are in manifests/base/runtimes/ are discovered, without having to maintain a list of unrelated repo-root files.

Proposed fix: only match names under the requested path, e.g. rf"{re.escape(path)}/([\w-]+\.yaml)". Against the current page this returns exactly the five runtime files plus kustomization.yaml (already excluded), so the golangci.yaml and pre-commit-config.yaml entries can be dropped. I'd add a unit test that feeds a saved-HTML-style string containing root dotfiles.

Related: #783 / #784 change how often discovery runs (caching/memoization) but not what it matches, so this is independent and wouldn't conflict in logic (#784 touches the same file).

Environment

Kubernetes version: N/A (Container backend, Docker Desktop 29.8.1 on Windows 11)

Kubeflow Trainer version: N/A (runtimes discovered from kubeflow/trainer master)

Kubeflow Python SDK version:

$ pip show kubeflow
Version: 0.5.0  (source checkout at main 6f3ef0e)

Activity

  1. github-actions commented on Nov 25, 2026

    @github-actions
    Contributor

    🎉 Welcome to the Kubeflow SDK! 🎉

    Thanks for opening your first issue! We're happy to have you as part of our community 🚀

    Here's what happens next:

    • Our team will review your issue soon! cc @kubeflow/kubeflow-sdk-team
    • If you'd like to contribute to this issue, check out our Contributing Guide for repo-specific guidelines and the Kubeflow Contributor Guide for general community standards

    Join the community:

    Feel free to ask questions in the comments if you need any help or clarification!
    Thanks again for contributing to Kubeflow! 🙏

  2. debojyoti-dev commented on Nov 25, 2026

    @debojyoti-dev
    Author

    /assign

    I found this while following the local development guide. My plan is to match only filenames under the requested runtimes path (e.g. manifests/base/runtimes/<name>.yaml) in _discover_github_runtime_files, so the exclude list for repo-root files is no longer needed. I'll add a unit test that feeds HTML containing root dotfiles. This only changes what discovery matches, so it shouldn't conflict with the caching work in #783 / #784.

  3. moved this from Ready to Merge to In Progress in Kubeflow SDKon Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions