-
Notifications
You must be signed in to change notification settings - Fork 14
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
fix: use gcf runtime specific builder instead of unified builder #120
Conversation
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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
Use unified language specific builders to make tests as close as possible to prod deployments.