microsoft / playwright

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
https://playwright.dev
Apache License 2.0
65.98k stars 3.6k forks source link

[Feature] Support CentOS #9199

Open udit0802 opened 3 years ago

udit0802 commented 3 years ago

Edit by maintainers

Hey everybody!

There's now an experimental support for all linux distributions using our browser container image mcr.microsoft.com/playwright. If you can run this container image on your linux distribution, then you can instruct @playwright/test to connect to it and run browsers inside the container.

Please give it a try and let us know what you think here: https://github.com/microsoft/playwright/issues/26482


We have our CI machines setup on centos7. I am trying to integrate in our integration tests which runs on jenkins on centos machines. Able to run tests using chrome but facing issues with following browsers:

Chromium :

<launching> /home/centos/.cache/ms-playwright/chromium-920619/chrome-linux/chrome --disable-background-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter --allow-pre-commit-input --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --disable-sync --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --no-service-autorun --user-data-dir=/tmp/playwright_chromiumdev_profile-GyWOJw --remote-debugging-pipe --headless --hide-scrollbars --mute-audio --blink-settings=primaryHoverType=2,availableHoverTypes=2,primaryPointerType=4,availablePointerTypes=4 --no-sandbox --no-startup-window
[2021-09-28T13:04:55.123Z]     <launched> pid=20094
[2021-09-28T13:04:55.123Z]     [pid=20094][err] /home/centos/.cache/ms-playwright/chromium-920619/chrome-linux/chrome: /lib64/libc.so.6: version `GLIBC_2.18' not found (required by /home/centos/.cache/ms-playwright/chromium-920619/chrome-linux/chrome)
[2021-09-28T13:04:55.123Z]     [pid=20094] <process did exit: exitCode=1, signal=null>
[2021-09-28T13:04:55.123Z]     [pid=20094] starting temporary directories cleanup

This issue was earlier reported on 1.

Edge :

browserType.launch: Chromium distribution 'msedge' is not supported on linux
[2021-09-28T13:04:55.120Z] 
[2021-09-28T13:04:55.120Z]         at Object._baseTest.extend.browser.scope [as fn] (/apps/jnkn/workspace/EvergreenShoots-CMgt_PR-1560/main/integration-tests/playwright-e2e/node_modules/@playwright/test/lib/test/index.js:127:40)
[2021-09-28T13:04:55.120Z]         at Fixture.setup (/apps/jnkn/workspace/EvergreenShoots-CMgt_PR-1560/main/integration-tests/playwright-e2e/node_modules/@playwright/test/lib/test/fixtures.js:73:73)
[2021-09-28T13:04:55.121Z]         at FixtureRunner.setupFixtureForRegistration (/apps/jnkn/workspace/EvergreenShoots-CMgt_PR-1560/main/integration-tests/playwright-e2e/node_modules/@playwright/test/lib/test/fixtures.js:312:5)
[2021-09-28T13:04:55.121Z]         at FixtureRunner.resolveParametersAndRunHookOrTest (/apps/jnkn/workspace/EvergreenShoots-CMgt_PR-1560/main/integration-tests/playwright-e2e/node_modules/@playwright/test/lib/test/fixtures.js:297:23)
[2021-09-28T13:04:55.121Z]         at WorkerRunner._runTestWithBeforeHooks (/apps/jnkn/workspace/EvergreenShoots-CMgt_PR-1560/main/integration-tests/playwright-e2e/node_modules/@playwright/test/lib/test/workerRunner.js:449:7)

Issue reported earlier on 2

Webkit:

browserType.launch: Host system is missing dependencies!
[2021-09-28T13:04:55.121Z] 
[2021-09-28T13:04:55.121Z]       Install missing packages with:
[2021-09-28T13:04:55.121Z]           sudo apt-get install gstreamer1.0-libav
[2021-09-28T13:04:55.121Z] 
[2021-09-28T13:04:55.121Z]       Missing libraries we didn't find packages for:
[2021-09-28T13:04:55.121Z]           libnotify.so.4
[2021-09-28T13:04:55.121Z]           libopus.so.0
[2021-09-28T13:04:55.121Z]           libwoff2dec.so.1.0.2
[2021-09-28T13:04:55.121Z]           libharfbuzz-icu.so.0
[2021-09-28T13:04:55.121Z]           libgcrypt.so.20
[2021-09-28T13:04:55.121Z]           libgstapp-1.0.so.0
[2021-09-28T13:04:55.121Z]           libgstbase-1.0.so.0
[2021-09-28T13:04:55.121Z]           libgstreamer-1.0.so.0
[2021-09-28T13:04:55.121Z]           libgstpbutils-1.0.so.0
[2021-09-28T13:04:55.121Z]           libgstaudio-1.0.so.0
[2021-09-28T13:04:55.121Z]           libgsttag-1.0.so.0
[2021-09-28T13:04:55.121Z]           libgstvideo-1.0.so.0
[2021-09-28T13:04:55.121Z]           libgstgl-1.0.so.0
[2021-09-28T13:04:55.121Z]           libgstcodecparsers-1.0.so.0
[2021-09-28T13:04:55.121Z]           libgstfft-1.0.so.0
[2021-09-28T13:04:55.121Z]           libjpeg.so.8
[2021-09-28T13:04:55.121Z]           libpng16.so.16
[2021-09-28T13:04:55.121Z]           libopenjp2.so.7
[2021-09-28T13:04:55.121Z]           libwebpdemux.so.2
[2021-09-28T13:04:55.121Z]           libwebp.so.6
[2021-09-28T13:04:55.121Z]           libenchant.so.1
[2021-09-28T13:04:55.121Z]           libsecret-1.so.0
[2021-09-28T13:04:55.121Z]           libhyphen.so.0
[2021-09-28T13:04:55.121Z]           libicui18n.so.66
[2021-09-28T13:04:55.121Z]           libicuuc.so.66
[2021-09-28T13:04:55.121Z]           libevdev.so.2
[2021-09-28T13:04:55.121Z]           libGLESv2.so.2
[2021-09-28T13:04:55.121Z] 
[2021-09-28T13:04:55.121Z] 
[2021-09-28T13:04:55.121Z]         at Object._baseTest.extend.browser.scope [as fn] (/apps/jnkn/workspace/EvergreenShoots-CMgt_PR-1560/main/integration-tests/playwright-e2e/node_modules/@playwright/test/lib/test/index.js:127:40)
[2021-09-28T13:04:55.121Z]         at Fixture.setup (/apps/jnkn/workspace/EvergreenShoots-CMgt_PR-1560/main/integration-tests/playwright-e2e/node_modules/@playwright/test/lib/test/fixtures.js:73:73)
[2021-09-28T13:04:55.121Z]         at FixtureRunner.setupFixtureForRegistration (/apps/jnkn/workspace/EvergreenShoots-CMgt_PR-1560/main/integration-tests/playwright-e2e/node_modules/@playwright/test/lib/test/fixtures.js:312:5)
[2021-09-28T13:04:55.121Z]         at FixtureRunner.resolveParametersAndRunHookOrTest (/apps/jnkn/workspace/EvergreenShoots-CMgt_PR-1560/main/integration-tests/playwright-e2e/node_modules/@playwright/test/lib/test/fixtures.js:297:23)
[2021-09-28T13:04:55.121Z]         at WorkerRunner._runTestWithBeforeHooks (/apps/jnkn/workspace/EvergreenShoots-CMgt_PR-1560/main/integration-tests/playwright-e2e/node_modules/@playwright/test/lib/test/workerRunner.js:449:7)

Issue reported earlier on 3

As many organizations like ours uses centos machines as their infrastructure, this feature will have a wider impact and will help many developers. Request playwright team to have a look at this request.

Thanks!!

kumaraditya303 commented 3 years ago

Fyi, I have got chromium and firefox working on CentOS 8 and created a dockerfile here https://github.com/kumaraditya303/playwright-centos/blob/master/Dockerfile only WebKit is not working. Linking https://github.com/microsoft/playwright/issues/6219

udit0802 commented 3 years ago

https://github.com/kumaraditya303/playwright-centos/blob/master/Dockerfile

Awesome but, i was expecting OOTB support for the same.

jasonparallel commented 2 years ago

GLIBC_2.18 ticket for chromium https://bugs.chromium.org/p/chromium/issues/detail?id=1253967&q=glibc&can=2

ghost commented 2 years ago

+1 , we would like using Playwright on our production server, it runs CentOS 8

andrewvc commented 2 years ago

+1 as well

paulovpereira commented 2 years ago

+1 on this request

MDSemetis commented 2 years ago

+1 as well

paulovpereira commented 2 years ago

Seems like Chromium has a fix according to this comment: https://bugs.chromium.org/p/chromium/issues/detail?id=1261617#c49

y-chen commented 2 years ago

+1

FreezeSoul commented 2 years ago

+1

bbhxwl commented 2 years ago

+1 chromium-930007 ./chrome: /lib64/libc.so.6: version `GLIBC_2.18' not found (required by ./chrome)

