Skip to content

RFC: template.yaml #2987

Closed as not planned
Closed as not planned

Description

@ammario

As a template admin, I want to subject my whole template to version control to simplify change management. If/when #2958 is implemented, this becomes even more true. Let's also remember that our product is built around an IaaC tool, so our users probably prefer this method of configuration.

As a template admin, I sometimes forget what I've named my template. If I thoughtlessly run coder templates update and my directory happens to correspond with the wrong template I just disrupted developers. In a world without #2958, it's possible that the last template doesn't exist anymore and users are offline for days while it is reconstructed.

As a template admin, I forget that there are distinct coder templates update and coder templates edit commands. I'm also confused that coder templates update is the compliment to coder templates pull. I expect push/pull like git, or doors.

Proposal

coder templates edit and coder templates update are unified as coder templates push.

All the configuration in edit is now in a template.yml file that looks like:

version: 1
name: dogfood
description: "Our standard dogfood image"
schedule:
  max_ttl: 12h
  min_autostart_interval: 24h
# Some future knobs
deprecated_for: "dogfood-ts"
allow:
   - all
deny:
   - dean@coder.com

Why not HCL?
Our provisioner layer is abstract, and this template config sits above provisioning instead of within it. For example, we may have Docker, Pulumi and Kubernetes provisioners in the near future.

Activity

  1. ketang commented on Jul 14, 2022

    @ketang
    Contributor

    A reason to keep the commands separate is because we don't want to prompt for metadata updates on template update, and we don't want to require that users be in a template directory to update the metadata.

    As of a few days ago we at least confirm on template update. I certainly wouldn't mind if we also required the name as an argument instead of inferring it.

  2. ammario commented on Jul 14, 2022

    @ammario
    MemberAuthor

    I see the use case of wanting to update the metadata but not touch the template meat. I would still put it under the same command for discoverability though. Perhaps a template push --config-only.

  3. ketang commented on Jul 14, 2022

    @ketang
    Contributor

    Yeah that'll work, I think.

  4. changed the title [-]RFC: Template Config as Code[/-] [+]RFC: template.yaml[/+] on Jul 18, 2022
  5. self-assigned this
    on Jul 21, 2022
  6. bpmct commented on Aug 17, 2022

    @bpmct
    Member

    This is certainly a necessary feature for large teams who want security and extensibility for their templates.

    After a chat with @kylecarbs and @BrunoQuaresma, we decided to expose some basic features (icon, max TTL, description) via the dashboard/CLI for increased interactivity. If a template.yaml is present, this will "grey out" these settings, as we do in Coder Classic:

    Screen Shot 2022-08-17 at 11 51 38 AM

  7. ammario commented on Aug 17, 2022

    @ammario
    MemberAuthor

    I think we should hold off on this feature until more user feedback. While theoretically good, bifurcating the product experience seems like unnecessary complexity.

  8. kylecarbs commented on Aug 24, 2022

    @kylecarbs
    Member

    I'm closing for now re the comment above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions