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.
Next, in Figure 2, let’s run the
Extending the config code from above, we’ll use the
config grid (and
tenant) commands. With these commands you have the options
Get returns the current grid information and
set applies a new configuration to the grid.
getcommand for both
tenantto display the configurations.
Now let’s look at the
hosts command. In Figure 4, we use the hosts command to display the additional commands
listcommand and displays information about the current SAS Viya host.
Moving on to the
info command in Figure 6, we see the available commands are
gridcommand lists information about the product.
Managerlists information about the current usage of the manager. Finally, the
tenantcommand lists information about the tenant.
Moving on to the
jobs command in Figure 8.
We have a couple of commands remaining. Let’s move on.
logs command, as seen in Figure 9, allows you to set the log level or list specified logs.
levelscommand also has
Getdisplays the logger levels for a specified host or all hosts. The
setcommand 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.
The final command we’ll look at is the
queues command. In Figure 11, you can see there are multiple commands available for queues.
listcommand of the
Feel free to try out the other
queuescommands on your own.
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.