Discussion

153
Views
Kaustav Dutta (DUTTAK01)
Wipro Digital
Senior Architect
Wipro Digital
AU
DUTTAK01 Member since 2007 11 posts
Wipro Digital
Posted: July 19, 2021
Last activity: 2 days 19 hours ago
Posted: 19 Jul 2021 8:32 EDT
Last activity: 15 Sep 2021 19:27 EDT

Setting up Pega Cosmos React UI on Pega Personal Edition 8.6

Well ever since Pega 8.6 came out I have been inkling to try out the Cosmos React UI . There were probably 2 main options which came to my mind

  1. Use the cloud instances from Pega Academy
  2. Set up "Cosmos React UI" to work in Pega Personal Edition

Option #1 was probably the easy way out , but there's nothing like a little bit of tinkering in personal edition to truly understand what's going on under the hood . So in this discussion i'll describe what I did to get this working and hopefully it helps someone else .

So first things first the prerequisites 

  1. Install Pega Personal Edition the usual way nothing fancy , jsut check that it's working and shut it down
  2. Install Docker. If you use windows then you could use Docker Desktop, follow the article Install Docker Desktop on Windows | Docker Documentation, it's really easy. Just make sure you follow all the steps specifically the one regarding WSL 2 feature on Windows.
  3. Download an install Open SSL (will be used for working with SSL Certs) 
  4. Check that docker is working fine , I just used a the following command in powershell / command prompt and then navigate to localhost:8011
     docker run -d -p 8011:80 docker/getting-started
  5. Stop the Container
     docker ps
    
    -- copy the container ID from the output
    
    docker stop <container ID>
  6. Request pega platform image access key. This can generally be raised from Digital Delivery | Pega . and you'd receive a email with the access key. Some people may run into issues with this step since access to the key is based on the license agreement your organization has with Pega. If you do run into issues getting the key then talk to your organization's Pega Account Executive.  

Now to Setup

  1. Generate a SSL certificate , I used a self signed cert since this is just for personal use , the following command can be used from Powershell 
    keytool -genkey -keyalg RSA -noprompt -alias tomcat -dname "CN=localhost, OU=NA, O=NA, L=NA, S=NA, C=NA" -keystore C:\certs\pegalocalkeystore.jks -validity 9999 -storepass changeme -keypass changeme
  2. Then generate the .cert and .key file , run the following form Powershell 

    keytool -importkeystore -srckeystore C:\certs\pegalocalkeystore.jks -destkeystore C:\certs\pegalocalkeystore.p12 -deststoretype PKCS12
    
    - Run the following commands from the folder where Open SSL is installed and use the appropriate folder in place of C:\certs\ 
    
    .\openssl pkcs12 -in C:\certs\pegalocalkeystore.p12 -nokeys -out C:\certs\pegalocal.crt
    
    .\openssl pkcs12 -in C:\certs\pegalocalkeystore.p12 -nocerts -nodes -out C:\certs\pegalocal.key
  3. Install Constellation engine by following Installing Constellation by using Docker | Pega , here's the command I ran in Powershell 

    docker login pega-docker.downloads.pega.com/constellationui/service:8.6.0-rc-latest
    
    -- Enter the user name and key received in the email (prerequisite step 6) if prompted
    
    docker run -p 3443:3443 -v C:\certs:/host_folder --name constellation-service pega-docker.downloads.pega.com/constellationui/service:8.6.0-rc-latest port=3443 urlPath=/constellation httpsKey=pegalocal.key httpsCert=pegalocal.crt logLevel=info
    

     

  4. Enable SSL for Tomcat used by Pega Personal Edition by updating the server.xml file , I just used the nio implementation , snippet below.

     <Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
                   maxThreads="150" SSLEnabled="true">
            <SSLHostConfig>
                <Certificate certificateKeystoreFile="C:/certs/pegalocalkeystore.jks" 
    						 certificateKeystorePassword="changeme" 
                             type="RSA" />
            </SSLHostConfig>
        </Connector>

     

  5. Import the certificate file C:\pegalocal.crt in JRE keystore (cacerts) used by Tomcat (look in <Personal Edition Folder>\jre1.8.XXXX\lib\security) 

  6. Start Personal Edition and set the DSS ConstellationSvcURL to https://localhost:3443/constellation

And that's it , all set to create the first Pega Cosmos React app.

Pega Platform 8.6.1 User Experience Developer Knowledge Share