0008 - add job-type GPU/session schema and coverage#20
Conversation
las7
left a comment
There was a problem hiding this comment.
Tests pass, code reviewed. Config.py shows new data model for GPU workloads. Some validation is donea against names. So far this is not being used yet, however will be useful for supporting GPU workloads in the future.
las7
left a comment
There was a problem hiding this comment.
Review Notes
Overall this is clean and well-structured — schema-only changes with solid validation and test coverage. A few things worth discussing:
Questions
1. API response exposes gpu_vendor but omits gpu_count and gpu_device_ids
JobTypeResponse includes session_enabled, gpu_enabled, gpu_vendor but not gpu_count or gpu_device_ids. If a client needs to know the full GPU capabilities of a job type, they'd get an incomplete picture. Is this intentional to keep the API lean, or should those be included?
Suggestions
2. from_dict behavior change — silent key dropping
The old from_dict was cls(**data), which would raise TypeError on unknown keys. The new explicit field enumeration silently ignores unrecognized keys. This is arguably better for forward compatibility, but it could mask data issues. Consider logging a warning for unrecognized keys.
3. Spurious whitespace change in config.py
A blank line before # Validate and create config was removed — unrelated to the PR. Minor diff noise.
4. job_types.json still missing trailing newline
Coordination note
PR #21 duplicates all of this PR's schema changes but has diverged — notably, #21's validate_device_ids is missing the duplicate detection (the seen set with case-insensitive dedup) that this PR added. If #21 merges first or gets rebased carelessly, that validation could be lost. Recommend merging this PR first, then rebasing #21 to only include its runtime additions.
Looks good
- GPU validation model is thorough (vendor normalization, mutual exclusion of count/device_ids, AMD count restriction, duplicate detection, comma rejection)
merge_config_job_typesis clean — in-memory only, returns countregister/register_manywithpersistparam — good backward-compatible API- Version digest correctly includes new fields with
sorted(gpu_device_ids)for determinism - Test coverage is solid across config validation, roundtrip, merge, and digest stability
This PR introduces the schema and serialization support needed to represent session-capable and GPU-capable job types. It is intentionally limited to config/schema/API surface for job-type metadata, without runtime execution behavior.
What Changed
tako_vm/config.pytako_vm/job_types.pytako_vm/job_types.jsontako_vm/server/app.pysession_enabledgpu_enabledgpu_vendortako_vm/version.pyTests Added/Updated
tests/test_config.pytests/test_job_types.pytests/test_version.pygpu_device_idstests/test_api.pyHow To Review
tako_vm/config.pyto validate the model constraints.tako_vm/job_types.pyfor parsing/merge behavior and backward compatibility.tako_vm/server/app.py.tests/test_config.pytests/test_job_types.pytests/test_version.pySuggested Verification
ruff check tako_vm testspytest tests/test_config.py tests/test_job_types.py tests/test_version.py -vOut of Scope