Skip to content

fix: use gcf runtime specific builder instead of unified builder #120

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

Merged
merged 1 commit into from
Jun 9, 2023

Conversation

kenneth-rosario
Copy link

@kenneth-rosario kenneth-rosario commented Jun 6, 2023

Use unified language specific builders to make tests as close as possible to prod deployments.

@kenneth-rosario kenneth-rosario marked this pull request as ready for review June 6, 2023 20:34
@kenneth-rosario kenneth-rosario requested review from anniefu, garethgeorge and a team June 6, 2023 20:34
func (b *buildpacksFunctionServer) buildpackBuilderImage() (string, error) {
runtimeLanguage := runtimeLanguageRegexp.FindString(b.runtime)
if runtimeLanguage == "" {
return "", fmt.Errorf("Invalid runtime format. Runtime should start with language followed by version. Example: go119, python311. Got %q", b.runtime)

Choose a reason for hiding this comment

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

I believe gcr.io/buildpacks/builder is the GCP builder that contains all language builders, the one you're changing to is the unified language builder, which is what we're using in prod. The URL should be in the form of gcr.io/gae-runtimes/buildpacks/<language>/builder and should be just "go", "java" and so on.

Copy link
Author

Choose a reason for hiding this comment

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

Hey Kayla, thanks for taking a look. I am extracting the runtime language name (go, php) from the runtime (go119, php82) input stored in b.runtime and using that to fill the <language> portion of the url.

Copy link
Author

Choose a reason for hiding this comment

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

The purpose of the change is that PHP and ruby integ tests seem to be failing when using global builder but pass with the specific prod builder.

Choose a reason for hiding this comment

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

does the builder not automatically detect the language? Do you know if these other builders work for php ruby integ tests? https://cloud.google.com/docs/buildpacks/builders

Copy link
Contributor

Choose a reason for hiding this comment

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

So, we have this generic builder at "gcr.io/gae-runtimes/buildpack/builder" that can build all languages that we call the "OSS builder". It's not maintained as well as the GCF/GAE builders, so we never actually added support for PHP functions to that builder, which is why PHP and Ruby aren't working.

You'll notice that there's no google.php.functions-framework buildpack mentioend in this builder's configuration:
https://github.com/GoogleCloudPlatform/buildpacks/blob/main/builders/gcp/base/builder.toml

The builders we actually use for GCF/GAE are language-specific and use the /builder URL pattern that Kenneth is updating in this PR: https://github.com/GoogleCloudPlatform/buildpacks/blob/main/builders/php/builder.toml

Using those are better for the FF tests because it's closer to what is actually used in production. When I originally added the buildpack integration tests to FF, the URL for the language-specific builders were in flux, so I just used the "OSS builder" to reduce complexity.

func (b *buildpacksFunctionServer) buildpackBuilderImage() (string, error) {
runtimeLanguage := runtimeLanguageRegexp.FindString(b.runtime)
if runtimeLanguage == "" {
return "", fmt.Errorf("Invalid runtime format. Runtime should start with language followed by version. Example: go119, python311. Got %q", b.runtime)
Copy link
Contributor

Choose a reason for hiding this comment

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

So, we have this generic builder at "gcr.io/gae-runtimes/buildpack/builder" that can build all languages that we call the "OSS builder". It's not maintained as well as the GCF/GAE builders, so we never actually added support for PHP functions to that builder, which is why PHP and Ruby aren't working.

You'll notice that there's no google.php.functions-framework buildpack mentioend in this builder's configuration:
https://github.com/GoogleCloudPlatform/buildpacks/blob/main/builders/gcp/base/builder.toml

The builders we actually use for GCF/GAE are language-specific and use the /builder URL pattern that Kenneth is updating in this PR: https://github.com/GoogleCloudPlatform/buildpacks/blob/main/builders/php/builder.toml

Using those are better for the FF tests because it's closer to what is actually used in production. When I originally added the buildpack integration tests to FF, the URL for the language-specific builders were in flux, so I just used the "OSS builder" to reduce complexity.

@kenneth-rosario kenneth-rosario merged commit 0a94dc6 into master Jun 9, 2023
@kenneth-rosario kenneth-rosario deleted the kennethrosario/use-gcf-specific-builder branch June 9, 2023 20:10
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.

4 participants