dstack icon indicating copy to clipboard operation
dstack copied to clipboard

Remove duplication in run configuration models and schemas

Open jvstme opened this issue 1 year ago • 3 comments

Some models used for run configurations have duplicates. See GPUSpec and GPUSpecSchema, DiskSpec and DiskSpecSchema, etc. The *Schema models are needed to generate a more permissive JSON schema, see this comment. E.g. they replace Range with Union[Range, int, str], because ranges can parse ints and strs too. #1055 also introduced additional duplication of range parsing logic to avoid creating a new *Schema model.

We might want to look for ways to reduce duplication. Maybe Range could replace its own JSON schema wherever it's used by implementing __get_pydantic_json_schema__ (Pydantic v2) or __modify_schema__ (Pydantic v1).

jvstme avatar Apr 12 '24 12:04 jvstme

This issue is stale because it has been open for 30 days with no activity.

peterschmidt85 avatar May 13 '24 01:05 peterschmidt85

This issue was closed because it has been inactive for 14 days since being marked as stale. Please reopen the issue if it is still relevant.

peterschmidt85 avatar May 27 '24 01:05 peterschmidt85

Relevant

jvstme avatar Jun 12 '24 10:06 jvstme

This issue is stale because it has been open for 30 days with no activity.

peterschmidt85 avatar Jul 13 '24 01:07 peterschmidt85

This issue was closed because it has been inactive for 14 days since being marked as stale. Please reopen the issue if it is still relevant.

peterschmidt85 avatar Jul 28 '24 01:07 peterschmidt85