分布式Python应用程序的高级数据流管理
项目描述
ProxyStore
ProxyStore简化了分布式Python应用程序,如基于任务的动态工作流或无服务器和边缘应用程序的数据流管理。
ProxyStore的核心构建块透明对象代理,类似于一种低成本的广域引用。与仅限于单个进程虚拟地址空间的传统引用不同,代理引用远程存储中的对象,可以在任意进程中隐式解引用——即使在远程机器上。代理是透明的,因为它在引用时隐式地解引用其目标对象——称为即时解析——然后将其本身的所有操作转发到缓存的目标对象。
这种范式实现了引用传递和值传递语法的最佳结合,通过减少通过中介的传输开销来提高性能和可移植性,并抽象了低级通信方法,从而降低了代码复杂性。代理包含了解决目标对象所需的所有信息和逻辑。这种自包含的特性意味着代理消费者不需要了解代理使用的底层通信机制;相反,这由代理的制作者单方面决定。
ProxyStore支持基于代理范式的多种编程模式
ProxyStore可以利用许多流行的中介数据传输和存储系统: DAOS、Globus传输、Kafka、KeyDB 和 Redis。提供基于 Mochi、UCX、WebRTC 和 ZeroMQ 的自定义通信方法,用于高性能和点对点应用。
了解更多关于ProxyStore概念的信息这里。ProxyStore的完整文档可在docs.proxystore.dev找到。
安装
可以使用pip
安装基本ProxyStore包。
pip install proxystore
利用第三方库可能需要默认未安装的依赖项,但可以通过额外安装选项(例如endpoints
、kafka
或redis
)启用。所有额外依赖项都可以使用以下命令安装:
pip install proxystore[all]
这将安装包含扩展和实验功能的proxystore-ex
包。也可以使用pip
通过proxystore[extensions]
或proxystore-ex
安装扩展包。
有关可用额外安装选项的更多信息,请参阅安装指南。有关开始本地开发的说明,请参阅贡献指南。
示例
使用ProxyStore存储和传输对象只需要几行代码。
from proxystore.connectors.redis import RedisConnector
from proxystore.proxy import Proxy
from proxystore.store import Store
data = MyDataType(...)
def my_function(x: MyDataType) -> ...:
# x is transparently resolved when first used by the function.
# Then the proxy, x, behaves as an instance of MyDataType
# for the rest of its existence.
assert isinstance(x, MyDataType)
with Store(
'example',
connector=RedisConnector('localhost', 6379),
register=True,
) as store:
# Store the object in Redis (or any other connector).
# The returned Proxy acts like a reference to the object.
proxy = store.proxy(data)
assert isinstance(proxy, Proxy)
# Invoking a function with proxy works without function changes.
my_function(proxy)
查看入门指南以了解更多信息!
引用
如果您在您的作品中使用了ProxyStore或任何此代码,请引用我们的ProxyStore(SC '23)和Proxy Patterns(arXiv预印本)论文。
@inproceedings{pauloski2023proxystore,
author = {Pauloski, J. Gregory and Hayot-Sasson, Valerie and Ward, Logan and Hudson, Nathaniel and Sabino, Charlie and Baughman, Matt and Chard, Kyle and Foster, Ian},
title = {{Accelerating Communications in Federated Applications with Transparent Object Proxies}},
address = {New York, NY, USA},
articleno = {59},
booktitle = {Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis},
doi = {10.1145/3581784.3607047},
isbn = {9798400701092},
location = {Denver, CO, USA},
numpages = {15},
publisher = {Association for Computing Machinery},
series = {SC '23},
url = {https://doi.org/10.1145/3581784.3607047},
year = {2023}
}
@misc{pauloski2024proxystore,
author = {J. Gregory Pauloski and Valerie Hayot-Sasson and Logan Ward and Alexander Brace and André Bauer and Kyle Chard and Ian Foster},
title = {{Object Proxy Patterns for Accelerating Distributed Applications}},
archiveprefix = {arXiv},
eprint = {2407.01764},
primaryclass = {cs.DC},
url = {https://arxiv.org/abs/2407.01764},
year = {2024}
}
项目详情
下载文件
下载适合您平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。