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

chore(examples): update devcontainer-docker template#14199

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
johnstcn merged 6 commits intomainfromcj/examples/devcontainer-docker-envbuilder
Aug 14, 2024

Conversation

johnstcn
Copy link
Member

@johnstcnjohnstcn commentedAug 7, 2024
edited
Loading

Updates the devcontainer-docker template to use the coder/envbuilder provider.
Caching is completely optional here.

@johnstcnjohnstcn requested a review frommafredriAugust 7, 2024 12:00
@johnstcnjohnstcn self-assigned thisAug 7, 2024
@johnstcnjohnstcn changed the titleupdate devcontainer templatechore(examples): update devcontainer-docker templateAug 7, 2024
@@ -161,7 +174,10 @@ resource "docker_container" "workspace" {
"ENVBUILDER_FALLBACK_IMAGE=${data.coder_parameter.fallback_image.value}",
"ENVBUILDER_CACHE_REPO=${var.cache_repo}",
"ENVBUILDER_DOCKER_CONFIG_BASE64=${try(data.local_sensitive_file.cache_repo_dockerconfigjson[0].content_base64, "")}",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Should this also be passed toenbuilder_cached_image? What about utilizing the outputenvbuilder_cached_image.cached.env?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

oop, forgot about the env 👍

Copy link
MemberAuthor

@johnstcnjohnstcnAug 13, 2024
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

OK, I took a stab at this -- unfortunately there's abug in the provider that mangles the init script. I can remove the FIXME after this is done though.

@johnstcnjohnstcnforce-pushed thecj/examples/devcontainer-docker-envbuilder branch from1416edd tob8c3ddaCompareAugust 9, 2024 11:29
@johnstcnjohnstcnforce-pushed thecj/examples/devcontainer-docker-envbuilder branch fromb8c3dda to3f37703CompareAugust 13, 2024 14:21
@johnstcnjohnstcn marked this pull request as ready for reviewAugust 13, 2024 16:03
@@ -89,14 +93,13 @@ EOF

variable "cache_repo" {
default = ""
description = "Use a container registry as a cache to speed up builds."
sensitive = true
description = "(Optional) Use a container registry as a cache to speed up builds."
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

review: this shouldn't contain any credentials and it's kind of annoying to have this sensitive

type = string
}

variable "cache_repo_docker_config_path" {
default = ""
description = "Path to a docker config.json containing credentials to the provided cache repo, if required."
description = "(Optional)Path to a docker config.json containing credentials to the provided cache repo, if required."
sensitive = true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Is this actually sensitive if it's just the path to a file?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

🤷 maybe? The nice thing about making the file sensitive is that the content automatically becomes sensitive. (That's my recollection anyhow)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Ok, so there’s some magic there wrt content? If so please keep it as is 👍

"ENVBUILDER_DOCKER_CONFIG_BASE64" : try(data.local_sensitive_file.cache_repo_dockerconfigjson[0].content_base64, ""),
"ENVBUILDER_PUSH_IMAGE" : var.cache_repo == "" ? "" : "true",
#"ENVBUILDER_INSECURE": "true", # Uncomment if testing with an insecure registry.
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

If these are fed in via extra env, shouldn't they be included in the computed env the resource outputs? (In which case the below would be unnecessary?)

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Yes, but I'm going to keep it like this untilcoder/terraform-provider-envbuilder#31 is fixed.

mafredri reacted with thumbs up emoji
count = var.cache_repo == "" ? 0 : data.coder_workspace.me.start_count
builder_image = local.devcontainer_builder_image
git_url = local.repo_url
cache_repo = var.cache_repo
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Should we make these optional and let them be provided via extra env too? Would simplify a bit and a user knows they can just cram everything in extra.

Right now for url is given here and in extra, what if the values differ? What's the behavior? (IMO maybe it's an error).

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Alternatively, we could validate at runtime thatextra_env does not contain any duplicated variables from the inputs?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I agree, that’s what I had in mind, but in a more roundabout way 😅. I think it would help with avoiding mistakes, and remove ambiguity.

johnstcn reacted with thumbs up emoji
item {
key = "cache repo"
value = var.cache_repo == "" ? "not enabled" : var.cache_repo
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Nice addition ❤️

@johnstcnjohnstcn merged commite978d4d intomainAug 14, 2024
24 checks passed
@johnstcnjohnstcn deleted the cj/examples/devcontainer-docker-envbuilder branchAugust 14, 2024 09:32
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsAug 14, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@mafredrimafredrimafredri approved these changes

@dannykoppingdannykoppingAwaiting requested review from dannykopping

Assignees

@johnstcnjohnstcn

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@johnstcn@mafredri

[8]ページ先頭

©2009-2025 Movatter.jp