ESP dSeries Workload Automation

 View Only

  • 1.  Using a POJO Job to Run a Script on Kubernetes

    Posted Feb 19, 2025 04:44 PM

    Hello all,

    We have a team that is wanting to use dSeries (version 12.4) in combination with Kubernetes to run their nightly batch jobs. We have the Kubernetes agents installed and everything setup on the backend we believe, but we are hitting a wall when setting up jobs in dSeries. Reading through the documentation, we landed on using a POJO job to achieve our goal however we have been unable to even get the most basic of "Hello world" scripts to work properly. Unfortunately the Broadcom documentation has been less helpful than we wanted. And so I am hoping to discuss with others. To if anyone else has done this or something similar before. Any advice or examples of how you set up the job would be appreciated.

    -Nick



  • 2.  RE: Using a POJO Job to Run a Script on Kubernetes

    Broadcom Employee
    Posted Feb 20, 2025 01:12 AM

    Hi,

    Thank you for your interest in the Kubernetes plugin extension. Can you please let me know if you got a chance to look at the methods that you can use to execute commands in pods - https://techdocs.broadcom.com/us/en/ca-enterprise-software/intelligent-automation/workload-automation-plugin-extensions/GA/workload-automation-agent-plugin-extension/openshift-plugin-extension/kubernetes-openshift-methods.html#:~:text=will%20be%20executed.-,Execute,-Command%20in%20Pods .

    I use the below sample example - 

    J2EE POJO Job: OpenShift_ExecuteCommand_CRED_working
    Class Name: com.ca.cloud.oc.OpenShift
    Method Name: executeCommand
    Method Parameters
    • Parameter Value:
      Type = String
      Value = %OPEN_SHIFT_BASE_URL_1

    • Parameter Value:
      Type = String
      Value = %OPEN_SHIFT_USER_NAME

    • Parameter Value:
      Type = String
      Value = %PASSWORD

    • Parameter Value:
      Type = String
      Value = %namespace 

    • Parameter Value:
      Type = String
      Value =

    • Parameter Value:
      Type = String
      Value = app=nginx

    • Parameter Value:
      Type = String
      Value = ls /

    • Parameter Value:
      Type = String
      Value = %PROXY_HOST

    • Parameter Value:
      Type = String
      Value = %PROXY_PORT

    • Parameter Value:
      Type = String
      Value = %PROXY_USER

    • Parameter Value:
      Type = String
      Value = %PROXY_PASSWORD

    • Parameter Value:
      Type = Integer
      Value = 32

    • Parameter Value:
      Type = int
      Value = 3

    Run the job on request: false
    Run the job on hold: false
    Critical Job: false
    Release counter: 0
    Retry count: 0
    Interval in minutes: 0
    Wait for previous generation of subApplication: false



  • 3.  RE: Using a POJO Job to Run a Script on Kubernetes

    Posted Mar 31, 2025 11:06 AM

    Attempting this post again as I think my previous attempt didn't go through.

    So after reading through the above reply and the documentation link that was provided, that gave us enough information to be able to set up a job in dSeries that utilizes a script which lives in a github repository. It was a very simple "Hello World" level script which executed successfully so we made great progress on that front (thanks for the information Ravi!).

    However we hit a new problem when testing/experimenting with job failures in order to see how dSeries reacts to the script encountering an issue. Using the successful script, we changed it so that it would force an exit code of 04. Our hopes being that this would then report back to dSeries and fail the job with an exit code of 04. However instead what happened is that the job on dSeries stayed in an executing state up until finally failing with an exit code of 01, status "Execution of monitorJob has failed". Looking through the spool logs, it seems that the job failed due to "BackoffLimitExceeded" which leads me to think that the script attempted to run itself multiple times until it reached a pre-programmed limit and then sent back to dSeries that the job failed (with an 01). This is not ideal at all because we use the exit codes from the job failing in order to send out notifications in dSeries depending on the specific job (some require a developer to be paged while others simply get added to a daily report and are reviewed on the next business day). While it's possible for us to work around this issue internally in each job's script, we would prefer to avoid this if possible. And so we are now looking for any advice on how to make it so that when a job fails on Kubernetes that it sends back the appropriate exit code and dSeries reflects this appropriately.

    -Nick W.




  • 4.  RE: Using a POJO Job to Run a Script on Kubernetes

    Broadcom Employee
    Posted Apr 01, 2025 12:58 AM

    Thank you for the update. 

    Can you please raise a support case/ticket to understand what the script does and to know why job fails with exit 01 . We will need to investigate it a bit.