Skip to main content

Introduction

The AVxcelerate Resource Manager REST API v0.1.0 is compatible with the AVX Architecture V2. This REST API allows to perform CRUD (Create, Read, Update, and Delete) operations on resources such as queues, deployments, applications and app-runtime-configurations.

Features

Plugins

You can register a plugin with definition of container runtime. For example: Docker Engine / Kubernetes

Python helper

The AVxcelerate python APIs are hosted as a python package on a cluster as part of the Explore service deployment. The developers can install the package using pip and use it to call AVx autonomy APIs without needing to make raw REST calls.

PyPi Regsitry URL:

The python package is hosted as PyPi compliant registry on each deployed cluster. The registry URL is like this:

Usage example

Pre-requisites: We assume that the system is running with the Ubuntu 22.04 version, and that the following tools are already installed:
  • python 3.10
  • pip 25.1
  • uv 0.6
And we assume that you are using AVx Autonomy Toolchain version 25R2.2 Step 1: Create virtual environment
Step 3: Install python packages:
  • ansys-api-avxcelerate-autonomy
  • ansys-avxcelerate-autonomy
Step 4: Use ansys-api-avxcelerate-autonomy and ansys-avxcelerate-autonomy in your python code

Optimize available resource through worker management

1. Introduction: worker management in simulation jobs

If you submit a large number of simulation jobs, this will trigger the creation of workers that are queued and launched simultaneously. This creation of many worker instances (referred to as containers in Kubernetes) can overload the cluster. As a result, the cluster’s resources may become depleted, which could lead to failures or even a complete system crash.

2. Cluster Resource Usage Optimization

To prevent this issue, you can set a limit on the maximum number of worker instances that can be created during a simulation job. This limit is controlled by the maximum_allowed_worker_instances parameter, which can be set when creating or updating a queue via the Resource Manager REST API. Once this limit is configured, the system will only launch up to the specified number of workers at the same time; any additional jobs will remain in a waiting state until sufficient worker capacity becomes available.

Example

  • If The maximum_allowed_worker_instances parameter is set to 10 for the queue named Default.
  • Two jobs are created: a. Job (1) with 10 worker instances b. Job (2) with 8 worker instances
If Job (1) is created first, it will allocate 10 worker instances, using up all available capacity. As a result, Job (2) will be paused at the Simulation Step, and a warning will appear under the Simulation Step indicating that no worker instances can be created. Once Job (1) has finished, then capacity becomes available. Job (2) can then allocate 8 worker instances, the warning disappears, and the simulation proceeds. Note: The AVxcelerate toolchain does not support partial allocation of worker instances. If a job requests 10 workers, it will only begin when all 10 worker instances are available.

Additional Containers

While worker instances are the primary consumers of cluster resources, there are two additional containers that are created when a job is submitted:
  1. Simulation Controller Instance (created on the simulation-controller-queue): Manages the job and its associated workers.
  2. Post Controller Instance (created on the post-controller-queue): Launched when the visualization tab is opened in the UI and is responsible for data analysis.
When estimating the resources needed for a job, consider that each job will run one simulation controller instance, the specified number of worker instances, and potentially one post controller instance. Note: By default, there is no limit on the number of simulation controller and post controller instances that can be created. This means that n concurrent jobs will result in n controller instances, which can consume significant resources. To manage this, you can set the maximum_allowed_worker_instances parameter for these queues to control the number of controller instances created.

Configuring maximum number of parallel running workers per queue

Through the Resource REST API, and the maximum_allowed_worker_instances parameter you are able to configure the maximum number of parallel running workers per job. Set a limit to the following parameter:
See below screenshot as an example: Alt text Note: The resource manager allocates the job that has the requested amount of workers or less. In the example below, only 3 workers are available, so the job that requires 4 workers, appears as ‘pending’ Alt text

Getting a Token to use the REST API

To use the REST API, you need to enter a Token To generate the Token:
  1. Run the following command from your terminal, to generate a token:
The output should be the following: Copy and save the generated token so that you can use it to authenticate.
Note: The mandatory attributes are refresh_token and access_token.
  1. Go the REST API documentation page.
  2. Click Authorize
Alt text
  1. Enter Bearer in the Value field, with a space at the end. Then, insert the access token. Click Authorize once again.
Alt text

Creating and Configuring Queues

The following steps explain how to add or update an existing queue through the Resource Manager REST API that will appear in the Explore web app to be selected during the simulation job configuration. To create a queue you need to make a POST request to:
  1. Edit the Request body and click Try it out.
  2. Click Execute. A Queue ID will be generated.
Alt text Update the queue to add the following attributes in the request body
You need to get the Application ID on which you want to run the job. To get this, click Execute on the GET/Applications command (below) on the Resource REST API:
Alt text Alt text Now map the above generated Queue ID with the Application ID for the app-runtime-config by making a POST call.
You must specify the image path and working directory in the request body Alt text Once the queue is created and configured it will be available to select in the Explore & Analyze simulation job configuration template.