-
Notifications
You must be signed in to change notification settings - Fork 463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Unix domain sockets in IoT Edge on Windows #518
Conversation
LGTM for the edgelet and installer script changes. Someone else should review the edge agent change. As discussed offline, this change allows users to use |
Changes to Edge Agent:
Changes to edgelet:
file://
scheme instead ofunix://
. This is because theurl
crate does lots of special handling of Windows paths for thefile://
scheme, but doesn't do it for "non-special" schemes likeunix://
(per the URL spec).mio-uds-windows
,tokio-uds-windows
, andhyperlocal-windows
crates on Windows. These are adaptations ofmio-uds
,tokio-uds
, andhyperlocal
respectively.#[cfg(unix)]
attribute from Unix domain socket-specific features that expected a Unix-only implementation, and add it in places where we still need to differentiate on platform. Notable examples:edgelet-http::unix::listener(path)
, only use umask to reset socket file permissions on Unix platforms.file.exists()
. On Windows, usefs::symlink_metadata()
instead because it works on reparse points (Unix domain sockets in Windows are reparse points).UnixStreamExt::pid(&self)
for WindowsUnixStream::pair()
to do its setup doesn't work on Windows because Winsock2 doesn't implement BSD'spair
function. So create an ugly workaround for the test on Windows./tmp
.run_uds_server
out of a linux-specific source file and into the parentmod.rs
.In the Windows installer script:
NT AUTHORITY\Authenticated Users
) that will exist in any container so that non-privileged modules can access it. Since we give the rights to the parent folder, we don't need to recreate the permissions every time iotedged restarts, like we do for Unix platforms. (Note: this part of the script is disabled for now, until we have everything in place to fully support UDS in IoT Edge on Windows, specifically RS5-based module images and the ability to use process-isolated containers on non-Server Windows.)