mirror of
https://github.com/clearml/clearml-server
synced 2025-06-26 23:15:47 +00:00
Add API version 2.4 with new trains-server capabilities including DevOps and scheduling
This commit is contained in:
@@ -276,33 +276,6 @@ revoke_credentials {
|
||||
}
|
||||
}
|
||||
|
||||
delete_user {
|
||||
allow_roles = [ "system", "root", "admin" ]
|
||||
internal: false
|
||||
"2.1" {
|
||||
description: """Delete a new user manually. Only supported in on-premises deployments. This only removes the user's auth entry so that any references to the deleted user's ID will still have valid user information"""
|
||||
request {
|
||||
type: object
|
||||
required: [ user ]
|
||||
properties {
|
||||
user {
|
||||
type: string
|
||||
description: User ID
|
||||
}
|
||||
}
|
||||
}
|
||||
response {
|
||||
type: object
|
||||
properties {
|
||||
deleted {
|
||||
description: "True if user was successfully deleted, False otherwise"
|
||||
type: boolean
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
edit_user {
|
||||
internal: false
|
||||
allow_roles: ["system", "root", "admin"]
|
||||
|
||||
@@ -224,7 +224,7 @@
|
||||
}
|
||||
add_batch {
|
||||
"2.1" {
|
||||
description: "Adds a batch of events in a single call."
|
||||
description: "Adds a batch of events in a single call (json-lines format, stream-friendly)"
|
||||
batch_request: {
|
||||
action: add
|
||||
version: 1.5
|
||||
@@ -251,6 +251,11 @@
|
||||
type: string
|
||||
description: "Task ID"
|
||||
}
|
||||
allow_locked {
|
||||
type: boolean
|
||||
description: "Allow deleting events even if the task is locked"
|
||||
default: false
|
||||
}
|
||||
}
|
||||
}
|
||||
response {
|
||||
@@ -452,6 +457,10 @@
|
||||
type: integer
|
||||
description: "Number of events to return each time"
|
||||
}
|
||||
event_type {
|
||||
type: string
|
||||
description: "Return only events of this type"
|
||||
}
|
||||
}
|
||||
}
|
||||
response {
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
}
|
||||
system_tags {
|
||||
type: array
|
||||
description: "System tags. This field is reserved for system use, please don’t use it."
|
||||
description: "System tags. This field is reserved for system use, please don't use it."
|
||||
items {type: string}
|
||||
}
|
||||
framework {
|
||||
@@ -279,7 +279,7 @@
|
||||
}
|
||||
system_tags {
|
||||
type: array
|
||||
description: "System tags. This field is reserved for system use, please don’t use it."
|
||||
description: "System tags. This field is reserved for system use, please don't use it."
|
||||
items {type: string}
|
||||
}
|
||||
override_model_id {
|
||||
@@ -346,7 +346,7 @@
|
||||
}
|
||||
system_tags {
|
||||
type: array
|
||||
description: "System tags. This field is reserved for system use, please don’t use it."
|
||||
description: "System tags. This field is reserved for system use, please don't use it."
|
||||
items {type: string}
|
||||
}
|
||||
framework {
|
||||
@@ -434,7 +434,7 @@
|
||||
}
|
||||
system_tags {
|
||||
type: array
|
||||
description: "System tags. This field is reserved for system use, please don’t use it."
|
||||
description: "System tags. This field is reserved for system use, please don't use it."
|
||||
items {type: string}
|
||||
}
|
||||
framework {
|
||||
@@ -516,7 +516,7 @@
|
||||
}
|
||||
system_tags {
|
||||
type: array
|
||||
description: "System tags. This field is reserved for system use, please don’t use it."
|
||||
description: "System tags. This field is reserved for system use, please don't use it."
|
||||
items {type: string}
|
||||
}
|
||||
ready {
|
||||
|
||||
@@ -49,7 +49,7 @@ _definitions {
|
||||
}
|
||||
system_tags {
|
||||
type: array
|
||||
description: "System tags. This field is reserved for system use, please don’t use it."
|
||||
description: "System tags. This field is reserved for system use, please don't use it."
|
||||
items {type: string}
|
||||
}
|
||||
default_output_destination {
|
||||
@@ -159,7 +159,7 @@ _definitions {
|
||||
}
|
||||
system_tags {
|
||||
type: array
|
||||
description: "System tags. This field is reserved for system use, please don’t use it."
|
||||
description: "System tags. This field is reserved for system use, please don't use it."
|
||||
items {type: string}
|
||||
}
|
||||
default_output_destination {
|
||||
@@ -223,7 +223,7 @@ create {
|
||||
}
|
||||
system_tags {
|
||||
type: array
|
||||
description: "System tags. This field is reserved for system use, please don’t use it."
|
||||
description: "System tags. This field is reserved for system use, please don't use it."
|
||||
items {type: string}
|
||||
}
|
||||
default_output_destination {
|
||||
@@ -393,7 +393,7 @@ update {
|
||||
}
|
||||
system_tags {
|
||||
type: array
|
||||
description: "System tags. This field is reserved for system use, please don’t use it."
|
||||
description: "System tags. This field is reserved for system use, please don't use it."
|
||||
items {type: string}
|
||||
}
|
||||
default_output_destination {
|
||||
|
||||
568
server/schema/services/queues.conf
Normal file
568
server/schema/services/queues.conf
Normal file
@@ -0,0 +1,568 @@
|
||||
{
|
||||
_description: "Provides a management API for queues of tasks waiting to be executed by workers deployed anywhere (see Workers Service)."
|
||||
_definitions {
|
||||
queue_metrics {
|
||||
type: object
|
||||
properties: {
|
||||
queue: {
|
||||
type: string
|
||||
description: "ID of the queue"
|
||||
}
|
||||
dates {
|
||||
type: array
|
||||
description: "List of timestamps (in seconds from epoch) in the acceding order. The timestamps are separated by the requested interval. Timestamps where no queue status change was recorded are omitted."
|
||||
items { type: integer }
|
||||
}
|
||||
avg_waiting_times {
|
||||
type: array
|
||||
description: "List of average waiting times for tasks in the queue. The points correspond to the timestamps in the dates list. If more than one value exists for the given interval then the maximum value is taken."
|
||||
items { type: number }
|
||||
}
|
||||
queue_lengths {
|
||||
type: array
|
||||
description: "List of tasks counts in the queue. The points correspond to the timestamps in the dates list. If more than one value exists for the given interval then the count that corresponds to the maximum average value is taken."
|
||||
items { type: integer }
|
||||
}
|
||||
}
|
||||
}
|
||||
entry {
|
||||
type: object
|
||||
properties: {
|
||||
task {
|
||||
description: "Queued task ID"
|
||||
type: string
|
||||
}
|
||||
added {
|
||||
description: "Time this entry was added to the queue"
|
||||
type: string
|
||||
format: "date-time"
|
||||
}
|
||||
}
|
||||
}
|
||||
queue {
|
||||
type: object
|
||||
properties: {
|
||||
id {
|
||||
description: "Queue id"
|
||||
type: string
|
||||
}
|
||||
name {
|
||||
description: "Queue name"
|
||||
type: string
|
||||
}
|
||||
user {
|
||||
description: "Associated user id"
|
||||
type: string
|
||||
}
|
||||
company {
|
||||
description: "Company id"
|
||||
type: string
|
||||
}
|
||||
created {
|
||||
description: "Queue creation time"
|
||||
type: string
|
||||
format: "date-time"
|
||||
}
|
||||
tags {
|
||||
description: "User-defined tags"
|
||||
type: array
|
||||
items { type: string }
|
||||
}
|
||||
system_tags {
|
||||
description: "System tags. This field is reserved for system use, please don't use it."
|
||||
type: array
|
||||
items { type: string }
|
||||
}
|
||||
entries {
|
||||
description: "List of ordered queue entries"
|
||||
type: array
|
||||
items { "$ref": "#/definitions/entry" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
get_by_id {
|
||||
"2.4" {
|
||||
description: "Gets queue information"
|
||||
request {
|
||||
type: object
|
||||
required: [ queue ]
|
||||
properties {
|
||||
queue {
|
||||
description: "Queue ID"
|
||||
type: string
|
||||
}
|
||||
}
|
||||
}
|
||||
response {
|
||||
type: object
|
||||
properties {
|
||||
queue {
|
||||
description: "Queue info"
|
||||
"$ref": "#/definitions/queue"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// typescript generation hack
|
||||
get_all_ex {
|
||||
internal: true
|
||||
"2.4": ${get_all."2.4"}
|
||||
}
|
||||
get_all {
|
||||
"2.4" {
|
||||
description: "Get all queues"
|
||||
request {
|
||||
type: object
|
||||
properties {
|
||||
name {
|
||||
description: "Get only queues whose name matches this pattern (python regular expression syntax)"
|
||||
type: string
|
||||
}
|
||||
id {
|
||||
description: "List of Queue IDs used to filter results"
|
||||
type: array
|
||||
items { type: string }
|
||||
}
|
||||
tags {
|
||||
description: "User-defined tags list used to filter results. Prepend '-' to tag name to indicate exclusion"
|
||||
type: array
|
||||
items { type: string }
|
||||
}
|
||||
system_tags {
|
||||
description: "System tags list used to filter results. Prepend '-' to system tag name to indicate exclusion"
|
||||
type: array
|
||||
items { type: string }
|
||||
}
|
||||
page {
|
||||
description: "Page number, returns a specific page out of the result list of results."
|
||||
type: integer
|
||||
minimum: 0
|
||||
}
|
||||
page_size {
|
||||
description: "Page size, specifies the number of results returned in each page (last page may contain fewer results)"
|
||||
type: integer
|
||||
minimum: 1
|
||||
}
|
||||
order_by {
|
||||
description: "List of field names to order by. When search_text is used, '@text_score' can be used as a field representing the text score of returned documents. Use '-' prefix to specify descending order. Optional, recommended when using page"
|
||||
type: array
|
||||
items { type: string }
|
||||
}
|
||||
search_text {
|
||||
description: "Free text search query"
|
||||
type: string
|
||||
}
|
||||
only_fields {
|
||||
description: "List of document field names (nesting is supported using '.', e.g. execution.model_labels). If provided, this list defines the query's projection (only these fields will be returned for each result entry)"
|
||||
type: array
|
||||
items { type: string }
|
||||
}
|
||||
}
|
||||
}
|
||||
response {
|
||||
type: object
|
||||
properties {
|
||||
queues {
|
||||
description: "Queues list"
|
||||
type: array
|
||||
items { "$ref": "#/definitions/queue"}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
get_default {
|
||||
"2.4" {
|
||||
description: ""
|
||||
request {
|
||||
type: object
|
||||
properties {}
|
||||
additionalProperties: false
|
||||
}
|
||||
response {
|
||||
type: object
|
||||
properties {
|
||||
id {
|
||||
description: "Queue id"
|
||||
type: string
|
||||
}
|
||||
name {
|
||||
description: "Queue name"
|
||||
type: string
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
create {
|
||||
"2.4" {
|
||||
description: "Create a new queue"
|
||||
request {
|
||||
type: object
|
||||
required: [ name ]
|
||||
properties {
|
||||
name {
|
||||
description: "Queue name Unique within the company."
|
||||
type: string
|
||||
}
|
||||
tags {
|
||||
description: "User-defined tags list"
|
||||
type: array
|
||||
items { type: string }
|
||||
}
|
||||
system_tags {
|
||||
description: "System tags list. This field is reserved for system use, please don't use it."
|
||||
type: array
|
||||
items { type: string }
|
||||
}
|
||||
}
|
||||
}
|
||||
response {
|
||||
type: object
|
||||
properties {
|
||||
id {
|
||||
description: "New queue ID"
|
||||
type: string
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
update {
|
||||
"2.4" {
|
||||
description: "Update queue information"
|
||||
request {
|
||||
type: object
|
||||
required: [ queue ]
|
||||
properties {
|
||||
queue {
|
||||
description: "Queue id"
|
||||
type: string
|
||||
}
|
||||
name {
|
||||
description: "Queue name Unique within the company."
|
||||
type: string
|
||||
}
|
||||
tags {
|
||||
description: "User-defined tags list"
|
||||
type: array
|
||||
items { type: string }
|
||||
}
|
||||
system_tags {
|
||||
description: "System tags list. This field is reserved for system use, please don't use it."
|
||||
type: array
|
||||
items { type: string }
|
||||
}
|
||||
}
|
||||
}
|
||||
response {
|
||||
type: object
|
||||
properties {
|
||||
updated {
|
||||
description: "Number of queues updated (0 or 1)"
|
||||
type: integer
|
||||
enum: [ 0, 1 ]
|
||||
}
|
||||
fields {
|
||||
description: "Updated fields names and values"
|
||||
type: object
|
||||
additionalProperties: true
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
delete {
|
||||
"2.4" {
|
||||
description: "Deletes a queue. If the queue is not empty and force is not set to true, queue will not be deleted."
|
||||
request {
|
||||
type: object
|
||||
required: [ queue ]
|
||||
properties {
|
||||
queue {
|
||||
description: "Queue id"
|
||||
type: string
|
||||
}
|
||||
force {
|
||||
description: "Force delete of non-empty queue. Defaults to false"
|
||||
type: boolean
|
||||
default: false
|
||||
}
|
||||
}
|
||||
}
|
||||
response {
|
||||
type: object
|
||||
properties {
|
||||
deleted {
|
||||
description: "Number of queues deleted (0 or 1)"
|
||||
type: integer
|
||||
enum: [ 0, 1 ]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
add_task {
|
||||
"2.4" {
|
||||
description: "Adds a task entry to the queue."
|
||||
request {
|
||||
type: object
|
||||
required: [
|
||||
queue
|
||||
task
|
||||
]
|
||||
properties {
|
||||
queue {
|
||||
description: "Queue id"
|
||||
type: string
|
||||
}
|
||||
task {
|
||||
description: "Task id"
|
||||
type: string
|
||||
}
|
||||
}
|
||||
}
|
||||
response {
|
||||
type: object
|
||||
properties {
|
||||
added {
|
||||
description: "Number of tasks added (0 or 1)"
|
||||
type: integer
|
||||
enum: [ 0, 1 ]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
get_next_task {
|
||||
"2.4" {
|
||||
description: "Gets the next task from the top of the queue (FIFO). The task entry is removed from the queue."
|
||||
request {
|
||||
type: object
|
||||
required: [ queue ]
|
||||
properties {
|
||||
queue {
|
||||
description: "Queue id"
|
||||
type: string
|
||||
}
|
||||
}
|
||||
}
|
||||
response {
|
||||
type: object
|
||||
properties {
|
||||
entry {
|
||||
description: "Entry information"
|
||||
"$ref": "#/definitions/entry"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
remove_task {
|
||||
"2.4" {
|
||||
description: "Removes a task entry from the queue."
|
||||
request {
|
||||
type: object
|
||||
required: [
|
||||
queue
|
||||
task
|
||||
]
|
||||
properties {
|
||||
queue {
|
||||
description: "Queue id"
|
||||
type: string
|
||||
}
|
||||
task {
|
||||
description: "Task id"
|
||||
type: string
|
||||
}
|
||||
}
|
||||
}
|
||||
response {
|
||||
type: object
|
||||
properties {
|
||||
removed {
|
||||
description: "Number of tasks removed (0 or 1)"
|
||||
type: integer
|
||||
enum: [ 0, 1 ]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
move_task_forward: {
|
||||
"2.4" {
|
||||
description: "Moves a task entry one step forward towards the top of the queue."
|
||||
request {
|
||||
type: object
|
||||
required: [
|
||||
queue
|
||||
task
|
||||
]
|
||||
properties {
|
||||
queue {
|
||||
description: "Queue id"
|
||||
type: string
|
||||
}
|
||||
task {
|
||||
description: "Task id"
|
||||
type: string
|
||||
}
|
||||
count {
|
||||
description: "Number of positions in the queue to move the task forward relative to the current position. Optional, the default value is 1."
|
||||
type: integer
|
||||
}
|
||||
}
|
||||
}
|
||||
response {
|
||||
type: object
|
||||
properties {
|
||||
position {
|
||||
description: "The new position of the task entry in the queue (index, -1 represents bottom of queue)"
|
||||
type: integer
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
move_task_backward: {
|
||||
"2.4" {
|
||||
description: ""
|
||||
request {
|
||||
type: object
|
||||
required: [
|
||||
queue
|
||||
task
|
||||
]
|
||||
properties {
|
||||
queue {
|
||||
description: "Queue id"
|
||||
type: string
|
||||
}
|
||||
task {
|
||||
description: "Task id"
|
||||
type: string
|
||||
}
|
||||
count {
|
||||
description: "Number of positions in the queue to move the task forward relative to the current position. Optional, the default value is 1."
|
||||
type: integer
|
||||
}
|
||||
}
|
||||
}
|
||||
response {
|
||||
type: object
|
||||
properties {
|
||||
position {
|
||||
description: "The new position of the task entry in the queue (index, -1 represents bottom of queue)"
|
||||
type: integer
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
move_task_to_front: {
|
||||
"2.4" {
|
||||
description: ""
|
||||
request {
|
||||
type: object
|
||||
required: [
|
||||
queue
|
||||
task
|
||||
]
|
||||
properties {
|
||||
queue {
|
||||
description: "Queue id"
|
||||
type: string
|
||||
}
|
||||
task {
|
||||
description: "Task id"
|
||||
type: string
|
||||
}
|
||||
}
|
||||
}
|
||||
response {
|
||||
type: object
|
||||
properties {
|
||||
position {
|
||||
description: "The new position of the task entry in the queue (index, -1 represents bottom of queue)"
|
||||
type: integer
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
move_task_to_back: {
|
||||
"2.4" {
|
||||
description: ""
|
||||
request {
|
||||
type: object
|
||||
required: [
|
||||
queue
|
||||
task
|
||||
]
|
||||
properties {
|
||||
queue {
|
||||
description: "Queue id"
|
||||
type: string
|
||||
}
|
||||
task {
|
||||
description: "Task id"
|
||||
type: string
|
||||
}
|
||||
}
|
||||
}
|
||||
response {
|
||||
type: object
|
||||
properties {
|
||||
position {
|
||||
description: "The new position of the task entry in the queue (index, -1 represents bottom of queue)"
|
||||
type: integer
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
get_queue_metrics : {
|
||||
"2.4" {
|
||||
description: "Returns metrics of the company queues. The metrics are avaraged in the specified interval."
|
||||
request {
|
||||
type: object
|
||||
required: [from_date, to_date, interval]
|
||||
properties: {
|
||||
from_date {
|
||||
description: "Starting time (in seconds from epoch) for collecting metrics"
|
||||
type: number
|
||||
}
|
||||
to_date {
|
||||
description: "Ending time (in seconds from epoch) for collecting metrics"
|
||||
type: number
|
||||
}
|
||||
interval {
|
||||
description: "Time interval in seconds for a single metrics point. The minimal value is 1"
|
||||
type: integer
|
||||
}
|
||||
queue_ids {
|
||||
description: "List of queue ids to collect metrics for. If not provided or empty then all then average metrics across all the company queues will be returned."
|
||||
type: array
|
||||
items { type: string }
|
||||
}
|
||||
}
|
||||
}
|
||||
response {
|
||||
type: object
|
||||
properties: {
|
||||
queues {
|
||||
type: array
|
||||
description: "List of the requested queues with their metrics. If no queue ids were requested then 'all' queue is returned with the metrics averaged accross all the company queues."
|
||||
items { "$ref": "#/definitions/queue_metrics" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -193,6 +193,10 @@ _definitions {
|
||||
execution {
|
||||
type: object
|
||||
properties {
|
||||
queue {
|
||||
description: "Queue ID where task was queued."
|
||||
type: string
|
||||
}
|
||||
parameters {
|
||||
description: "Json object containing the Task parameters"
|
||||
type: object
|
||||
@@ -219,6 +223,10 @@ _definitions {
|
||||
description: """Framework related to the task. Case insensitive. Mandatory for Training tasks. """
|
||||
type: string
|
||||
}
|
||||
docker_cmd {
|
||||
description: "Command for running docker script for the execution of the task"
|
||||
type: string
|
||||
}
|
||||
artifacts {
|
||||
description: "Task artifacts"
|
||||
type: array
|
||||
@@ -230,6 +238,7 @@ _definitions {
|
||||
type: string
|
||||
enum: [
|
||||
created
|
||||
queued
|
||||
in_progress
|
||||
stopped
|
||||
published
|
||||
@@ -348,14 +357,14 @@ _definitions {
|
||||
"$ref": "#/definitions/script"
|
||||
}
|
||||
tags {
|
||||
description: "User-defined tags list"
|
||||
type: array
|
||||
description: "User-defined tags"
|
||||
items { type: string }
|
||||
}
|
||||
system_tags {
|
||||
description: "System tags list. This field is reserved for system use, please don't use it."
|
||||
type: array
|
||||
description: "System tags. This field is reserved for system use, please don’t use it."
|
||||
items {type: string}
|
||||
items { type: string }
|
||||
}
|
||||
status_changed {
|
||||
description: "Last status change time"
|
||||
@@ -375,6 +384,15 @@ _definitions {
|
||||
type: string
|
||||
format: "date-time"
|
||||
}
|
||||
last_worker {
|
||||
description: "ID of last worker that handled the task"
|
||||
type: string
|
||||
}
|
||||
last_worker_report {
|
||||
description: "Last time a worker reported while working on this task"
|
||||
type: string
|
||||
format: "date-time"
|
||||
}
|
||||
last_update {
|
||||
description: "Last time this task was created, updated, changed or events for this task were reported"
|
||||
type: string
|
||||
@@ -467,12 +485,12 @@ get_all {
|
||||
items { type: string }
|
||||
}
|
||||
tags {
|
||||
description: "User-defined tags list used to filter results. Prepend '-' to tag name to indicate exclusion"
|
||||
description: "List of task user-defined tags. Use '-' prefix to exclude tags"
|
||||
type: array
|
||||
items { type: string }
|
||||
}
|
||||
system_tags {
|
||||
description: "System tags list used to filter results. Prepend '-' to system tag name to indicate exclusion"
|
||||
description: "List of task system tags. Use '-' prefix to exclude system tags"
|
||||
type: array
|
||||
items { type: string }
|
||||
}
|
||||
@@ -547,14 +565,14 @@ create {
|
||||
type: string
|
||||
}
|
||||
tags {
|
||||
description: "User-defined tags list"
|
||||
type: array
|
||||
description: "User-defined tags"
|
||||
items { type: string }
|
||||
}
|
||||
system_tags {
|
||||
description: "System tags list. This field is reserved for system use, please don't use it."
|
||||
type: array
|
||||
description: "System tags. This field is reserved for system use, please don’t use it."
|
||||
items {type: string}
|
||||
items { type: string }
|
||||
}
|
||||
type {
|
||||
description: "Type of task"
|
||||
@@ -612,14 +630,14 @@ validate {
|
||||
type: string
|
||||
}
|
||||
tags {
|
||||
description: "User-defined tags list"
|
||||
type: array
|
||||
description: "User-defined tags"
|
||||
items { type: string }
|
||||
}
|
||||
system_tags {
|
||||
description: "System tags list. This field is reserved for system use, please don't use it."
|
||||
type: array
|
||||
description: "System tags. This field is reserved for system use, please don’t use it."
|
||||
items {type: string}
|
||||
items { type: string }
|
||||
}
|
||||
type {
|
||||
description: "Type of task"
|
||||
@@ -675,14 +693,14 @@ update {
|
||||
type: string
|
||||
}
|
||||
tags {
|
||||
description: "User-defined tags list"
|
||||
type: array
|
||||
description: "User-defined tags"
|
||||
items { type: string }
|
||||
}
|
||||
system_tags {
|
||||
description: "System tags list. This field is reserved for system use, please don't use it."
|
||||
type: array
|
||||
description: "System tags. This field is reserved for system use, please don’t use it."
|
||||
items {type: string}
|
||||
items { type: string }
|
||||
}
|
||||
comment {
|
||||
description: "Free text comment "
|
||||
@@ -762,14 +780,14 @@ edit {
|
||||
type: string
|
||||
}
|
||||
tags {
|
||||
description: "User-defined tags list"
|
||||
type: array
|
||||
description: "User-defined tags"
|
||||
items { type: string }
|
||||
}
|
||||
system_tags {
|
||||
description: "System tags list. This field is reserved for system use, please don't use it."
|
||||
type: array
|
||||
description: "System tags. This field is reserved for system use, please don’t use it."
|
||||
items {type: string}
|
||||
items { type: string }
|
||||
}
|
||||
type {
|
||||
description: "Type of task"
|
||||
@@ -838,6 +856,11 @@ reset {
|
||||
type: array
|
||||
items { type: string }
|
||||
}
|
||||
dequeued {
|
||||
description: "Response from queues.remove_task"
|
||||
type: object
|
||||
additionalProperties: true
|
||||
}
|
||||
frames {
|
||||
description: "Response from frames.rollback"
|
||||
type: object
|
||||
@@ -1114,7 +1137,85 @@ publish {
|
||||
}
|
||||
}
|
||||
}
|
||||
enqueue {
|
||||
"1.5" {
|
||||
description: """Adds a task into a queue.
|
||||
|
||||
Fails if task state is not 'created'.
|
||||
|
||||
Fails if the following parameters in the task were not filled:
|
||||
|
||||
* execution.script.repository
|
||||
|
||||
* execution.script.entrypoint
|
||||
"""
|
||||
request = {
|
||||
type: object
|
||||
required: [
|
||||
task
|
||||
]
|
||||
properties {
|
||||
queue {
|
||||
description: "Queue id. If not provided, task is added to the default queue."
|
||||
type: string
|
||||
}
|
||||
}
|
||||
|
||||
} ${_references.status_change_request}
|
||||
response {
|
||||
type: object
|
||||
properties {
|
||||
queued {
|
||||
description: "Number of tasks queued (0 or 1)"
|
||||
type: integer
|
||||
enum: [ 0, 1 ]
|
||||
}
|
||||
updated {
|
||||
description: "Number of tasks updated (0 or 1)"
|
||||
type: integer
|
||||
enum: [ 0, 1 ]
|
||||
}
|
||||
fields {
|
||||
description: "Updated fields names and values"
|
||||
type: object
|
||||
additionalProperties: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
dequeue {
|
||||
"1.5" {
|
||||
description: """Remove a task from its queue.
|
||||
Fails if task status is not queued."""
|
||||
request = {
|
||||
type: object
|
||||
required: [
|
||||
task
|
||||
]
|
||||
} ${_references.status_change_request}
|
||||
response {
|
||||
type: object
|
||||
properties {
|
||||
dequeued {
|
||||
description: "Number of tasks dequeued (0 or 1)"
|
||||
type: integer
|
||||
enum: [ 0, 1 ]
|
||||
}
|
||||
updated {
|
||||
description: "Number of tasks updated (0 or 1)"
|
||||
type: integer
|
||||
enum: [ 0, 1 ]
|
||||
}
|
||||
fields {
|
||||
description: "Updated fields names and values"
|
||||
type: object
|
||||
additionalProperties: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
set_requirements {
|
||||
"2.1" {
|
||||
description: """Set the script requirements for a task"""
|
||||
|
||||
483
server/schema/services/workers.conf
Normal file
483
server/schema/services/workers.conf
Normal file
@@ -0,0 +1,483 @@
|
||||
{
|
||||
_description: "Provides an API for worker machines, allowing workers to report status and get tasks for execution"
|
||||
_definitions {
|
||||
metrics_category {
|
||||
type: object
|
||||
properties {
|
||||
name {
|
||||
type: string
|
||||
description: "Name of the metrics category."
|
||||
}
|
||||
metric_keys {
|
||||
type: array
|
||||
items { type: string }
|
||||
description: "The names of the metrics in the category."
|
||||
}
|
||||
}
|
||||
}
|
||||
aggregation_type {
|
||||
type: string
|
||||
enum: [ avg, min, max ]
|
||||
description: "Metric aggregation type"
|
||||
}
|
||||
stat_item {
|
||||
type: object
|
||||
properties {
|
||||
key {
|
||||
type: string
|
||||
description: "Name of a metric"
|
||||
}
|
||||
category {
|
||||
"$ref": "#/definitions/aggregation_type"
|
||||
}
|
||||
}
|
||||
}
|
||||
aggregation_stats {
|
||||
type: object
|
||||
properties {
|
||||
aggregation {
|
||||
"$ref": "#/definitions/aggregation_type"
|
||||
}
|
||||
values {
|
||||
type: array
|
||||
description: "List of values corresponding to the dates in metric statistics"
|
||||
items { type: number }
|
||||
}
|
||||
}
|
||||
}
|
||||
metric_stats {
|
||||
type: object
|
||||
properties {
|
||||
metric {
|
||||
type: string
|
||||
description: "Name of the metric ("cpu_usage", "memory_used" etc.)"
|
||||
}
|
||||
variant {
|
||||
type: string
|
||||
description: "Name of the metric component. Set only if 'split_by_variant' was set in the request"
|
||||
}
|
||||
dates {
|
||||
type: array
|
||||
description: "List of timestamps (in seconds from epoch) in the acceding order. The timestamps are separated by the requested interval. Timestamps where no workers activity was recorded are omitted."
|
||||
items { type: integer }
|
||||
}
|
||||
stats {
|
||||
type: array
|
||||
description: "Statistics data by type"
|
||||
items { "$ref": "#/definitions/aggregation_stats" }
|
||||
}
|
||||
}
|
||||
}
|
||||
worker_stats {
|
||||
type: object
|
||||
properties {
|
||||
worker {
|
||||
type: string
|
||||
description: "ID of the worker"
|
||||
}
|
||||
metrics {
|
||||
type: array
|
||||
description: "List of the metrics statistics for the worker"
|
||||
items { "$ref": "#/definitions/metric_stats" }
|
||||
}
|
||||
}
|
||||
}
|
||||
activity_series {
|
||||
type: object
|
||||
properties {
|
||||
dates {
|
||||
type: array
|
||||
description: "List of timestamps (in seconds from epoch) in the acceding order. The timestamps are separated by the requested interval."
|
||||
items {type: integer}
|
||||
}
|
||||
counts {
|
||||
type: array
|
||||
description: "List of worker counts corresponding to the timestamps in the dates list. None values are returned for the dates with no workers."
|
||||
items {type: integer}
|
||||
}
|
||||
}
|
||||
}
|
||||
worker {
|
||||
type: object
|
||||
properties {
|
||||
id {
|
||||
description: "Worker ID"
|
||||
type: string
|
||||
}
|
||||
user {
|
||||
description: "Associated user (under whose credentials are used by the worker daemon)"
|
||||
"$ref": "#/definitions/id_name_entry"
|
||||
}
|
||||
company {
|
||||
description: "Associated company"
|
||||
"$ref": "#/definitions/id_name_entry"
|
||||
}
|
||||
ip {
|
||||
description: "IP of the worker"
|
||||
type: string
|
||||
}
|
||||
register_time {
|
||||
description: "Registration time"
|
||||
type: string
|
||||
format: "date-time"
|
||||
}
|
||||
last_activity_time {
|
||||
description: "Last activity time (even if an error occurred)"
|
||||
type: string
|
||||
format: "date-time"
|
||||
}
|
||||
last_report_time {
|
||||
description: "Last successful report time"
|
||||
type: string
|
||||
format: "date-time"
|
||||
}
|
||||
task {
|
||||
description: "Task currently being run by the worker"
|
||||
"$ref": "#/definitions/current_task_entry"
|
||||
}
|
||||
queue {
|
||||
description: "Queue from which running task was taken"
|
||||
"$ref": "#/definitions/queue_entry"
|
||||
}
|
||||
queues {
|
||||
description: "List of queues on which the worker is listening"
|
||||
type: array
|
||||
items { "$ref": "#/definitions/queue_entry" }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
id_name_entry {
|
||||
type: object
|
||||
properties {
|
||||
id {
|
||||
description: "Worker ID"
|
||||
type: string
|
||||
}
|
||||
name {
|
||||
description: "Worker name"
|
||||
type: string
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
current_task_entry = ${_definitions.id_name_entry} {
|
||||
properties {
|
||||
running_time {
|
||||
description: "Task running time"
|
||||
type: integer
|
||||
}
|
||||
last_iteration {
|
||||
description: "Last task iteration"
|
||||
type: integer
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
queue_entry = ${_definitions.id_name_entry} {
|
||||
properties {
|
||||
next_task {
|
||||
description: "Next task in the queue"
|
||||
"$ref": "#/definitions/id_name_entry"
|
||||
}
|
||||
num_tasks {
|
||||
description: "Number of task entries in the queue"
|
||||
type: integer
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
machine_stats {
|
||||
type: object
|
||||
properties {
|
||||
cpu_usage {
|
||||
description: "Average CPU usage per core"
|
||||
type: array
|
||||
items { type: number }
|
||||
}
|
||||
gpu_usage {
|
||||
description: "Average GPU usage per GPU card"
|
||||
type: array
|
||||
items { type: number }
|
||||
}
|
||||
memory_used {
|
||||
description: "Used memory MBs"
|
||||
type: integer
|
||||
}
|
||||
memory_free {
|
||||
description: "Free memory MBs"
|
||||
type: integer
|
||||
}
|
||||
gpu_memory_free {
|
||||
description: "GPU free memory MBs"
|
||||
type: array
|
||||
items { type: integer }
|
||||
}
|
||||
gpu_memory_used {
|
||||
description: "GPU used memory MBs"
|
||||
type: array
|
||||
items { type: integer }
|
||||
}
|
||||
network_tx {
|
||||
description: "Mbytes per second"
|
||||
type: integer
|
||||
}
|
||||
network_rx {
|
||||
description: "Mbytes per second"
|
||||
type: integer
|
||||
}
|
||||
disk_free_home {
|
||||
description: "Mbytes free space of /home drive"
|
||||
type: integer
|
||||
}
|
||||
disk_free_temp {
|
||||
description: "Mbytes free space of /tmp drive"
|
||||
type: integer
|
||||
}
|
||||
disk_read {
|
||||
description: "Mbytes read per second"
|
||||
type: integer
|
||||
}
|
||||
disk_write {
|
||||
description: "Mbytes write per second"
|
||||
type: integer
|
||||
}
|
||||
cpu_temperature {
|
||||
description: "CPU temperature"
|
||||
type: array
|
||||
items { type: number }
|
||||
}
|
||||
gpu_temperature {
|
||||
description: "GPU temperature"
|
||||
type: array
|
||||
items { type: number }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
get_all {
|
||||
"2.4" {
|
||||
description: "Returns information on all registered workers."
|
||||
request {
|
||||
type: object
|
||||
properties {
|
||||
last_seen {
|
||||
description: """Filter out workers not active for more than last_seen seconds.
|
||||
A value or 0 or 'none' will disable the filter."""
|
||||
type: integer
|
||||
default: 3600
|
||||
}
|
||||
}
|
||||
}
|
||||
response {
|
||||
type: object
|
||||
properties {
|
||||
workers {
|
||||
type: array
|
||||
items { "$ref": "#/definitions/worker" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
register {
|
||||
"2.4" {
|
||||
description: "Register a worker in the system. Called by the Worker Daemon."
|
||||
request {
|
||||
required: [ worker ]
|
||||
type: object
|
||||
properties {
|
||||
worker {
|
||||
description: "Worker id. Must be unique in company."
|
||||
type: string
|
||||
}
|
||||
timeout {
|
||||
description: "Registration timeout in seconds. If timeout seconds have passed since the worker's last call to register or status_report, the worker is automatically removed from the list of registered workers."
|
||||
type: integer
|
||||
default: 600
|
||||
}
|
||||
queues {
|
||||
description: "List of queue IDs on which the worker is listening."
|
||||
type: array
|
||||
items { type: string }
|
||||
}
|
||||
}
|
||||
}
|
||||
response {
|
||||
type: object
|
||||
properties {}
|
||||
}
|
||||
}
|
||||
}
|
||||
unregister {
|
||||
"2.4" {
|
||||
description: "Unregister a worker in the system. Called by the Worker Daemon."
|
||||
request {
|
||||
required: [ worker ]
|
||||
type: object
|
||||
properties {
|
||||
worker {
|
||||
description: "Worker id. Must be unique in company."
|
||||
type: string
|
||||
}
|
||||
}
|
||||
}
|
||||
response {
|
||||
type: object
|
||||
properties {}
|
||||
}
|
||||
}
|
||||
}
|
||||
status_report {
|
||||
"2.4" {
|
||||
description: "Called periodically by the worker daemon to report machine status"
|
||||
request {
|
||||
required: [
|
||||
worker
|
||||
timestamp
|
||||
]
|
||||
type: object
|
||||
properties {
|
||||
worker {
|
||||
description: "Worker id."
|
||||
type: string
|
||||
}
|
||||
task {
|
||||
description: "ID of a task currently being run by the worker. If no task is sent, the worker's task field will be cleared."
|
||||
type: string
|
||||
}
|
||||
queue {
|
||||
description: "ID of the queue from which task was received. If no queue is sent, the worker's queue field will be cleared."
|
||||
type: string
|
||||
}
|
||||
queues {
|
||||
description: "List of queue IDs on which the worker is listening. If null, the worker's queues list will not be updated."
|
||||
type: array
|
||||
items { type: string }
|
||||
}
|
||||
timestamp {
|
||||
description: "UNIX time in seconds since epoch."
|
||||
type: integer
|
||||
}
|
||||
machine_stats {
|
||||
description: "The machine statistics."
|
||||
"$ref": "#/definitions/machine_stats"
|
||||
}
|
||||
}
|
||||
}
|
||||
response {
|
||||
type: object
|
||||
properties {}
|
||||
}
|
||||
}
|
||||
}
|
||||
get_metric_keys {
|
||||
"2.4" {
|
||||
description: "Returns worker statistics metric keys grouped by categories."
|
||||
request {
|
||||
type: object
|
||||
properties {
|
||||
worker_ids {
|
||||
description: "List of worker ids to collect metrics for. If not provided or empty then all the company workers metrics are analyzed."
|
||||
type: array
|
||||
items { type: string }
|
||||
}
|
||||
}
|
||||
}
|
||||
response {
|
||||
type: object
|
||||
properties {
|
||||
categories {
|
||||
type: array
|
||||
description: "List of unique metric categories found in the statistics of the requested workers."
|
||||
items { "$ref": "#/definitions/metrics_category" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
get_stats {
|
||||
"2.4" {
|
||||
description: "Returns statistics for the selected workers and time range aggregated by date intervals."
|
||||
request {
|
||||
type: object
|
||||
required: [ from_date, to_date, interval, items ]
|
||||
properties {
|
||||
worker_ids {
|
||||
description: "List of worker ids to collect metrics for. If not provided or empty then all the company workers metrics are analyzed."
|
||||
type: array
|
||||
items { type: string }
|
||||
}
|
||||
from_date {
|
||||
description: "Starting time (in seconds from epoch) for collecting statistics"
|
||||
type: number
|
||||
}
|
||||
to_date {
|
||||
description: "Ending time (in seconds from epoch) for collecting statistics"
|
||||
type: number
|
||||
}
|
||||
interval {
|
||||
description: "Time interval in seconds for a single statistics point. The minimal value is 1"
|
||||
type: integer
|
||||
}
|
||||
items {
|
||||
description: "List of metric keys and requested statistics"
|
||||
type: array
|
||||
items { "$ref": "#/definitions/stat_item" }
|
||||
}
|
||||
split_by_variant {
|
||||
description: "If true then break statistics by hardware sub types"
|
||||
type: boolean
|
||||
default: false
|
||||
}
|
||||
}
|
||||
}
|
||||
response {
|
||||
type: object
|
||||
properties {
|
||||
workers {
|
||||
type: array
|
||||
description: "List of the requested workers with their statistics"
|
||||
items { "$ref": "#/definitions/worker_stats" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
get_activity_report {
|
||||
"2.4" {
|
||||
description: "Returns count of active company workers in the selected time range."
|
||||
request {
|
||||
type: object
|
||||
required: [ from_date, to_date, interval ]
|
||||
properties {
|
||||
from_date {
|
||||
description: "Starting time (in seconds from epoch) for collecting statistics"
|
||||
type: number
|
||||
}
|
||||
to_date {
|
||||
description: "Ending time (in seconds from epoch) for collecting statistics"
|
||||
type: number
|
||||
}
|
||||
interval {
|
||||
description: "Time interval in seconds for a single statistics point. The minimal value is 1"
|
||||
type: integer
|
||||
}
|
||||
}
|
||||
}
|
||||
response {
|
||||
type: object
|
||||
properties {
|
||||
total {
|
||||
description: "Activity series that include all the workers that sent reports in the given time interval."
|
||||
"$ref": "#/definitions/activity_series"
|
||||
}
|
||||
active {
|
||||
description: "Activity series that include only workers that worked on a task in the given time interval."
|
||||
"$ref": "#/definitions/activity_series"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user