xenon api的python包装器。

pyxenon的Python项目详细描述


ZenodoBadgeDocumentation StatusApache2LicenseBuildStatusCodacyBadge

python到Xenon middleware library, v. 2.0的接口。Xenon提供了一个简单的编程 与可用于访问分布式 计算和存储资源。

下面使用GRPC,连接到Xenon-GRPC服务。 我们已经注意在这个python模块中镜像原始的java api 尽可能的。

安装

克隆此存储库,并执行以下操作:

pip install .

当代码准备好发布时,它将出现在pypi上。

文档

编译的文档位于Read the Docs上。这包括一个快速的开始 引导。

开发

pyxenon附带xenon grpcjar文件和命令行可执行文件。如果 这些需要升级,手动构建,按照 Xenon-GRPC,并将 build/install/xenon-grpc-shadow文件夹(libbin)在这里。

要生成grpc代码,请从项目根目录运行scripts/protoc.sh

测试

单元测试都是针对 文件系统。要运行它们,请执行以下操作:

$ pytest ./tests

为了更快地进行测试,启动xenon-grpc守护进程可能很有用 手动;在单独的终端中启动,因为它可能为 调试。

对于集成测试,运行以下Docker容器来测试 远程泥泞

docker run --detach --publish 10022:22 nlesc/xenon-slurm:17

针对此容器运行的某些代码的示例位于 examples/tutorial.py

示例

importxenonfrompathlibimportPathimportosxenon.init()# create a new job scheduler, using SSH to localhost to submit new jobs.withxenon.Scheduler.create(adaptor='ssh',location='localhost')asscheduler:# make a new job description. The executable must already be present on# the target host.target=Path('.')/'stdout.txt'desc=xenon.JobDescription(executable='hostname',stdout=str(target.resolve()))# submit a jobjob=scheduler.submit_batch_job(desc)status=scheduler.wait_until_done(job,1000)# read the standard output of the job. We can do this directly because# we ran on localhost, otherwise, we need to transfer the file first.withopen(target)asf:print(f.read())

贡献

可以使用github pull请求进行贡献。要添加功能, 首先安装测试要求

pip install -U tox

然后运行

tox

直到所有测试成功。该命令检查flake8代码 python 3.5和3.6上的标准和语法错误。然后承诺,确保 更改没有破坏任何代码。将在中评估拉取请求 Travis

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java Switch语句,用于根据用户输入确定字母等级(十进制)   使用rich:datascroller更改页面后,java actionListener无法在rich:dataTable中工作   使用Azure AD帐户时java强制密码更改问题   java如何在flink中模拟异步操作   java如何将整数格式化为两个小数?   基于javascript条件访问amazon lamda结果?   java成本/从源节点到目标节点的所有可能路径的距离   java为什么我的光标在NextLine()之后的错误行上?   java Gridlayout未根据约束调整大小   windows使用特殊路径名在java中加载文件   如何在java上使用selenium在移动浏览器中滑动   Java中字符串类的成员使用了哪种utf8编码?   java删除截击缓存   java Musicg库不适用于mp3、rm、wma