-
Notifications
You must be signed in to change notification settings - Fork 9
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
Buildpack support for Symfony 5 demo app #284
Comments
If you're using the base bionic builder, you have to have add a few mixins because Alternatively, you can use the full-builder. The following build succeeded for me:
|
Thanks for that tip. Now I've gotten the app to build but something's going wrong when I try to run it and access the homepage:
Output from server:
|
The stack trace reads:
|
Thanks for the detailed report. I'm not able to do
Do you have an app after you have successfully completed steps 1,2 and 3? |
Try this fork of the demo app. It has the updated composer.lock and the buildpack.yml added. |
Thanks. We'll investigate if this is a problem with the buildpack or the app |
Hey @arjun024 – did you end up learning anything interesting about this problem? |
@fg-j did you manage to build the app? |
No, this still isn't working for me. But it might be a question of configuration/lack of documentation, since the PHP buildpack has been significantly overhauled since I initially filed my issue. @paketo-buildpacks/php-maintainers, can you take another look at Symfony support in the buildpack? |
It wasn't working for us either out of the box, I'll pull together what we had to do later in the day. |
@fg-j @sophiewigmore we published a working example here: https://github.com/hostwithquantum/runway-example-php Not ideal yet, it works, but IMHO too many changes required for a smooth (user) experience. The readme outlines everything that's necessary, especially the patching of paths. Don't want to rule out that we didn't fully grok it yet either. |
@till thanks for putting so much detail into to the runway-example-php repo, I totally see that there are too many extra changes needed to make it super usable. Did you ever get the app to run correctly? I tested out your sample app but see an error when I try to query the app Going through the changes you outlined, setting the PHP extensions, creating the The other changes you outlined are definitely less than ideal:
|
Thanks for the detailed response. :) The error I got is the error in this issue. 👆 It fails to load classes from other paths than I understand the part about webservers, etc. though I'd argue the majority of PHP needs a webserver to run and CLI is not unheard of but in most cases it's also part of an application which needs a webserver. As for the paths, I think the conceptual layers are a problem here. Everything should be in one layer for the code to run. A Do you know how to adjust it to flatten the layers into one? Otherwise it could probably use What other use cases is the bp adressing right now? I am curious as to how to solve this issue and not break anything else. |
@till sorry for the delayed response here. I really appreciate the feedback, and also all of the insights - I am not a PHP expert. Can you clarify the line I totally agree that the layers are causing an issue. I think we missed this because we are testing against a pretty vanilla set of applications. We could benefit from adding some more complicated examples, at least to the composer-install integration suite, since that seems to be the buildpack that has the most issues. We could also benefit from being more intentional with where we put the outputs of the various The entire The top-level PHP use cases are outlined here: https://github.com/paketo-buildpacks/rfcs/blob/main/text/php/0001-restructure.md#buildpacks. Like I mentioned before, the |
@sophiewigmore thanks for taking the time. I'll try to answer your questions one by one, but let me know if I should clarify anything. We can also Zoom (or so) some time next week. Sorry, this is a rather long answer. I hope it's an answer though.
CLI - command line interface. I wanted to say that the majority of PHP applications (and frameworks) require a web server:
People use the above to build applications that run in the browser, or provide some kind of "web-based" API. I have to admit that I am also not (100%) up to date as to what else people use these days. So if anyone reads this and I am missing their favorite framework, apologies. More specific applications/frameworks:
What I meant by "CLI is not unheard of" is that people build CLI applications/tools with PHP, but usually these are part of an application which also requires a web server. So defaulting to a web server is good. So as an example, the Symfony framework itself is used to build an application for the browser, but it also includes a CLI tool (through a
The PHP built-in web server is not a great choice, but then again, I am not entirely sure what the buildpack targets here. If the objective is to get something running for local development, then the built-in web server is okay, but I feel like buildpacks are too involved for that. I think, this is one of the key differences of PHP to languages like Ruby, Python or NodeJS. All these languages have libraries to provide web server parts. It's not absolutely necessary to front them with nginx/Apache.
As for defaulting, (personal preferences aside) I think most of these applications include instructions how to setup URL rewriting with
Yeah, great idea to improve the test suite. I think it's safe to assume that
Yeah, I am just starting to learn more about this, and I was a bit stretched this week as well. So regarding what happens (for example) during/after install, I think in our example, we should have adjusted --- a/composer.json
+++ b/composer.json
@@ -87,7 +87,6 @@
"assets:install %PUBLIC_DIR%": "symfony-cmd"
},
"post-install-cmd": [
- "@auto-scripts"
],
"post-update-cmd": [
"@auto-scripts" That would fix one of the problems with Symfony setup. For more context: the I think for convenience ("easy demo app setup") it may be (often) (ab)used to setup a database schema, but also generate assets (css, images, javascript). While generating assets (and baking them into the image) is a good idea, setting up a database schema is definitely far away during a build process.
Yeah, not sure either. This may be somewhere related to how Symfony's flex plugin handles paths. Though it seemed like Drupal, etc. suffered from similar problems. See the But maybe to add some context: (I don't want to bore anyone with this, and apologies if any/all of that is already known.) Before we had The <?php
require_once 'Foo/Bar.php'; By default the If you want a similar behaviour for other paths, you can add them like so: Then enter The path/name There is a really long list of things that A developer can run any amount of applications on the same server/VM:
... and they can use different dependencies because they are included:
As in, let's say, I rely on different versions of the same library in each of these applications. Because each is installed into a different folder, they don't collide. I also no longer have to ask someone with Looking at the <?php
require 'vendor/autoload.php`; Which brings me to the second thing: You can also test this with a
I would probably prioritize
Thanks for that link. And again, sorry for posting here. I am guessing this should have all been in that repo. But yeah, those use-cases should do... Though I don't fully grok the difference between: Is the If that is the (use-)case, another approach to this these days is to add Just looking at the README, I think And instead I would extend the buildpack to support more granular control over |
I appreciate the effort you put into this thread, it's got some great context. I think it'll come in handy as we iterate on the PHP buildpacks. It really helps having a user's input on what makes sense/ what's confusing. I should also point out that Paketo Slack is a great place to chat with people as well! Let me see if I can summarize where we're at:
Actionable things:
Your question regarding the global composer app is extremely valid. I think the point was just to show in the related integration test, that if the I'd definitely like to hear a bit more about what you had in mind for |
I haven't been able to get the PHP buildpack to build the Symfony 5 demo app. Expected behaviour is that the buildpack should be able to build this app, as it's apparently a canonical Symfony app and users want support for the framework (see #3)
Repro steps:
composer update --no-install
Result:
Build fails with output
The text was updated successfully, but these errors were encountered: