You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/developer/overview-developer.md
+21-10Lines changed: 21 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,23 @@
1
1
---
2
2
title: Developer Documentation Overview
3
+
summary: This article is an overview of the developer documentation for the Run:ai platform.
4
+
authors:
5
+
- Jason Novich
6
+
date: 2024-Apr-10
3
7
---
4
8
5
-
# Overview: Developer Documentation
9
+
Developers can access Run:ai through various programmatic interfaces.
6
10
7
-
Developers can access Run:ai through various programmatic interfaces.
11
+
## API Support
8
12
13
+
The endpoints and parameters specified in the API reference are the ones that are officially supported by Run:ai. Endpoints and parameters that are **NOT** listed in the reference are not officially supported.
14
+
15
+
Endpoints and parameters marked as `deprecated` means they remain operational and can be used; however, Run:ai will **NO LONGER RECOMMEND USING THEM**, **WILL NOT ADD FUNCTIONALITY TO THEM**, and **WILL NO LONGER BE SUPPORTED AFTER**
16
+
17
+
Option1 : <#of versions>
18
+
Option 2: <timeperiod>.
19
+
20
+
For details, see the [Deprecation notifications](../home/whats-new-2-17.md#deprecation-notifications).
9
21
10
22
## API Architecture
11
23
@@ -19,32 +31,31 @@ Below is a diagram of the Run:ai API Architecture. A developer may:
Add, delete, modify and list Run:ai meta-data objects such as Projects, Departments, Users, and more.
36
+
Add, delete, modify and list Run:ai meta-data objects such as Projects, Departments, Users, and more.
26
37
27
38
The API is provided as REST and is accessible via the control plane endpoint.
28
39
29
-
For more information see [Administrator REST API](admin-rest-api/overview.md).
40
+
For more information see [Administrator REST API](admin-rest-api/overview.md).
30
41
31
42
## Cluster API
32
43
33
-
Submit and delete Workloads.
44
+
Submit and delete Workloads.
34
45
35
46
The API is provided as [Kubernetes API](./cluster-api/submit-yaml.md).
36
47
37
-
Cluster API is accessible via the GPU cluster itself. As such, __multiple clusters may have multiple endpoints__.
48
+
Cluster API is accessible via the GPU cluster itself. As such, **multiple clusters may have multiple endpoints**.
38
49
39
50
!!! Note
40
-
The same functionality is also available via the [Run:ai Command-line interface](../Researcher/cli-reference/Introduction.md). The CLI provides an alternative for automating with shell scripts.
51
+
The same functionality is also available via the [Run:ai Command-line interface](../Researcher/cli-reference/Introduction.md). The CLI provides an alternative for automating with shell scripts.
52
+
41
53
## Metrics API
42
54
43
-
Retrieve metrics from multiple GPU clusters.
55
+
Retrieve metrics from multiple GPU clusters.
44
56
45
57
See the [Metrics API](metrics/metrics.md) document.
46
58
47
59
## API Authentication
48
60
49
61
See [API Authentication](rest-auth.md) for information on how to gain authenticated access to Run:ai APIs.
The following document explains how to authenticate with Run:ai APIs.
4
5
5
-
The following document explains how to authenticate with Run:ai APIs.
6
-
7
-
Run:ai APIs are accessed using _bearer tokens_. A token can be obtained in several ways:
6
+
Run:ai APIs are accessed using *bearer tokens*. A token can be obtained in several ways:
8
7
9
8
* When logging into the Run:ai user interface, you enter an email and password (or authenticated via single sign-on) which are used to obtain a token.
10
9
* When using the Run:ai command-line, you use a Kubernetes profile and are authenticated by pre-running `runai login` (or oc login with OpenShift). The command attaches a token to the profile and allows you access to Run:ai functionality.
11
-
* When using Run:ai APIs, you need to create an __Application__ through the Run:ai user interface. The Application is created with specific roles and contains a _secret_. Using the secret you can obtain a token and use it within subsequent API calls.
10
+
* When using Run:ai APIs, you need to create an **Application** through the Run:ai user interface. The Application is created with specific roles and contains a *secret*. Using the secret you can obtain a token and use it within subsequent API calls.
12
11
13
12
## Create a Client Application
14
13
15
14
* Open the Run:ai Run:ai User Interface.
16
-
* Go to `Settings | Application` and create a new Application.
17
-
* Set the required roles:
18
-
* Select `Researcher` to manipulate _Jobs_ using the [Cluster API](cluster-api/submit-rest.md). To provide access to a specific project, you will also need to go to `Application | Projects` and provide the Application with access to specific projects.
19
-
* Select `Editor` to manipulate _Projects_ and _Departments_ using the [Administrator REST API](admin-rest-api/overview.md).
20
-
* Select `Administrator` to manipulate _Users_, _Tenant Settings_ and _Clusters_ using the [Administrator REST API](admin-rest-api/overview.md).
21
-
* Copy the `<APPLICATION-NAME>` and `<CLIENT-SECRET>` to be used below
22
-
* Go to `Settings | General`, under `Researcher Authentication` copy `<REALM>`.
15
+
* Go to `Settings & Tools`, `Application` and create a new Application.
16
+
* Copy the `<APPLICATION>` and `<SECRET KEY>` to be used below
23
17
24
-
!!! Important Note
25
-
Creating Client Application tokens is only available with SaaS installations where the tenant has been created post-January 2022 or any Self-hosted installation. If you are an administrator but do not see the `Settings | Application` area, please contact Run:ai customer support.
18
+
### Access rules for the Application
19
+
20
+
* Set the required roles:
21
+
* Select `Researcher` to manipulate *Jobs* using the [Cluster API](cluster-api/submit-rest.md). To provide access to a specific project, you will also need to go to `Application | Projects` and provide the Application with access to specific projects.
22
+
* Select `Editor` to manipulate *Projects* and *Departments* using the [Administrator REST API](admin-rest-api/overview.md).
23
+
* Select `Administrator` to manipulate *Users*, *Tenant Settings* and *Clusters* using the [Administrator REST API](admin-rest-api/overview.md).
26
24
27
25
## Request an API Token
28
26
29
-
Use the above parameters to get a temporary token to access Run:ai as follows.
27
+
Use the above parameters to get a temporary token to access Run:ai as follows.
30
28
31
-
### Example command to get an API token
29
+
### Example command to get an API token
32
30
33
-
Replace `<COMPANY-URL>` below with `app.run.ai` for SaaS installations (not `<company>.run.ai`) or the Run:ai user interface URL for Self-hosted installations.
31
+
Replace `<COMPANY-URL>` below with:
32
+
33
+
* For SaaS installations use `<company>.run.ai`
34
+
* For self-hosted use the Run:ai user interface URL.
34
35
35
36
=== "cURL"
36
37
``` bash
37
-
curl -X POST 'https://<COMPANY-URL>/auth/realms/<REALM>/protocol/openid-connect/token' \
@@ -78,19 +70,11 @@ The API response will look as follows:
78
70
79
71
```JSON title="API Response"
80
72
{
81
-
"access_token": "...", // (1)
82
-
"expires_in": 36000,
83
-
....
84
-
"token_type": "bearer"
85
-
"id_token": "..."
73
+
"accessToken": "<TOKEN>",
86
74
}
87
75
```
88
76
89
-
1. Use the `id_token` as the Bearer token below.
90
-
91
-
92
-
To call APIs, the application must pass the retrieved `access_token` as a Bearer token in the Authorization header of your HTTP request.
93
-
94
-
* To retrieve and manipulate Workloads, use the [Cluster API](cluster-api/workload-overview-dev.md). Researcher API works at the cluster level and you will have different endpoints for different clusters.
95
-
* To retrieve and manipulate other metadata objects, use the [Administrator REST API](admin-rest-api/overview.md). Administrator API works at the control-plane level and you have a single endpoint for all clusters.
77
+
To call APIs, the application must pass the retrieved `accessToken` as a *Bearer token* in the Authorization header of your HTTP request.
96
78
79
+
* To retrieve and manipulate Workloads, use the [Cluster API](cluster-api/workload-overview-dev.md). Researcher API works at the cluster level and you will have different endpoints for different clusters.
80
+
* To retrieve and manipulate other metadata objects, use the [Administrator REST API](admin-rest-api/overview.md). Administrator API works at the control-plane level and you have a single endpoint for all clusters.
0 commit comments