File tree Expand file tree Collapse file tree 6 files changed +32
-10
lines changed
Expand file tree Collapse file tree 6 files changed +32
-10
lines changed Original file line number Diff line number Diff line change @@ -240,9 +240,11 @@ func (c *DstackClient) getEndpoint() string {
240240 c .logger .Info ("using simulator endpoint" , "endpoint" , simEndpoint )
241241 return simEndpoint
242242 }
243- // Try new path first, fall back to old path for backward compatibility
243+ // Try paths in order of preference (namespaced first, then direct paths for backward compatibility)
244244 socketPaths := []string {
245245 "/var/run/dstack/dstack.sock" ,
246+ "/run/dstack/dstack.sock" ,
247+ "/run/dstack.sock" ,
246248 "/var/run/dstack.sock" ,
247249 }
248250 for _ , path := range socketPaths {
Original file line number Diff line number Diff line change @@ -230,9 +230,11 @@ func (c *TappdClient) getEndpoint() string {
230230 c .logger .Info ("using simulator endpoint" , "endpoint" , simEndpoint )
231231 return simEndpoint
232232 }
233- // Try new path first, fall back to old path for backward compatibility
233+ // Try paths in order of preference (namespaced first, then direct paths for backward compatibility)
234234 socketPaths := []string {
235235 "/var/run/dstack/tappd.sock" ,
236+ "/run/dstack/tappd.sock" ,
237+ "/run/tappd.sock" ,
236238 "/var/run/tappd.sock" ,
237239 }
238240 for _ , path := range socketPaths {
Original file line number Diff line number Diff line change @@ -179,9 +179,11 @@ export class DstackClient<T extends TcbInfo = TcbInfoV05x> {
179179 console . warn ( `Using simulator endpoint: ${ process . env . DSTACK_SIMULATOR_ENDPOINT } ` )
180180 endpoint = process . env . DSTACK_SIMULATOR_ENDPOINT
181181 } else {
182- // Try new path first, fall back to old path for backward compatibility
182+ // Try paths in order of preference (namespaced first, then direct paths for backward compatibility)
183183 const socketPaths = [
184184 '/var/run/dstack/dstack.sock' ,
185+ '/run/dstack/dstack.sock' ,
186+ '/run/dstack.sock' ,
185187 '/var/run/dstack.sock' ,
186188 ]
187189 endpoint = socketPaths . find ( p => fs . existsSync ( p ) ) ?? socketPaths [ 0 ]
@@ -407,9 +409,11 @@ export class TappdClient extends DstackClient<TcbInfoV03x> {
407409 console . warn ( `Using tappd endpoint: ${ process . env . TAPPD_SIMULATOR_ENDPOINT } ` )
408410 endpoint = process . env . TAPPD_SIMULATOR_ENDPOINT
409411 } else {
410- // Try new path first, fall back to old path for backward compatibility
412+ // Try paths in order of preference (namespaced first, then direct paths for backward compatibility)
411413 const socketPaths = [
412414 '/var/run/dstack/tappd.sock' ,
415+ '/run/dstack/tappd.sock' ,
416+ '/run/tappd.sock' ,
413417 '/var/run/tappd.sock' ,
414418 ]
415419 endpoint = socketPaths . find ( p => fs . existsSync ( p ) ) ?? socketPaths [ 0 ]
Original file line number Diff line number Diff line change @@ -51,9 +51,11 @@ def get_endpoint(endpoint: str | None = None) -> str:
5151 f"Using simulator endpoint: { os .environ ['DSTACK_SIMULATOR_ENDPOINT' ]} "
5252 )
5353 return os .environ ["DSTACK_SIMULATOR_ENDPOINT" ]
54- # Try new path first, fall back to old path for backward compatibility
54+ # Try paths in order of preference (namespaced first, then direct paths for backward compatibility)
5555 socket_paths = [
5656 "/var/run/dstack/dstack.sock" ,
57+ "/run/dstack/dstack.sock" ,
58+ "/run/dstack.sock" ,
5759 "/var/run/dstack.sock" ,
5860 ]
5961 for path in socket_paths :
@@ -69,9 +71,11 @@ def get_tappd_endpoint(endpoint: str | None = None) -> str:
6971 if "TAPPD_SIMULATOR_ENDPOINT" in os .environ :
7072 logger .info (f"Using tappd endpoint: { os .environ ['TAPPD_SIMULATOR_ENDPOINT' ]} " )
7173 return os .environ ["TAPPD_SIMULATOR_ENDPOINT" ]
72- # Try new path first, fall back to old path for backward compatibility
74+ # Try paths in order of preference (namespaced first, then direct paths for backward compatibility)
7375 socket_paths = [
7476 "/var/run/dstack/tappd.sock" ,
77+ "/run/dstack/tappd.sock" ,
78+ "/run/tappd.sock" ,
7579 "/var/run/tappd.sock" ,
7680 ]
7781 for path in socket_paths :
Original file line number Diff line number Diff line change @@ -36,8 +36,13 @@ fn get_endpoint(endpoint: Option<&str>) -> String {
3636 if let Ok ( sim_endpoint) = env:: var ( "DSTACK_SIMULATOR_ENDPOINT" ) {
3737 return sim_endpoint;
3838 }
39- // Try new path first, fall back to old path for backward compatibility
40- const SOCKET_PATHS : & [ & str ] = & [ "/var/run/dstack/dstack.sock" , "/var/run/dstack.sock" ] ;
39+ // Try paths in order of preference (namespaced first, then direct paths for backward compatibility)
40+ const SOCKET_PATHS : & [ & str ] = & [
41+ "/var/run/dstack/dstack.sock" ,
42+ "/run/dstack/dstack.sock" ,
43+ "/run/dstack.sock" ,
44+ "/var/run/dstack.sock" ,
45+ ] ;
4146 for path in SOCKET_PATHS {
4247 if std:: path:: Path :: new ( path) . exists ( ) {
4348 return path. to_string ( ) ;
Original file line number Diff line number Diff line change @@ -21,8 +21,13 @@ fn get_tappd_endpoint(endpoint: Option<&str>) -> String {
2121 if let Ok ( sim_endpoint) = env:: var ( "TAPPD_SIMULATOR_ENDPOINT" ) {
2222 return sim_endpoint;
2323 }
24- // Try new path first, fall back to old path for backward compatibility
25- const SOCKET_PATHS : & [ & str ] = & [ "/var/run/dstack/tappd.sock" , "/var/run/tappd.sock" ] ;
24+ // Try paths in order of preference (namespaced first, then direct paths for backward compatibility)
25+ const SOCKET_PATHS : & [ & str ] = & [
26+ "/var/run/dstack/tappd.sock" ,
27+ "/run/dstack/tappd.sock" ,
28+ "/run/tappd.sock" ,
29+ "/var/run/tappd.sock" ,
30+ ] ;
2631 for path in SOCKET_PATHS {
2732 if std:: path:: Path :: new ( path) . exists ( ) {
2833 return path. to_string ( ) ;
You can’t perform that action at this time.
0 commit comments