Skip to content

部署智能体运行时

deploy 命令是对智能体运行时资源进行部署的命令,即将本地在 Yaml 文件 中声明的资源部署到线上。

命令解析

当执行命令 deploy -h / deploy --help 时,可以获取帮助文档。

参数解析

当前命令支持部分全局参数(例如 -a/--access, --debug 等),详情可参考 Serverless Devs 全局参数文档

操作案例

有资源描述文件(Yaml)时,可以直接执行 s deploy 进行资源部署,部署完成的输出示例:

agent:
  id:           d4584638-8a29-4b11-bc8f-ca2d6615e543
  arn:          acs:agentrun:cn-hangzhou:143xxxxx:workspaces/system-default-workspace-143xxxxx/runtimes/test
  name:         test
  description:  OpenClaw Agent Runtime
  artifactType: Container
  status:       READY
  resources: 
    cpu:      4
    memory:   8192
    diskSize: 10240
    port:     18789
  timestamps: 
    createdAt:     2026-04-21T09:33:47.793276Z
    lastUpdatedAt: 2026-04-22T05:23:02.567661Z
  region:       cn-hangzhou
  endpoints: 
    - name:       production
      url:        https://xxx.agentrun-data.cn-hangzhou.aliyuncs.com/.../invocations
      version:    LATEST
      status:     READY
  workspaceId:  26c62411-be8b-5858-9763-e4501a43d727
__component: agentrun

注意事项

  • 部署时会自动处理代码上传(如果是代码模式)或容器镜像配置(如果是容器模式)
  • 如果配置了logConfig: auto,会自动创建SLS日志项目和日志库
  • 部署过程会自动创建或更新端点配置
  • 容器镜像会自动推送到ACR,无需手动推送

高级部署指南

对于生产环境部署和复杂场景,我们提供了综合的高级部署指南:

主题 说明 文档
高级部署指南 生产部署、CI/CD、多环境管理 一站式高级部署最佳实践

权限与策略说明

使用该命令时,推荐配置系统策略:AliyunAgentRunFullAccess