14 Customizing BRM Cloud Native Services

Learn how to customize the Oracle Communications Billing and Revenue Management (BRM) server and clients in a cloud native environment to meet your business needs.

The Podman build commands in this chapter reference Dockerfile and related scripts as is from the oc-cn-docker-files-15.0.x.0.0.tgz package. Ensure you use your own version of Dockerfile and related scripts before running the build command.

Caution:

The Dockerfiles and related scripts are provided for reference only. You can refer to them to build or extend your own images. Support is restricted to core product issues only and no support will be provided for custom Dockerfiles and scripts.

Customizing BRM Server

You can customize BRM Server by layering the BRM cloud native image with a customized library file.

For example, you could extend the fm_subsciption_pol_custom.so library file and layer it with the BRM cloud native image by doing this:

  1. Customize your lib/fm_subscription_pol_custom.so library file as follows:

    1. Enable the BRM SDK by setting the following keys in your override-values.yaml file for oc-cn-helm-chart:

      brm_sdk:        
         isEnabled: true        
         deployment:             
            imageName: brm_sdk           
            imageTag: 15.0.x.0.0        
         pvc:
            storage: 50Mi
    2. Run the helm upgrade command to deploy the brm-sdk pod:

      helm upgrade BrmReleaseName oc-cn-helm-chart --values OverrideValuesFile -n BrmNameSpace
    3. Run the following kubectl command to retrieve the brm-sdk pod name:

      kubectl get pods -n BrmNameSpace | grep brm-sdk

      If successful, you should see something similar to this:

      NAME                       READY   STATUS    RESTARTS   AGE
      brm-sdk-f67b95777-bf8j5    1/1     Running   0          18m 
    4. Run the following kubectl command to retrieve the name of the PVC volume for brm-sdk:

      kubectl get pvc -n BrmNameSpace | grep brm-sdk

      If successful, you should see something similar to this:

      NAME      STATUS   VOLUME                                    CAPACITY   ACCESS MODES   STORAGECLASS   AGE
      brm-sdk   Bound    pvc-094feae0-4d11-4887-83a0-b47a0fc6a3f4  50Mi       RWX            myclass        23h
    5. List the files and folders in /mnt/oke_test/brm to verify that the PVC volume is present:

      ls /mnt/oke_test/brm/ | grep pvc-094feae0-4d11-4887-83a0-b47a0fc6a3f4

      If successful, you should see something similar to this:

      brm-sdk-pvc-094feae0-4d11-4887-83a0-b47a0fc6a3f4
    6. Do one of the following:

      • Copy the custom C file to the PVC:

        cp customFile nfsMountPath/BrmNameSpace/pvcVolumePath/

        For example:

        cp fm_cust_pol_valid_billinfo.c /mnt/oke_test/brm/brm-sdk-pvc-094feae0-4d11-4887-83a0-b47a0fc6a3f4/
      • Copy the custom C file to the oc-cn-helm-chart/brm_sdk_scripts/ directory and run the helm upgrade command:

        cp customFile  oc-cn-helm-chart/brm_sdk_scripts/ 
        helm upgrade BrmReleaseName oc-cn-helm-chart -n BrmNameSpace --values oc-cn-helm-chart/override_values.yaml

        For example:

        cp fm_cust_pol_valid_billinfo.c  oc-cn-helm-chart/brm_sdk_scripts/ 
        helm upgrade release oc-cn-helm-chart -n brm --values oc-cn-helm-chart/override_values.yaml

        The files from oc-cn-helm-chart/brm_sdk_scripts/ will be present at /oms/load in the brm-sdk pod.

    7. Run the kubectl command to get a shell to a running container:

      kubectl exec -n BrmNameSpace -it brmSDKPod bash

      For example:

      kubectl exec -n brm -it brm-sdk-f67b95777-bf8j5 bash
    8. Build your custom library file in one of these ways:

      • If you copied your custom C file to the PVC in step 1.f, do this:

        cd source/sys/libraryName
        cp /oms/ext/fileName .
        make

        For example:

        cd source/sys/fm_cust_pol/ 
        cp /oms/ext/fm_cust_pol_valid_billinfo.c .
        make 
      • If you copied your custom C file to oc-cn-helm-chart/brm_sdk_scripts/ in step 1.f, do this:

        cd source/sys/libraryName
        cp /oms/load/fileName .
        make

        For example:

        cd source/sys/fm_cust_pol/ 
        cp /oms/load/fm_cust_pol_valid_billinfo.c .
        make 
    9. Copy the generated library file to the PVC:

      cp customLibrary.so /oms/ext/

      For example:

      cp fm_cust_pol_custom.so /oms/ext/
    10. Copy the library file from the PVC to the $PIN_HOME/lib directory:

      cp nfsMountPath/BrmNameSpace/brmSDKPod/customLibrary.so $PIN_HOME/lib

      For example:

      cp /mnt/oke_test/brm/brm-sdk-pvc-094feae0-4d11-4887-83a0-b47a0fc6a3f4/fm_cust_pol_custom.so $PIN_HOME/lib
  2. Build the custom Connection Manager (CM) image using the Dockerfile:

    FROM cm:15.0.x.0.0
    USER root
    COPY lib/fm_subscription_pol_custom.so $PIN_HOME/lib/fm_subscription_pol_custom.so
    RUN chown -R omsuser:root $PIN_HOME/lib/fm_subscription_pol_custom.so && \
     chmod 755 ${PIN_HOME}/lib/fm_subscription_pol_custom.so
    USER omsuser
  3. Build the BRM Server image by entering this command:

    podman build --format docker --tag cm:imageTag --file Dockerfile_cm .
  4. Push the image to the image repository:

    podman tag cm:imageTag imageRepository/cm:imageTag 
    podman push imageRepository/cm:imageTag 
  5. Update the custom image name in the override-values.yaml file. For example:

    cm:     
       isEnabled: true    
       deployment:        
          replicaCount: 1        
          imageName: cm        
          imageTag: imageTag

    where imageTag must match the value used in step 4.

  6. Add the custom configuration for the CM pin.conf to the configmap_pin_conf_cm.yaml file.

    For example, for the fm_cust_pol_custom library:

    - cm fm_module ${PIN_HOME}/lib/fm_cust_pol_custom${LIBRARYEXTENSION} fm_cust_pol_custom_config fm_cust_pol_init pin
  7. Run the helm upgrade command to update the release with the new CM image:

    helm upgrade BrmReleaseName oc-cn-helm-chart -n BrmNameSpace --values oc-cn-helm-chart/override_values.yaml 

