NoteWe invite your participation on this feature proposal. Please keep commentssubstantive. We'd especially love feedback on ways in which this feature may be useful to you and/or where you feel this RFC falls short. Problem StatementWorkspace templates may be defined with a range of configurable parameters - such as CPU, RAM, disk size, operating system, cloud region, etc. Users may not always know which settings are most appropriate for their needs, and default values don’t necessarily fit every scenario. New or non-technical users may find it especially difficult to choose the right settings. Furthermore, giving users complete freedom to select these parameters can lead to a proliferation of different workspace types and sizes, making it harder to manage them effectively. UX & Design
One or morecoder_workspace_preset blocks can be added to a template, which allows operators to choose combinations ofcoder_parameter values which together form a “preset”. Any parameters which are not part of the preset will still be displayed. A “Custom” option will also be (configurably) available for users to choose their own values. User Stories- As atemplate admin, I want to define combinations of parameter values, in order to give my users a simplified approach when creating workspaces
- As anoperator, I want my workloads to conform to certain predefined shapes & sizes, so I can cost-efficiently run (easier to bin-pack) compute
- As anon-technical end-user, I don’t want to have to choose how much CPU/RAM/disk my workspace should have - I just want a workspace with the standard set of options for my department
- As atechnical end-user, I want options to choose preset sizes of workspaces (S/M/L) depending on my use-case, as a convenience
- As atechnical end-user, I want a “Custom” option where I can still modify individual parameters where no preset matches my particular use-case
- As anoperator, I want to disable the “Custom” option if I’m satisfied that the presets represent the full suite of requirements for my users, in order to control cost and tame infra complexity
RequirementsInitial Functional Requirements- MUST introduce new Terraform datasource (
coder_workspace_preset ) in provider - MUST be built in order to accommodate integration with Prebuilds (TODO: link to RFC)
- we will likely introduce a
prebuilds attribute on thecoder_workspace_preset block, specifying how many workspaces using the preset’s parameter values must be prebuilt
- MUST work for the web UI and the CLI alike
- MAY validate on the frontend before submission
- MAY validate on template import
- MAY change preset after-the-fact when updating a workspace
Initial Non-functional Requirements- MUST be clear and easy for non-technical users to create workspaces from presets, as this cohort is likely to benefit the most
Eventual Requirements- MAY perform frontend validation of selected preset parameter values on submit
- MUST produce template insights about usage of presets
ImplementationCreation Flow- template admin adds one or more
coder_workspace_preset blocks to their template - template is imported and a new version is created
- the
coder_workspace_preset blocks’ properties will be accessible in theplanResources func, and will be persisted to the database - user goes to create new workspace via web UI or CLI
- presets are fetched and listed
- preset is chosen
- validation occurs
- workspace build initiated using given parameters, if valid
- selected preset is tracked for later insights
Update Flow- user goes to modify workspace
- previously selected preset should be set
- if parameters have been changed from the preset, this must be indicated
- the preset used to create the workspace must be indicated
- a new preset can be selected, provided none of the parameters are immutable
- parameters are submitting to workspace build API
- workspace is updated with given parameters
|