Skip to content

Constraints

Create an execution profile to only run workloads on workers with a specified label.

Before you start

Goal

  • Create an execution profile constraining workloads to a worker node with a given label.

Prerequisites

  • A configured hub server with at least one worker node.
  • A worker node configured with a label.
  • A configured namespace.

Create Execution Profile

In the Altair SLC Hub portal, launch Hub Administration and then click Execution Profiles. Select New and enter a name for the execution profile. Click Save to display the execution profile editing page.

Namespace binding

For an execution profile to be useable it needs to have a binding to at least one namespace otherwise workloads in that namespace will not be able to make use of it.

To add a namespace binding, from the execution profile editing page click New under the Namespace Binding section, select the namespace from the drop down. Optionally, you can set the execution profile to be the default for the namespace, this will replace any other default execution profile for the namespace and make it the automatically selected profile when running workloads. Click OK to add the namespace binding.

Verify namespace binding created successfully

Check that the namespace binding was created. To do this first make sure your namespace is selected in the Altair SLC Hub portal. Launch Deployment Services, click Deployment and then click Deploy Demo. The new execution profile should be an option in the Execution Profile dropdown of the dialog box.

Setting Constraint

From the execution profile editing screen you can add constraints to limit where workloads will be executed.

Node Label Constraint

Workloads can be constrained to only be executed on worker nodes with a given label. These labels are specified in the Node label field of the constraints section in the execution profile. This is a text field that can take multiple labels. Known labels can be selected from the drop down or new labels entered in. Press Enter or Tab after each label to select the label. Setting multiple node labels means that a worker node must have all the selected labels for the workload to execute.

Operating System Constraint

The Operating system field of the Constraints section is used to specify that a workload needs to run on a specific operating system. This is only required if running in a heterogeneous cluster containing worker nodes running different operating systems.

Verify

Verify constraint applied

To verify that an execution profile constraints are working as expected first we'll create a demo deployment using the execution profile and check that jobs run on the expected worker node.

Make sure the correct namespace is selected. In the Altair SLC Hub portal, launch Deployment Services, click Deployment and click Deploy Demo. Select the new execution profile, enter a name and click OK*.

In the portal, launch Invocation, select Programs and run one of the programs such as PKGSAS01 - Hello World. Take note of the Job ID field under the Advanced tab. Launch Hub Administrator and select Cluster Workloads which should contain a workload named hubasync/<Job ID>. Select this workload and verify that the job execution is run on the correct worker node.