Integrate with AEM Processing Profiles
For Asset Compute workers to generate custom renditions in AEM as a Cloud Service, they must be registered in AEM as a Cloud Service Author service via Processing Profiles. All assets subject to that Processing Profile will have the worker invoked upon upload or re-processing, and have the custom rendition generated and made available via the asset's renditions.
Define a Processing Profile
First create a new Processing Profile that will invoke the worker with the configurable parameters.
- Login to AEM as a Cloud Service Author service as an AEM Administrator . As this is a tutorial we recommend using a Dev environment or an environment in a Sandbox.
- Navigate to Tools > Assets > Processing Profiles
- Tap Create button
- Name the Processing Profile, WKND Asset Renditions
- Tap the Custom tab, and tap Add New
- Define the new service
- Rendition name: Circle
- The file name rendition that will be used to identify this rendition in AEM Assets
- Extension: png
- The extension of the rendition that will be generated. Set to png as this is the supported output format the worker's web service supports, and results in transparent background behind the circle cut out.
- Endpoint: https://...adobeioruntime.net/api/v1/web/wkndAemAssetCompute-0.0.1/worker
- This is th URL to the worker obtained via aio app get-url . Ensure the URL points at the correct workspace based on the AEM as a Cloud Service environment the Processing Profile is being configured in. Note that this sub-domain matches the development workspace.
- Make sure the worker URL points to the correct workspace. AEM as a Cloud Service Stage should use the Stage workspace URL, and AEM as a Cloud Service Production should use the Production workspace URL.
- Service Parameters
- Tap Add Parameter
- Key: size
- Value: 1000
- Tap Add Parameter
- Key: contrast
- Value: 0.25
- Tap Add Parameter
- Key: brightness
- Value: 0.10
- Mime Types
- Includes: image/jpeg , image/png , image/gif , image/bmp , image/tiff
- These MIME types are the only ones the worker's web service supports, this limits which assets can be processed by the custom worker.
- Excludes: Leave blank
- Never process assets with these MIME Types using this service configuration. In this case, we only use an allow list.
- Tap Save in the top right
Apply and invoke a Processing Profile
- Select the newly created Processing Profile, WKND Asset Renditions
- Tap Apply Profile to Folder(s) in the top action bar
- Select a folder to apply the Processing Profile to, such as WKND and tap Apply
- Navigate to the folder the Processing Profile was not applied to via AEM > Assets > Files and tap into WKND .
- Tap the asset to open its details
- Default renditions may generate and appear more quickly in AEM than custom renditions.
- Open the Renditions view from the left sidebar
- Tap on the asset named Circle.png and review the generated rendition
Congratulations! You have finished the tutorial on how to extend AEM as a Cloud Service Asset Compute microservices! You should now have the ability to set up, develop, test, debug and deploy custom Asset Compute workers for use by your AEM as a Cloud Service Author service.
Review the full project source code on Github
The final Asset Compute project is available on Github at:
Github contains is the final state of the project, fully populated with the worker and test cases, but does not contain any credentials, ie. .env , .config.json or .aio .
Custom rendition missing from asset
- Error: New and re-processed assets process successfully, but are missing the custom rendition
Processing profile not applied to ancestor folder
- Cause: The asset does not exist under a folder with the Processing Profile that uses the custom worker
- Resolution: Apply the Processing Profile to an ancestor folder of the asset
Processing profile superseded by lower Processing Profile
- Cause: The asset exists beneath a folder with the custom worker Processing Profile applied, however a different Processing Profile that does not use the customer worker has been applied between that folder and the asset.
- Resolution: Combine, or otherwise reconcile, the two Processing Profiles and remove the intermediate Processing Profile
Asset Processing Failed
- Error: Asset Processing Failed badge displayed on asset
- Cause: An error occurred in the execution of the custom worker
- Resolution: Follow the instructions on debugging Adobe I/O Runtime activations using aio app logs .