warden icon indicating copy to clipboard operation
warden copied to clipboard

Introduce variables for GraphQL Application server

Open navarr opened this issue 1 year ago • 5 comments

Starting with Magento 2.4.7, Adobe has introduced a method to run a GraphQL Application server.

As always, when testing local environments it's important to be able to mirror the way production works at some point.

Documentation on enabling and running the application server for on-premises deployments (which includes Warden): https://experienceleague.adobe.com/docs/commerce-operations/performance-best-practices/performance-best-practices/application-server.html?lang=en#enable-application-server-on-on-premises-deployments

Initial ideas for how to best handle this is a WARDEN_MAGENTO2_GRAPHQL_SERVER_ENABLED flag. When 1, this would start up an image that runs the application server and receives traffic through Traefik automatically.

  • [ ] Determine if we should use a custom entry script or a special image (likely a custom entry script)
  • [x] Add OpenSwoole from PECL to the PHP images
  • [ ] Write entry script

navarr avatar Feb 22 '24 15:02 navarr

@navarr given that this is an optional item in Adobe Commerce Cloud, and the differences in how the processes are handled, I would lean toward using a separate image entirely for this. According to their documentation it's a separate app that's just routed via the /graphql path.

bap14 avatar Feb 22 '24 16:02 bap14

@bap14 My primary concern with doing it that way is that we're adding a new image variant for every version of PHP with the only difference being pecl's OpenSwoole. Everything else is still within the Magento application

I definitely intend for it to be a second container, but it seems overkill for it to be a new image variant.

navarr avatar Feb 22 '24 16:02 navarr

@navarr Ah, I see. I misunderstood your initial thought.

bap14 avatar Feb 22 '24 16:02 bap14

@navarr I submitted a PR to add Openswoole to the base PHP images ( https://github.com/wardenenv/images/pull/22 ). Once that's added, it will make things easier to play around with. At the moment Openswoole is application dependent (e.g. M2 will use a different entrypoint / start than a Laravel project).

bap14 avatar Feb 26 '24 03:02 bap14

Hello! Any progress after the image merge on this topic?

evktalo avatar Jun 11 '24 10:06 evktalo