3.5 Deploying Jobs

A job must be deployed to the Orchestration Server before that job can be run. Deployment to the server is done in either of the following ways:

3.5.1 Using the Orchestration Console to Deploy Jobs

  1. In the Actions menu, click Deploy Job.

3.5.2 Using the zosadmin Command Line Tool to Deploy Jobs

From the CLI, you can deploy a component file (.job, .jdl, .sar) or refer to a directory containing job components.

.job files are Java jar archives containing .jdl, .policy, .sched and any other files required by your job. A .sar file is a Java jar archive for containing multiple jobs and policies.

  1. To deploy a .job file from the command line, enter the following command:

    >zosadmin deploy <myjob>.job
    
  2. To deploy a job from a directory where the directory /jobs/myjob contains .jdl, .policy, .sched, and any other files required by your job, enter the following command:

    >zosadmin deploy /jobs/myjob
    

    Deploying from a directory is useful if you want to explode an existing job or .sar file and redeploy the job components without putting the job back together as a .job or .sar file.

  3. Copy the job file into the “hot” deploy directory by entering the following command:

    >cp <install dir>/examples/whoami.job <install dir>/deploy
    

As part of an iterative process, you can re-deploy a job from a file or a directory again after specified local changes are made to the job file. You can also undeploy a job out of the system if you are done with it. Use zosadmin redeploy and zosadmin undeploy to re-deploy and undeploy jobs, respectively.

A typical approach to designing, deploying, and running a job is as follows:

  1. Identify and outline the job tasks you want the Orchestration Server to perform.

  2. Use the preconfigured JDL files for specific tasks listed in Section B.0, Cloud Manager Orchestration Job Classes and JDL Syntax.

  3. To configure jobs, edit the JDL file with an external text editor.

  4. Repackage the job as a .jar file.

    NOTE:The job could also be packaged and sent as an “exploded” file.

  5. Run the zos CLI administration tool to redeploy the packaged job into the Orchestration Server.

  6. Run the job using the zos command line tool.

  7. Monitor the results of the job in the Orchestration Console.

Another method to deploy jobs is to edit JDL files through the Orchestration Console. The console has a text editor that enables you to make changes directly in the JDL file as it is stored on the server ready to deploy. After changes are made and the file is saved using the Orchestration Console, you simply re-run the job without redeploying it. The procedure is useful when you need to fix typos in the JDL file or have minor changes to make in the job functionality.

NOTE:Redeploying a job overwrites any job that has been previously saved on the Orchestration Server. The Orchestration Console has a Save File menu option if you want to preserve JDL modifications you made using the console.

There is no way “undo” a change to a .jdl file after the JDL editor in the Orchestration console has saved the file, nor is there a method for rolling back to a previously deployed version. We recommend that you use an external source code control system such as CVS or SVN for version control.