File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -240,9 +240,10 @@ 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 ( new paths first, then legacy paths for backward compatibility)
244244 socketPaths := []string {
245245 "/var/run/dstack/dstack.sock" ,
246+ "/run/dstack.sock" ,
246247 "/var/run/dstack.sock" ,
247248 }
248249 for _ , path := range socketPaths {
Original file line number Diff line number Diff line change @@ -230,9 +230,10 @@ 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 ( new paths first, then legacy paths for backward compatibility)
234234 socketPaths := []string {
235235 "/var/run/dstack/tappd.sock" ,
236+ "/run/tappd.sock" ,
236237 "/var/run/tappd.sock" ,
237238 }
238239 for _ , path := range socketPaths {
Original file line number Diff line number Diff line change @@ -179,9 +179,10 @@ 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 ( new paths first, then legacy paths for backward compatibility)
183183 const socketPaths = [
184184 '/var/run/dstack/dstack.sock' ,
185+ '/run/dstack.sock' ,
185186 '/var/run/dstack.sock' ,
186187 ]
187188 endpoint = socketPaths . find ( p => fs . existsSync ( p ) ) ?? socketPaths [ 0 ]
@@ -407,9 +408,10 @@ export class TappdClient extends DstackClient<TcbInfoV03x> {
407408 console . warn ( `Using tappd endpoint: ${ process . env . TAPPD_SIMULATOR_ENDPOINT } ` )
408409 endpoint = process . env . TAPPD_SIMULATOR_ENDPOINT
409410 } else {
410- // Try new path first, fall back to old path for backward compatibility
411+ // Try paths in order of preference ( new paths first, then legacy paths for backward compatibility)
411412 const socketPaths = [
412413 '/var/run/dstack/tappd.sock' ,
414+ '/run/tappd.sock' ,
413415 '/var/run/tappd.sock' ,
414416 ]
415417 endpoint = socketPaths . find ( p => fs . existsSync ( p ) ) ?? socketPaths [ 0 ]
Original file line number Diff line number Diff line change @@ -51,9 +51,10 @@ 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 ( new paths first, then legacy paths for backward compatibility)
5555 socket_paths = [
5656 "/var/run/dstack/dstack.sock" ,
57+ "/run/dstack.sock" ,
5758 "/var/run/dstack.sock" ,
5859 ]
5960 for path in socket_paths :
@@ -69,9 +70,10 @@ def get_tappd_endpoint(endpoint: str | None = None) -> str:
6970 if "TAPPD_SIMULATOR_ENDPOINT" in os .environ :
7071 logger .info (f"Using tappd endpoint: { os .environ ['TAPPD_SIMULATOR_ENDPOINT' ]} " )
7172 return os .environ ["TAPPD_SIMULATOR_ENDPOINT" ]
72- # Try new path first, fall back to old path for backward compatibility
73+ # Try paths in order of preference ( new paths first, then legacy paths for backward compatibility)
7374 socket_paths = [
7475 "/var/run/dstack/tappd.sock" ,
76+ "/run/tappd.sock" ,
7577 "/var/run/tappd.sock" ,
7678 ]
7779 for path in socket_paths :
Original file line number Diff line number Diff line change @@ -36,8 +36,12 @@ 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 (new paths first, then legacy paths for backward compatibility)
40+ const SOCKET_PATHS : & [ & str ] = & [
41+ "/var/run/dstack/dstack.sock" ,
42+ "/run/dstack.sock" ,
43+ "/var/run/dstack.sock" ,
44+ ] ;
4145 for path in SOCKET_PATHS {
4246 if std:: path:: Path :: new ( path) . exists ( ) {
4347 return path. to_string ( ) ;
Original file line number Diff line number Diff line change @@ -21,8 +21,12 @@ 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 (new paths first, then legacy paths for backward compatibility)
25+ const SOCKET_PATHS : & [ & str ] = & [
26+ "/var/run/dstack/tappd.sock" ,
27+ "/run/tappd.sock" ,
28+ "/var/run/tappd.sock" ,
29+ ] ;
2630 for path in SOCKET_PATHS {
2731 if std:: path:: Path :: new ( path) . exists ( ) {
2832 return path. to_string ( ) ;
You can’t perform that action at this time.
0 commit comments