Bref: Support Composer's vendor folder packaging in a separate layer

Created on 20 Jul 2020  路  8Comments  路  Source: brefphp/bref

Currently, if you try packaging the Composer's vendor directory into a separate layer and specify the BREF_AUTOLOAD_PATH environment variable accordingly, the deployment is broken due to the fact that Composer creates the autoloading maps which are different from the Lambda directory structure and the autoloading fails.

Since a non-standard vendor directory path is supported by Bref using the above-mentioned environment variable, I think it's a fair ask to provide support/fix for the Composer vendor directory layer as well as provide the relevant documentation around it. Most people would want to keep their actual Lambda function zip sizes as small as possible (also helping in quick debugging in the AWS Lambda console).

I see that others are also facing this issue. https://github.com/brefphp/bref/pull/556#issuecomment-608303535

enhancement

Most helpful comment

@aniljaiswal please don't assume the amount of work someone else might do, possibly for your benefit.

If you think this is simple, then do it. If not, let's leave it at that 馃槂

All 8 comments

By the way, Laravel Vapor is already doing this, so I'm assuming, it shouldn't be a big technical challenge.

@aniljaiswal please don't assume the amount of work someone else might do, possibly for your benefit.

If you think this is simple, then do it. If not, let's leave it at that 馃槂

I think you misunderstood my sentiment. Anyway, I do not want to get into a debate here. Thanks for the comment.

Sorry if I did! You're right, there's no need to turn it into a debate ;)

Anyone accepting bounties to create some magical PR for us, fat-lambda guys?

Just found out that what sorcery Laravel Vapor was doing to avoid using some EFS (a.k.a Elastic File-system that is Slow) drive. (https://github.com/laravel/vapor-core/pull/4/files)

They're actually using the 500MB of /tmp storage.

Perhaps the new run-Docker-containers-as-lambda-functions (announced at reinvent 2020) could shine some new light on this?

From what I have seen, one could just as well build a Docker container and deploy that, rather than doing the s3 dance.

I鈥榲e created this PR here to enable separation of the vendor folder from the lambda archive: https://github.com/brefphp/bref/pull/812

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Yalian picture Yalian  路  9Comments

t-geindre picture t-geindre  路  5Comments

mnapoli picture mnapoli  路  6Comments

akondas picture akondas  路  7Comments

mnapoli picture mnapoli  路  3Comments