BerkeleyAutomation / FogROS2

An Adaptive and Extensible Platform for Cloud and Fog Robotics Using ROS 2
https://berkeleyautomation.github.io/FogROS2
Apache License 2.0
172 stars 29 forks source link

Make `sudo` portion of launch happen as early as possible #38

Closed jeffi closed 1 year ago

jeffi commented 2 years ago

Is your feature request related to a problem? Please describe. It can take a while after launch before the user is prompted for a password to setup the VPN. Ideally all sudo operations could happen right after launch so that the user can walk away and rely on it launching.

KeplerC commented 2 years ago

We can leave a sudo ls at the beginning of the AWS class, but the code might not that clean.

jeffi commented 2 years ago

Not a bad idea, but that assumes that sudo is set up to not ask for a password each time.

KeplerC commented 2 years ago

At least when I am deploying it on NUC, it only prompts for the first sudo command. I am not sure how it behaves on other machines

jeffi commented 2 years ago

Yeah, that's the default on Ubuntu, I think. But other systems will have different settings. https://askubuntu.com/a/636095

jeffi commented 2 years ago

I'd also suggest that if we can remove the need for a sudo password prompt altogether, that might be the most ideal solution (assuming we can do so without sacrificing security).

nikhiljha commented 2 years ago

The VPN start script is now moved up (only in main branch, do we want to also have this in the humble branch)? Passwordless sudo with an SSH key is also reasonably safe (I would argue just as safe as what we're doing now, provided the user executing the ROS payload is different from the user with passwordless sudo access).

We can ship a cloud-init config (cloud-init is distro and cloud-provider agnostic) when booting up the image for the first time with the SSH key and just rely on sudo to let us through with no password for all future executions.

SimeonOA commented 2 years ago

Needs to be merged/moved into Humble Branch

mjd3 commented 2 years ago

@nikhiljha can you PR this for humble?