nephio-project / nephio

Nephio is a Kubernetes-based automation platform for deploying and managing highly distributed, interconnected workloads such as 5G Network Functions, and the underlying infrastructure on which those workloads depend.
Apache License 2.0
93 stars 52 forks source link

docker supplementary group not reloading causes VLAN configuration failure #589

Closed vjayaramrh closed 2 months ago

vjayaramrh commented 3 months ago

When following the steps from https://github.com/nephio-project/docs/blob/main/content/en/docs/guides/user-guides/exercise-2-oai.md on a VM from start (including docker install) to finish, the below issue is encountered due to the docker supplementary group not getting reloaded.

[fedora@nephio-r2-e2e-vish-fedora-2 ~]$ ./test-infra/e2e/provision/hacks/vlan-interfaces.sh
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/core-md-0-kw6vg-wqtfk-4chmk/json": dial unix /var/run/docker.sock: connect: permission denied
[fedora@nephio-r2-e2e-vish-fedora-2 ~]$ id
uid=1000(fedora) gid=1000(fedora) groups=1000(fedora),4(adm),10(wheel),190(systemd-journal) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023

The work around is to either logout and re-login into the VM or issue the newgrp docker command to reload the supplementary docker group

[fedora@nephio-r2-e2e-vish-fedora-2 ~]$ newgrp docker
[fedora@nephio-r2-e2e-vish-fedora-2 ~]$ id
uid=1000(fedora) gid=990(docker) groups=990(docker),4(adm),10(wheel),190(systemd-journal),1000(fedora) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023

The docs need an update to call this out so that users are aware.

cc: @electrocucaracha @rravindran123 @liamfallon

electrocucaracha commented 3 months ago

We also need to standardize the docker client calls to use or not sudo

I think that this is not detected by the CI because the runuser instruction loads the latest information group (https://github.com/nephio-project/test-infra/blob/main/e2e/provision/init.sh#L155)