Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion kubeflow/trainer/backends/localprocess/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def list_jobs(self, runtime: types.Runtime | None = None) -> list[types.TrainJob
types.TrainJob(
name=_job.name,
creation_timestamp=_job.created,
runtime=runtime,
runtime=_job.runtime,
num_nodes=1,
steps=[
types.Step(name=s.step_name, pod_name=s.step_name, status=s.job.status)
Expand Down
22 changes: 22 additions & 0 deletions kubeflow/trainer/backends/localprocess/backend_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,28 @@ def test_list_jobs(local_backend, test_case):
assert isinstance(jobs, list)


def test_list_jobs_without_runtime_filter_preserves_stored_runtime(
local_backend, mock_train_environment
):
"""Test unfiltered job listings retain each job's runtime metadata."""
runtime = types.Runtime(
name=TORCH_RUNTIME,
trainer=types.RuntimeTrainer(
trainer_type=types.TrainerType.CUSTOM_TRAINER,
framework="torch",
image=LOCAL_RUNTIME_IMAGE,
),
kind=types.RuntimeKind.TRAINING_RUNTIME,
)

local_backend.train(runtime=runtime, trainer=types.CustomTrainer(func=dummy_training_function))

jobs = local_backend.list_jobs()

assert len(jobs) == 1
assert jobs[0].runtime == runtime


@pytest.mark.parametrize(
"test_case",
[
Expand Down