SAS Viya Workload Orchestrator CLI Plug-in

This post was kindly contributed by SAS Users - go there to comment and to read the full post.

A key tool for SAS Viya admins and many users is the command line interface (CLI). You can think of it in terms of other CLIs, but with direct access to SAS Viya. The CLI facilitates automation of tasks as well as other administrative functions. You can find information about installing the CLI and its plugins in the SAS documentation and through this SAS Users YouTube tutorial.

The workload-orchestrator plug-in, provides a wealth of information about your SAS Viya Workload Management Environment. SAS Viya Workload Management was developed by SAS, starting with the cloud-native version of SAS Viya and relies on Kubernetes. Kubernetes comes with capabilities to balance workload of jobs; however, SAS Viya Workload Orchestrator is designed to enhance Kubernetes’ workload capabilities by adding prioritization for jobs, queues management, etc.

Now, I am predicting you know what a plug-in is but just in case you don’t, a plug-in manages and monitors the service for which you are seeking or providing information. Before you use you any SAS Viya plug-in via the CLI, you must create a profile and authenticate. Here is the documentation which details those steps. You may also refer to the YouTube tutorial linked earlier.

Workload orchestrator plugin

In the example in Figure 1, I am using a command prompt for the CLI to connect to my SAS Viya environment. Make sure you read the links above on how to create a profile and authenticate. In the shell, navigate to the directory with the CLI executable. SAS Viya commands take the form:

> sas-viya --profile <profile name> command [command options] [arguments]

Now let’s look at some basic commands. We’ll increase the complexity of the command as we go along.

List command options

The most generic command for workload-orchestrator is listed in Figure 1.

Figure 1: List of command Line Options for workload orchestrator

The command returns the name of the CLI, the usage syntax and commands at my disposal.

Config command

Next, in Figure 2, let’s run the config command.

Figure 2: The config command displays granular details for the grid or tenant

The response displays details for additional commands for the grid or tenant configuration.

Extending the config code from above, we’ll use the config grid (and tenant) commands. With these commands you have the options get and set. Get returns the current grid information and set applies a new configuration to the grid.

Figure 3: The config command followed by grid, tenant and get

As you can see in Figure 3, I used the get command for both grid and tenant to display the configurations.

Hosts command

Now let’s look at the hosts command. In Figure 4, we use the hosts command to display the additional commands close, list and open hosts.

Figure 4: The hosts command

Figure 5 uses the list command and displays information about the current SAS Viya host.

Figure 5: The hosts command with the list command

Info command

Moving on to the info command in Figure 6, we see the available commands are grid, manager and tenant.

Figure 6: The info command with the list commands

In Figure 7, we use the three commands.

Figure 7: The info command with the grid, manager and tenant commands

The grid command lists information about the product. Manager lists information about the current usage of the manager. Finally, the tenant command lists information about the tenant.

Jobs command

Moving on to the jobs command in Figure 8.

Figure 8: The jobs command with the various commands

We see the results with the available commands including cancelling, listing, resume processing and suspending jobs.
We have a couple of commands remaining. Let’s move on.

Logs command

The logs command, as seen in Figure 9, allows you to set the log level or list specified logs.

Figure 9: The logs command with the various commands

The levels command also has get and set sub-commands. Get displays the logger levels for a specified host or all hosts. The set command sets a specified level for one more logger.

Figure 10 displays the logs command with the list command, and it shows info and error message collected.

Figure 10: The logs command with the list command

Queues command

The final command we’ll look at is the queues command. In Figure 11, you can see there are multiple commands available for queues.

Figure 11: The queues command with the various commands

Figure 12 is the list command of the queues command.

Figure 12: The queues command with the list command

Feel free to try out the other queues commands on your own.

Finally

Fairly straight forward, eh? I hope this helps you understand how you can use the workload-orchestration SAS Viya CLI plug to retrieve and configure various settings of the SAS Viya Workload Management Environment.

SAS Viya Workload Orchestrator CLI Plug-in was published on SAS Users.

This post was kindly contributed by SAS Users - go there to comment and to read the full post.