Saturday, 18 February 2023

FAQ on Rapid Development Environments - RDEs in AEM as Cloud Service

As an AEM Developer, we always wanted a faster deployment process enabled in AEM as Cloud Service Environments. There is a good news for all of us!

Why we need faster deployments?

Being a curious developer, one of the newly developed feature we wanted to test quickly but we know usually a deployment takes an average of 40 minutes in AEM cloud service. The average time for Adobe Experience Manager (AEM) cloud deployment can vary depending on several factors, such as the complexity of the implementation, the size of the content repository, the number of customizations required, and the chosen cloud deployment model.

Why the deployments take time on AEM as Cloud Service Environments and what is the relevance of a Rapid Development Environments (RDEs)?


Usually a code deployment on AEM as cloud service goes through a set of code security and quality rules which makes it a slow process. Assume a new feature has to be tested quickly on AEM as cloud which is already working on AEM as cloud local sdk. Using RDE, a developer can quickly deploy the changes and test it. And successful RDE tested code can be deployed through normal AEM as cloud deployment pipelines.

What is the new feature ‘Rapid Deployments’ in AEM as cloud service which enables quick deployments?
 
Rapid deployments in Adobe Experience Manager (AEM) as a cloud service refers to the ability to quickly and efficiently deploy AEM instances in the cloud. Rapid deployment is achieved through a combination of pre-configured environments, CLi plugins, and configurations.

RDE provides below advantages 

-RDE enables a faster development cycles
-Efficient Testing on a ‘near to prod’ environment which gives confidence to developers
-Enables collaboration between developers to test related features by increasing productivity
-Avoids the long waiting deployment process

By default RDE gets set to the most recent AEM version.

How developer works on RDEs

The developer uses command line tools to invoke the RDEs on cloud.

Once the user is done with a feature testing and a successful local build completion, he can use the CLI commands to invoke the RDE deployment. If multiple developers want to use RDEs, they will have to commit the code in feature branch /club the code and use CLI to test the feature at a time.

How do we work with RDEs?

Please ensure the developer is having latest version of Adobe I/O Runtime Extensible CLI . Steps given below,

Step1

$ npm install -g @adobe/aio-cli - To install the Adobe I/O Runtime Extensible CLI,
$ aio plugins:install @adobe/aio-cli-plugin-cloudmanager - To Install Cloud Manager plugin
$ aio plugins:install @adobe/aio-cli-plugin-aem-rde - To install AEM RDE plugin
$ aio aem:rde:status - To verify the AEM RDE plugin installation and configuration 

Step 2

Once basic installation is done, we need to configure few things,
$ aio config:set cloudmanager_orgid <org-id>  - Set the organization id of RDE
$ aio config:set cloudmanager_programid <program-id> - Set the program id of RDE
$ aio config:set cloudmanager_environmentid <env-id> - Set the environment id of RDE

Step 3

Validate the configurations now using below command,
$ aio config:list - To verify the current config values

Step 4 

Once above steps are completed, do a code build on developer machine using below command
 mvn clean install -PautoInstallSinglePackage

Step 5
 

After successful code build, developer can use CLI commands to push the code/ packages to RDE environment.

Note: If one developer wants to use the RDE for new feature testing, he will have to ensure the RDE is ‘reset’ before new deployments.

A pictorial representation of the RDE development flow is given below.

RDEs on AEM - Click on image to see it big




What all can be deployed using RDE approach


- [+] AEM code & content package (all, ui.apps)
- [+] OSGi bundle and config files
- [+] Any individual files like HTL, .content.xml (dialog XML)
- [+] Apache and Dispatcher configs deployment as a zip file

Is this(RDE) feature available for all readily?
This is an on-demand feature at present, we will have to contact Adobe for enabling this feature. But every licensed customer is expected to get an RDE each in couple of weeks from now and additional RDE is license based.

How do we enable it once RDEs are provisioned?
In the ‘Environments’ > Add Environment section, we have a new options called ‘Rapid Deployment’. Once you provide necessary details, we can see the new rapid deployment added under environment section.

Will RDE work for sandbox programs?
Yes, RDE works for sandbox programs as well as production programs

Few useful commands for RDEs (assuming we have a ‘sample aem wknd guides project’)

Install the 'all' package

  • aio aem:rde:install all/target/aem-guides-wknd.all-2.1.0-SNAPSHOT.zip


To deploy the OSGi bundle,

  • aio aem:rde:install target/aem-guides-wknd.core-2.1.0-SNAPSHOT.jar


OSGi configuration (Deploy individual config file)

  • aio aem:rde:install ui.config/src/main/content/jcr_root/apps/wknd/osgiconfig/config/org.apache.sling.commons.log.LogManager.factory.config~wknd.cfg.json


Deploy the complete config package

  • aio aem:rde:install target/aem-guides-wknd.ui.config-2.1.0-SNAPSHOT.zip


Install the 'dispatcher' zip

  • aio aem:rde:install dispatcher/target/aem-guides-wknd.dispatcher.cloud-2.1.0-SNAPSHOT.zip


Install component Dialog and related HTL files.

  • aio aem:rde:install target/aem-guides-wknd.ui.apps-2.1.0-SNAPSHOT.zip


Individual HTL file

  • aio aem:rde:install ui.apps/src/main/content/jcr_root/apps/wknd/components/helloworld/helloworld.html -t content-file -p /apps/wknd/components/helloworld/helloworld.html

where p is the path and t is the type.

Install a dialogue XML

  • aio aem:rde:install ui.apps/src/main/content/jcr_root/apps/wknd/components/helloworld/_cq_dialog/.content.xml -t content-xml -p /apps/wknd/components/helloworld/_cq_dialog/.content.xml


To list out all commands

  • aio aem:rde:install --help


There are additional RDE commands -

  • aio aem rde delete -  Delete bundles and configs from the current rde.
  • aio aem rde history - Get a list of the updates done to the current rde.
  • aio aem rde install  - Install/update bundles, configs, and content-packages.
  • aio aem rde reset   - Reset the RDE
  • aio aem rde restart  - Restart the author and publish of an RDE
  • aio aem rde status - Get a list of the bundles and configs deployed to the current rde.
  • aio where - To switch or know which organization you are currently logged in to


Summary:

Using RDE, a developer can test his features quickly and efficiently without waiting for a build & deployment pipeline.

AEM As Cloud Service Video Series