Metadata-Version: 2.1
Name: Yucebio-Wdladaptor
Version: 0.0.10
Summary: Yucebio Wdl适配器
Home-page: UNKNOWN
Author: huangqingjun
Author-email: huangqingjun@yucebio.com
License: MIT
Platform: UNKNOWN
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: Yucebio-Config
Requires-Dist: json5
Requires-Dist: click
Requires-Dist: requests

# Yucebio Wdl适配器

- 根据不同云平台的Cromwell基础设施将通用的workflow内容转换适合对应平台的版本
- 已经支持的云
    - Yucebio 本地SGE集群
    - 阿里云批量计算平台
    - 亚马逊云Batch平台

# 安装

```bash
# 初始化环境，如通过conda初始化python>=3.8的环境
conda create -n python3.8 python=3.8

# 安装依赖包
pip install click icecream requests
# 安装
pip install -i https://test.pypi.org/simple/ Yucebio-Wdladaptor
```

# 配置(基于Yucebio-Config，配置文件在~/.yucebioconfig/...)

```bash
# 查看使用方式
yucebio_wdl_adaptor --help

# 设置指定平台的配置信息
yucebio_wdl_adaptor config -p <platform> -g <global_path> -s <simg_path> -h <host> -r runtime1,runtime2
# -p --platform     需要设置的平台
# -h --host         待设置平台的cromwell api地址，如 http://host:port
# -g --global_path  公共文件路径，用于替换输入文件中的__GLOBAL__
# -s --simg_path    singularity镜像路径，用于替换输入文件中的__SIMG__
# -r --runtimes     当前平台需要支持的额外自定义runtime属性（未知的runtime将被移除）
```

# 转换wdl到指定平台
```bash
yucebio_wdl_adaptor convert -p <platform> -i <json> [--submit|-s] <WDL>
# -i --input    JSON文件路径
# -p --platform 平台名称
# -s --submit   是否直接投递任务【default:False】
# WDL           workflow文件路径
```

# 更新阿里云可用实例类型
> 第一次执行时必须提供ACCESS_KEY ID 和 SECRECT。第一次执行成功后，会自动保存到配置文件中

```bash
yucebio_wdl_adaptor update-bcs-instance -i <ACCESS_KEY_ID> -s <ACCESS_KEY_SECRECT>
# -i --access_id        阿里云ACCESS_KEY_ID
# -s --access_secrect   阿里云ACCESS_KEY_SECRECT
```

# 附录

## 各个平台RUNTIME属性差异

**阿里云**
- 'cpu', 'memory', 'rescource_type' ==> cluster
- 'systemDisk', 'cluster', 'mounts', 'vpc', 'continueOnReturnCode', 'failOnStderr'
**SGE**
- 'cpu', 'memory', "sge_queue", "sge_project", "mount", 'continueOnReturnCode'
- simg
**亚马逊**
- cpu
- memory
- docker
- disk


