上传 ======= .. contents:: 本节目录 :depth: 2 命令: ``push`` 此时我们用 ``anyctl config ls`` 查看配置会发现项目、本地算法、本地数据集的 ``id`` 都是空的, 是因为我们添加后还没有上传,此时我们用 ``push`` 命令对资源进行上传。 ``--help`` 命令可看到有 ``all`` ``project`` ``algorithm`` ``dataset`` 子命令, 分别代表一次性上传所有未上传资源、上传项目、上传算法、上传数据集。 .. code-block:: shell anyctl push --help .. code-block:: shell Usage: anyctl push [OPTIONS] COMMAND [ARGS]... Push local project or algorithm(s) or dataset(s) to remote Anylearn. Options: --help Show this message and exit. Commands: algorithm Create/update and/or upload local algorithm to remote Anylearn. all Create/update local project, all algorithms and all datasets to... dataset Create/update and/or upload local dataset to remote Anylearn. project Create/update local project to remote Anylearn. 上传所有资源 --------------- 命令: ``all`` +---------------------------+----------+-------------+---------------------------------------------------------+ | 参数及缩写 | 是否必须 | 默认值 | 说明 | +===========================+==========+=============+=========================================================+ | -\-force, -f | False | False | 是否跳过提示和强制操作 | +---------------------------+----------+-------------+---------------------------------------------------------+ | -\-async-upload | False | False | 是否以异步模式上传 | +---------------------------+----------+-------------+---------------------------------------------------------+ 使用示例: .. code-block:: shell anyctl push all [-f] [--async-upload] 如果需要配置远程地址和用户信息请参考 :ref:`set_host_user_info` 。 运行后会有上传提示信息,此时我们再用 ``anyctl config ls`` 命令查看配置信息可以看到 项目、算法、数据集的 ``id`` 已经有值了。 .. code-block:: shell Pushing project cli_example_project... [SUCCESS] PUSHED #提示项目上传完毕 Pushing algorithm cli_example_algo... Local algorithm (None) has been deleted remotely, forced to re-registering algorithm. [SUCCESS] PUSHED #提示算法上传成功 Pushing dataset cli_example_dset... [SUCCESS] PUSHED #提示数据集上传成功 [SUCCESS] DONE #所有数据上传完毕 上传项目 ------------- 命令: ``project`` +---------------------------+----------+-------------+---------------------------------------------------------+ | 参数及缩写 | 是否必须 | 默认值 | 说明 | +===========================+==========+=============+=========================================================+ | -\-force, -f | False | False | 是否跳过提示和强制操作 | +---------------------------+----------+-------------+---------------------------------------------------------+ 使用示例: .. code-block:: shell anyctl push project [-f] 如果需要配置远程地址和用户信息请参考 :ref:`set_host_user_info` 。 运行后会有以下输出: .. code-block:: shell [SUCCESS] PUSHED #提示项目上传成功 此时我们用 ``anyctl config ls`` 查看配置项可以看到项目 ``id`` 已经有值了: .. code-block:: shell project: id: PROJxxx name: test_project description: A project created by anylearn ctl. 上传算法 ------------- 命令: ``algorithm`` +---------------------------+----------+-------------+---------------------------------------------------------+ | 参数及缩写 | 是否必须 | 默认值 | 说明 | +===========================+==========+=============+=========================================================+ | name | True | | 算法名称 | +---------------------------+----------+-------------+---------------------------------------------------------+ | -\-force, -f | False | False | 是否跳过提示和强制操作 | +---------------------------+----------+-------------+---------------------------------------------------------+ | -\-async-upload | False | False | 是否以异步模式上传 | +---------------------------+----------+-------------+---------------------------------------------------------+ 使用示例: .. code-block:: shell anyctl push algorithm anyctl_algo [-f] [--async-upload] 如果需要配置远程地址和用户信息请参考 :ref:`set_host_user_info` 。 运行后会有以下输出: .. code-block:: shell [SUCCESS] PUSHED #提示算法上传成功 此时我们用 ``anyctl config ls`` 查看配置项可以看到算法 ``id`` 已经有值了: .. code-block:: shell ... algorithms: anyctl_algo: id: ALGOxxx name: anyctl_algo description: SDK_QUICKSTART visibility: 3 train_params: - name: dataset type: dataset suggest: 1 follows_anylearn_norm: false entrypoint_training: python fashion_mnist.py output_training: anyctl_algo_result ... 上传数据集 ------------- 命令: ``dataset`` +---------------------------+----------+-------------+---------------------------------------------------------+ | 参数及缩写 | 是否必须 | 默认值 | 说明 | +===========================+==========+=============+=========================================================+ | name | True | | 数据集名称 | +---------------------------+----------+-------------+---------------------------------------------------------+ | -\-force, -f | False | False | 是否跳过提示和强制操作 | +---------------------------+----------+-------------+---------------------------------------------------------+ | -\-async-upload | False | False | 是否以异步模式上传 | +---------------------------+----------+-------------+---------------------------------------------------------+ 使用示例: .. code-block:: shell anyctl push dataset anyctl_dset [-f] [--async-upload] 如果需要配置远程地址和用户信息请参考 :ref:`set_host_user_info` 。 运行后会有以下输出: .. code-block:: shell [SUCCESS] PUSHED #提示数据集上传成功 此时我们用 ``anyctl config ls`` 查看配置项可以看到数据集 ``id`` 已经有值了: .. code-block:: shell ... datasets: anyctl_dset: id: DSETxxx name: DSET_n0ldfvqa description: SDK_QUICKSTART visibility: 1 ...