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.
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.
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.
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 5 uses the list
command and displays information about the current SAS Viya host.
Info command
Moving on to the info
command in Figure 6, we see the available commands are grid
, manager
and tenant
.
In Figure 7, we use the three 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.
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.
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.
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 12 is the list
command of the queues
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.