Expand my Community achievements bar.

SOLVED

Is there a way to run cq-quickstart-5.6.1-runMode-pPortNo.jar to stop after CQ is initialized for the first time?

Avatar

Level 7

I want to create a reusable VM image that contains a barebones CQ5 instance.

To do this, I have written a script to run cq-quickstart-5.6.1-author-p4502.jar, for example, and send curl requests to the login page of the instance till it responds with a 200 status code and then I execute ./stop to stop the container.

At this point I take a snapshot of the VM and I can reuse it or share it with my teammates afterwards.

Is there a better way to achieve this? Basically, is there a way to run cq-quickstart-5.6.1-author-p4502.jar as an installer that just installs CQ and then terminates the process?

If not, is it safe to assume that when CQ's login page returns with a 200 (20x) status code, if we execute ./stop, it won't leave the installation in an inconsistent state?

Thanks in advance.    

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Hi,

I understand. An option you would have would be to check the login page for the availability of the string "QUICKSTART_HOMEPAGE" in the login page. That's exactly the way the quickstart detects that the instance is up (when you have doubleclicked the JAR file).

Jörg

View solution in original post

9 Replies

Avatar

Former Community Member

We also use a VM image built specifically for Devs. The obvious reason is to ensure a consistent environment for everyone and eliminate 'it works on my machine' time wasting. It also helps us re-enforce our development process (mostly 'test first') and the tool-chain. So our build is perhaps a little more expansive than what you have described since it includes not only AEM (including any patches we have applied to our production servers and all of our custom OSGI bundles and other standard AEM artefacts) but also eClipse, Maven, Java JDK, Git, Mocking framework, test framework, and a bunch of other standard utility software. We have also standardised our maven archetypes and POMs.

Anyway back to your question, I am responsible for maintaining a master image. Devs just need a copy of the player (and a sufficiently powerful machine to host the image).

Recently I have been looking at some alternatives both for creating the image and hosting. For example, another area of the company I work for use a combination of Vagrant, Puppet and Virtual Box. I have also begun some research into AWS Workspaces, especially with off-shore resource in mind.

HTHs

Fraser.

Avatar

Employee Advisor

Why can't you just put the quickstart file to the image and then let the developer do the "first doubleclick"? Anyways, you can start the quickstart.jar with the "-unpack" parameter, and then the basic filesystem structure is created, including a start script. But still the repository itself is not created.

Jörg

Avatar

Level 7

Hi Jorg,

Running the quickstart.jar for the first time is a lengthy process. On an SSD-powered machine it can take up to 5 minutes. On an HDD-powered machine it can take up to 15 minutes or more.

If a developer didn't have to do this more than once, I could have created an image with an uninitialized filesystem structure/repository and expect developers to wait 15 minutes for the first run. But there are times when a developer needs to delete everything in the repository and start from scratch. Having an image that has a base state with a clean and initialized repository can help in circumstances like this.

By the way, is there a way to query a CQ 5 instance to see its repository state (initializing, initialized, etc.)?

Thanks.

Avatar

Former Community Member

> But there are >times when a developer needs to delete everything in the repository and start from scratch.

Why is that a problem ?

Surely you can create a master install and just save that (as a zip if you want to) that a dev can just copy to their machine (virtual or otherwise) having first deleted the one that they no longer need.

Fraser.

Avatar

Employee Advisor

Hi,

I wonder,  if a developer has screwed up his personal AEM installation, does he really start again with copying a master image from a central server? I don't know if this is a time saver at all then (well, depends on the copy performance), especially if you think of the preparation time you as master of this golden image have with.

Jörg

Avatar

Level 7

Hi Jorg,

I had simplified the scenario for this question. But rather than a VM, we are using Docker. And as such there's no need for developers to download the image over and over again. Even with a VM, Vagrant, etc. it was unnecessary to that though.

Basically it is possible to create a snapshot of the VM/Docker Container with a clean installation of CQ and revert back to it and start it up quickly.

Avatar

Former Community Member

Jörg Hoh wrote...

Hi,

I wonder,  if a developer has screwed up his personal AEM installation, does he really start again with copying a master image from a central server? I don't know if this is a time saver at all then (well, depends on the copy performance), especially if you think of the preparation time you as master of this golden image have with.

Jörg

 

If all a Dev needs is a new AEM install (already expanded) then there is no need to copy a complete image with all the other tooling and config. In fact in most cases you wouldn't want to do that. It's just a case of the granularity of the images available and whether to offer individual parts that commonly need to be replaced. The AEM install is only a few GBs so unless you have an incredibly slow network that wouldn't take more than a couple of minutes (and if you do, offer it on physical media). As far as the time taken to create a fully configured 'golden image', yes indeed it does take a while, but that's the whole point, ... you do it once and the whole of your dev community benefits.

As I said earlier, using a combination of Vagrant, Puppet and Vortial Box can be effective as can Docker. Be aware that Docker isn't a direct VM Replacement in all cases.

Fraser.

Avatar

Correct answer by
Employee Advisor

Hi,

I understand. An option you would have would be to check the login page for the availability of the string "QUICKSTART_HOMEPAGE" in the login page. That's exactly the way the quickstart detects that the instance is up (when you have doubleclicked the JAR file).

Jörg

Avatar

Level 7

Hi Jorg,

How does quickstart detect readiness of the publisher instance?

Thanks.