命令行工具beta
yfctl 是炎扉算力调度平台命令行工具,用于与平台进行交互,支持身份认证、工作空间管理、分布式训练作业等功能。
请将 URL 中的<客户ID>替换为您实际的客户 ID,ID 获取详情请查阅 控制台-基本资料。
环境配置
配置脚本的相关环境变量和自动补全命令。
环境变量
-
下载
yfctl_linux.tar.gz并解压到任何位置bashwget --no-check-certificate https://product-deploy.titanai.cloud/admin/deploy/cluster/command/linux/<客户ID> -O yfctl_linux.tar.gz# 解压后的目录结构 ├── bin/ │ └── yfctl # 执行文件 └── linux_install.sh # 环境变量设置 -
执行linux_install.sh
bashbash linux_install.shroot@gpu-3090-vm08:~/test# bash linux_install.sh 安装成功! yfctl 已全局可用 帮助信息: 炎扉算力调度平台命令行工具,用于与平台进行交互 支持身份认证、工作空间管理、分布式训练作业等功能 完整文档请查看:https://cluster.titanai.cc/documents/help/cluster/yfctl 用法: yfctl [flags] [命令] 选项: -h, --help help for yfctl 可用命令: image 镜像管理 job 管理作业 login 登录系统 logout 登出系统 project 查看项目信息 source 查看可用资源 workspace 管理工作空间 使用"yfctl [命令] --help"查看命令详情。 使用方法: yfctl [命令选项]
命令行自动补全
-
安装bash-completion
bashapt-get install -y bash-completion -
生成补全脚本
bashyfctl completion bash > yfctl_bash_completion.sh -
安装到系统目录
bashmv yfctl_bash_completion.sh /etc/bash_completion.d/yfctl -
在 ~/.bashrc 文件末尾添加
bashvim ~/.bashrcbash# 加载自定义补全脚本 if [ -f /etc/bash_completion.d/yfctl ]; then source /etc/bash_completion.d/yfctl fi -
刷新
bashsource ~/.bashrc -
验证补全是否永久生效(输入 "yfctl " 后按 Tab 键)
bashyfctl <Tab>
核心命令说明
身份认证
yfctl login
- 功能:登录系统
- 用法:
yfctl login [主机] [用户名] - 示例:交互式输入密码
yfctl login https://clusterdev.titanai.cloud user # 公网访问 yfctl login http://192.168.100.100:18003 user # 内网访问
yfctl logot
- 功能:登出系统,清除本地认证信息
- 用法:
yfctl logout - 示例:
yfctl logout
节点信息
yfctl node list
- 功能:列出节点资源
- 用法:
yfctl node list [used|available] - 选项:
-a, --all:显示所有工作空间(无数量限制)-n, --num int:显示前 N 条结果(默认 10)
- 示例:
root@499fcb8246c1:~# yfctl node list available │─────────────────│─────────────────│─────────────────────────────────│────────────────────────────────────────────────────────────│────────│───────────│ │ NAME │ IP │ GPU │ CPU │ MEMORY │ DISK │ │─────────────────│─────────────────│─────────────────────────────────│────────────────────────────────────────────────────────────│────────│───────────│ │ gpu-4070ti-vm04 │ 192.168.100.173 │ NVIDIA GeForce RTX 4070 Ti * 2 │ Intel(R) Xeon(R) Platinum 8163 CPU @ 2.50GHz * 48 core * 1 │ 125GiB │ 490.05GiB │ │─────────────────│─────────────────│─────────────────────────────────│────────────────────────────────────────────────────────────│────────│───────────│ root@499fcb8246c1:~# yfctl node list used --num 1 │───────────────│───────│─────────────────│──────────────────────────────│────────────────────────────────────────────────────────────│────────│───────────│ │ NAME │ MODEL │ IP │ GPU │ CPU │ MEMORY │ DISK │ │───────────────│───────│─────────────────│──────────────────────────────│────────────────────────────────────────────────────────────│────────│───────────│ │ gpu-3090-vm08 │ job │ 192.168.100.119 │ NVIDIA GeForce RTX 3090 * 2 │ Intel(R) Xeon(R) Platinum 8163 CPU @ 2.50GHz * 48 core * 1 │ 125GiB │ 490.05GiB │ │───────────────│───────│─────────────────│──────────────────────────────│────────────────────────────────────────────────────────────│────────│───────────│
项目信息
yfctl project list
- 功能:列出当前用户有权限的项目
- 用法:
yfctl project list - 示例:
root@gpu-3090-vm08:~# yfctl project list │─────────────────────│───────────│ │ ID │ PROJECT │ │─────────────────────│───────────│ │ 1933029687854202882 │ xxxxx项目 │ │─────────────────────│───────────│
资源信息
yfctl source list
- 功能:查看集群可用资源(GPU/CPU 等)
- 用法:
yfctl source list --type gpu|vgpu|cpu - 选项:
-t, --type string:按资源类型过滤(gpu/vgpu/cpu) - 示例:
root@gpu-3090-vm08:~# yfctl source list --type gpu │────────────────────────────│────────│ │ NAME │ UNUSED │ │────────────────────────────│────────│ │ NVIDIA GeForce RTX 4070 Ti │ 0 │ │────────────────────────────│────────│
yfctl source full
- 功能:列出所有整机可用资源
- 用法:
yfctl source full - 示例:
root@499fcb8246c1:~# yfctl source full │─────────────────────────────────────────────────│─────────────│ │ NAME │ UNUSED NODE │ │─────────────────────────────────────────────────│─────────────│ │ NVIDIA GeForce RTX 3090(24GB) 2 cards 1 node │ 1 │ │ NVIDIA GeForce RTX 4070 Ti(12GB) 2 cards 1 node │ 1 │ │─────────────────────────────────────────────────│─────────────│
镜像信息
yfctl image list
- 功能:查看集群可用模板镜像
- 用法:
yfctl image list model|mine|share - 示例:
root@gpu-3090-vm08:~# yfctl image list mine │─────────────────────────────────────────────────────────────────────────────────────│─────────│ │ NAME │ SIZE │ │─────────────────────────────────────────────────────────────────────────────────────│─────────│ │ 192.168.100.200/chenchao/mariadb:10.5 │ 0.12GiB │ │ 192.168.100.200/chenchao/cuda:11.8.0-cudnn8-devel-torch2.0.1-mpi-py3.10-ubuntu20.04 │ 8.29GiB │ │─────────────────────────────────────────────────────────────────────────────────────│─────────│
工作空间管理
yfctl workspace list
- 功能:列出所有工作空间
- 用法:
yfctl workspace list [flags] - 选项:
-a, --all:显示所有工作空间(无数量限制)-n, --num int:显示前 N 条结果(默认 10)-N, --name string:按名称过滤-t, --type string:按资源类型过滤(gpu/vgpu/cpu)
- 示例:
root@gpu-3090-vm08:~# yfctl workspace list --type gpu --num 2 │─────────────────────│─────────│──────│─────────│─────────────────────────────────────────────────────────────────────────│─────────────────│───────────│─────────────────────│ │ ID │ NAME │ TYPE │ STATE │ IMAGE │ NODE │ PROJECT │ CREATE │ │─────────────────────│─────────│──────│─────────│─────────────────────────────────────────────────────────────────────────│─────────────────│───────────│─────────────────────│ │ 1945404905292271617 │ test113 │ GPU │ removed │ 192.168.100.200/cluster/cuda:11.8.0-cudnn8-devel-mpi-py3.10-ubuntu20.04 │ gpu-4070ti-vm04 │ xxxxx项目 │ 2025-07-16 16:47:27 │ │ 1945402050422476801 │ test112 │ GPU │ removed │ 192.168.100.200/cluster/cuda:11.8.0-cudnn8-devel-mpi-py3.10-ubuntu20.04 │ gpu-4070ti-vm04 │ xxxxx项目 │ 2025-07-16 16:36:07 │ │─────────────────────│─────────│──────│─────────│─────────────────────────────────────────────────────────────────────────│─────────────────│───────────│─────────────────────│
yfctl workspace detail
- 功能:查看指定工作空间信息
- 用法:
yfctl workspace detail [ID] - 示例:
root@499fcb8246c1:~# yfctl workspace detail 1946014681965498369 ────────────────────────────────────────────────────────────────────────────────────────────────── 工作空间[5201314]信息 ────────────────────────────────────────────────────────────────────────────────────────────────── WORKSPACE ID: 0c8731f92da021f406e9970142ea81cd90d4bb1a0687738b0ec83dee4c131c52 IMAGE : 192.168.100.200/cluster/cuda:12.1.0-cudnn8-devel-torch2.4.1-mpi-py3.10-ubuntu20.04 NODE : cpu-vm03 PROJECT : xxxxx项目 CREATED : 2025-07-18 09:11:50 AGE : 6.97h CMD : /bin/bash -c /run.sh ARGS : -c /run.sh PORT : │─────────────────│──────────│──────────│──────────│────────────────│──────────│──────────│ │ IP │ EXTERNAL │ INTERNAL │ PROTOCOL │ INFO │ USERNAME │ PASSWORD │ │─────────────────│──────────│──────────│──────────│────────────────│──────────│──────────│ │ 192.168.100.112 │ 33005 │ 22 │ TCP │ SSH服务 │ root │ c0j2xls1 │ │ │ 33006 │ 5901 │ TCP │ VNC服务 │ root │ c0j2xls1 │ │ │ 33007 │ 8888 │ TCP │ JupyterLab服务 │ root │ c0j2xls1 │ │─────────────────│──────────│──────────│──────────│────────────────│──────────│──────────│ CPU : │──────────────────────────────────────────────│──────────────│───────│ │ CPU │ MEMORY │ RATE │ │──────────────────────────────────────────────│──────────────│───────│ │ Intel(R) Xeon(R) Platinum 8163 CPU @ 2.50GHz │ 2MiB / 31MiB │ 0.45% │ │──────────────────────────────────────────────│──────────────│───────│ VOLUME : │────────────│────────────────────────────────────────────────────────────────│──────────────────────│ │ TYPE │ EXTERNAL │ INTERNAL │ │────────────│────────────────────────────────────────────────────────────────│──────────────────────│ │ 用户数据卷 │ /mnt/volume/d9b6da00e9a44e0da235fa92614ab760/userdata/chenchao │ /mnt/volume/chenchao │ │ 公共数据卷 │ /mnt/volume/d9b6da00e9a44e0da235fa92614ab760/userdata/public │ /mnt/volume/public │ │────────────│────────────────────────────────────────────────────────────────│──────────────────────│ ENV : │─────────────│──────────│ │ NAME │ VALUE │ │─────────────│──────────│ │ USER_PASSWD │ c0j2xls1 │ │─────────────│──────────│
yfctl workspace init
- 功能:初始化工作空间(创建默认配置)
- 用法:
yfctl workspace init [工作空间名称] [flags] - 选项:
-t, --type string:按资源类型过滤(gpu/vgpu/cpu) - 示例:交互式输入项目,资源等信息后生成yaml
root@gpu-3090-vm08:~# yfctl workspace init test0717 --type gpu >>> yaml文件已生成: test0717_gpu.yaml
yfctl workspace create
- 功能:创建工作空间
- 用法:
yfctl workspace create [flags] - 选项:
-f, --file string:通过yaml文件创建工作空间 - 示例:
root@gpu-3090-vm08:~# yfctl workspace create -f test0717_cpu.yaml >>> 创建工作空间[test0717]成功
yfctl workspace pause / resume / remove
- 功能:暂停工作空间 / 恢复工作空间 / 删除工作空间
- 用法:
yfctl workspace pause [ID] ... - 示例:
root@gpu-3090-vm08:~# yfctl workspace pause 1945803638882406402 >>> 暂停工作空间[[1945803638882406402]]成功 root@gpu-3090-vm08:~# yfctl workspace resume 1945803638882406402 >>> 恢复工作空间[[1945803638882406402]]成功 root@gpu-3090-vm08:~# yfctl workspace remove 1945803638882406402 >>> 释放工作空间[[1945803638882406402]]成功
作业管理
yfctl job list
- 功能:列出所有作业
- 用法:
yfctl job list kubernetes|determined_cluster|determined_single|queue|timed - 选项:
-a, --all:显示所有作业(无数量限制)-n, --num int:显示前 N 条结果(默认 10)-N, --name string:按名称过滤
- 示例:
root@499fcb8246c1:~# yfctl job list kubernetes --name c --num 1 │─────────────────────│───────│──────│──────────│───────────│─────│─────────│ │ ID │ NAME │ GPUS │ STATE │ PROJECT │ AGE │ CREATOR │ │─────────────────────│───────│──────│──────────│───────────│─────│─────────│ │ 1947594995102482433 │ caid1 │ 2 │ CANCELED │ xxxxx项目 │ 1m │ 陈超 │ │─────────────────────│───────│──────│──────────│───────────│─────│─────────│
yfctl job init :::note[说明] 我们提供了示例代码工程 Kubernetes, Determined :::
- 功能:初始化作业(创建默认配置)
- 用法:
yfctl job init [名称] [类型] - 示例:交互式输入项目,资源等信息后生成yaml
root@gpu-3090-vm08:~# yfctl job init 0723 kubernetes >>> yaml文件已生成: 0723_kubernetes.yaml >>> 已开启samba服务,请使用samba服务将训练代码文件上传至用过户数据卷中任意位置 >>> Linux Host:smbclient //192.168.100.200/chenchao -U chenchao >>> Windows Host:\\192.168.100.200\chenchao >>> Mac Host://192.168.100.200/chenchao >>> Username:chenchao >>> Password:chenchao
yfctl job create
- 功能:创建作业
- 用法:
yfctl job create [类型] [flags] - 选项:
-f, --file string:通过yaml文件创建作业 - 示例:
root@499fcb8246c1:~# yfctl job create kubernetes -f 0723_kubernetes.yaml >>> 创建作业[0723]成功
yfctl job pause / resume
- 功能:暂停作业 / 恢复作业
- 用法:
yfctl job pause [ID] - 示例:
root@gpu-3090-vm08:~# yfctl job pause 1945803638882406402 >>> 暂停作业[[1945803638882406402]]成功 root@gpu-3090-vm08:~# yfctl job resume 1945803638882406402 >>> 恢复作业[1948196243922894849]成功
yfctl job cancel
- 功能:取消作业
- 用法:
yfctl job cancel kubernetes|determined [ID]... - 示例:
root@499fcb8246c1:~# yfctl job cancel determined 1948196243922894849 >>> 取消作业[[1948196243922894849]]成功

