Граф коммитов

44 Коммитов

Автор SHA1 Сообщение Дата
Patrick Shaw 6e78dcb7dc
fix: Allow portable bash paths for systems including NixOS (#23889)
Although very common, bash is not guaranteed to be located at
`/bin/bash`. NixOS is an example of this.

More commonly, `/bin/bash` can be quite out of date. An example of this
is MacOS's version of `bash`. This realistically won't affect Playwright
but it's worth noting. You can technically update MacOS's system version
of bash but you need elevated permissions to do so.

By using `/usr/bin/env bash` instead of `/bin/bash` we can execute
Playwright's bash scripts in like NixOS and generally improve the
selection behaviour for bash in other systems too.

Some discussion of why it's worth favouring `/usr/bin/env bash` over
`/bin/bash`:
- Discusses `/bin/bash` missing in NixOS:
https://discourse.nixos.org/t/add-bin-bash-to-avoid-unnecessary-pain/5673
- Some general commentary on why `/usr/bin/env bash` is favoured:
https://askubuntu.com/a/1402721
- Points out how old bash is in MacOS:
https://itnext.io/upgrading-bash-on-macos-7138bd1066ba

Improves situation at #5501
2023-07-03 06:27:06 -07:00
Pavel Feldman 64dde29788
chore: move to npx playwright-core install when using core (#23260) 2023-05-24 12:16:59 -07:00
Andrey Lushnikov 8ebe4dc81a
devops: do not use NPX during docker container build (#23213)
The postmortem of the broken docker image:
- We use `playwright-core` package when bootstrapping our docker
container.
- Due to accidental removal of `bin` entry in the `playwright-core` (see
  https://github.com/microsoft/playwright/issues/23206), the `npx
  playwright install --with-deps` was using the last published
  Playwright version instead of a locally-built playwright binary

This patch starts using `npx exec --no` to make sure that we never call
remote commands during docker image build.
2023-05-22 19:21:09 -07:00
Max Schmitt 336d2114c8
chore: have Ubuntu 22 Docker image by default (#22356)
Fixes https://github.com/microsoft/playwright-python/issues/1858
2023-04-12 19:40:23 +02:00
Andrey Lushnikov bcb2d67c5d
chore: remove experimental dockerfile.remote (#20790)
We didn't find a compelling-enough use case to release this.
2023-02-09 12:18:02 -08:00
Andrey Lushnikov b67cef2c4d
feat: introduce Dockerfile.remote image (#20691)
When this image is launched, it exposes a single endpoint
that can be used to connect to and to launch browsers.
2023-02-07 10:50:44 -08:00
Andrey Lushnikov 0a752f3fd6
chore(docker): remove experimental docker integration (#20676)
This removes everything related to docker integration experiments that
we conducted over the last 6 months.

I'll send a follow-up with an alternative suggestion that was demo'ed on
a team meeting in the end of December.
2023-02-06 10:50:45 -08:00
Martijn Cornips 5dd2b1ef0c
chore: update node version comment in dockerfile (#20496) 2023-02-02 16:44:20 -08:00
Max Schmitt c6bc3ce23f
devops: upgrade Docker images to Node.js 18 (#20361)
Fixes https://github.com/microsoft/playwright/issues/20133
2023-01-26 16:34:32 +01:00
Andrey Lushnikov 59a41f6051
chore: prepare to publish dockerfile.vrt docker image (#19324)
This patch:
- adds a new `Dockerfile.vrt` image file based on focal that installs
  VRT-related dependencies inside it.
- updates scripts to build & publish the new docker image.

Drive-by: remove stale file
2022-12-07 15:57:01 -08:00
Max Schmitt 6a5552ba24
chore: drop Ubuntu 18.04 support (#18924) 2022-11-21 11:23:45 -10:00
Yury Semikhatsky 70065ba6dd
Revert "chore(driver): roll driver to recent Node.js LTS version (#18… (#18791)
…636)"

The new node resolves loalhost to ::1 by default which breaks API tests
in the ports (Java in particular). Reverting to the previous LTS to
allow some time to implement happy eyeballs algorithm on our end by next
release.

This reverts commit 63a0b75186.
Reference https://github.com/microsoft/playwright/issues/18790
2022-11-14 11:30:36 -08:00
Max Schmitt 5d99719f5d
chore: use Node.js 18 for Docker images (#18334)
Node.js 18 is now LTS and we follow LTS schedule.
2022-10-26 08:11:20 -07:00
Andrey Lushnikov af042beb13
feat: introduce docker integration (#16382)
This patch introduces the following commands:
- `npx playwright docker build` that builds a VRT docker image
  locally that is based off the `mcr.microsoft.com/playwright:jammy`
- `npx playwright docker start` that launches a docker container with
  browsers.
- `npx playwright docker stop` that stops given docker container.
- `npx playwright docker test` that runs all the tests inside a
  launched docker container.
2022-09-09 15:25:42 -07:00
Max Schmitt db5e097aca
chore: add 'gpg' package to Docker images (#15917) 2022-07-25 12:49:51 +02:00
Max Schmitt 4f1ab2fa62 devops: fix Docker publishing 2022-06-14 11:20:29 +02:00
Ross Wollman b76d3f2b40
chore: fix publish_docker.sh (#14851)
Started failing a few days ago (https://github.com/microsoft/playwright/runs/6871909784?check_suite_focus=true)
with:

```
./utils/docker/publish_docker.sh: line 82: syntax error near unexpected
token `else'
```
2022-06-13 18:19:57 -07:00
Max Schmitt d1a7fa2901
chore: add Ubuntu 22 Docker image (#14755) 2022-06-09 23:19:54 +02:00
Andrey Lushnikov 4ab4c0bda1
feat: detect docker version and Playwright version mismatch (#12806)
This patch prints a friendly instructions in case Docker image version
mismatches Playwright version and there are missing browser
dependencies.

With this patch, Playwright will yield the following error:

```
root@f0774d2b2097:~# node a.mjs
node:internal/process/promises:279
            triggerUncaughtException(err, true /* fromPromise */);
            ^

browserType.launch:
╔════════════════════════════════════════════════════════════════════════════════════════════╗
║ Host system is missing dependencies to run browsers.                                       ║
║ This is most likely due to docker image version not matching Playwright version:           ║
║ - Playwright: 1.22.0                                                                       ║
║ -     Docker: 1.21.0                                                                       ║
║                                                                                            ║
║ Either:                                                                                    ║
║ - (recommended) use docker image "mcr.microsoft.com/playwright:v1.22.0-focal"              ║
║ - (alternative 1) run the following command inside docker to install missing dependencies: ║
║                                                                                            ║
║     npx playwright install-deps                                                            ║
║                                                                                            ║
║ - (alternative 2) use Aptitude inside docker:                                              ║
║                                                                                            ║
║     apt-get install libgbm1                                                                ║
║                                                                                            ║
║ <3 Playwright Team                                                                         ║
╚════════════════════════════════════════════════════════════════════════════════════════════╝
    at file:///root/a.mjs:3:10 {
  name: 'Error'
}```

Fixes #12796

Co-authored-by: Dmitry Gozman <dgozman@gmail.com>
2022-03-25 14:45:53 -07:00
Max Schmitt 372a3219f3
chore: remove Python from main Docker image (#12431) 2022-03-10 19:51:35 +01:00
Max Schmitt 428a014cad
devops: Docker publishing cleanups (#12341) 2022-02-24 18:10:34 +01:00
Andrey Lushnikov 6ea607ce2a
devops: move docker publishing logic to main repo (#10768)
This patch:
- moves docker publishing to main repo
- extracts all the logic from the GHA YML file to Bash
- starts using the script in both `publish_canary.yml` and
  `publish_release.yml`

Fixes #10351
2021-12-07 15:28:47 -08:00
Andrey Lushnikov e680b733f5
devops: demand explicit arch when building docker (#10743)
Currently, arch is inhereted from host. This patch explicitly
sets desired docker build arch.

References #10351
2021-12-07 09:28:59 -08:00
Max Schmitt 0936ce2bbd chore: add wget to Docker images 2021-11-30 19:35:48 +01:00
Andrey Lushnikov 8ce6633937
chore: clean up docker image (#10260)
This patch:
- removes the Visual Regression bits from the images. These will
  probably be added back when it's ready for the prime time.
    * removes VNC && noVNC
    * removes Playwright Agent
- cleans up apt caches

This drops image size from 2.03GB to 1.91GB.
2021-11-11 15:35:57 -08:00
Max Schmitt 113d425f15
chore: use Node.js 16 in Docker (#9824) 2021-10-27 23:48:10 +02:00
Andrey Lushnikov 7927920c35
fix(docker): do not export DISPLAY for everybody without XVFB running (#9795)
Fixes #9756
2021-10-26 13:21:18 -07:00
Andrey Lushnikov 983cfde4d4
feat: introduce docker integration for Playwright Test (#9599) 2021-10-19 16:10:24 -07:00
Joel Einbinder c89d5a50dd
chore: migrate to monorepo (#9421) 2021-10-11 16:52:17 +02:00
Max Schmitt 5b93df0bab
chore(docker): upgrade to NPM 7 (#8915) 2021-09-22 16:38:50 +02:00
Andrey Lushnikov fe32d38414
feat: move browser fonts to tools section (#7443)
This way we not only fix Docker images, but also fix `npx playwright
install-deps` in virtual machines.
2021-07-02 02:09:31 -07:00
Andrey Lushnikov a6421c690b
devops: add missing fonts to docker (#7435)
These fonts are taken from Selenium docker image:

77db00ced0/NodeBase/Dockerfile (L57-L89)

Fixes #6907
2021-07-01 23:29:33 -07:00
Joel Einbinder 4a04a939a9
fix(docker): use node 14 not node 16 (#7212) 2021-06-17 16:14:10 -07:00
Manu Chambon 2697f8380f
devops(docker): upgrade to node 16 (#6498) 2021-05-12 09:23:38 -07:00
Yury Semikhatsky 28b14fc5f7
feat(docker): use playwright install-deps for building docker image (#5995) 2021-03-29 23:48:54 -07:00
Yury Semikhatsky 8c6822bd32
fix(docker): update native deps and docker files for chromium (#5989) 2021-03-29 13:43:31 -07:00
rob salmond 1bcbb15299
set system default python3 to python3.8 (#5892) 2021-03-22 12:29:54 -07:00
Pavel Feldman c4578f19f2
chore: organize per-browser dependencies (#5787) 2021-03-11 20:22:50 -08:00
Andrey Lushnikov 5ad8da962b
devops(docker): fix typo in docker build (#5705) 2021-03-03 10:26:23 -08:00
Andrey Lushnikov f637b0302d
devops(docker): fix registry to be accessible by Azure Pipelines user (#5672)
Turns out Azure Pipelines is doing a few modifications to the base
container. One of the important modification is that they add a new
user to the container that has a passwordless sudo permissions. This
user is used later on to run all the pipeline steps.

This patch makes sure our shared registry inside the docker containers
is accessible to all the users.

Fixes #5635
2021-03-01 17:24:07 -08:00
Andrey Lushnikov 5ea6d6eefd
fix(docker): avoid symlink hack in Docker images (#5429)
Instead of symlinking pwuser's registry to root's registry, we now
use the `PLAYWRIGHT_BROWSERS_PATH` variable to define a single
browser registry across the docker image, accessible for all
users.

Fixes #4485
2021-02-11 18:33:30 -08:00
Joel Einbinder 3d14780bcb
fix(docker): add fonts-liberation for chromium (#5344) 2021-02-06 09:05:45 -08:00
Andrey Lushnikov 9de0a5a963
chore: add Python to docker images (#5139)
This adds +100MB to network transfer size but enables our
users to use playwright-python from-inside docker container.
2021-01-27 08:51:51 -08:00
Pavel Feldman ae935a43d9
doc: further align docs w/ playwright.dev (#4866) 2021-01-03 08:47:29 -08:00