apps
Creates, updates, deletes, gets or lists an apps resource.
Overview​
| Name | apps |
| Type | Resource |
| Id | ovh.cloud_ai.apps |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | App Id |
created_at | string (date-time) | App creation date (wire: createdAt) |
spec | object | App spec |
status | object | App Container Status |
updated_at | string (date-time) | App last update date (wire: updatedAt) |
user | string | App user owner |
AI Solutions Platform App Object
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | App Id |
created_at | string (date-time) | App creation date (wire: createdAt) |
spec | object | App spec |
status | object | App Container Status |
updated_at | string (date-time) | App last update date (wire: updatedAt) |
user | string | App user owner |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | app_id, service_name | Get app information | |
list | select | service_name | label_selector, order, page, size, sort, status_state, updated_after, updated_before, user_name | List apps |
create | insert | service_name, image, region, resources | Create a new app | |
update | update | app_id, service_name | Update several parts of an app's spec | |
delete | delete | app_id, service_name | force | Delete an app |
command | exec | service_name, image, region, resources | Generate an app spec corresponding CLI command | |
datasync | exec | appId, service_name | Starts a manual data synchronization on an app | |
update_image | exec | appId, service_name, url | Set the Docker image of an AI app | |
update_label | exec | appId, service_name, name | Update/add an AI Solutions app label | |
update_scalingstrategy | exec | appId, service_name | Scale a App | |
start | exec | appId, service_name | Start an existing AI Solutions app | |
stop | exec | appId, service_name | Stop an AI Solutions app |
Parameters​
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
api_host | string | The OVHcloud API host. Selected by OVH_ENDPOINT (ovh-eu, ovh-ca or ovh-us; default ovh-eu). (default: api.eu.ovhcloud.com, x-stackQL-envVarSelector: {"envVar":"OVH_ENDPOINT","default":"ovh-eu","values":{"ovh-eu":"api.eu.ovhcloud.com","ovh-ca":"api.ca.ovhcloud.com","ovh-us":"api.us.ovhcloud.com"}}) |
appId | string (uuid) | App ID |
app_id | string (uuid) | App ID (wire: appId) |
service_name | string | The Public Cloud project ID. Resolved from OVH_CLOUD_PROJECT_SERVICE when set. |
force | boolean | Force app deletion by killing it if at a running state |
label_selector | string | Filter on app label (e.g. 'app_name=kind_of_magic') (wire: labelSelector) |
order | string | Order the result set |
page | integer | Page of the result set |
size | integer | Size of the result set |
sort | string | Sort the result with this field |
status_state | array | Filter on status state (wire: statusState) |
updated_after | string (date-time) | Filter on updatedAt property (>) (wire: updatedAfter) |
updated_before | string (date-time) | Filter on updatedAt property (<) (wire: updatedBefore) |
user_name | string | User that submit the job (wire: userName) |
SELECT examples​
- get
- list
Get app information
SELECT
id,
created_at,
spec,
status,
updated_at,
user
FROM ovh.cloud_ai.apps
WHERE app_id = '{{ app_id }}' -- required
AND service_name = '{{ service_name }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
;
List apps
SELECT
id,
created_at,
spec,
status,
updated_at,
user
FROM ovh.cloud_ai.apps
WHERE service_name = '{{ service_name }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
AND label_selector = '{{ label_selector }}'
AND order = '{{ order }}'
AND page = '{{ page }}'
AND size = '{{ size }}'
AND sort = '{{ sort }}'
AND status_state = '{{ status_state }}'
AND updated_after = '{{ updated_after }}'
AND updated_before = '{{ updated_before }}'
AND user_name = '{{ user_name }}'
;
INSERT examples​
- create
- Manifest
Create a new app
INSERT INTO ovh.cloud_ai.apps (
command,
default_http_port,
deployment_strategy,
env_vars,
grpc_port,
image,
labels,
liveness_probe,
name,
partner_id,
probe,
region,
resources,
scaling_strategy,
unsecure_http,
volumes,
service_name
)
SELECT
'{{ command }}',
{{ default_http_port }},
'{{ deployment_strategy }}',
'{{ env_vars }}',
{{ grpc_port }},
'{{ image }}' /* required */,
'{{ labels }}',
'{{ liveness_probe }}',
'{{ name }}',
'{{ partner_id }}',
'{{ probe }}',
'{{ region }}' /* required */,
'{{ resources }}' /* required */,
'{{ scaling_strategy }}',
{{ unsecure_http }},
'{{ volumes }}',
'{{ service_name }}'
RETURNING
id,
created_at,
spec,
status,
updated_at,
user
;
# Description fields are for documentation purposes
- name: apps
props:
- name: service_name
value: "{{ service_name }}"
description: Required parameter for the apps resource.
- name: command
value:
- "{{ command }}"
description: |
App command
- name: default_http_port
value: {{ default_http_port }}
description: |
Default port to access http service inside the app
- name: deployment_strategy
description: |
AI App deployment strategy
value:
maxSurge: "{{ maxSurge }}"
maxUnavailable: "{{ maxUnavailable }}"
progressDeadlineSeconds: {{ progressDeadlineSeconds }}
terminationGracePeriodSeconds: {{ terminationGracePeriodSeconds }}
- name: env_vars
description: |
List of environment variable to be set inside the app
value:
- name: "{{ name }}"
value: "{{ value }}"
- name: grpc_port
value: {{ grpc_port }}
description: |
GRPC Port that we want to expose in case workload HTTP & gRPC servers cannot be multiplexed to listen on the same port
- name: image
value: "{{ image }}"
description: |
Docker or capability image to use in the app. App capability images must comply with the pattern 'image-id:version'
- name: labels
value: "{{ labels }}"
description: |
Labels are used to scope tokens, labels prefixed by 'ovh/' are owned by the platform and overridden
- name: liveness_probe
description: |
App liveness probe
value:
failureThreshold: {{ failureThreshold }}
initialDelaySeconds: {{ initialDelaySeconds }}
path: "{{ path }}"
periodSeconds: {{ periodSeconds }}
port: {{ port }}
successThreshold: {{ successThreshold }}
timeoutSeconds: {{ timeoutSeconds }}
- name: name
value: "{{ name }}"
description: |
App name
- name: partner_id
value: "{{ partner_id }}"
description: |
Partner ID
- name: probe
description: |
App readiness probe
value:
failureThreshold: {{ failureThreshold }}
initialDelaySeconds: {{ initialDelaySeconds }}
path: "{{ path }}"
periodSeconds: {{ periodSeconds }}
port: {{ port }}
successThreshold: {{ successThreshold }}
timeoutSeconds: {{ timeoutSeconds }}
- name: region
value: "{{ region }}"
description: |
Host region of the app
- name: resources
description: |
App resources
value:
cpu: {{ cpu }}
ephemeralStorage: {{ ephemeralStorage }}
flavor: "{{ flavor }}"
flavorCount: {{ flavorCount }}
gpu: {{ gpu }}
gpuBrand: "{{ gpuBrand }}"
gpuMemory: {{ gpuMemory }}
gpuModel: "{{ gpuModel }}"
memory: {{ memory }}
privateNetwork: {{ privateNetwork }}
publicNetwork: {{ publicNetwork }}
- name: scaling_strategy
description: |
App scaling strategy
value:
automatic:
averageUsageTarget: {{ averageUsageTarget }}
cooldownPeriodSeconds: {{ cooldownPeriodSeconds }}
customMetrics:
aggregationType: "{{ aggregationType }}"
apiUrl: "{{ apiUrl }}"
format: "{{ format }}"
targetValue: {{ targetValue }}
valueLocation: "{{ valueLocation }}"
replicasMax: {{ replicasMax }}
replicasMin: {{ replicasMin }}
resourceType: "{{ resourceType }}"
scaleDownStabilizationWindowSeconds: {{ scaleDownStabilizationWindowSeconds }}
scaleUpStabilizationWindowSeconds: {{ scaleUpStabilizationWindowSeconds }}
fixed:
replicas: {{ replicas }}
- name: unsecure_http
value: {{ unsecure_http }}
description: |
Whether if app api port can be accessed without any authentication token
- name: volumes
description: |
App Data linked
value:
- cache: {{ cache }}
container: "{{ container }}"
dataStore:
alias: "{{ alias }}"
archive: "{{ archive }}"
container: "{{ container }}"
internal: {{ internal }}
prefix: "{{ prefix }}"
id: "{{ id }}"
mountPath: "{{ mountPath }}"
permission: "{{ permission }}"
prefix: "{{ prefix }}"
publicGit:
url: "{{ url }}"
publicSwift:
url: "{{ url }}"
region: "{{ region }}"
standalone:
name: "{{ name }}"
targetDataStore:
alias: "{{ alias }}"
archive: "{{ archive }}"
container: "{{ container }}"
internal: {{ internal }}
prefix: "{{ prefix }}"
volumeSource:
dataStore:
alias: "{{ alias }}"
archive: "{{ archive }}"
container: "{{ container }}"
internal: {{ internal }}
prefix: "{{ prefix }}"
publicGit:
url: "{{ url }}"
publicSwift:
url: "{{ url }}"
standalone:
name: "{{ name }}"
volumeTarget:
targetDataStore:
alias: "{{ alias }}"
archive: "{{ archive }}"
container: "{{ container }}"
internal: {{ internal }}
prefix: "{{ prefix }}"
UPDATE examples​
- update
Update several parts of an app's spec
UPDATE ovh.cloud_ai.apps
SET
command = '{{ command }}',
cpu = {{ cpu }},
default_http_port = {{ default_http_port }},
deployment_strategy = '{{ deployment_strategy }}',
env_vars = '{{ env_vars }}',
flavor = '{{ flavor }}',
flavor_count = {{ flavor_count }},
gpu = {{ gpu }},
grpc_port = {{ grpc_port }},
liveness_probe = '{{ liveness_probe }}',
probe = '{{ probe }}',
url = '{{ url }}'
WHERE
app_id = '{{ app_id }}' --required
AND service_name = '{{ service_name }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
RETURNING
id,
created_at,
spec,
status,
updated_at,
user;
DELETE examples​
- delete
Delete an app
DELETE FROM ovh.cloud_ai.apps
WHERE app_id = '{{ app_id }}' --required
AND service_name = '{{ service_name }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
AND force = '{{ force }}'
;
Lifecycle Methods​
EXEC variables use wire (API) names.
- command
- datasync
- update_image
- update_label
- update_scalingstrategy
- start
- stop
Generate an app spec corresponding CLI command
EXEC ovh.cloud_ai.apps.command
@service_name='{{ service_name }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
@@json=
'{
"command": "{{ command }}",
"defaultHttpPort": {{ defaultHttpPort }},
"deploymentStrategy": "{{ deploymentStrategy }}",
"envVars": "{{ envVars }}",
"grpcPort": {{ grpcPort }},
"image": "{{ image }}",
"labels": "{{ labels }}",
"livenessProbe": "{{ livenessProbe }}",
"name": "{{ name }}",
"partnerId": "{{ partnerId }}",
"probe": "{{ probe }}",
"region": "{{ region }}",
"resources": "{{ resources }}",
"scalingStrategy": "{{ scalingStrategy }}",
"unsecureHttp": {{ unsecureHttp }},
"volumes": "{{ volumes }}"
}'
;
Starts a manual data synchronization on an app
EXEC ovh.cloud_ai.apps.datasync
@appId='{{ appId }}' --required,
@service_name='{{ service_name }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
@@json=
'{
"direction": "{{ direction }}",
"volume": "{{ volume }}"
}'
;
Set the Docker image of an AI app
EXEC ovh.cloud_ai.apps.update_image
@appId='{{ appId }}' --required,
@service_name='{{ service_name }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
@@json=
'{
"url": "{{ url }}"
}'
;
Update/add an AI Solutions app label
EXEC ovh.cloud_ai.apps.update_label
@appId='{{ appId }}' --required,
@service_name='{{ service_name }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
@@json=
'{
"name": "{{ name }}",
"value": "{{ value }}"
}'
;
Scale a App
EXEC ovh.cloud_ai.apps.update_scalingstrategy
@appId='{{ appId }}' --required,
@service_name='{{ service_name }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
@@json=
'{
"automatic": "{{ automatic }}",
"fixed": "{{ fixed }}"
}'
;
Start an existing AI Solutions app
EXEC ovh.cloud_ai.apps.start
@appId='{{ appId }}' --required,
@service_name='{{ service_name }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
;
Stop an AI Solutions app
EXEC ovh.cloud_ai.apps.stop
@appId='{{ appId }}' --required,
@service_name='{{ service_name }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
;