Skip to content

Batch jobs

There are two styles of submitting batch jobs, depending on whether the source program being submitted is available to the workers or needs to be copied into Altair SLC Hub.

The hubcli job runpgm command is used when the source program (SAS language file, bash script etc) is in a directory available to the Altair SLC Hub workers. The hubcli application does not read the contents of the file. This command takes the path of the file, and that path string is passed to the chosen worker. The worker receives the path string and will open the specified file; the path needs to have meaning to the worker.

The specified file path is not required to be available to the hubcli tool. This means the tool cannot verify the file content or the file's existence. When identifying a file, you should specify the absolute path for the file. You should not specify the file location using a relative path to the current directory where the hubcli is running. The relative path string is unlikely to have any meaning to the worker node.

The hubcli job submitpgm command is used when the source program is not in a directory available to the Altair SLC Hub workers. When this command is run, the hubcli tool opens and reads the content of the specified file and the contents of the file are passed to the worker to run. In this style of execution, the source program has to be available to the hubcli tool, and the location of the file can be specified as a relative path if desired.

Namespaces and Execution Profiles

To submit a batch program it is necessary to specify a namespace and an execution profile to the hubcli command.

  • A namespace can be specified using the --namespace argument. Alternatively, a default namespace for the current connection can be set using the hubcli namespace use command.

  • An execution profile can be specified using the --execution-profile argument. Alternatively, a default namespace can be set using the hubcli exprof use command.

The specified defaults are used for future hubcli commands that require a namespace or execution profile on a per-connection basis. Default namespace for one connection can be different to the default namespace for another connection. Specified default values the user's ~/.hubcli/config.yaml file.

Running Altair SLC Hub Package Programs

A program can be run from an Altair SLC Hub package that has been authored in Altair Analytics Workbench and uploaded into Altair SLC Hub. This can be done with the hubcli job runpkg command.

There is no requirement for the package to be deployed to use the hubcli job runpkg command, only that the package has been uploaded to Altair SLC Hub.

If you specify the --program parameter to invoke a program from an Altair SLC Hub package, you should use the API entry point for the program not the path to the source file within the package

For example, the following shows the editor for a program in Altair Analytics Workbench.

Image

The name of the source file in the package is Program1.sas. The value required for the --program parameter is the value of the "Program path" field, in this example, the path is examples/example1. The command to invoke this program using the hubcli command is:

hubcli job runpkg --program examples/example1 [other required parameters]

Other required parameters for this program include the repository, group, name, and version arguments.

Batch job monitoring

After job submission, the hubcli command can be used to monitor the progress of batch jobs. For example:

  • hubcli job list. Used to list all the batch jobs that have been submitted.
    This command will also show the job ID, which is needed for many of the other hubcli job commands.
  • hubcli job status. Used to get the status of a specific job.
  • hubcli job log. Used to get the log of a specific job.
  • hubcli job download. Used to get the results of a specific job.