bbhxwl commented 2 years ago

+10

aslushnikov commented 2 years ago

For the record: only issue upvoting counts as a vote

canfeng11 commented 2 years ago

+10

anastasiyamazheika commented 2 years ago

+1

rinogo commented 2 years ago

What version(s) should we revert to for CentOS support? We were previously using ^1.9.2 successfully on our CentOS machine. When we updated to ^1.18.1, we started having problems. I see that @vigneshshanmugam reverted to 1.14.0. Will that enable us to use chrome on CentOS?

andrewvc commented 2 years ago

@rinogo I think you may be confused between the versioning of https://github.com/elastic/synthetics which uses playwright and this repo which is for the playwright project itself. We have resolved our issue by moving our base image to Ubuntu FWIW.

rinogo commented 2 years ago

Thanks for your feedback, @andrewvc ! I was referring to this; maybe I'm misunderstanding, though!

Regardless, our environment is unfortunately not containerized, so switching platforms is a lot more challenging. Hoping something can come of this for us and the community - lots of legacy CentOS-hosted apps are still out there!

If I find some other kind of workaround, I'll post back here.

ECIAP commented 2 years ago

+1

azarudeena commented 2 years ago

++1

tranngoclam commented 2 years ago

+1

Rvtea commented 2 years ago

+1

