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

[Feature] Versioned Docker files with browsers #2926

Closed
2 of 3 tasks
pavelfeldman opened this issue Jul 13, 2020 · 3 comments
Closed
2 of 3 tasks

[Feature] Versioned Docker files with browsers #2926

pavelfeldman opened this issue Jul 13, 2020 · 3 comments
Assignees

Comments

@pavelfeldman
Copy link
Member

pavelfeldman commented Jul 13, 2020

Docker files for Playwright should be versioned with Playwright versions and come with the browsers pre-installed. Rationale:

  • Docker files are potentially updated every time Playwright is updated due to the browser dependencies
  • It does not make sense to download browsers from within the library, because it only adds work for the users that have to deal with the environment variables and cache the browsers.
  • We should also provide per-vendor images out of the box

@aslushnikov, wdyt?

Actions:

  • version docker images similarly to playwright releases
  • bake browsers into docker images
  • release per-vendor docker images
aslushnikov added a commit to aslushnikov/playwright that referenced this issue Jul 13, 2020
aslushnikov added a commit to aslushnikov/playwright that referenced this issue Jul 14, 2020
- Repository name has to start with `public/` to be exported to dockerhub.
- Remove `DOCKER_USERNAME` to avoid unnecessary masking in our logs.
- Publish dev versions of Docker image only when changes to docker file
happen. (this is why NPM publishing and Docker publishing for dev
releases are now separate).
- Release publishing in two separate jobs to make them independent.

References microsoft#2926
aslushnikov added a commit that referenced this issue Jul 14, 2020
- Repository name has to start with `public/` to be exported to dockerhub.
- Remove `DOCKER_USERNAME` to avoid unnecessary masking in our logs.
- Publish dev versions of Docker image only when changes to docker file
happen. (this is why NPM publishing and Docker publishing for dev
releases are now separate).
- Release publishing in two separate jobs to make them independent.

References #2926
aslushnikov added a commit to aslushnikov/playwright that referenced this issue Jul 16, 2020
This patch bakes browsers into docker image.

Important observations:
- We now re-build docker image everytime we roll browsers.
- Docker image size almost doubles: from `225MB` to `496MB`.

References microsoft#2926
aslushnikov added a commit to aslushnikov/playwright that referenced this issue Jul 17, 2020
This patch bakes browsers into docker image.

Important observations:
- We now re-build docker image everytime we roll browsers.
- Docker image size almost doubles: from `225MB` to `496MB`.

References microsoft#2926
aslushnikov added a commit that referenced this issue Jul 17, 2020
This patch bakes browsers into docker image.

Important observations:
- We now re-build docker image everytime we roll browsers.
- Docker image size almost doubles: from `225MB` to `496MB`.

References #2926
@DJ-Glock
Copy link

DJ-Glock commented Jul 23, 2020

Very good point.
At the moment we have to make our internal dockerfile for this. But we use only for chromium.

Also it would be great to have a yarn installed as requested here:
#3108

Putting our dockerfile here, probably it will save some time for anybody.

FROM mcr.microsoft.com/playwright:bionic

USER root

RUN  apt-get update \
   && apt-get install -y sudo \
   && usermod -aG sudo pwuser \
   && echo "pwuser ALL=(ALL) NOPASSWD: ALL" | tee -a /etc/sudoers \
   && apt-get install -y gnupg2 \
   && apt-get install -y wget --no-install-recommends \
   && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
   && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
   && apt update \
   && apt install yarn \
   && yarn add [email protected]
   
USER pwuser

aslushnikov added a commit to aslushnikov/playwright that referenced this issue Jul 29, 2020
This patch:
- refactors script to output per-browser package dependencies. This is to aid with
  per-browser docker setup and Playwright github action.
- sorts package maps for both Ubuntu 18.04 and Ubuntu 20.04 alphabetically (and removes a stray dependency)
- hardcodes `DLOPEN` libraries for the browsers

References microsoft#2926
aslushnikov added a commit that referenced this issue Jul 29, 2020
…lts (#3194)

This patch:
- refactors script to output per-browser package dependencies. This is to aid with
  per-browser docker setup and Playwright github action.
- sorts package maps for both Ubuntu 18.04 and Ubuntu 20.04 alphabetically (and removes a stray dependency)

References #2926
@aslushnikov
Copy link
Collaborator

aslushnikov commented Aug 5, 2020

With v1.3.0, we'll publish mcr.microsoft.com/playwright:v1.3.0 that will have browsers baked in.
We'll start publishing per-vendor browser images since next release.

@aslushnikov aslushnikov added v1.4 and removed v1.3 labels Aug 5, 2020
aslushnikov added a commit to aslushnikov/playwright that referenced this issue Sep 1, 2020
It turns out Github Actions have docker pre-installed.

This patch unifies the codepaths that we use to build docker image
locally and to publish it from CI.

As a result, there's no extra `--prepare-context` argument in
`//docs/docker/build.sh` that was used solely on CI.

References microsoft#2926
aslushnikov added a commit that referenced this issue Sep 1, 2020
It turns out Github Actions have docker pre-installed.

This patch unifies the codepaths that we use to build docker image
locally and to publish it from CI.

As a result, there's no extra `--prepare-context` argument in
`//docs/docker/build.sh` that was used solely on CI.

References #2926
aslushnikov added a commit to aslushnikov/playwright that referenced this issue Sep 1, 2020
Manual login appeared to be successful, but rejected docker push.

References microsoft#2926
aslushnikov added a commit that referenced this issue Sep 1, 2020
Manual login appeared to be successful, but rejected docker push.

References #2926
@pavelfeldman pavelfeldman added 1.5 and removed v1.4 labels Sep 3, 2020
@aslushnikov
Copy link
Collaborator

So far:

  • we publish ubuntu-bionic (18.04) images
  • starting with v1.5 we will publish ubuntu-focal (20.04) images as well

The per-vendor docker images haven't been requested much. Closing this for now.

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