seleniumhq-community / docker-seleniarm

Multi-Arch (arm64/armhf/amd64) Docker images for the Selenium Grid Server
https://hub.docker.com/u/seleniarm
Other
249 stars 26 forks source link

Update to latest Debian (Bookworm/12) #54

Open fhoeben opened 9 months ago

fhoeben commented 9 months ago

Debian 12

Uses Eclipse Adoptium Temurin JDK 11 (as OpenJDK 11 is no longer supported) No longer includes xfonts-cyrillic, as it is no longer supported Uses official firefox from Debian (not the extended support one)

Thanks for contributing to the Docker-Selenium project! A PR well described will help maintainers to quickly review and merge it

Before submitting your PR, please check our contributing guidelines, applied for this repository. Avoid large PRs, help reviewers by making them as simple and short as possible.

Description

Motivation and Context

Types of changes

Checklist

fhoeben commented 9 months ago

Test failed on arm64 for Chromium. I don't know how to interpret this error

    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: Could not start a new session. Could not start a new session. Unable to obtain: Capabilities {browserName: chrome, browserVersion: 119.0, goog:chromeOptions: {args: [], extensions: []}, pageLoadStrategy: normal, platformName: linux, se:noVncPort: 7900, se:vncEnabled: true}, error Command failed with code: 2, executed: [--browser, chrome, --output, json, --browser-version, 119.0]
/tmp/selenium-manager15213643794124591921/manager/0.4.15/selenium-manager: 1: cannot create �@: Permission denied
/tmp/selenium-manager15213643794124591921/manager/0.4.15/selenium-manager: 2: H�: not found
/tmp/selenium-manager15213643794124591921/manager/0.4.15/selenium-manager: 3: h�: not found
/tmp/selenium-manager15213643794124591921/manager/0.4.15/selenium-manager: 4: Syntax error: Unterminated quoted string
jamesmortensen commented 9 months ago

Thanks for contributing. I think the problem with Chromium is something to do with changes in the upstream repo related to Chrome for Testing. There's also changes that happened on the upstream server that I'm working on resolving.

I'll look into the errors you faced and see if it's the same thing.

jamesmortensen commented 9 months ago

@fhoeben Do you know how to disable Selenium Manager? This is something @diemol mentioned here: https://github.com/seleniumhq-community/docker-seleniarm/issues/46#issuecomment-1695164282 but aside from adding the env variable, I haven't had time to troubleshoot and really dig in.

It's been awhile since I've synced from upstream, so there's a lot of changes to sort through, and I'm working on that now.

Once synced, I plan to dig into it more. If you're able to get Chromium figured out, that would be awesome. Let me know if there's any other questions I can answer.

fhoeben commented 9 months ago

@jamesmortensen I did see some stuff comparing the upstream test scripts (tests/SeleniumTests/__init__.py):

class ChromeTests(SeleniumGenericTests):
    def setUp(self):
        options = ChromeOptions()
        options.enable_downloads = True
        options.add_argument('disable-features=DownloadBubble,DownloadBubbleV2')
        self.driver = webdriver.Remote(
            options=options,
            command_executor="http://%s:%s" % (SELENIUM_GRID_HOST,SELENIUM_GRID_PORT)
        )
fhoeben commented 9 months ago

@jamesmortensen I thought it might be easier to start from the latest selenium/trunk branch, as their ubuntu version also comes with arm64 support these days. It turns out the main issue was getting chromium instead of chrome, but now it seems to work on my M1 mac with only the changes in https://github.com/fhoeben/docker-seleniarm/tree/ubuntu-cross (specifically https://github.com/fhoeben/docker-seleniarm/commit/8df5822120cf509f3a8aceeb1aefc72623f8d301)

Of course it is not a true cross platform set of images yet, and I just put chromium in the chrome image (and removed edge), but I think this might be a good path forward staying closer to the amd64 trunk. Otherwise maybe some inspiration for your efforts

fhoeben commented 9 months ago

@jamesmortensen I was a bit premature in my previous comment. Although the build process worked, the images did not :-( Now I believe I put a version in that branch that does work, for chromium and firefox.

Locally (on my M1 Mac) the tests pass, on GitHub the amd64 tests pass, but the arm64 tests fail. I suspect that is due to the fact the GitHub runners are amd64 and I try to run the tests using emulation there.

diemol commented 9 months ago

@fhoeben Do you know how to disable Selenium Manager? This is something @diemol mentioned here: #46 (comment) but aside from adding the env variable, I haven't had time to troubleshoot and really dig in.

It's been awhile since I've synced from upstream, so there's a lot of changes to sort through, and I'm working on that now.

Once synced, I plan to dig into it more. If you're able to get Chromium figured out, that would be awesome. Let me know if there's any other questions I can answer.

@jamesmortensen I can help with that. Which branch should I use to do the same changes I did to avoid Selenium Manager?

diemol commented 9 months ago

BTW, avoiding Selenium Manager will make Chromium work.

jamesmortensen commented 9 months ago

@fhoeben - Just FYI, the images don't use the extended support Firefox. They pull from Debian snapshots so I can control the specific Firefox version that gets installed. If the latest Firefox is ever broken on one of the architectures, this gives us control to pull a more stable version of Firefox into the images and make sure all 3 architectures use the same Firefox, but without having to rely on the old ESR build.

I'll work on documenting this as well at some point.

Also, just FYI we are planning to potentially move the base image to Ubuntu and replace Debian. I need to open a draft pull request to showcase what I've done so far on this. I will do this once we stabilize the images. Thank you for the work you've done to upgrade to the latest Debian release.

fhoeben commented 9 months ago

@jamesmortensen thanks for all YOUR work.

I believe I have working images based on Ubuntu (using Debian packages for chromium, and packages from team-mozilla for Firefox) in my test branch. Again no fixed versions, but also not ESR, but that should be possible by adding a version to their apt-get command I suppose.

I'll create a draft PR for those, maybe those can provide some input to further your efforts in that area...

jamesmortensen commented 9 months ago

I'll take a look at that again. I see the images are being built, but the tests are failing. If you try to use Selenium 4.10 instead of the latest, it should pass tests. The problem is Chromium won't run on newer Selenium due to those permission errors we see in the logs.

On Thu, Dec 14, 2023 at 4:50 AM Fried Hoeben @.***> wrote:

@jamesmortensen https://github.com/jamesmortensen thanks for all YOUR work.

I believe I have working images based on Ubuntu (using Debian packages for chromium, and packages from team-mozilla for Firefox) in my test branch. Again no fixed versions, but also not ESR, but that should be possible by adding a version to their apt-get command I suppose.

I'll create a draft PR for those, maybe those can provide some input to further your efforts in that area...

— Reply to this email directly, view it on GitHub https://github.com/seleniumhq-community/docker-seleniarm/pull/54#issuecomment-1855620176, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKBH2ETCPZRNDKYRNHWDO3YJLKXBAVCNFSM6AAAAABANX4Q2SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJVGYZDAMJXGY . You are receiving this because you were mentioned.Message ID: @.***>

--

James

diemol commented 9 months ago

IIRC, the permissions issue should be fixed already. I wanted to add the changes I did to avoid Selenium Manager get used. Should I do the in this PR or is there another one?