Categories

Versions

Web API Groups

Web API Group describes a set of Web API Agents. Such a group can be joined by any arbitrary number of Web API Agents. This means that all connected Web API Agents of one Web API Group share the same deployments and permissions. All requests targeting a specific Web API Deployment endpoint are sent to a Web API Group, and not to one specific Web API Agent. The default installation of AI Hub includes the Web API Group DEFAULT.

Any user can access the Web API Group overview to see their status on the web interface. Web API Group definitions can be edited by admins and Endpoint admins.

img/overview-group.png

All connected Web API Agents for a Web API Group are visible.

Autodiscovery

Web API Agents are automatically connected to their assigned Web API Group. As the requests, e.g., for scoring data are sent over the Web API Gateway, a Web API Agent of the Web API Group is picked by the underlying load balancing algorithm, described in the overview.

Adding a new Web API Group

A Web API Group is configured in two places:

  1. A Web API Agent
  2. AI Hub

Adding a new Web API Group to the Web API Agent

By default, the standard docker installation of AI Hub comes with redundant Web API Agents in the DEFAULT Web API Group already. To add an Web API Agent to a different Web API Group than DEFAULT, the WEBAPI_GROUP_NAME environment variable inside the docker container of the Web API Agent needs to be changed. This is similar to the way Job Agents are set to a specific Queue, which also needs changes inside the docker container.

If this property has been changed to a Web API Group which is unknown to AI Hub, the Web API Agent is not usable. The Web API Agents inside an unknown Web API Group are listed inside the Unknown tab of the Web APIs.

img/unknown-group.png

Adding a new Web API Group to AI Hub

A new Web API Group can be added to AI Hub on the web interface by a platform admin or an endpoint admin. The user needs to add the Web API Group from the Web APIs page.

img/create-group.png

When adding new Web API Groups, a name and proper permissions must be set. For example, here a new Web API Group with the name NEW_GROUP has been added, where only the administrator has read access to.

img/permission-group.png

To give an overview of the different permissions:

Permission Description
Read The user can see the Web API Group and Web API Deployments of that group
Create The user can create Web API Deployments for this group
Delete The user can delete the Web API Group and Web API Deployments of that group
Update The user can update the Web API Group and Web API Deployments of that group
Recreate Allows user to (forcefully) re-distribute Web API Deployments of that group

After the Web API Group has been created, a dialog will pop up, reminding the user to set the Web API Group name for the Web API Agent.

img/dialog-group.png

Now, if a new Web API Agent with the WEBAPI_GROUP_NAME=NEW_GROUP is started, this Web API Agent will be added to that Web API Group.

Error Handling

The Web API Groups overview page shows all relevant information about each group and its connected Web API Agents. In case connected Web API Agents serve requests as expected, a green check mark is displayed. At the moment a Web API Agent is started, it will download all relevant data from the AI Hub backend, meaning that it is not immediately available to serve requests. In this time frame, the Web API Agent status will be shown with a danger sign, stating that the Web API Agent is down:

img/agent-down.png

In any other case, the Web API Agents can also have different states during their life cycle as illustrated in the table below.

State Description Icon
Up The Web API Agent is up and serves requests Check mark
Down The Web API Agent has started and is syncing resources Warning
Out Of Service The Web API Agent is syncing Web API Deployments Warning
Starting Not used, is shown in of case misconfiguration Spinner
Unknown Web API Agent is in unknown state Warning

In the time when a Web API Deployment is created or updated, the Web API Agent will temporarily be put into the Out Of Service state. This is also shown on the overview page with a danger sign. When a Web API Deployment has a fault, and a Web API Agent cannot deploy it, the Web API Agent will stay in out of service until the faulty Web API Deployment has been corrected or has been deleted.

Shutdown

When a Web API Agent stays in the error state, even if no faulty Web API Deployments are left, an admin or an endpoint admin can shut down the Web API Agent. Depending on the deployment descriptor file of the Web API Agent, e.g. when restart: unless-stopped is set, the Wep API Agent will restart. The shutdown action is only available when the Web API Agent is in an error state, and no new Extensions have been uploaded and are currently distributed to the Web API Agents. To trigger the shutdown, the user can click on the Shutdown button and confirm the dialog:

img/shutdown.png