项目配置 ========= .. contents:: 本节目录 :depth: 2 命令: ``config`` 查看或设置项目配置,项目所有的配置信息包括数据集、算法等都在一个yaml文件总记录, 可通过此命令可以查看或对某一项进行设置,用 ``--help`` 命令可看到有以下子命令: .. code-block:: anyctl config --help Usage: anyctl config [OPTIONS] COMMAND [ARGS]... Get or set project's options. Options: --help Show this message and exit. Commands: get Get config by key. ls Print full config in current project. set Set config by key. 查看所有配置 ------------- 命令: ``ls`` 使用示例: .. code-block:: shell anyctl config ls 运行后会有以下输出: .. code-block:: text remote: host: username: password: project: id: name: test_project description: A project created by anylearn ctl. algorithms: {} datasets: {} path: algorithm: {} dataset: {} 目前仅项目信息有数据,其他标签在后续章节逐步介绍。 获取某一配置项 --------------- 命令: ``get`` +---------------+-----------+---------+----------------------------------------------------+ | 参数及缩写 | 是否必须 | 默认值 | 说明 | +===============+===========+=========+====================================================+ | config_key | True | | 配置项的 ``key`` | +---------------+-----------+---------+----------------------------------------------------+ 使用示例: .. code-block:: shell anyctl config get project.name 运行后会有以下输出: .. code-block:: shell test_project 设置某一配置项 --------------- 命令: ``set`` +---------------+-----------+--------------+----------------------------------------------------+ | 参数及缩写 | 是否必须 | 默认值 | 说明 | +===============+===========+==============+====================================================+ | config_key | True | | 配置项的 ``key`` | +---------------+-----------+--------------+----------------------------------------------------+ | value | True | | 配置项的值 | +---------------+-----------+--------------+----------------------------------------------------+ 使用示例: .. code-block:: shell anyctl config set project.name anyctl_project 运行后会有以下输出: .. code-block:: shell [SUCCESS] OK #提示设置成功 此时我们再查看所有配置: .. code-block:: shell anyctl config ls 运行后会有以下输出: .. code-block:: shell remote: host: username: password: project: id: name: anyctl_project #可以看到项目名称已经修改 description: A project created by anylearn ctl. algorithms: {} datasets: {} path: algorithm: {} dataset: {}