GoogleCloudPlatform / GoogleCloudPlatform/functions-framework-nodejs

Ability to run cloud function that uses yarn 2 plug and play mode without invoking yarn.

Offen
#532 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
enhancement P3
Vorherrschende Sprache
TypeScript
Sterne
1.4k
Forks
181
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

We experience about 2x memory usage when using cloud function in yarn 2 plug and play, zero install mode.

- in https://github.com/yarnpkg/berry/discussions/2884#discussioncomment-728054 people elaborate that using sometehing like `node -r ./.pnp.cjs ...` without calling yarn directly should help mitigate this problem.
- [google cloud buildpack doc](https://cloud.google.com/docs/buildpacks/nodejs#application_entrypoint) mentions following:
>  We recommend using a Procfile because it takes npm or yarn out of the path.

This makes me think that maybe, it should be somehow possible to alter default ` /bin/bash -c yarn functions-framework` command into something more yarn pnp friendly, possibly by providing some form of custom procfile in the code deployed?

Alternatively - maybe there is some other issue in zero install mode? we do have workspace-tools plugin installed, and verified that `yarn workspaces focus --all --production` gets called during cloud function build process.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Start by reviewing the default `/bin/bash -c yarn functions-framework` command and the Google Cloud buildpack's application entrypoint guidance, including the Procfile approach. The issue is complete when a deployed Yarn 2 Plug'n'Play cloud function can run without invoking Yarn and avoids the reported extra memory usage.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
google-cloud, nodejs, typescript
Bereich
backend, cloud
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
28/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.