[Internal] Preset service serialization format - #4162
Draft
peterschmidt85 wants to merge 1 commit into
Draft
Conversation
preset.yml and exported service configurations are now the exact model dump. All dump-time transforms are removed: field exclusions (type, status, name, gateway, profile params), the env rewrite to key=value list form, and the empty-container filter. What a preset must not carry is enforced by VerifiedPreset validation, not hidden at serialization. Old files load unchanged; new files load on old versions. Redaction now covers secrets only: the dstack token, the agent API key, resolved passthrough env values, and inherited proxy variables. Literal env values are the user's own configuration text; treating them as secrets failed creation for any literal of 8+ characters. dstack preset export names the service after the preset; -n overrides. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The exported service must match the configuration of the verified run exactly, and presentation does not belong in serialization. Stored
preset.ymlfiles and exports were built through a custom serializer: field exclusions (type,status,name,gateway, profile params), an env rewrite to thekey=valuelist form, and a filter dropping empty containers, so the written files diverged from the model that ran. The serializer is deleted; presentation, including a future human-readable format, is a separate concern on top of an exact export (aTODOmarks it). As a bonus, one transform masked a real bug: literal env values counted as secrets, so creation failed for any literal value of 8 or more characters.What changed
~/.dstack/presets/<id>/preset.ymland the service configurationdstack preset exportwrites are the exactmodel_dumpof the preset and its service; the custom serializer is deleted.-n/--nameoverrides.What this does not change
The stored service still never contains
name,gateway, or anyProfileParamsfield (backends,spot_policy,max_price, ...): they are the deployer's choices, and a preset with any of them set fails validation.resourcesstays required and stored as the run specified it, with the GPU vendor filled in from the hardware the run was verified on, as before.Backward compatible
Old files load with new code, and new files load with old code.
🤖 Generated with Claude Code