Customizing Billing Care

Extensibility is one of the biggest features of on-premise Billing Care, and this same extensibility is available in the Billing Care cloud native deployment. You can override the existing Billing Care behavior, such as changing labels and icons, add new flows and screens, and so on, by using the Billing Care SDK.

To use the Billing Care SDK in a cloud native environment, do this:

  1. Build the Billing Care SDK WAR the same way as described in "Packaging and Deploying Customizations" in Billing Care SDK Guide.

  2. Create a Billing Care SDK image by using the Linux image as a base.

  3. Update the override-values.yaml file to direct oc-cn-op-job-helm-chart to deploy the SDK WAR file and link it with Billing Care or the Billing Care REST API WAR after deploying them.

The cloud native package includes all of the scripts necessary to prepare and run an SDK image. For example, if your SDK WAR is named BillingCareCustomizations.war, you would build the Billing Care SDK image like this:

  1. Go to the oc-cn-docker-files/ocbc/billing_care_sdk directory.

  2. Copy the BillingCareCustomizations.war file to your current working directory (oc-cn-docker-files/ocbc/billing_care_sdk).

  3. Build the SDK image by entering this command:

    podman build --format docker --build-arg SDK_WAR=BillingCareCustomizations.war --tag oracle/billingcare_sdk:15.0.x.0.0  .
  4. In your override-values.yaml file for oc-cn-op-job-helm-chart, edit the keys shown in Table 14-1. This directs oc-cn-op-job-helm-chart to deploy the Billing Care SDK image rather than the Billing Care image and to include additional files that are needed for successful deployment of SDK.

    Table 14-1 Billing Care SDK Keys

    Key Path Description

    imageName

    ocbc.bc.deployment.sdk

    ocbc.bcws.deployment.sdk

    Set this to oracle/billingcare_sdk.

    This is the name of the image, which must be used for the billingcare pod.

    imageTag

    ocbc.bc.deployment.sdk

    ocbc.bcws.deployment.sdk

    Set this to 15.0.x.0.0.

    This tags the image used for the billingcare pod.

    isEnabled

    ocbc.bc.sdk

    ocbc.bcws.sdk

    Set this key to true if you want to deploy SDK.

    deployName

    ocbc.bc.sdk

    ocbc.bcws.sdk

    The name of the SDK Library in the Manifest.MF file. The default is BillingCareCustomizations.

  5. Install oc-cn-op-job-helm-chart followed by oc-cn-helm-chart to customize Billing Care or the Billing Care REST API with SDK.

Customizing ECE

You can customize the ECE image by layering the native image with the customized code.

For example:

 > cat Dockerfile_custom_ece
FROM oc-cn-ece:15.0.x.0.0
USER root
#commands that need to be run
USER eceuser

To build the image, run this Podman command:

podman build --format docker --tag customECE:15.0.x.0.0 --file customECEDockerfile .

where customECE is the name of your custom ECE Helm chart, and customECEDockerfile is the name of your custom Dockerfile.

For the Helm chart to take the new custom image for installation, set these keys in your override-values.yaml file for the ECE Helm chart:

imageRepository: "imageRepo:imagePort"
container:
   image: "customECEImageName"