Closed viktorianer closed 2 years ago
I agree this is possible. It's been done before in previous tags, and I've done this with a WebKit Browser container image. I should be able to dig into this over the weekend.
There are a couple places I can think of that have a dependency on architecture, and these would need to be addressed, possibly by using uname -m
to derive the architecture type at build time.
https://github.com/seleniarm/docker-selenium/blob/dab951c64b97c6c023826f0f2596da4b8ff09eaf/Base/Dockerfile#L16 https://github.com/seleniarm/docker-selenium/blob/dab951c64b97c6c023826f0f2596da4b8ff09eaf/Base/Dockerfile#L36
https://github.com/seleniarm/docker-selenium/blob/dab951c64b97c6c023826f0f2596da4b8ff09eaf/NodeFirefox/build-step-1.sh#L8 https://github.com/seleniarm/docker-selenium/blob/dab951c64b97c6c023826f0f2596da4b8ff09eaf/NodeFirefox/build-step-2.sh#L32 https://github.com/seleniarm/docker-selenium/blob/dab951c64b97c6c023826f0f2596da4b8ff09eaf/NodeFirefox/build-step-2.sh#L40
Firefox has more dependencies on ARCH. If you wanted to get started sooner with Selenium/Standalone-Chromium, it has less dependencies on ARCH, so as long as the Java 11 dependency can be made multi-arch, you should be able to build a multi-arch Chromium image:
docker buildx build --platform linux/amd64,linux/arm64 -t local-seleniarm/standalone-chromium:latest .
I'll be able to look at this more over the weekend. In the meantime, hope this is helpful!
@viktorianer I made changes to the Dockerfiles and pushed multi-arch builds for base, node-base, hub, node-chromium, and standalone-chromium. Please try them out and let me know how it goes. They're currently tagged as 4.1.0-alpha-20211218 because I haven't had a chance to fully test them:
docker pull seleniarm/standalone-chromium:4.1.0-alpha-20211218
Hey @jamesmortensen , thank you! I asked our engineers with Linux/Windows to check it. I will come back later to this issue.
Hi @jamesmortensen! @viktorianer and I tested the node-chromium and hub images on our Linux and M1 systems. We still get the following errors
Selenium::WebDriver::Error::WebDriverError: You are trying to work with something that isn't a file.
test/integration/candidate_flows_test.rb:18:in `block in <class:CandidateFlowsTest>'
with these lines of code
visit("/#!/candidates/new")
fill_in("candidate_first_name", with: "Test")
We are using the frameworks rails and angular.
Our systems are
Darwin mbp-work.local 21.2.0 Darwin Kernel Version 21.2.0: Sun Nov 28 20:28:41 PST 2021; root:xnu-8019.61.5~1/RELEASE_ARM64_T6000 arm64
and
Linux ThinkPad-T560 5.4.0-91-generic #102-Ubuntu SMP Fri Nov 5 16:31:28 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux (amd64)
.
@jamesmortensen is it possible for you to add a major version tag too, e.g. 4
, when you upload the new images? Thanks a lot!
@tan-linx do these involve any kind of file uploading?
visit("/#!/candidates/new")
fill_in("candidate_first_name", with: "Test")
https://github.com/SeleniumHQ/selenium/blob/trunk/rb/lib/selenium/webdriver/remote/bridge.rb#L417
Does this happen on the standard x86 images as well, when using the ThinkPad?
The reason I ask is because I know that, when uploading files to a browser in a docker container, the file must be made available on the container filesystem. This is usually done by mounting a volume between the host and container so the container can access the files to be uploaded. Could that be the issue you're facing?
No, there is no file upload at all. And with old images it works, so it is not Docker (but we use Docker, yes).
Basically, you can reduce the full test to this 2 lines and it will fall.
We do not have 32 bit system to test. But I will ask other if they have possibility to test this setup too.
Does the latest tag have the same problem? The latest tag is only for arm64 but it has a stable selenium server, 4.0.0 version.
If you can isolate what might be causing the issue that would be helpful.
Also, is it just the hub images or with standalone-chromium as well? I haven't had amazing experiences with the grid on Arm64. There are crashes that occur.
Hey @jamesmortensen, I checked today again on my M1 MBP. On a small, private project with the latest Rails 6 setup and on our big, work project with different Rails 6 setup.
First, I checked your last image:
small project: no problems
big work project: In this project, we use Rails with Angular. Therefore, we need a proxy server, and we pass the settings to the Chrome like:
CHROME_OPTIONS = %W[... proxy-server=#{Billy.proxy.host}:#{Billy.proxy.port} ...].freeze
Capybara.register_driver :selenium_chrome_headless do |app|
Capybara::Selenium::Driver.new(
app,
...
capabilities: Selenium::WebDriver::Chrome::Options.new(args: CHROME_OPTIONS),
...
)
end
I get a typical error on hub
: [1642847813.972][SEVERE]: bind() failed: Cannot assign requested address (99)
And the message, which we have described above: Selenium::WebDriver::Error::WebDriverError: You are trying to work with something that isn't a file.
Then, I tried with your latest
tag:
small project: no problems
big work project:
Now, I get error on chrome
and no error on hub: [1642848350.618][SEVERE]: bind() failed: Cannot assign requested address (99)
And the message, which we have described above: Selenium::WebDriver::Error::WebDriverError: You are trying to work with something that isn't a file. But, it alternates with the following error:
Capybara::ElementNotFound: Unable to find field "person_first_name" that is not disabled`.
Last, I tried seleniarm/standalone-chromium:4.1.1-alpha-20220119
: the same results
The same result on an older image 4.0.0-beta-1-20210215
, which we use on master
.
@viktorianer Does it happen with the stock x86_64 Chrome images from upstream, or just the seleniarm ones? Are you able to replicate the issue in the small project by adding the proxy? Could the proxy be interrupting the communication flow? Could you also check the version of Capybara and confirm it's up to date/compatible with Selenium 4?
How long do tests run before the error manifests itself? Are you able to run tests without the proxy server if the app is deployed to a public test server?
Does this also happen with the Firefox image?
Hey @jamesmortensen, I did not have time at all for this issue at this time, so sorry to not coming back to you earlier. I would not have time to dig deeper in our "big project", because I am working on other things now.
The point is, your images working great on new project. And why not use them?
So, if it is possible for you, it would be great to have regular updated images like you did it here:
@viktorianer I made changes to the Dockerfiles and pushed multi-arch builds for base, node-base, hub, node-chromium, and standalone-chromium.
Thank you for great job and a lot of work.
If possible, it would help to include/have a major tag for each of those docker images, e.g.: 4
and 4.x
.
Thanks for following back up, @viktorianer Tagging is something I'll be working on eventually.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Feature and motivation
As I mentioned in the #1, I would like to use this image not only on
arm64
platform, but also onamd64
based arch, in order to make it useful indocker-compose.yml
file/projects.Expected behaviour, when I use this image in
docker-compose.yml
:It should build the services on
arm
andamd
arch based host platform.Note: the
node-chromium:4.0.0-beta-1-20210215
image was build for multi arch.Possible solutions:
SeleniumHQ/docker-selenium
arm
andamd
Usage example with images from selenium