feat(sdk): Add /run socket paths for compatibility #480
+38
−16
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Add
/run/*.sockand/run/dstack/*.sockto the socket path search list in all SDKs. This ensures compatibility with systemd socket activation which uses/runinstead of/var/run.Background
PR #478 introduced systemd socket activation for dstack-guest-agent, which creates sockets at
/run/dstack.sockand/run/tappd.sock(using the modern/runpath instead of legacy/var/run).While
/var/runis typically a symlink to/runon modern Linux systems, some container environments may not have this symlink configured. Adding explicit/runpaths ensures SDKs work correctly in all environments.Changes
Updated socket path search order in all SDKs:
sdk/rust/src/dstack_client.rs,sdk/rust/src/tappd_client.rssdk/python/src/dstack_sdk/dstack_client.pysdk/js/src/index.tssdk/go/dstack/client.go,sdk/go/tappd/client.goSearch Order (legacy paths first for backward compatibility)
/var/run/*.sock(legacy path)/run/*.sock(modern systemd path)/var/run/dstack/*.sock(namespaced legacy)/run/dstack/*.sock(namespaced modern)