Showing posts with label aem. Show all posts
Showing posts with label aem. Show all posts

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


Wednesday 31 March 2021

Crx2Oak Migration tool Concepts and Demo

 Crx2Oak helps migrate data from older CQ versions based on Apache Jackrabbit 2 to Oak, and it can also be used to copy data between Oak repositories.


 

You may also read: AEM As A Cloud Video Tutorials

The tool can be used for:

  • Migrating from older CQ 5 versions to AEM 6
  • Copying data between multiple Oak repositories
  • Converting data between different Oak MicroKernel implementations. (S3DataStore to FileDataStore)


Some of its features are

  • The migration can be interrupted at any time, with the possibility to resume it afterwards.
  • Custom Java logic can also be implemented using CommitHooks.
  • CRX2Oak also supports memory mapped operations by default. Memory mapping greatly improves performance


Parameters
Node Store Options
--cache: Cache size in MB (default is 256)

--mmap: Enable memory mapped file access for Segment Store

--src-password: Password for the source RDB database

--src-user: User for the source RDB

--user: User for the targed RDB

--password: Password for the target RDB.

Version Store Options
--copy-orphaned-versions: Skips copying orphaned versions. Parameters supported are: true, false and yyyy-mm-dd. Defaults to true.

--copy-versions: Copies the version storage. Parameters: true, false, yyyy-mm-dd. Defaults to true.

WATCH THIS >> AEM AS CLOUD SERVICE VIDEO TUTORIAL SERIES

Path Options
--include-paths: Comma-separated list of paths to include during copy
--merge-paths: Comma-separated list of paths to merge during copy
--exclude-paths: Comma-separated list of paths to exclude during copy.


Source Blob Store Options
--src-datastore: The datastore directory to be used as a source FileDataStore

--src-fileblobstore: The datastore directory to be used as a source FileBlobStore

--src-s3datastore: The datastore directory to be used for the source S3DataStore

--src-s3config: The configuration file for the source S3DataStore.


Destination BlobStore Options
--datastore: The datastore directory to be used as a target FileDataStore

--fileblobstore: The datastore directory to be used as a target FileBlobStore

--s3datastore: The datastore directory to be used for the target S3DataStore

--s3config: The configuration file for the target S3DataStore.

Help Options
-?, -h, --help: Shows help information.

Debugging
--log-level TRACE or --log-level DEBUG 

Demo Video Series

Friday 14 December 2018

Create & Author Content Fragments in AEM

Previous post on this topic
How to create & Deploy a Progressive Web Application


Login to AEM, go to Assets > Files.
Let us create a folder now called 'My Samples' by clicking the create button.
Create CF Folder - click on it to see it big

Now go inside the folder and click on create > Content Fragment.

Then Select the Simple Fragment template. Enter title and description and then click on create.



Create Content Fragment AEM


In next dialog click on open and edit content fragment as shown below.

[Author CF]


To access the content fragment, we need to author it on a page. Let us author it on a sample we-retail page.

Now go to sites> we-retail > us >en > Men, open it for editing.

From component browser, drag and drop 'Content Fragment' component on the page.

[Author Content Fragment AEM 6.2 onwards


Click on Configure and add the newly created Content Fragment and save it.

[Authoring and landing]


We have the authored Content Fragment now. We can access it over the JSON Exporter API by invoking the '.model.json' in author instance, For me it was below URL.

http://localhost:4502/content/we-retail/us/en/men/jcr:content/root/responsivegrid/contentfragment.model.json

Note: This URL needs to be updated in file "retrieve_content_fragment.js" at line '$("button").click(function(){ $.ajax({url:'

The sample output is given below.


[AEM 6.4 Content Fragment Output]


Now Publish the page where Content Fragment is authored. So that all data is available in AEM Publish

Demo


Next post:
Integrate PWA & AEM and retrieve the AEM content from PWA.