Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Idea: add template metadata to provisioner as a data source#5589

johnstcn started this conversation inFeature Requests
Discussion options

johnstcn
Jan 5, 2023
Collaborator

In the docker-image-builds example template](https://github.com/coder/coder/tree/main/examples/templates/docker-image-builds#updating-images) template, there is a manual required step of updating the image tag in the Terraform code. Without this step, the Terraform provider doesn't rebuild the image.

What would make intuitive sense here is to provide a data source that exposes the template version identifier to the provisioner so that the manual step above becomes automated:

resource "docker_image" "coder_image" {  [...]  tag = ["coder-${var.docker_image}:${data.coder_template.version_friendly}"]  [...]}

There are some other use-cases I can also see this enabling though:

  • With cloud infra, you could tag resources with the template and version that originally spawned them. This could then be consumed by cost attribution tools etc.
  • Similarly with Kubernetes resources, deployments, volumes etc. could be labeled with the template and version.

I'd imagine the schema to look something like the following:

  • name (string) The name of the template
  • id (string) The UUID of the template
  • version_id (string) The UUID of the active template version
  • version (string) The SHA-like representation of the active template version ID
  • version_friendly (string) The human-readable UUID (e.g. fantastic_narwhal7) of the active template version ID

Thoughts?

You must be logged in to vote

Replies: 2 comments 7 replies

Comment options

mtojek
Jan 5, 2023
Collaborator

What would make intuitive sense here is to provide a data source that exposes the template version identifier to the provisioner so that the manual step above becomes automated:

This would improve the user experience! I'm curious if we need a manual override, so that users can easily publish different templates with different version tags. Let's say we know that a published revisionv1.2 is broken, so DevOps would like to temporarily replace it with Docker image SHA.

Similarly with Kubernetes resources, deployments, volumes etc. could be labeled with the template and version.
:+1

I'd imagine the schema to look something like the following:

Do you think that we could support a nested structure, so that it bundles all version properties together underversion key?

You must be logged in to vote
3 replies
@johnstcn
Comment options

johnstcnJan 5, 2023
Collaborator Author

Do you think that we could support a nested structure, so that it bundles all version properties together under version key?

I don't see why not!

@johnstcn
Comment options

johnstcnJan 5, 2023
Collaborator Author

I'm curious if we need a manual override, so that users can easily publish different templates with different version tags.

Would this instead be a use-case for rolling back to a previous template version?

@mtojek
Comment options

mtojekJan 5, 2023
Collaborator

Rolling-back to the previous template can help here if it doesn't mean that it will nuke the latest template version. Let's say we want to keep it for debugging purposes.

Maybe it's an edge case, but I remember that I struggled a bit with emergency fixes applied to Docker:latest image.

Comment options

+1

Our company is using Artifactory and migrating from Coder v1 to v2. Being able to get tags dynamically is a feature we would really like to see as well.

You must be logged in to vote
4 replies
@matifali
Comment options

You mean to get all tags for an image from the registry,,?

@ddsmith2-eprod
Comment options

Yes. In Coder v1 when users click to create a new workspace, they get a screen where they can select an existing image source and then select a tag. They have reported to me that the Git integration dynamically updates the tags from Artifactory.

The feedback I received after setting up a v2 cluster was that they want to deploy the images they use for Airflow into Coder by just selecting the image and a tag. When we spoke with support, they mentioned this might be a new feature that will get added eventually.

It would greatly speed up our developer's adoption of the new platform. We may be able to accomplish this by modifying their current workflow. I just have not had time to investigate it.

@matifali
Comment options

There is a related issue that is no more being worked on I guess.kreuzwerker/terraform-provider-docker#204

@matifali
Comment options

Created a new request:kreuzwerker/terraform-provider-docker#524

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Labels
None yet
4 participants
@johnstcn@matifali@mtojek@ddsmith2-eprod

[8]ページ先頭

©2009-2025 Movatter.jp