build-image icon indicating copy to clipboard operation
build-image copied to clipboard

Cache Playwright browser dependencies

Open Rarst opened this issue 2 years ago • 3 comments

Is your feature request related to a problem? Please describe.

The build image doesn't seem to come with browser binaries, which could be used by Playwright for testing.

They need to be explicitly installed, however their target location .cache/ms-playwright is not cached by Netlify and the dependencies are re-downloaded in every build.

Describe the solution you'd like

Playwright dependencies to be cached by default.

Describe alternatives you've considered

I've tried third party netlify-plugin-cache to cache it, but according to support Netlify has plugin issues with current Node 18 version.

Additional context

8:05:26 PM: > npx playwright install chromium
8:05:27 PM: Downloading Chromium 104.0.5112.20 (playwright build v1012)...
8:05:29 PM: |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■| 100% of 132.8 Mb
8:05:32 PM: Chromium 104.0.5112.20 (playwright build v1012) downloaded to /opt/buildhome/.cache/ms-playwright/chromium-1012
8:05:32 PM: Downloading FFMPEG playwright build v1007...
8:05:33 PM: |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■| 100% of 2.6 Mb
8:05:33 PM: FFMPEG playwright build v1007 downloaded to /opt/buildhome/.cache/ms-playwright/ffmpeg-1007

Can you submit a pull request?

No, fuzzy on nixes scripting, sorry. :)

Rarst avatar Jul 27 '22 08:07 Rarst

@Rarst can you provide some details about the .cache location where is this directory located?

Furthermore node 18 support for plugins should be now available ;)

lukasholzer avatar Jan 09 '23 16:01 lukasholzer

.cache location where is this directory located?

Log above says /opt/buildhome/.cache/ms-playwright/chromium-1012, looks like right in the build root.

Furthermore node 18 support for plugins should be now available ;)

Does this mean existing plugin should no longer have issues running on node 18, or the plugin's author would need to update it for it?

Rarst avatar Jan 09 '23 16:01 Rarst

Does this mean existing plugin should no longer have issues running on node 18, or the plugin's author would need to update it for it?

Previously we had issues in the IPC communication between the build and the plugin. Now those are resolved and you can run the plugins with node18 (Generally speaking there should not be anything to "add support" from the plugin side except if the engine property was set to not include node 18)

lukasholzer avatar Jan 09 '23 16:01 lukasholzer