proxystore.endpoint.directory¶
Endpoint directory layout and files.
EndpointDir
dataclass
¶
EndpointDir(path: str)
Directory of an endpoint.
An endpoint directory contains the endpoint's configuration and the files created while it runs (e.g., its log and the connection file that clients use to connect).
Example
Attributes:
-
path(str) –Path of the directory.
database_path
property
¶
database_path: str
Path to the default SQLite database for persisting objects.
from_home
classmethod
¶
Get the directory of an endpoint in a ProxyStore home directory.
Parameters:
-
proxystore_dir(str) –ProxyStore home directory (see
home_dir()). -
name(str) –Name of the endpoint.
Source code in proxystore/endpoint/directory.py
find_all
classmethod
¶
find_all(
proxystore_dir: str,
) -> list[tuple[Self, EndpointConfig]]
Find all endpoints with a valid configuration.
Parameters:
-
proxystore_dir(str) –ProxyStore home directory to search in (see
home_dir()).
Returns:
-
list[tuple[Self, EndpointConfig]]–List of each endpoint directory and its configuration.
Source code in proxystore/endpoint/directory.py
read_config
¶
read_config() -> EndpointConfig
Read the endpoint configuration.
Raises:
-
FileNotFoundError–If the configuration file does not exist.
-
ValueError–If the configuration contains an invalid value or cannot be parsed.
Source code in proxystore/endpoint/directory.py
write_config
¶
write_config(config: EndpointConfig) -> None
Write the endpoint configuration, creating the directory if needed.
Parameters:
-
config(EndpointConfig) –Configuration to write.
Source code in proxystore/endpoint/directory.py
write_connection
¶
write_connection(info: ConnectionInfo) -> None
Atomically write the connection file of the running endpoint.
The file is only readable by the owner because it contains the endpoint's token.
Source code in proxystore/endpoint/directory.py
read_connection
¶
read_connection() -> ConnectionInfo
Read the connection file of the running endpoint.
Raises:
-
FileNotFoundError–If the connection file does not exist (e.g., because the endpoint is not running).
-
ValueError–If the connection file is malformed.
Source code in proxystore/endpoint/directory.py
remove_connection
¶
remove_connection(
info: ConnectionInfo | None = None,
) -> None
Remove the connection file if it exists.
Parameters:
-
info(ConnectionInfo | None, default:None) –Only remove the connection file if it contains this information (i.e., it was not replaced by another instance of the endpoint).
Source code in proxystore/endpoint/directory.py
running_pid
¶
running_pid() -> int | None
Get the PID of the endpoint daemon if it is running.
Returns:
-
int | None–The PID in the PID file if that process is running as the current user on this host, otherwise
None(e.g., the PID file is missing or malformed, the endpoint stopped unexpectedly, or the endpoint is running on a different host).
Source code in proxystore/endpoint/directory.py
restrict_permissions
¶
restrict_permissions() -> bool
Remove all group and other permissions from the directory.
Clients trust the connection file in the endpoint directory, so no one other than the owner may be able to create, replace, or rename files in it. The directory also contains the endpoint's database and log which may contain user data.
Returns:
-
bool–Trueif the permissions of the directory were changed.
Source code in proxystore/endpoint/directory.py
is_own_process
¶
Check if a process with the PID exists and is owned by this user.