digiscape-bnu commented 2 years ago

+1 (Rocky Linux)

ToanNguyen97 commented 2 years ago

+1

royteeuwen commented 1 year ago

+1

sanderlenaerts commented 1 year ago

+1

BryanEdClark commented 1 year ago

+1

rhwong commented 1 year ago

+1

Sanady commented 1 year ago

+1 Wouldnt be bad to add support for the RedHat too 👍🏻

baart1989 commented 1 year ago

+1

eugeniodevv commented 1 year ago

+1

abadfox233 commented 1 year ago

+1

theniceangel commented 1 year ago

+1

kght6123 commented 1 year ago

+1 CentOS!

noraroxette commented 1 year ago

+1 CentOS, Rhel ! The lack of support for these platforms is so frustrating :( Our CI/CD runs on RHEL and there's no way for us to change unfortunately.

jglick commented 1 year ago

I got Firefox and Chromium working in a UBI-based CI container image roughly as follows:

FROM mcr.microsoft.com/playwright/java:v1.31.0-focal as playwright
FROM registry.access.redhat.com/ubi8
RUN dnf update -y && \
    dnf install -y \
        libX11-xcb \
        mesa-libGL \
        mesa-libgbm \
        pciutils-libs \
        `# other stuff…` && \
    dnf -y clean all
COPY --from=playwright --chown=1000:1000 /ms-playwright /ms-playwright
ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
USER 1000

Did not check WebKit, which might require additional libraries.

phyesix commented 1 year ago

I am using Almalinux. I would be glad if you can support.

baiyyee commented 1 year ago

+1

jasonparallel commented 1 year ago

@aslushnikov The recent move to node 18 broke centos 7 support. Was this intentional? See https://github.com/nodejs/node/issues/43246

aslushnikov commented 1 year ago

@jasonparallel we never supported CentOS, so i'm not sure what broke exactly. The move to node 18 was since 18 is the current LTS.

yesid-lopez commented 1 year ago

+1

DexterIA commented 1 year ago

+1 CentoOS support needed for our CI

gskierk commented 1 year ago

+1

dulestar commented 1 year ago

+1

tustman commented 1 year ago

+1 for centos

vasthan commented 1 year ago

+1

Johnson-You commented 1 year ago

+1

aslushnikov commented 1 year ago

Hey everybody!

There's now an experimental support for all linux distributions using our browser container image mcr.microsoft.com/playwright. If you can run this container image on your linux distribution, then you can instruct @playwright/test to connect to it and run browsers inside the container.

Please give it a try and let us know what you think here: https://github.com/microsoft/playwright/issues/26482

jonasz9 commented 1 year ago

+1

abinba commented 1 year ago

+1