[go: nahoru, domu]

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

PHP Extensions Mismatch: App Engine Standard <> gcr.io/buildpacks/builder #393

Open
2 of 6 tasks
iamacarpet opened this issue Mar 14, 2024 · 4 comments
Open
2 of 6 tasks
Labels
kind/enhancement New feature or request

Comments

@iamacarpet
Copy link

Describe the bug

The PHP extensions included in the main builder (gcr.io/buildpacks/builder) don't seem to match those on App Engine Standard.

Tested against PHP 8.3, some of the versions don't match and opentelemetry is entirely missing.

Additional context
How are you using GCP buildpacks?

  • pack and the gcr.io/buildpacks/builder
  • Cloud Functions
  • Cloud Run
  • Cloud Build
  • App Engine Standard
  • App Engine Flex

Did this used to work?

First time testing / unknown

What language is your project primarily written in?
(Python/Java/Node.js/Go/etc.)

PHP 8+, specifically testing PHP 8.3

Steps To Reproduce
Steps to reproduce the behavior:

  1. pack build sample-php --builder=gcr.io/buildpacks/builder
  2. docker run --entrypoint /bin/bash -it sample-php
  3. ls -lh /layers/google.php.runtime/php/lib/php/extensions/no-debug-non-zts-20230831/

vs

  1. docker run --entrypoint /bin/bash -it gcr.io/gae-runtimes/buildpacks/php83/run:latest
  2. ls -lh /usr/lib/php/extensions/no-debug-non-zts-20230831/

Expected behavior
A clear and concise description of what you expected to happen.

At the most basic level, expect opentelmetry.so to be present, and when loading PHP, all of the module versions to match.

Actual behavior
What actually happened?

opentelemetry.so isn't present, version numbers mismatch.

If applicable, add screenshots / logs / error messages

@iamacarpet iamacarpet added the kind/bug Something isn't working label Mar 14, 2024
@jama22 jama22 added kind/enhancement New feature or request and removed kind/bug Something isn't working labels Mar 18, 2024
@jama22
Copy link
Collaborator
jama22 commented Mar 18, 2024

This is some what "as designed". The base images in the GAE context are designed to capture more use cases supporting we applications. The "generic" builders (gcr.io/buildpacks/builder) are much more stripped down.

@iamacarpet I'm assuming you're looking for the same set of extensions so you have some portability between GAE and manually building & deploying to Cloud Run / k8s? You can try using gcr.io/gae-runtimes/buildpacks/google-gae-22/php/builder with pack

@iamacarpet
Copy link
Author

Thanks @jama22 ,

Yes, exactly - see my answer to your other reply here for a full explanation:

#300 (reply in thread)

But yes, broadly, full portability & equality between App Engine and Cloud Run, since that is the direction we are being pushed in (and have been for some time).

I have tried using the gcr.io/gae-runtimes/buildpacks/google-gae-22/php/builder image, but without all of the environment variables from an App Engine Standard build (pulled from Cloud Run), it's still using the same PHP runtime (tar.gz) as the generic builder, not the App Engine run image.

Pulling the environment variables from the App Engine Standard build seemed to make it choose the run image, but ran me into more errors down the line - I ended up giving up on that, as it was wasting too much time.

@kennethye1
Copy link
Contributor

There's a difference between the builder and the run image. The extensions are enabled on the run image. You can specify the run image specifically via

pack build sample-php --builder=gcr.io/buildpacks/builder --run-image gcr.io/gae-runtimes/buildpacks/php83/run:latest

@sl0wik
Copy link
Contributor
sl0wik commented Apr 12, 2024

@iamacarpet you can try:

pack build sample-php --builder gcr.io/buildpacks/builder:latest --run-image gcr.io/buildpacks/google-22/run:latest

I keep on looking for a better way.

I would expect that --builder=gcr.io/gae-runtimes/buildpacks/google-gae-22/php/builder:latest --run-image=gcr.io/gae-runtimes/buildpacks/google-gae-22/php/run:latest is the right one but it would throw ERROR: failed to launch: change to app directory: chdir /workspace: permission denied

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants