配置manifest.yml

manifest.yml,位于Asset compute项目的根目录下,描述了此项目中要部署的所有工作程序。

manifest.yml

默认工作人员定义

辅助进程在下被定义为Adobe I/O Runtime操作条目 actions,并且由一组配置组成。

访问其他Adobe I/O集成的工作程序必须设置 annotations -> require-adobe-auth 属性至 true 作为此 公开工作人员的Adobe I/O凭据 通过 params.auth 对象。 当工作进程调用Adobe I/OAPI(如Adobe Photoshop、Lightroom或Sensei API)时,通常需要此项,并且每个工作进程可以切换。

  1. 打开并查看自动生成的工作人员 manifest.yml. 包含多个Asset compute工作程序的项目,必须在下为每个工作人员定义一个条目 actions 数组。
packages:
  __APP_PACKAGE__:
    license: Apache-2.0
    actions: # the array of workers, since we have a single worker there is only one entry beneath actions
      worker: # the auto-generated worker definition
        function: actions/worker/index.js # the entry point to the worker
        web: 'yes'  # as our worker is invoked over HTTP from AEM Author service
        runtime: 'nodejs:12' # the target nodejs runtime (only 10 and 12 are supported)
        limits:
          concurrency: 10
        annotations:
          require-adobe-auth: true # set to true, to pass through Adobe I/O access token/client id via params.auth in the worker, typically required when the worker calls out to Adobe I/O APIs such as the Adobe Photoshop, Lightroom or Sensei APIs.

定义限制

每个工作人员可以配置 限制 以了解其在Adobe I/O Runtime中的执行上下文。 应调整这些值,根据工作人员将要计算的资产数量、比率、类型以及所执行的工作类型,为工作人员提供最佳规模。

审核 Adobe大小调整指南 设置限制之前。 asset compute工作程序在处理资产时可能会耗尽内存,从而导致终止Adobe I/O Runtime执行,因此请确保该工作程序的大小适合处理所有候选资产。

  1. 添加 inputs 部分 wknd-asset-compute 操作条目。 这允许调整Asset compute工作程序的总体性能和资源分配。
packages:
  __APP_PACKAGE__:
    license: Apache-2.0
    actions:
      worker:
        function: actions/worker/index.js
        web: 'yes'
        runtime: 'nodejs:12'
        limits: # Allows for the tuning of the worker's performance
          timeout: 60000 # timeout in milliseconds (1 minute)
          memorySize: 512 # memory allocated in MB; if the worker offloads heavy computational work to other Web services this number can be reduced
          concurrency: 10 # adjust based on expected concurrent processing and timeout
        annotations:
          require-adobe-auth: true

已完成的manifest.yml

决赛 manifest.yml 类似于:

packages:
  __APP_PACKAGE__:
    license: Apache-2.0
    actions:
      worker:
        function: actions/worker/index.js
        web: 'yes'
        runtime: 'nodejs:12'
        limits:
          timeout: 60000 # in ms
          memorySize: 512 # in MB
          concurrency: 10
        annotations:
          require-adobe-auth: true

Github上的manifest.yml

决赛 .manifest.yml 可在Github上获取,网址为:

正在验证manifest.yml

生成的Asset compute后 manifest.yml ,运行本地开发工具,并确保使用更新后的成功启动 manifest.yml 设置。

要启动Asset compute项目的Asset compute开发工具,请执行以下操作:

  1. 在Asset compute项目根中打开命令行(在VS代码中,可以直接在IDE中通过“终端”>“新建终端”打开命令行),然后执行命令:

    $ aio app run
    
  2. 本地Asset compute开发工具将在默认Web浏览器中打开,网址为 http://localhost:9000.

    aio应用程序运行

  3. 在开发工具初始化时,请观察命令行输出和Web浏览器中的错误消息。

  4. 要停止“Asset compute开发工具”,请点按 Ctrl-C 在执行 aio app run 以终止进程。

疑难解答

在此页面上