aerokube / cm

Configuration manager for Aerokube products
https://aerokube.com/cm/latest/
Apache License 2.0
119 stars 31 forks source link

Browers.json file being saved outside of selenoid docker container #328

Closed damiensprinkle closed 1 year ago

damiensprinkle commented 1 year ago

I'm trying to setup selenoid on an azure build agent using the following commands

cd $(System.DefaultWorkingDirectory)/Repo/Base/Scripts/
chmod +x cm 
./cm selenoid start --vnc --port 4444 --force

This seems to work, all the brower images are downloaded etc. However when I look at the container logs I see the following message

2023-03-09T18:46:41.958042395Z 2023/03/09 18:46:41 [-] [INIT] [/usr/bin/selenoid: browsers config: read error: open /etc/selenoid/browsers.json: no such file or directory]

After looking into it further I can see the browsers.json file is being saved into a different home directory on the build agent

> Configuration saved to /home/build_azpcontainer/.aerokube/selenoid/browsers.json

Has anyone seen this before or have any idea why this is happening?

Note: I am using the latest version of the linux_amd64 cm

vania-pooh commented 1 year ago

@damiensprinkle containers are stateless, all state should be hosted outside of containers. So Selenoid when running in container is always expecting config file to be mounted to /etc/selenoid/browsers.json inside container. Outside of container CM tool is usually generating such file to ~/.aerokube/selenoid/browsers.json. So that's the expected behavior. Make sure you really have such file on filesystem.

damiensprinkle commented 1 year ago

@vania-pooh Yeah the folder structure exists and the file is created at ~/.aerokube/selenoid/browsers.json in my case "home" is "/home/build_azpcontainer"

I ran "cat ~/.aerokube/selenoid/browsers.json" and the browsers.json file contents were returned as expected . So if the file exists in the correct location, why would it not be mounted inside the container?

vania-pooh commented 1 year ago

@damiensprinkle probably some security settings in Docker or SELinux or similar stuff.