proxystore.store.globus
Globus Endpoint Implementation.
GlobusEndpoint ¶
GlobusEndpoint(
uuid: str,
endpoint_path: str,
local_path: str | None,
host_regex: str | Pattern[str],
) -> None
Globus endpoint representation.
Parameters:
-
uuid
(
str
) –UUID of Globus endpoint.
-
endpoint_path
(
str
) –Path within endpoint to directory to use for storing objects.
-
local_path
(
str | None
) –Local path (as seen by the host filesystem) that corresponds to the directory specified by
endpoint_path
. -
host_regex
(
str | Pattern[str]
) –String that matches the host where the Globus endpoint exists or regex pattern than can be used to match the host. The host pattern is needed so that proxies can figure out what the local endpoint is when they are resolved.
Source code in proxystore/store/globus.py
GlobusEndpoints ¶
A collection of Globus endpoints.
Parameters:
-
endpoints
(
Collection[GlobusEndpoint]
) –Iterable of
GlobusEndpoints
instances.
Raises:
-
ValueError
–If
endpoints
has length 0 or if multiple endpoints with the same UUID are provided.
Source code in proxystore/store/globus.py
from_dict
classmethod
¶
Construct an endpoints collection from a dictionary.
Example
Source code in proxystore/store/globus.py
from_json
classmethod
¶
Construct a GlobusEndpoints object from a json file.
The dict
read from the JSON file will be passed to
from_dict()
and
should match the format expected by
from_dict()
.
Source code in proxystore/store/globus.py
dict ¶
Convert the GlobusEndpoints to a dict.
Note that the
GlobusEndpoints
object can be reconstructed by passing the dict
to.
from_dict()
.
Source code in proxystore/store/globus.py
get_by_host ¶
Get endpoint by host.
Searches the endpoints for a endpoint who's host_regex
matches
host
.
Parameters:
-
host
(
str
) –Host to match.
Returns:
-
GlobusEndpoint
–Globus endpoint.
Raises:
-
ValueError
–If
host
does not match any of the endpoints.
Source code in proxystore/store/globus.py
GlobusStoreKey ¶
Bases: NamedTuple
Key to object in a GlobusStore.
__eq__ ¶
Match keys by filename only.
This is a hack around the fact that the task_id is not created until after the filename is so there can be a state where the task_id is empty.
Source code in proxystore/store/globus.py
GlobusStore ¶
GlobusStore(
name: str,
*,
endpoints: GlobusEndpoints
| list[GlobusEndpoint]
| dict[str, dict[str, str]],
polling_interval: int = 1,
sync_level: int
| Literal[exists, size, mtime, checksum] = "mtime",
timeout: int = 60,
cache_size: int = 16,
stats: bool = False
) -> None
Bases: Store[GlobusStoreKey]
Globus backend class.
The GlobusStore
is similar to a
FileStore
in that objects in the
store are saved to disk but allows for the transfer of objects between two
remote file systems. The two directories on the separate file systems are
kept in sync via Globus transfers. The
GlobusStore
is useful when moving data between hosts that have a Globus endpoint but
may have restrictions that prevent the use of other store backends
(e.g., ports cannot be opened for using a
RedisStore
.
Note
To use Globus for data transfer, Globus authentication needs to be
performed otherwise an error will be raised. Authentication can be
performed on the command line with proxystore-globus-auth
.
Authentication only needs to be performed once per system.
Parameters:
-
name
(
str
) –Name of the store instance.
-
endpoints
(
GlobusEndpoints | list[GlobusEndpoint] | dict[str, dict[str, str]]
) –Globus endpoints to keep in sync. If passed as a
dict
, the dictionary must match the format expected byGlobusEndpoints.from_dict()
. -
polling_interval
(
int
) –Interval in seconds to check if Globus tasks have finished.
-
sync_level
(
int | Literal[exists, size, mtime, checksum]
) –Globus transfer sync level.
-
timeout
(
int
) –Timeout in seconds for waiting on Globus tasks.
-
cache_size
(
int
) –Size of LRU cache (in # of objects). If 0, the cache is disabled. The cache is local to the Python process.
-
stats
(
bool
) –Collect stats on store operations.
Raise
GlobusAuthFileError: If the Globus authentication file cannot be found.
ValueError: If endpoints
is of an incorrect type.
ValueError: If the :code:len(endpoints) != 2
because this
implementation can currently only keep two endpoints in sync.
Source code in proxystore/store/globus.py
close ¶
Cleanup directories used by ProxyStore in the Globus endpoints.
Warning
Will delete the directory at local_path
on each endpoint.
Warning
This method should only be called at the end of the program when the store will no longer be used, for example once all proxies have been resolved.