在远程系统上提交、监控和终止作业
项目描述
Troika
在本地和远程主机上提交、监控和终止作业
需求
- Python 3.8或更高版本
pyyaml
(https://pypi.ac.cn/project/PyYAML/)- 测试:
pytest
(https://pypi.ac.cn/project/pytest/) - 构建文档:
sphinx
(https://sphinx-doc.cn)
安装
python3 -m venv troika
source troika/bin/activate
python3 -m pip install troika
运行测试
在您的环境中安装Troika后,可以使用pytest
运行测试
python3 -m pytest -v tests/
构建文档
文档使用sphinx
。要生成HTML文档
cd docs/
make html
演示
在FOSDEM'23上关于"Troika:使用相同的接口在任何HPC系统上提交、监控和中断作业"演讲的幻灯片和录音可通过https://fosdem.org/2023/schedule/event/troika_hpc_jobs获取。
入门
概念
Troika持有一份站点列表,可以提交作业。站点由两个主要参数定义:一个连接类型(local
或ssh
),以及一个站点类型(例如direct
或slurm
)。每个站点都由配置文件中给出的名称标识。
示例配置文件
---
sites:
localhost:
type: direct # jobs are run directly on the target
connection: local # the target is the current host
remote:
type: direct # jobs are run directly on the target
connection: ssh # connect to the target via ssh
host: remotebox # ssh host
copy_script: true # if false, the script will be piped through ssh
at_startup: ["check_connection"]
slurm_cluster:
type: slurm # jobs are submitted to Slurm
connection: ssh # connect to the target via ssh
host: remotecluster # ssh host
copy_script: true # if false, the script will be piped through ssh
at_startup: ["check_connection"]
pre_submit: ["create_output_dir"]
at_exit: ["copy_submit_logfile"]
pbs_cluster:
type: pbs # jobs are submitted to PBS
connection: ssh # connect to the target via ssh
host: othercluster # ssh host
copy_script: true # if false, the script will be piped through ssh
at_startup: ["check_connection"]
pre_submit: ["create_output_dir"]
at_exit: ["copy_submit_logfile"]
可以使用list-sites
命令检查配置
$ troika -c config.yml list-sites
Available sites:
Name Type Connection
------------------------------------------------------------
localhost direct local
remote direct ssh
slurm_cluster slurm ssh
pbs_cluster pbs ssh
可用选项
$ troika --help
主要命令
在cluster
上提交作业
$ troika -c config.yaml submit -o /path/to/output/file cluster job.sh
查询作业状态
$ troika -c config.yaml monitor cluster job.sh
终止作业
$ troika -c config.yaml kill cluster job.sh
项目详情
下载文件
下载适用于您平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。
源代码分发
troika-0.2.3.tar.gz (32.2 kB 查看哈希值)
构建分发
troika-0.2.3-py3-none-any.whl (44.1 kB 查看哈希值)
关闭
troika-0.2.3.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 3a400d1c37171e67be008e773d9fe4d5e63e063978d31affd24f01ec53f892fe |
|
MD5 | 5bd223ea37049f0d2fd794a81b4d9d14 |
|
BLAKE2b-256 | 8967f7de6049ac40eb97afbf413d9dff1a23e91470d07adfbd7882d7201b6d2e |
关闭
troika-0.2.3-py3-none-any.whl的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | dfcca02e31af51c17af609cd4d08a7fb7cb2fd63239180ebc42fb8603b8640e7 |
|
MD5 | f33dd20e6d058281ae57fa913f0384ab |
|
BLAKE2b-256 | 675d8f6a204f7cdb89385b2985c91b2e59a87ba2f1da2eda014cb5b4c1eeff73 |