diff --git a/docs/6-automation/1-quick-start-workflow.md b/docs/6-automation/1-quick-start-workflow.md index 9218cb960..495231e7b 100644 --- a/docs/6-automation/1-quick-start-workflow.md +++ b/docs/6-automation/1-quick-start-workflow.md @@ -46,13 +46,19 @@ sidebar_position: 1 ![action_3](./img/action_3.png) - 步骤名称:unzip -- 镜像:registry-vpc.cn-hangzhou.aliyuncs.com/coscene/cos:2025-02-06-v25.6.1 - - 该镜像为刻行时空提供的镜像,内置 `icos` 工具,仅支持在平台内部使用,了解[镜像](../image/1-about-docker-image.md) -- 命令:icos fs decompress f \*.zip -i /cos/files -o /cos/files - - 调用 `icos` 工具,对 `/cos/files` 目录(记录)下名称符合 `*.zip` 的文件进行解压,将其输出到原记录 - - 需一行填写一个参数,如第一行填写 `icos`,第二行填写 `fs`,以此类推 - - ![action_4](./img/action_4.png) +- 镜像:`python:3.12-slim` + - 这是 Docker Hub 上公开可拉取的 Python 镜像,适合用于快速验证自动化流程。 + - 生产环境建议将脚本和依赖打包为自己的镜像,并推送到组织镜像仓库。每个组织都会自动分配一个刻行镜像仓库,地址通常为 `cr.coscene.cn/`;使用 `cocli registry login` 可完成本地 Docker 登录,动作运行时会自动获得拉取当前组织镜像的授权。 +- 命令:将下面 3 行分别填入命令输入框,每一行都是一个独立参数。 + + ```bash + python + -c + import pathlib,zipfile;root=pathlib.Path('/cos/files');[zipfile.ZipFile(p).extractall(root) for p in root.rglob('*.zip')] + ``` + + - 该命令使用 Python 标准库扫描 `/cos/files` 下的 `*.zip` 文件,并把内容解压回原记录。 + - 命令和参数需要逐行填写;不要把 `python -c ...` 合并成一行。 - 记录文件挂载权限:读/写 - 允许该动作在执行期间对原记录进行读写操作 diff --git a/docs/6-automation/3-create-action.md b/docs/6-automation/3-create-action.md index 08b2db33a..1ee1642d3 100644 --- a/docs/6-automation/3-create-action.md +++ b/docs/6-automation/3-create-action.md @@ -30,13 +30,19 @@ sidebar_position: 2 ![action_3](./img/action_3.png) - 步骤名称:unzip -- 镜像:registry-vpc.cn-hangzhou.aliyuncs.com/coscene/cos:2025-02-06-v25.6.1 - - 该镜像为刻行时空提供的镜像,内置 `icos` 工具,仅支持在平台内部使用,了解[镜像](../image/1-about-docker-image.md) -- 命令:icos fs decompress f \*.zip -i /cos/files -o /cos/files - - 调用 `icos` 工具,对 `/cos/files` 目录(记录)下名称符合 `*.zip` 的文件进行解压,将其输出到原记录 - - 需一行填写一个参数,如第一行填写 `icos`,第二行填写 `fs`,以此类推 +- 镜像:`python:3.12-slim` + - 这是 Docker Hub 上公开可拉取的 Python 镜像,适合用于快速验证自动化流程。 + - 生产环境建议将脚本和依赖打包为自己的镜像,并推送到组织镜像仓库。每个组织都会自动分配一个刻行镜像仓库,地址通常为 `cr.coscene.cn/`;使用 `cocli registry login` 可完成本地 Docker 登录,动作运行时会自动获得拉取当前组织镜像的授权。 +- 命令:将下面 3 行分别填入命令输入框,每一行都是一个独立参数。 + + ```bash + python + -c + import pathlib,zipfile;root=pathlib.Path('/cos/files');[zipfile.ZipFile(p).extractall(root) for p in root.rglob('*.zip')] + ``` - ![action_4](./img/action_4.png) + - 该命令使用 Python 标准库扫描 `/cos/files` 下的 `*.zip` 文件,并把内容解压回原记录。 + - 命令和参数需要逐行填写;不要把 `python -c ...` 合并成一行。 - 记录文件挂载权限:读/写 - 允许该动作在执行期间对原记录进行读写操作 @@ -118,7 +124,7 @@ sidebar_position: 2 action-copy_1 -- 添加参数:添加参数 `filename`,值为 `*.zip`,供命令 `{{parameters.filename}}` 引用此参数,表示对指定目录下名称符合 `*.zip` 的文件进行解压 +- 添加参数:添加参数 `filename`,值为 `*.zip`,供命令 `{{parameter.filename}}` 引用此参数,表示对指定目录下名称符合 `*.zip` 的文件进行解压 ![action-copy_2](./img/action-copy_2.png) diff --git a/docs/image/1-about-docker-image.md b/docs/image/1-about-docker-image.md index c6ca9c94d..3c212f510 100644 --- a/docs/image/1-about-docker-image.md +++ b/docs/image/1-about-docker-image.md @@ -17,7 +17,11 @@ Docker 镜像是一个可执行的软件包,它包含运行应用程序所需 # 关于刻行镜像仓库 -刻行平台提供专业的私有镜像仓库服务。在刻行时空平台内部使用该服务时,无需额外配置认证过程,具有以下优势: +刻行平台提供专业的私有镜像仓库服务。每个组织都会自动分配一个组织级镜像仓库,地址通常为 `cr.coscene.cn/`。将镜像推送到该仓库后,可以直接在自动化动作和批量测试中使用;动作运行时会自动获得拉取当前组织镜像的授权,无需在动作里额外配置镜像仓库凭证。 + +开发者在本地构建和推送镜像时,可以使用 `cocli registry login` 登录当前组织的镜像仓库,详见[推送镜像](./3-push-image.md)。 + +使用刻行镜像仓库具有以下优势: - 支持快速上传和管理现有镜像 - 可在平台内直接使用托管的镜像 diff --git a/docs/image/2-build-image.md b/docs/image/2-build-image.md index c2a757d7f..4a45f46f6 100644 --- a/docs/image/2-build-image.md +++ b/docs/image/2-build-image.md @@ -40,10 +40,10 @@ if __name__ == "__main__": ## 打包镜像 -我们假设镜像名字为 `cr.coscene.cn/coscene/helloworld`, 标签为 `latest` +我们假设当前组织 slug 为 ``,镜像名字为 `cr.coscene.cn//helloworld`,标签为 `latest` ```bash -docker build -f dockerfile -t cr.coscene.cn/coscene/helloword:latest . +docker build -f dockerfile -t cr.coscene.cn//helloworld:latest . ``` 如果需要镜像支持不同的平台而进行交叉编译,具体请查看[文档](https://docs.docker.com/build/building/multi-platform/) @@ -54,7 +54,7 @@ docker build -f dockerfile -t cr.coscene.cn/coscene/helloword:latest . ```bash -docker run cr.coscene.cn/coscene/helloword:latest +docker run cr.coscene.cn//helloworld:latest ``` diff --git a/docs/image/3-push-image.md b/docs/image/3-push-image.md index 7786144c1..642383840 100644 --- a/docs/image/3-push-image.md +++ b/docs/image/3-push-image.md @@ -12,7 +12,24 @@ sidebar_position: 3 ## 推送镜像至刻行镜像仓库 -### 1. 认证和登录刻行的镜像仓库 +每个组织都会自动分配一个刻行镜像仓库,地址通常为 `cr.coscene.cn/`。推送镜像前,需要先在本地 Docker 登录该镜像仓库。 + +### 1. 使用 coCLI 登录刻行镜像仓库(推荐) + +确认已经完成 [coCLI 登录](../developers/cocli/1-cli-install.md#登录) 后,运行: + +```bash +cocli registry login +``` + +`cocli` 会根据当前 profile 的 OpenAPI endpoint 推断镜像仓库地址,并调用本机 Docker 完成登录。登录完成后,即可将镜像打上组织仓库地址并推送: + +```bash +docker tag local-image:latest cr.coscene.cn//local-image:latest +docker push cr.coscene.cn//local-image:latest +``` + +### 2. 在网页端生成登录凭证 登录刻行平台,在右上角用户设置下拉面板中,选择[【组织管理】-【镜像】](https://coscene.cn/org/images)。 diff --git a/i18n/en/docusaurus-plugin-content-docs/current/6-automation/1-quick-start-workflow.md b/i18n/en/docusaurus-plugin-content-docs/current/6-automation/1-quick-start-workflow.md index df49a9528..f6119ae9b 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/6-automation/1-quick-start-workflow.md +++ b/i18n/en/docusaurus-plugin-content-docs/current/6-automation/1-quick-start-workflow.md @@ -46,13 +46,19 @@ This section will introduce in detail how to create an automation process throug ![action_3](./img/action_3.png) - Step Name: unzip -- Image: registry-vpc.cn-hangzhou.aliyuncs.com/coscene/cos:2025-02-06-v25.6.1 - - This image is provided by Kehang Shikong and has the `icos` tool built - in. It is only supported for use within the platform. Learn more about [Images](../image/1-about-docker-image.md). -- Command: icos fs decompress f \*.zip -i /cos/files -o /cos/files - - Call the `icos` tool to decompress files with names matching `*.zip` in the `/cos/files` directory (record) and output them to the original record. - - You need to fill in one parameter per line. For example, fill in `icos` on the first line, `fs` on the second line, and so on. - - ![action_4](./img/action_4.png) +- Image: `python:3.12-slim` + - This is a publicly pullable Python image from Docker Hub, suitable for quickly verifying the automation flow. + - For production actions, package your script and dependencies into your own image and push it to the organization image registry. Each organization is automatically assigned a coScene image registry, usually in the form `cr.coscene.cn/`. Use `cocli registry login` to authenticate local Docker pushes; action runs are automatically authorized to pull images from the current organization registry. +- Command: enter the following 3 lines into the command fields. Each line is one separate argument. + + ```bash + python + -c + import pathlib,zipfile;root=pathlib.Path('/cos/files');[zipfile.ZipFile(p).extractall(root) for p in root.rglob('*.zip')] + ``` + + - This command uses Python's standard library to scan for `*.zip` files under `/cos/files` and extract them back to the original record. + - Commands and arguments must be entered line by line; do not merge `python -c ...` into a single line. - Record File Mount Permission: Read/Write - Allow the action to read from and write to the original record during execution. diff --git a/i18n/en/docusaurus-plugin-content-docs/current/6-automation/3-create-action.md b/i18n/en/docusaurus-plugin-content-docs/current/6-automation/3-create-action.md index 32746a2b3..3c8a608be 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/6-automation/3-create-action.md +++ b/i18n/en/docusaurus-plugin-content-docs/current/6-automation/3-create-action.md @@ -28,13 +28,19 @@ Take creating an action for "Unzipping Files" as an example to illustrate how to ![action_3](./img/action_3.png) - Step name: unzip -- Image: registry-vpc.cn-hangzhou.aliyuncs.com/coscene/cos:2025-02-06-v25.6.1 - - This image is provided by Kehang Space-Time, with the `icos` tool built - in. It only supports use within the platform. Learn more about [images](../image/1-about-docker-image.md). -- Command: icos fs decompress f \*.zip -i /cos/files -o /cos/files - - Call the `icos` tool to decompress files whose names match `*.zip` in the `/cos/files` directory (record), and output the results to the original record. - - You need to fill in one parameter per line. For example, fill in `icos` on the first line, `fs` on the second line, and so on. +- Image: `python:3.12-slim` + - This is a publicly pullable Python image from Docker Hub, suitable for quickly verifying the automation flow. + - For production actions, package your script and dependencies into your own image and push it to the organization image registry. Each organization is automatically assigned a coScene image registry, usually in the form `cr.coscene.cn/`. Use `cocli registry login` to authenticate local Docker pushes; action runs are automatically authorized to pull images from the current organization registry. +- Command: enter the following 3 lines into the command fields. Each line is one separate argument. - ![action_4](./img/action_4.png) + ```bash + python + -c + import pathlib,zipfile;root=pathlib.Path('/cos/files');[zipfile.ZipFile(p).extractall(root) for p in root.rglob('*.zip')] + ``` + + - This command uses Python's standard library to scan for `*.zip` files under `/cos/files` and extract them back to the original record. + - Commands and arguments must be entered line by line; do not merge `python -c ...` into a single line. - Record file mount permission: Read/Write - Allow this action to read from and write to the original record during execution. @@ -60,7 +66,7 @@ Take creating an action for "Unzipping Files" as an example to illustrate how to action-copy_1 -- Add a parameter: Add the parameter `filename` with a value of `*.zip` for the command `{{parameters.filename}}` to reference this parameter, indicating that files whose names match `*.zip` in the specified directory will be decompressed. +- Add a parameter: Add the parameter `filename` with a value of `*.zip` for the command `{{parameter.filename}}` to reference this parameter, indicating that files whose names match `*.zip` in the specified directory will be decompressed. ![action-copy_2](./img/action-copy_2.png) diff --git a/i18n/en/docusaurus-plugin-content-docs/current/image/1-about-docker-image.md b/i18n/en/docusaurus-plugin-content-docs/current/image/1-about-docker-image.md index ec4128eb3..e0384c12b 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/image/1-about-docker-image.md +++ b/i18n/en/docusaurus-plugin-content-docs/current/image/1-about-docker-image.md @@ -24,4 +24,8 @@ Docker images are typically built from a base image and customized through a Doc # About coScene Image Registry -The coScene platform provides a private image registry, eliminating the need for users to set up their own. Users can quickly upload existing images to the coScene image registry, enabling immediate use of these images on the coScene platform to build business processes and improve development efficiency. The coScene image registry is supported in features such as [Automation](../6-automation/1-quick-start-workflow.md) and [Batch Testing](../sim-and-tests/regression/1-intro.md). +The coScene platform provides a private image registry, eliminating the need for users to set up their own. Each organization is automatically assigned an organization-level registry, usually in the form `cr.coscene.cn/`. After you push an image to this registry, it can be used directly in automation actions and batch tests. Action runs are automatically authorized to pull images from the current organization registry, so you do not need to configure registry credentials inside the action. + +When building and pushing images locally, use `cocli registry login` to authenticate Docker against the current organization's registry. See [Push Images](./3-push-image.md). + +The coScene image registry is supported in features such as [Automation](../6-automation/1-quick-start-workflow.md) and [Batch Testing](../sim-and-tests/regression/1-intro.md). diff --git a/i18n/en/docusaurus-plugin-content-docs/current/image/2-build-image.md b/i18n/en/docusaurus-plugin-content-docs/current/image/2-build-image.md index 419983ca3..a43a63e5c 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/image/2-build-image.md +++ b/i18n/en/docusaurus-plugin-content-docs/current/image/2-build-image.md @@ -37,10 +37,10 @@ if __name__ == "__main__": ## Building the Image -Let's assume the image name is `cr.coscene.cn/coscene/helloworld` with the tag `latest` +Assume the current organization slug is `` and the image name is `cr.coscene.cn//helloworld` with the tag `latest`. ```bash -docker build -f dockerfile -t cr.coscene.cn/coscene/helloword:latest . +docker build -f dockerfile -t cr.coscene.cn//helloworld:latest . ``` If you need cross-compilation support for different platforms, please check the [documentation](https://docs.docker.com/build/building/multi-platform/) @@ -50,7 +50,7 @@ If you need cross-compilation support for different platforms, please check the After the image is built, we can run it to verify the code functionality. ```bash -docker run cr.coscene.cn/coscene/helloword:latest +docker run cr.coscene.cn//helloworld:latest ``` Check the output - if the image was built correctly, it should show our expected result. diff --git a/i18n/en/docusaurus-plugin-content-docs/current/image/3-push-image.md b/i18n/en/docusaurus-plugin-content-docs/current/image/3-push-image.md index 245a3c3f7..72a49725d 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/image/3-push-image.md +++ b/i18n/en/docusaurus-plugin-content-docs/current/image/3-push-image.md @@ -16,7 +16,24 @@ You can refer to the documentation [Pushing a Docker container image to Docker H ## Push Images to coScene Container Registry -### 1. Authenticate and Log in to coScene Container Registry +Each organization is automatically assigned a coScene image registry, usually in the form `cr.coscene.cn/`. Before pushing an image, authenticate local Docker against that registry. + +### 1. Log in with coCLI (Recommended) + +After completing [coCLI login](../developers/cocli/1-cli-install.md#login), run: + +```bash +cocli registry login +``` + +`cocli` infers the image registry host from the current profile's OpenAPI endpoint and calls local Docker to complete the login. After login, tag the image with your organization registry path and push it: + +```bash +docker tag local-image:latest cr.coscene.cn//local-image:latest +docker push cr.coscene.cn//local-image:latest +``` + +### 2. Generate Login Credentials in the Web UI Log in to coScene platform, access [Profile Settings] from the user settings dropdown menu in the top right corner, then navigate to the [Security](https://coscene.cn/profile?section=security) page in [Profile Settings].