AEM as Cloud Service’s Asset Compute microservices support the development and deployment of custom workers that are used to read, and manipulate binary data of assets stored in AEM, most commonly, to create custom asset renditions.
Whereas in AEM 6.x custom AEM Workflow processes were used to read, transform, and write back asset renditions, in AEM as a Cloud Service Asset Compute workers satisfy this need.
This tutorial walks through the creation of a simple Asset Compute worker that creates an asset rendition by cropping the original asset to a circle, and applies configurable contrast and brightness. While the worker itself is basic, this tutorial uses it to explore creating, developing, and deploying a custom Asset Compute worker for use with AEM as a Cloud Service.
Learn how to properly prepare for extending Asset Compute workers, and understand what services and accounts must be provisioned and configured, and software installed locally for development.
The following accounts and services require provisioning and access to in order to complete the tutorial, AEM as a Cloud Service Dev environment or Sandbox program, access to Adobe Project Firefly and Microsoft Azure Blob Storage.
Local development of Asset Compute projects requires a specific developer tool set, different from traditional AEM development, including: Microsoft Visual Studio Code, Docker Desktop, Node.js and supporting npm modules.
Asset Compute projects are specially defined Adobe Project Firefly projects, and as such, require access to Adobe Project Firefly in the Adobe Developer Console in order to set up and deploy them.
Learn how to create and configure an Asset Compute project and then develop a custom worker that generates a bespoke asset rendition.
Asset Compute projects, which contain one or more Asset Compute workers, are generated using the the interactive Adobe I/O CLI. Asset Compute projects are specially structured Adobe Project Firefly projects, which are in turn Node.js projects.
Environment variables are maintained in the
.env file for local development, and are used to provide Adobe I/O credentials and cloud storage credentials required for local development.
Asset Compute projects contain manifests which define all the Asset Compute workers contained within the project, as well as what resources they have available when deployed to Adobe I/O Runtime for execution.
Developing an Asset Compute worker is the core of extending Asset Compute microservices, as the worker contains the custom code that generates, or orchestrates, the generation of the resultant asset rendition.
The Asset Compute Development Tool provides a local Web harness for deploying, executing and previewing worker-generated renditions, supporting rapid and iterative Asset Compute worker development.
Learn how to test custom Asset Compute workers to be confident in their operation, and debug Asset Compute workers to understand and troubleshoot how the custom code is executed.
Asset Compute provides a test framework for creating test suites for workers, making defining tests that ensure proper behavior is easy.
Asset Compute workers provide various levels of debugging from traditional
console.log(..) output, to integrations with VS Code and wskdebug, allowing developers step through worker code as it executes in real time.
Learn how to integrate custom Asset Compute workers with AEM as a Cloud Service, by first deploying them to Adobe I/O Runtime and then invoking from AEM as a Cloud Service Author via AEM Assets’ Processing Profiles.
Asset Compute workers must be deployed to Adobe I/O Runtime to be used with AEM as a Cloud Service.
Once deployed to Adobe I/O Runtime, Asset Compute workers can be registered in AEM as a Cloud Service via Assets Processing Profiles. Processing Profiles are, in turn, applied to asset folders applying to the assets therein.
These abridged tutorials tackle more advanced use cases building upon foundational learnings established in the prior chapters.
The tutorial’s codebase is available on Github at:
The source code does not contain the required
config.json files. These must be added and configured using your accounts and services information.
The following are various Adobe resources that provide further information and useful APIs and SDKs for developing Asset Compute workers.