Skip to content

Commit

Permalink
chore: update GraphQL API Schema file to latest (#1982)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyujin-cho committed Mar 31, 2024
1 parent 4a0fb50 commit 059c31d
Showing 1 changed file with 168 additions and 26 deletions.
194 changes: 168 additions & 26 deletions src/ai/backend/manager/api/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type Queries {
node(
"""The ID of the object"""
id: ID!
): AsyncNode
): Node
agent(agent_id: String!): Agent
agent_list(limit: Int!, offset: Int!, filter: String, order: String, scaling_group: String, status: String): AgentList
agents(scaling_group: String, status: String): [Agent]
Expand All @@ -24,7 +24,13 @@ type Queries {
group_nodes(filter: String, order: String, offset: Int, before: String, after: String, first: Int, last: Int): GroupConnection
group(id: UUID!, domain_name: String): Group
groups_by_name(name: String!, domain_name: String): [Group]
groups(domain_name: String, is_active: Boolean): [Group]
groups(
domain_name: String
is_active: Boolean

"""Added since 24.03.0. Available values: GENERAL, MODEL_STORE"""
type: [String] = ["GENERAL"]
): [Group]
image(reference: String!, architecture: String = "aarch64"): Image
images(is_installed: Boolean, is_operation: Boolean): [Image]
user(domain_name: String, email: String): User
Expand Down Expand Up @@ -78,13 +84,19 @@ type Queries {
quota_scope(storage_host_name: String!, quota_scope_id: String!): QuotaScope
container_registry(hostname: String!): ContainerRegistry
container_registries: [ContainerRegistry]

"""Added in 24.03.0."""
model_card(id: String!): ModelCard

"""Added in 24.03.0."""
model_cards(filter: String, order: String, offset: Int, before: String, after: String, first: Int, last: Int): ModelCardConnection
}

"""
This GraphQL Relay Node extension is for running asynchronous resolvers and fine-grained handling of global id.
Refer to: https://github.com/graphql-python/graphene/blob/master/graphene/relay/node.py
"""
interface AsyncNode {
interface Node {
"""The ID of the object"""
id: ID!
}
Expand Down Expand Up @@ -218,7 +230,7 @@ type Domain {
scaling_groups: [String]
}

type GroupNode implements AsyncNode {
type GroupNode implements Node {
"""The ID of the object"""
id: ID!
name: String
Expand Down Expand Up @@ -272,7 +284,7 @@ type UserEdge {
cursor: String!
}

type UserNode implements AsyncNode {
type UserNode implements Node {
"""The ID of the object"""
id: ID!

Expand Down Expand Up @@ -338,6 +350,9 @@ type Group {
allowed_vfolder_hosts: JSONString
integration_id: String
resource_policy: String

"""Added since 24.03.0."""
type: String
scaling_groups: [String]
}

Expand Down Expand Up @@ -397,6 +412,11 @@ type User implements Item {
totp_activated: Boolean
totp_activated_at: DateTime
sudo_session_enabled: Boolean

"""
Added in 24.03.0. Used as the default authentication credential for password-based logins and sets the user's total resource usage limit. User's main_access_key cannot be deleted, and only super-admin can replace main_access_key.
"""
main_access_key: String
groups: [UserGroup]
}

Expand Down Expand Up @@ -529,9 +549,9 @@ type KeyPairResourcePolicy {
max_containers_per_session: Int
idle_timeout: BigInt
allowed_vfolder_hosts: JSONString
max_vfolder_count: Int @deprecated(reason: "Deprecated since 23.09.4.")
max_vfolder_size: BigInt @deprecated(reason: "Deprecated since 23.09.4.")
max_quota_scope_size: BigInt @deprecated(reason: "Deprecated since 23.09.4.")
max_vfolder_count: Int @deprecated(reason: "Deprecated since 23.09.4")
max_vfolder_size: BigInt @deprecated(reason: "Deprecated since 23.09.4")
max_quota_scope_size: BigInt @deprecated(reason: "Deprecated since 23.09.4")
}

type UserResourcePolicy {
Expand All @@ -544,7 +564,12 @@ type UserResourcePolicy {

"""Added since 24.03.1. Limitation of the quota size of user vfolders."""
max_quota_scope_size: BigInt
max_vfolder_size: BigInt @deprecated(reason: "Deprecated since 23.09.1.")
max_vfolder_size: BigInt @deprecated(reason: "Deprecated since 23.09.1")

"""
Added since 23.09.10. Maximum available number of sessions per single model service which the user is in charge of.
"""
max_session_count_per_model_session: Int
}

type ProjectResourcePolicy {
Expand All @@ -557,7 +582,7 @@ type ProjectResourcePolicy {

"""Added since 24.03.1. Limitation of the quota size of project vfolders."""
max_quota_scope_size: BigInt
max_vfolder_size: BigInt @deprecated(reason: "Deprecated since 23.09.1.")
max_vfolder_size: BigInt @deprecated(reason: "Deprecated since 23.09.1")
}

type ResourcePreset {
Expand Down Expand Up @@ -697,16 +722,31 @@ type PredefinedAtomicPermission {
type Endpoint implements Item {
id: ID
endpoint_id: UUID
image: String
image: String @deprecated(reason: "Deprecated since 23.09.9; use `image_object`")

"""Added at 23.09.9"""
image_object: ImageNode
domain: String
project: String
resource_group: String
resource_slots: JSONString
url: String
model: UUID
model_mount_destiation: String
created_user: UUID
session_owner: UUID
created_user: UUID @deprecated(reason: "Deprecated since 23.09.8; use `created_user_id`")

"""Added at 23.09.8"""
created_user_email: String

"""Added at 23.09.8"""
created_user_id: UUID
session_owner: UUID @deprecated(reason: "Deprecated since 23.09.8; use `session_owner_id`")

"""Added at 23.09.8"""
session_owner_email: String

"""Added at 23.09.8"""
session_owner_id: UUID
tag: String
startup_command: String
bootstrap_script: String
Expand All @@ -727,6 +767,22 @@ type Endpoint implements Item {
errors: [InferenceSessionError!]!
}

type ImageNode implements Node {
"""The ID of the object"""
id: ID!
name: String
humanized_name: String
tag: String
registry: String
architecture: String
is_local: Boolean
digest: String
labels: [KVPair]
size_bytes: BigInt
resource_limits: [ResourceLimit]
supported_accelerators: [String]
}

type Routing implements Item {
id: ID
routing_id: UUID
Expand Down Expand Up @@ -795,12 +851,6 @@ type ContainerRegistry implements Node {
config: ContainerRegistryConfig
}

"""An object with an ID"""
interface Node {
"""The ID of the object"""
id: ID!
}

type ContainerRegistryConfig {
url: String!
type: String!
Expand All @@ -810,6 +860,58 @@ type ContainerRegistryConfig {
ssl_verify: Boolean
}

type ModelCard implements Node {
"""The ID of the object"""
id: ID!
name: String
vfolder: VirtualFolder
author: String

"""Human readable name of the model."""
title: String
version: String

"""The time the model was created."""
created_at: DateTime

"""The last time the model was modified."""
modified_at: DateTime
description: String
task: String
category: String
architecture: String
framework: [String]
label: [String]
license: String
min_resource: JSONString
readme: String

"""
Type (mostly extension of the filename) of the README file. e.g. md, rst, txt, ...
"""
readme_filetype: String
}

type ModelCardConnection {
"""Pagination data for this connection."""
pageInfo: PageInfo!

"""Contains the nodes in this connection."""
edges: [ModelCardEdge]!

"""Total count of the GQL nodes of the query."""
count: Int
}

"""A Relay edge containing a `ModelCard` and its cursor."""
type ModelCardEdge {
"""The item at the end of the edge"""
node: ModelCard

"""A cursor for use in pagination"""
cursor: String!
}

"""All available GraphQL mutations."""
type Mutations {
modify_agent(id: String!, props: ModifyAgentInput!): ModifyAgent
Expand Down Expand Up @@ -904,6 +1006,7 @@ type Mutations {
create_container_registry(hostname: String!, props: CreateContainerRegistryInput!): CreateContainerRegistry
modify_container_registry(hostname: String!, props: ModifyContainerRegistryInput!): ModifyContainerRegistry
delete_container_registry(hostname: String!): DeleteContainerRegistry
modify_endpoint(endpoint_id: UUID!, props: ModifyEndpointInput!): ModifyEndpoint
}

type ModifyAgent {
Expand Down Expand Up @@ -971,6 +1074,8 @@ type CreateGroup {
}

input GroupInput {
"""Added since 24.03.0. Available values: GENERAL, MODEL_STORE"""
type: String = "GENERAL"
description: String = ""
is_active: Boolean = true
domain_name: String!
Expand Down Expand Up @@ -1061,6 +1166,7 @@ input ModifyUserInput {
totp_activated: Boolean
resource_policy: String
sudo_session_enabled: Boolean
main_access_key: String
}

"""
Expand Down Expand Up @@ -1212,9 +1318,9 @@ input CreateKeyPairResourcePolicyInput {
max_containers_per_session: Int!
idle_timeout: BigInt!
allowed_vfolder_hosts: JSONString
max_vfolder_count: Int @deprecated(reason: "Deprecated since 23.09.4.")
max_vfolder_size: BigInt @deprecated(reason: "Deprecated since 23.09.4.")
max_quota_scope_size: BigInt @deprecated(reason: "Deprecated since 23.09.4.")
max_vfolder_count: Int @deprecated(reason: "Deprecated since 23.09.4")
max_vfolder_size: BigInt @deprecated(reason: "Deprecated since 23.09.4")
max_quota_scope_size: BigInt @deprecated(reason: "Deprecated since 23.09.4")
}

type ModifyKeyPairResourcePolicy {
Expand All @@ -1231,9 +1337,9 @@ input ModifyKeyPairResourcePolicyInput {
max_containers_per_session: Int
idle_timeout: BigInt
allowed_vfolder_hosts: JSONString
max_vfolder_count: Int @deprecated(reason: "Deprecated since 23.09.4.")
max_vfolder_size: BigInt @deprecated(reason: "Deprecated since 23.09.4.")
max_quota_scope_size: BigInt @deprecated(reason: "Deprecated since 23.09.4.")
max_vfolder_count: Int @deprecated(reason: "Deprecated since 23.09.4")
max_vfolder_size: BigInt @deprecated(reason: "Deprecated since 23.09.4")
max_quota_scope_size: BigInt @deprecated(reason: "Deprecated since 23.09.4")
}

type DeleteKeyPairResourcePolicy {
Expand All @@ -1253,6 +1359,11 @@ input CreateUserResourcePolicyInput {

"""Added since 24.03.1. Limitation of the quota size of user vfolders."""
max_quota_scope_size: BigInt

"""
Added since 24.03.1. Maximum available number of sessions per single model service which the user is in charge of.
"""
max_session_count_per_model_session: Int
}

type ModifyUserResourcePolicy {
Expand All @@ -1266,6 +1377,11 @@ input ModifyUserResourcePolicyInput {

"""Added since 24.03.1. Limitation of the quota size of user vfolders."""
max_quota_scope_size: BigInt

"""
Added since 24.03.1. Maximum available number of sessions per single model service which the user is in charge of.
"""
max_session_count_per_model_session: Int
}

type DeleteUserResourcePolicy {
Expand Down Expand Up @@ -1453,4 +1569,30 @@ input ModifyContainerRegistryInput {

type DeleteContainerRegistry {
container_registry: ContainerRegistry
}
}

type ModifyEndpoint {
ok: Boolean
msg: String

"""Added at 23.09.8"""
endpoint: Endpoint
}

input ModifyEndpointInput {
resource_slots: JSONString
resource_opts: JSONString
cluster_mode: String
cluster_size: Int
desired_session_count: Int
image: ImageRefType
name: String
resource_group: String
open_to_public: Boolean
}

input ImageRefType {
name: String!
registry: String
architecture: String
}

0 comments on commit 059c31d

Please sign in to comment.