Create an Asset Compute project

Asset Compute projects are Node.js projects, generated using the Adobe I/O CLI, that adhere to a certain structure that allow them to be deployed to Adobe I/O Runtime and integrated with AEM as a Cloud Service. A single Asset Compute project can contain one or more Asset Compute workers, with each having a discrete HTTP end-point referenceable from an AEM as a Cloud Service Processing Profile.

Generate a project

Click-through of generating an Asset Compute project (No audio)

Use the Adobe I/O CLI Asset Compute plug-in to generate a new, empty Asset Compute project.

  1. From the command line, navigate to the folder to contain the project.

  2. From the command line, execute aio app init to begin the interactive project generation CLI.

  3. Select Org

    • Select the Adobe Org that has AEM as a Cloud Service, App Builder are registered with
  4. Select Project

    • Locate and select the Project. This is the Project title created from the App Builder project template, in this case WKND AEM Asset Compute
  5. Select Workspace

    • Select the Development workspace
  6. Which Adobe I/O App features do you want to enable for this project? Select components to include

    • Select Actions: Deploy runtime actions
    • Use the arrows keys to select and space to unselect/select, and Enter to confirm selection
  7. Select type of actions to generate

    • Select DX Asset Compute Worker v1
    • Use the arrows keys to select, space to unselect/select, and Enter to confirm selection
  8. How would you like to name this action?

    • Use the default name worker.
    • If your project contains multiple workers that perform different asset computations, name them semantically

Generate console.json

The developer tool requires a file named console.json that contains the necessary credentials to connect to Adobe I/O. This file is downloaded from the Adobe I/O console.

  1. Open the Asset Compute worker’s Adobe I/O project

  2. Select the project workspace to download the console.json credentials for, in this case select Development

  3. Go to the root of the Adobe I/O project and tap Download All in the upper-right corner.

  4. A file is downloaded as a .json file prefixed with the project and workspace, for example: wkndAemAssetCompute-81368-Development.json

  5. You can either

    • Rename the file as console.json and move it in the root of your Asset Compute worker project. This is the approach in this tutorial.

    • Move it into an arbitrary folder AND reference that folder from your .env file with a configuration entry ASSET_COMPUTE_INTEGRATION_FILE_PATH. The file path can be absolute or relative to the root of your project. For example:

      • ASSET_COMPUTE_INTEGRATION_FILE_PATH=/Users/example-user/secrets/wkndAemAssetCompute-81368-Development.json

      Or

      • ASSET_COMPUTE_INTEGRATION_FILE_PATH=../../secrets/wkndAemAssetCompute-81368-Development.json.json

NOTE
The file contains credentials. If you store the file within your project, make sure to add it to your .gitignore file to prevent from being shared. The same applies to the .env file – These credentials files must not be shared, or stored in Git.

Asset Compute project on GitHub

The final Asset Compute project is available on GitHub at:

GitHub contains the final state of the project, fully populated with the worker and test cases, but does not contain any credentials, that is, .env, console.json or .aio.

recommendation-more-help
4859a77c-7971-4ac9-8f5c-4260823c6f69