-
Notifications
You must be signed in to change notification settings - Fork 573
Rancher compatibility #396
Comments
Hi @monkpit, This was just implemented, and it will be released between today and tomorrow. You'll be able to use it like this:
I'll comment here when the release is done. |
@diemol Awesome! Thanks for the reply! |
Hi again, This was just released, please check https://github.com/zalando/zalenium/releases/tag/3.8.1g Let us know if things work as expected. I'll close this issue, but feel free to reopen it in case something didn't work. |
Hmm - it works and the selenium containers get created, but the zalenium containers shows timeout errors because it was unable to connect to them. Zalenium shows this:
And the spawned containers show this:
|
I think the issue is different, the docker-selenium containers cannot connect to the hub,
When I tested it, I used a normal setup with docker and a *nix environment. Sorry about my ignorance, I've not user Rancher, but it seems that it is just not a plain VM where you can run something. Can you tell me more about how you were trying to deploy Zalenium? |
The strange thing to me is you will notice that hub: node (container with ID: fdac7883...): The easiest way to get this working via Rancher would be if there was a For example, the following
|
You are right, it was the container itself... I don't really understand what happens there. Perhaps it is related to the fact that Zalenium is creating the containers and somehow this does not work as expected in Rancher. I'll find some spare time during the next days and download Rancher to understand better what happens there, if I follow this https://rancher.com/quick-start/, I should get the same result you are seeing, right? |
I believe you will get the same result. Tomorrow I will try to provide a minimal test case to reproduce what I am seeing. |
Thanks, that would be helpful indeed. Perhaps you can show the docker compose file used to start Zalenium in Rancher so I can try it out as well. |
I did not attempt to use docker-compose file with zalenium, I just tried to run the zalenium container by itself to get started. Steps to reproduce:
Rancher will start the Zalenium container. To check the logs, select the Zalenium service inside the stack. On the service page, you will have 4 tabs - Ports, Containers, Labels, and Log. "Log" is only for the Rancher logs, not the container logs. To see the container logs, click Containers, and click the "..." menu on the right. Select "View Logs". To see the logs for the containers that are spawned by Zalenium, click Infrastructure > Containers and search for "selenium". You will see 2 containers are created by Zalenium and are running, or possibly "stopped" after long enough time. |
For comparison, if you create a stack with the example Selenium Grid docker-compose file I listed previously (copy/paste it into the docker-compose field on the Add Stack page), it will create the selenium containers as expected, and register them to the hub. EDIT: It's also possible to create the Selenium stack without using a docker-compose file. You simply create each container 1 by 1, and the node containers will be linked to the hub. This is what I would like to be able to do with Zalenium - Create 1 hub container and create the selenium containers myself, and link them to the Zalenium hub. |
Hi @monkpit, just an update. I started Rancher and at least I was able to reach the same point. I can see the same message. This is happening because when the elgalu/selenium image starts, it tries to get its own container IP to use it in the registration process. We use this because we create nodes dynamically. Somehow, we cannot get the container's IP, so in the end the node cannot register. I will read a bit the Rancher docs to see if I spot something obvious and also debug a bit more. |
Status update :) I found this label https://rancher.com/docs/rancher/v1.6/en/cattle/labels/#native-docker-labels |
Hi @monkpit, It all points out that we need to make changes in Zalenium and elgalu/selenium to have it working in Rancher. My question is if you are still trying to use Zalenium, and if so, we could make those changes but it would take a few days. Please let us know, |
My workaround was just to use a virtual machine instead of rancher. It’s not ideal for us but it gets the job done! |
OK, so let us give it a try and see if we can make it work flawlessly directly in Rancher. I'll post here again in a couple of days. |
* Waiting for CONTAINER_IP a bit when using Zalenium zalando/zalenium#396 * Adding message to simplify debugging
Hi @monkpit, So we made some changes and we finally made it work in Rancher (at least in the environment we set up). Can you please pull the most recent releases of dosel/zalenium and elgalu/selenium? And also use this env vars in your docker-compose or docker run command:
Please reopen the issue if something doesn't work well. |
I'll try to get around to testing this today or this week as work allows - Thanks so much for the time! |
I believe this is working now! 🥇 |
If I leave the Zalenium container running in Rancher for a while (overnight) and retry tests afterwards, I am seeing an error in the logs saying unable to find image eglau/selenium. I am working on getting the full logfile from the point when the error occurs. Possible solution would be to always attempt to pull the image when spinning up a new selenium container? Not sure what is happening on Rancher's side here - Unsure if the docker image cache is cleared periodically, or if the containers are trying to run on a different host that has not pulled eglau/selenium yet? Will post full logs here when available. @diemol not sure if you want to reopen this issue - I don't seem to have the option to reopen it myself. EDIT: adding log
|
Sure, we can reopen it, no problem. Could you please tell me a bit how the deployment? Does Rancher have many hosts and it could spin nodes in different hosts from the one where Zalenium runs? |
Yes, it's possible, however I don't know the behavior of zalenium - does access to docker.sock mean it will always try to create the containers on the same host? Our rancher environment has 10+ hosts registered. I have Rancher set to only attempt to run Zalenium on 3 different hosts with the tag "selenium=true". However, I don't think this is part of the issue, because I can use Zalenium all day while developing and running tests against it. It's not an intermittent issue where it will randomly fail when trying to run on another host. When I come back in the next day, the containers will no longer spin up. I suspect that Rancher is clearing out the image cache. A way to test would be to have some kind of flag like EDIT: well, I can't say it works ALL day - it just stopped working. Same error message, out of nowhere: |
Yes, Zalenium just uses the docker.sock to create more containers, so I wonder how it works with Rancher, if it is really able to spin more containers in different hosts. If so, that'd be a great workaround for some people who are asking about how to use Zalenium with docker in different hosts. We just released https://github.com/zalando/zalenium/releases/tag/3.8.1i, which uses the flag @monkpit, please give it a try and let us know. I'll close the issue for now. |
Ah, that explains it :) So does that mean that Rancher can run Zalenium in different hosts? |
From what I can tell: nope! |
That's a shame, I thought we could have had a swarm-like behaviour with Rancher. Thanks for all your feedback. |
Expected Behavior -
I should be able to run zalenium via a docker-compose file without manually doing "docker pull eglalu/selenium" beforehand and having the zalenium able to "see" the image existing on the host.
Actual Behavior -
Error messages during
start
:If
eglau/selenium
is required for the docker-compose file to work, then it should be a part of the docker-compose file itself and managed by docker that way. What is the workaround? Can this be done via docker networking?My use case is: trying to run zalenium via Rancher.
The text was updated successfully, but these errors were encountered: