aerokube / selenoid

Selenium Hub successor running browsers within containers. Scalable, immutable, self hosted Selenium-Grid on any platform with single binary.
https://aerokube.com/selenoid/latest/
Apache License 2.0
2.54k stars 318 forks source link

Use Docker volumes instead of binds for video recording #1315

Open elvovsky opened 1 year ago

elvovsky commented 1 year ago

I have an install on windows running wsl2 and docker desktop. I had an issue and I had to reset docker desktop. Now after install it does not seem to see the config directory passed through cm parameter. I think what is missing is a mapping between the directory I am specifying in the parameter and the docker itself. Can you please guide me here ? Any help is appreciated !

vania-pooh commented 1 year ago

@elvovsky any example commands are also appreciated. :)

elvovsky commented 1 year ago

@vania-pooh Hello Ivan . From cm perspective the important parameter is --config-dir . The entire command is cm.exe selenoid start --config-dir "C:\\selenoid\\config" --vnc --args "-limit 10 -session-attempt-timeout 2m -service-startup-timeout 2m -timeout 2m -cpu 1.0" The output of the "docker ps" with no truncation is the following. 1a7e80b216e649a0ae984e0caa45c1cfd96411f608bd0fc3f53b46d07db37072 aerokube/selenoid:1.10.10 "/usr/bin/selenoid -listen :4444 -conf /etc/selenoid/browsers.json -video-output-dir /opt/selenoid/video/ -limit 10 -session-attempt-timeout 2m -service-startup-timeout 2m -timeout 2m -cpu 1.0 -conf /etc/selenoid/browsers.json -video-output-dir /opt/selenoid/video/ -video-recorder-image selenoid/video-recorder:latest-release -log-output-dir /opt/selenoid/logs/ -container-network selenoid" 2 minutes ago Up 2 minutes 0.0.0.0:4444->4444/tcp selenoid I believe, There is supposed to be a mapping between /etc/selenoid/browsers.json and windows directory where it is located. Let me know if you need anything else.

vania-pooh commented 1 year ago

@elvovsky I would try with --config-dir /c/selenoid/config.

elvovsky commented 1 year ago

@vania-pooh That did not work. It seemed to just add folders in windows. For now I ended up copying the browsers.josn I want under the default directory cm creates. I think this relates to the docker set up where it maps drive in windows to the linux wsl paths.

vania-pooh commented 1 year ago

@elvovsky so this is resolved?

elvovsky commented 1 year ago

@vania-pooh Well, theoretically it is a work around. In my mind though this is docker volume translation issue and a setting of docker. I guess the workaround works, but ideally I would like to go back to a folder outside of a user profile

vania-pooh commented 1 year ago

I would try to remove this old-style behavior completely and use Docker volumes instead.

elvovsky commented 1 year ago

@vania-pooh I will see if i can get it upgraded and tested. Thanks !

vania-pooh commented 1 year ago

@elvovsky implementing this is not as simple as we could imagine. Needs to think a bit more.

elvovsky commented 1 year ago

@vania-pooh Understood. No issue