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 rendition’s file name that used to identify this rendition in AEM Assets
-
Extension:
png
- The extension of the rendition that is 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.
- The extension of the rendition that is generated. Set to
-
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. - 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.
- This is th URL to the worker obtained via
-
Service Parameters
-
Tap Add Parameter
- Key:
size
- Value:
1000
- Key:
-
Tap Add Parameter
- Key:
contrast
- Value:
0.25
- Key:
-
Tap Add Parameter
- Key:
brightness
- Value:
0.10
- Key:
-
These key/value pairs that are passed into the Asset Compute worker and available via
rendition.instructions
JavaScript object.
-
-
Mime Types
- Includes:
image/jpeg
,image/png
,image/gif
,image/bmp
,image/tiff
- These MIME types are the only ones the worker’s npm modules. This list limits which are 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.
- Includes:
-
-
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
. -
Upload some new images assets (sample-1.jpg, sample-2.jpg, and sample-3.jpg) in any folder under the folder with the Processing Profile applied, and wait for the uploaded asset to be processed.
-
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
Finished!
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
.