Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add container-gcp-* templates #413

Merged
merged 7 commits into from
Oct 25, 2022
Merged

Add container-gcp-* templates #413

merged 7 commits into from
Oct 25, 2022

Conversation

cnunciato
Copy link
Contributor

This change adds new templates for container-gcp-{typescript,python,go,csharp}. Apps return JSON responses using common language-specific frameworks. Excludes YAML for now, as docker:Image is not yet supported.

Fixes https://github.com/pulumi/devrel-team/issues/173.

@cnunciato cnunciato marked this pull request as ready for review October 20, 2022 00:17
@cnunciato
Copy link
Contributor Author

cnunciato commented Oct 20, 2022

Question for reviewers: Should these templates create a new container registry, or use the registry that's enabled on the GCP project? Something tells me we should create a new one, but I'm not finding many examples (of ours or in general) that actually do that; most seem push to gcr.io/${project}/${image_name} and leave it at that. Thoughts, suggestions? Or is what's here okay in terms of what GCP users will expect?

@cnunciato cnunciato requested a review from a team October 20, 2022 00:53
@scottslowe
Copy link
Contributor

@cnunciato What is the behavior of the corresponding templates for the other providers? I would try to match that behavior here for consistency among templates across providers (where possible).

@cnunciato cnunciato force-pushed the cnunciato/container-gcp branch from e02d0e5 to 496d821 Compare October 20, 2022 22:26
@cnunciato cnunciato force-pushed the cnunciato/container-gcp branch from 496d821 to f11b2b3 Compare October 21, 2022 03:25
@cnunciato
Copy link
Contributor Author

cnunciato commented Oct 25, 2022

@scottslowe Near as I can tell, there's not really a way to create multiple registries per project, like there is with other providers; from the docs, it looks like you can push to up to four location-based hosts, but that's it: https://cloud.google.com/container-registry/docs/overview

So I think what we have here should suffice for purpose of the template -- but would love to hear whether @timbohiatt has any additional guidance here for us.

@cnunciato
Copy link
Contributor Author

Merging on @scottslowe's in Slack.

@cnunciato cnunciato merged commit 0e607ba into master Oct 25, 2022
@pulumi-bot pulumi-bot deleted the cnunciato/container-gcp branch October 25, 2022 20:38
@timbohiatt
Copy link

Hey @cnunciato @scottslowe thanks for summoning me to another great PR;

I see this is now merge complete. Sorry about the delay. However for what it is worth here are a few thoughts. That might help for further Example and Template developments.

  • @cnunciato is correct. In a single Google Cloud project you can only have 1 "Container Registry".

  • A Container Registry is segregated primarily by project/container-image-name:tag and is limited to Docker Only Images.

  • Artifact Registry has additional features to container registry including the ability to create multiple "Repositories" each can be bound to a Google Cloud Region for compliance reasons. In addition Artifact registry can house Maven Packages, Go Packages and NPM Packages and a few others, in addition of course to Docker Images.

My personal suggestion would be all examples or templates later on that require the creation of a Docker Image registry housed on Google Cloud simply use Artifact Registry. I think it would save a headache late on. Plus the examples of creating a Artifact Registry Repository for Docker Images could easily be replicated for Maven, YUM, NPM ect should those examples be required later on.

Additionally the URL structures for Container Registry and Artifact Registry are quite different. gcr.io vs us-docker.pkg.dev where "us" is the region and "docker" is the registry type.

Also, I am not sure how this stacks up with other Cloud Providers however at this time Cloud Run only supports Container Images that come from within Container Registry and or Artifact Registry.

One final consideration from my point. As previously mentioned the Creation of either Artifact Registry or Container registry both require the enablement of Google Cloud API for use with IaC or from within Cloud Console.

Transitioning Container Registry to Artifact Registry Public Docs:
https://cloud.google.com/artifact-registry/docs/transition/transition-from-gcr
TLDR; Container Registry will now only receive critical security updates and no new features.

Whole lot of information there. Sorry it's late I don't think for this particular PR it would change any outcomes. However I think its context is helpful for potentially future content.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants