Skip to content
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

[Question] Is there an API endpoint to get the binary download URLs? #4381

Closed
VaasRamsay opened this issue Nov 9, 2020 · 8 comments
Closed

Comments

@VaasRamsay
Copy link
Contributor

VaasRamsay commented Nov 9, 2020

For projects managing the binaries separately, is there an endpoint or something like that to get the URL of latest binary?

We can build download URLs like https://playwright.azureedge.net/builds/{browser}/{version}/{browser}-{os}.zip BUT A. not sure if this is a reliable approach B. there is no automated way to get the latest version number (without having to install the latest playwright package or use unpkg.com)

@mxschmitt
Copy link
Member

Hi, it's only guaranteed that the playwright version from NPM works with the attached browser version from the browsers.json (attached to the NPM package). It's not recommended to install them manually, what is the exact use case for it? I'm curious.

@VaasRamsay
Copy link
Contributor Author

VaasRamsay commented Nov 9, 2020

Thanks for the response @mxschmitt. What I'm trying to do is manually manage the binaries - outside Playwright (because of the nature of project). Both local browsers (installed by Playwright) & hermetic install is not helpful in my case because it runs on CI - containerized, different agents and node_modules are cached externally. So, the ideal solution now is to download binaries during the agent setup before test run.

@mxschmitt
Copy link
Member

If it's a docker container, what it is so far, then it's recommended to use the official Docker image with the specific version tag, they contain the browsers so they won't get downloaded over and over again, would that work for you?

https://playwright.dev/#version=v1.5.2&path=docs%2Fdocker%2FREADME.md&q=

@VaasRamsay
Copy link
Contributor Author

I was a bit hesitant to reference this docker image because my setup currently builds its own ubuntu image and if layer the playwright image on top of it, would it cause any issue? Secondly, to skip the browser downloads during npm install, do I need to use the env var to skip the downloads or would it already know that the binaries are available in local cache?

@mxschmitt
Copy link
Member

I would use the Playwright docker image as a base image which is also either Ubuntu 18 or 20 and then you can install your own Node.js version or apt dependencies if you want. That should work.
It should automatically detect if the browsers are already persistent and then automatically skip them, so no need to use environment variables there, but keep in mind for that the docker image version (tag) needs to match the npm version.

@pavelfeldman
Copy link
Member

It does not seem like you are consuming these binaries using Playwright, is that so? I.e. what is your use case and how is it relevant to Playwright?

@VaasRamsay
Copy link
Contributor Author

@mxschmitt Thanks, I'll try it out. It could be tricky with the current xenial image I'm using but will work around it. Thanks for the tip about tag version matching.
@pavelfeldman I'm setting these binaries up for Playwright. There are some caveats with my current project setup so traditional npm i playwright -> downloads binaries doesn't work for me. Hence, the question about downloading the relevant binaries during runtime. As Max suggested, I can somehow work around with the docker image as well.

@pavelfeldman
Copy link
Member

Ok then, if Docker solves it for you, closing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants