Skip to content

anonim-01/flexcube-14.5

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Deploying Flexcube in OCI OKE with ORACLE VISUAL BUILDER STUDIO

This document will show how to:

  • Deploy quickly a Flexcube Image
  • Create a Container Flexcube Image
  • Create a DevOps build and deploy Flexcube inside a Kubernetes Cluster

Layers for Containerization:

  • Fusion
  • Flexcube
  • WebLogic Configuration
  • Database Configuration
  • Flexcube Servers

For manual deployment (Simple way)

This is the rapid way to deploy the Flexcube (fcubs) in your cluster. Attention for the CPU and Memory pre-requisites:

8 OCPUs
64Gb RAM

Execute the YAML integrated145.yaml to start a Flexcube Weblogic instance on the cluster. If you want to clusterize your instances, you have to do it manually.

If you already have a Pod/Deployment:

kubectl delete deployment integrated145-deployment

------

Or if you want to create a new Deployment:

kubectl apply -f integrated145.yaml

Remember: Change the JDBC parameters inside integrated145.yaml

Building Flexcube Docker Image

You can build a customized image of Flexcube, but you can use this image on my repository:
    
gru.ocir.io/idvkxij5qkne/oraclefmw-infra:12.2.1.4.0_jdk8u281_pt34080315_apr22

Here I explain how to make your Flexcube base image in docker. First, we need to use a Fusion Image. There is a Fusion image on my repository. Execute the docker run to start the process:

sudo docker run --name integrated145 -h "fcubs.oracle.com" -p 7001-7020:7001-7020 -it "gru.ocir.io/idvkxij5qkne/oraclefmw-infra:12.2.1.4.0_jdk8u281_pt34080315_apr22" /bin/bash

flexcube.sh

This step loads the Flexcube kernel inside the Fusion image. This bash script do the job. All the scripts necessary to execute the process is inside this project:

flexcube.sh file:

yum install unzip -y
yum install wget -y
su - gsh
cd /
wget https://objectstorage.ap-mumbai-1.oraclecloud.com/p/XTl-V6bdphhbdUnf3hk0ut6xG247GcLrjqKxK8tN9TqL9w3QeYCanz2aKO1dz2Wu/n/ids3optpuczi/b/IB14.5/o/Integrated145/Product_Processor/kernel145_17Nov21.zip
unzip -o kernel145_17Nov21.zip -d /
cd /scratch/gsh/kernel145/user_projects/domains/integrated/bin

Merge Fusion Docker Image with Flexcube

Now, we need to start the image to configure and finalize the Flexcube image:

Execute docker image with:
sudo docker start integrated145    

Then execute:

sudo docker cp flexcube.sh integrated145:/

sudo docker exec integrated145 /bin/bash -c "sh /flexcube.sh"

Let's run the Weblogic Admin instance with:

sudo docker exec integrated145 /bin/bash -c "sh /scratch/gsh/kernel145/user_projects/domains/integrated/bin/startNodeManager.sh &"

sudo docker exec integrated145 /bin/bash -c "sh /scratch/gsh/kernel145/user_projects/domains/integrated/bin/startWebLogic.sh &"

Go to Weblogic Admin Server and change machine-1 Listen Address:

http://<your docker IP>:7001/console

if you mount your image locally, you can access the Admin Manager with:
http://0.0.0.0:7001/console

Now, you need to configure the Listen Address:

1. Go to Environment (left side of the menu)
2. Go to Machines
3. Select Machine-1
4. Select Configuration and Node Manager
5. Put "fcubs.oracle.com" in the Listen Address 
6. Save the configuration and Apply the update

weblogic-machine-1.png

And for push the docker image to OCIR:

sudo docker stop integrated145

sudo docker commit integrated145 flexcube/integrated145:v1
sudo docker tag flexcube/integrated145:v1 iad.ocir.io/id3kyspkytmr/flexcube/integrated145:v1
sudo docker push iad.ocir.io/id3kyspkytmr/flexcube/integrated145:v1

The Flexcube team needs to build the image with:

Fusion Middleware
Flexcube (/scratch/gsh/...)

Remember the URL of your new Flexcube image and update the YAML file named integrated145.yaml and integrated145-devops.yaml files. IT'S IMPORTANT!!!!

Automating the deployment for OKE (DevOps)

Change Database Password to AES format with weblogic.security.Encrypt

First we need to get the database (a template backup of an Oracle Database for the Flexcube) password. The password original will not work inside the scripts for this automation. The password needs to be converted in AES format, so you need to use the setWLSEnv.sh script to get your passsword into this format:

cd /scratch/gsh/oracle/wlserver/server/bin
.  ./setWLSEnv.sh
java -Dweblogic.RootDirectory=/scratch/gsh/kernel145/user_projects/domains/integrated  weblogic.security.Encrypt <Database Password>

Environment Variables

The DevOps process needs only these 2 parameters to run Flexcube inside a Kubernetes Cluster:

$JDBCPassword: {AES256}7kfaltdnEBjKNq.......RIU0IcLOynq1ee8Ib8=     (In AES format*)
$JDBCString: <JDBC Connection String>

DevOps Configuration

This is the DevOps shell script to prepare a Flexcube Image and make it work for use. This can be used in Jenkins or Oracle Visual Builder Studio

OCI CLI Install
Unix Shell

#  Prepare for kubectl from OCI CLI
mkdir -p $HOME/.kube
oci ce cluster create-kubeconfig --cluster-id ocid1.cluster.oc1.iad.aaaaaaaaae3tmyldgbtgmyjrmyzdeytbhazdmmbrgfstmntdgc2wmzrxgbrt --file $HOME/.kube/config --region us-ashburn-1 --token-version 2.0.0
export KUBECONFIG=$HOME/.kube/config
# Set Variables
export JDBCString=$JDBCString
export JDBCPassword=$JDBCPassword
# setup the JDBC variables in integrated145-devops.yaml
sed -i "s~--JDBCString--~$JDBCString~g" integrated145-devops.yaml
sed -i "s~--JDBCPassword--~$JDBCPassword~g" integrated145-devops.yaml
# Deploy integrated145
kubectl config view
kubectl replace -f integrated145-devops.yaml --force

You can configure your Build Pipeline in Oracle Visual Builder Studio like this:

Git Configuration: vbst-git-config.png

Parameters Configuration: vbst-config-parameters.png

Steps Configuration vbst-steps-config.png

YAML file for deploy the Flexcube Image into the Kubernetes Cluster

This is the file responsible for deploy your Flexcube image into Kubernetes Cluster. The configuration file replaces the $JDBCString and $JDBCPassword environment variables before execution. The scripts inside this projects will configure your Weblogic instance with all parameters.

Deployment YAML (integrated145-devops.yaml)

---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: flexcubeclaim
spec:
  accessModes:
    - ReadWriteOnce
  storageClassName: oci
  resources:
    requests:
      storage: 500Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: integrated145-deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      app: integrated145
  template:
    metadata:
      labels:
        app: integrated145
    spec:
      hostname: integrated145
      hostAliases:
      - ip: "127.0.0.1"
        hostnames:
        - "fcubs.oracle.com"
      containers:
      - name: integrated145
        image: gru.ocir.io/idvkxij5qkne/oraclefmw-infra:12.2.1.4.0_jdk8u281_pt34080315_apr22
        command: [ "/bin/sh", "-c"]
        args:
          [ "sleep 180; su - gsh ; cd /; yum -y install wget; wget https://objectstorage.us-ashburn-1.oraclecloud.com/p/dX80UuetlAvWOEbvQNMBv47H3ZPR-zZHJJmTsu_GQ66icfgFaPSSu_97j8q3Fyrp/n/idcci5ks1puo/b/flexcubeBucketNewVersion/o/initializeConfig.sh; yum -y install unzip; sh initializeConfig.sh $(JDBCSTRING) $(JDBCPASSWORD); while true; do sleep 30; done;" ]
        ports:
        - name: port7001
          containerPort: 7001
        - name: port7002
          containerPort: 7002
        - name: port7003
          containerPort: 7003
        - name: port7004
          containerPort: 7004
        - name: port7005
          containerPort: 7005
        - name: port7006
          containerPort: 7006
        - name: port7007
          containerPort: 7007
        - name: port7008
          containerPort: 7008
        - name: port7009
          containerPort: 7009
        - name: port7010
          containerPort: 7010
        - name: port7011
          containerPort: 7011
        - name: port7012
          containerPort: 7012
        - name: port7013
          containerPort: 7013
        - name: port7014
          containerPort: 7014
        - name: port7015
          containerPort: 7015
        - name: port7016
          containerPort: 7016
        - name: port7017
          containerPort: 7017
        - name: port7018
          containerPort: 7018
        - name: port7019
          containerPort: 7019
        - name: port7020
          containerPort: 7020
        - name: port5556
          containerPort: 5556
#        livenessProbe:
#          httpGet:
#            path: /console
#            port: 7001
#          initialDelaySeconds: 3000
#          timeoutSeconds: 30
#          periodSeconds: 300
#          failureThreshold: 3
        volumeMounts:
          - name: data
            mountPath: /scratch/gsh/kernel145
            readOnly: false
        resources:
          requests:
            cpu: "5"
            memory: "36Gi"
            #ephemeral-storage: "500Gi"
          limits:
            cpu: "8"
            memory: "64Gi"
            #ephemeral-storage: "500Gi"
#      restartPolicy: Always
      volumes:
        - name: data
          persistentVolumeClaim:
            claimName: flexcubeclaim
      imagePullSecrets:
      - name: ocirsecret
---
apiVersion: v1
kind: Service
metadata:
  name: integrated145-service
  labels:
    app: integrated145
  annotations:
    service.beta.kubernetes.io/oci-load-balancer-internal: "true"
    service.beta.kubernetes.io/oci-load-balancer-shape: "100Mbps"
    service.beta.kubernetes.io/oci-load-balancer-subnet1: "ocid1.subnet.oc1.sa-saopaulo-1.aaaaaaaay4rjx6d5o6nwqehxusgwrig43xie7lw25fhmzjyrza"
spec:
  selector:
    app: integrated145
  ports:
    - port: 7004
      targetPort: 7004
  type: LoadBalancer
---
apiVersion: v1
kind: Service
metadata:
  name: integrated145-service-weblogic
  labels:
    app: integrated145
  annotations:
    service.beta.kubernetes.io/oci-load-balancer-internal: "true"
    service.beta.kubernetes.io/oci-load-balancer-shape: "100Mbps"
    service.beta.kubernetes.io/oci-load-balancer-subnet1: "ocid1.subnet.oc1.sa-saopaulo-1.aaaaaaaay4rjx6d5o6nwqehxusgwrig432x7lw25fhmzjyrza"
spec:
  selector:
    app: integrated145
  ports:
    - port: 7001
      targetPort: 7001
  type: LoadBalancer
---
apiVersion: v1
kind: Service
metadata:
  name: integrated145-webservices
  labels:
    app: integrated145
  annotations:
    service.beta.kubernetes.io/oci-load-balancer-internal: "true"
    service.beta.kubernetes.io/oci-load-balancer-shape: "100Mbps"
    service.beta.kubernetes.io/oci-load-balancer-subnet1: "ocid1.subnet.oc1.sa-saopaulo-1.aaaaaaaay4rjx6d5o6nwqehxusgwrie7lw25fhmzjyrza"
spec:
  selector:
    app: integrated145
  ports:
    - port: 7005
      targetPort: 7005
  type: LoadBalancer
---
apiVersion: v1
kind: Service
metadata:
  name: integrated145-webservices2
  labels:
    app: integrated145
  annotations:
    service.beta.kubernetes.io/oci-load-balancer-internal: "true"
    service.beta.kubernetes.io/oci-load-balancer-shape: "100Mbps"
    service.beta.kubernetes.io/oci-load-balancer-subnet1: "ocid1.subnet.oc1.sa-saopaulo-1.aaaaaaaay4rjx6d5o6nwqehxusgwrig432xzek5dbojxie7lw25fhmzjyrza"
spec:
  selector:
    app: integrated145
  ports:
    - port: 7009
      targetPort: 7009
  type: LoadBalancer

Resilience

The Flexcube deployment is resilient, so if the Weblogic or Flexcube falls down, the Kubernetes Cluster will load and execute again. The responsible for this is the livenessprobe inside the integrated145-devops.yaml file.

Manage the Weblogic manually

If you want to start or stop WebLogic, you can execute these commands.

Execute WebLogic

kubectl exec $(kubectl get pod -l app=integrated145 -o jsonpath="{.items[0].metadata.name}") -- /bin/bash -c "sh /scratch/gsh/kernel145/user_projects/domains/integrated/bin/startNodeManager.sh &"

kubectl exec $(kubectl get pod -l app=integrated145 -o jsonpath="{.items[0].metadata.name}") -- /bin/bash -c "sh /scratch/gsh/kernel145/user_projects/domains/integrated/bin/startWebLogic.sh &"

Stop WebLogic

kubectl exec $(kubectl get pod -l app=integrated145 -o jsonpath="{.items[0].metadata.name}") -- /bin/bash -c "sh /scratch/gsh/kernel145/user_projects/domains/integrated/bin/stopNodeManager.sh &"

kubectl exec $(kubectl get pod -l app=integrated145 -o jsonpath="{.items[0].metadata.name}") -- /bin/bash -c "sh /scratch/gsh/kernel145/user_projects/domains/integrated/bin/stopWebLogic.sh &"

The scripts inside this project

These are the scripts responsible for automate the deployment, configuration and execution of the Flexcube instance

Changing Database Passwords in JDBC Configuration

These scripts change the configuration of all JDBC XML files inside the Weblogic. The environmental variables $JDBCString and $JDBCPassword will be used here

domainsDetails.properties

ds.jdbc.new.1=jdbc:oracle:thin:@xxx.xxx.xxx.xxx:1521/DBSTRING.subnet04...815.vcn04...815.oraclevcn.com
ds.password.new.1={AES256}7kfaltdnEBjKNqdH..............ynq1ee8Ib8=

ChangeJDBC.py

from java.io import FileInputStream

propInputStream = FileInputStream("/domainsDetails.properties")
configProps = Properties()
configProps.load(propInputStream)

for i in 1,1:
    newJDBCString = configProps.get("ds.jdbc.new."+ str(i))
    newDSPassword = configProps.get("ds.password.new."+ str(i))
    i = i + 1

    print("*** Trying to Connect.... *****")
    connect('weblogic','weblogic123','t3://localhost:7001')
    print("*** Connected *****")
    cd('/Servers/AdminServer')
    edit()
    startEdit()
    cd('JDBCSystemResources')
    pwd()
    ls()
    allDS=cmo.getJDBCSystemResources()
    for tmpDS in allDS:
               dsName=tmpDS.getName();
               print 'DataSource Name: ', dsName
               print ' '
               print ' '
               print 'Changing Password & URL for DataSource ', dsName
               cd('/JDBCSystemResources/'+dsName+'/JDBCResource/'+dsName+'/JDBCDriverParams/'+dsName)
               print('/JDBCSystemResources/'+dsName+'/JDBCResource/'+dsName+'/JDBCDriverParams/'+dsName)
               set('PasswordEncrypted', newDSPassword)
               cd('/JDBCSystemResources/'+dsName+'/JDBCResource/'+dsName+'/JDBCDriverParams/'+dsName)
               set('Url',newJDBCString)
               print("*** CONGRATES !!! Username & Password has been Changed for DataSource: ", dsName)
               print ('')
               print ('')

save()
activate()

Important: The JDBC configuration files for the Flexcube is on /scratch/gsh/kernel145/user_projects/domains/integrated/config/jdbc

ChangeJDBC.sh

cd /scratch/gsh/oracle/wlserver/server/bin
.  ./setWLSEnv.sh
java weblogic.WLST /ChangeJDBC.py

JDBCReplace.sh

#!/bin/bash
su - gsh
filename=$1
while read line; do
# reading each line
echo $line
sed -i 's/<url>jdbc:oracle:thin:@whf00fxh.in.oracle.com:1521\/prodpdb<\/url>/<url>$JDBCString<\/url>/' /scratch/gsh/kernel145/user_projects/domains/integrated/config/jdbc/$line
sed -i 's/<password-encrypted><\/password-encrypted>/<password-encrypted>$JDBCPassword<\/password-encrypted>/' /scratch/gsh/kernel145/user_projects/domains/integrated/config/jdbc/$line
done < $filename

JDBCList

FLEXTEST2eMDB-9656-jdbc.xml
jdbc2ffcelcmDS-6351-jdbc.xml
jdbc2ffcjdevDSBranch-1885-jdbc.xml
jdbc2ffcjdevDS_EL-0091-jdbc.xml
jdbc2ffcjpmDS_GTXN-9747-jdbc.xml
FLEXTEST2eWORLD-1247-jdbc.xml
jdbc2ffcjDevXADS-7492-jdbc.xml
jdbc2ffcjdevDSSMS-8814-jdbc.xml
jdbc2ffcjdevDS_GTXN-7273-jdbc.xml
jdbc2ffcjsmsDS-7727-jdbc.xml
jdbc2fINT145_integrated145-0549-jdbc.xml
jdbc2ffcjSchedulerDS-6833-jdbc.xml
jdbc2ffcjdevDSSMS_XA-5306-jdbc.xml
jdbc2ffcjdevDS_XA-0669-jdbc.xml
jdbc2fODT14_4-1795-jdbc.xml
jdbc2ffcjdevDS-9467-jdbc.xml
jdbc2ffcjdevDS_ASYNC-6792-jdbc.xml
jdbc2ffcjpmDS-1925-jdbc.xml

Starting NodeManager and WebLogic

These scripts start the Weblogic Admin, Node Manager and the application (Flexcube) and are used in the automation in the deployment YAML file

ExecuteWebLogic.sh

cd /
su - gsh
cd /scratch/gsh/kernel145/user_projects/domains/integrated/bin
sh /scratch/gsh/kernel145/user_projects/domains/integrated/bin/startNodeManager.sh &
sh /scratch/gsh/kernel145/user_projects/domains/integrated/bin/startWebLogic.sh &

StartApps.py

from java.io import FileInputStream

print("*** Trying to Connect.... *****")
connect('weblogic','weblogic123','t3://localhost:7001')
print("*** Connected *****")

start('gateway_server')
start('rest_server')
start('integrated_server')

disconnect()
exit()

StartApps.sh

cd /scratch/gsh/oracle/wlserver/server/bin
.  ./setWLSEnv.sh
java weblogic.WLST /StartApps.py

RestartFlexcube.sh

cd /
sh ExecuteWebLogic.sh
sleep 180
cd /
sh StartApps.sh

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PLSQL 99.8%
  • Other 0.2%