Skip to content

Commit

Permalink
fix: set Max Network Count field to project resource policy
Browse files Browse the repository at this point in the history
  • Loading branch information
ironAiken2 committed Dec 24, 2024
1 parent 6d41a8f commit 9a113c2
Show file tree
Hide file tree
Showing 23 changed files with 160 additions and 23 deletions.
107 changes: 105 additions & 2 deletions react/data/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,12 @@ type Queries {

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

"""Added in 24.12.0."""
network(id: String!): NetworkNode

"""Added in 24.12.0."""
networks(filter: String, order: String, offset: Int, before: String, after: String, first: Int, last: Int): NetworkConnection
}

"""
Expand Down Expand Up @@ -1023,6 +1029,11 @@ type ProjectResourcePolicy {
"""
max_quota_scope_size: BigInt
max_vfolder_size: BigInt @deprecated(reason: "Deprecated since 23.09.2.")

"""
Added in 24.12.0. Limitation of the number of networks created on behalf of project.
"""
max_network_count: Int
}

type ResourcePreset {
Expand Down Expand Up @@ -1368,7 +1379,10 @@ type Endpoint implements Item {
environ: JSONString
name: String
resource_opts: JSONString
desired_session_count: Int

"""Added in 24.12.0. Replaces `desired_session_count`."""
replicas: Int
desired_session_count: Int @deprecated(reason: "Deprecated since 24.12.0. Use `replicas` instead.")
cluster_mode: String
cluster_size: Int
open_to_public: Boolean
Expand All @@ -1382,6 +1396,9 @@ type Endpoint implements Item {
status: String
lifecycle_stage: String
errors: [InferenceSessionError!]!

"""Added in 24.12.0."""
live_stat: JSONString
}

"""Added in 24.03.5."""
Expand All @@ -1399,6 +1416,9 @@ type Routing implements Item {
traffic_ratio: Float
created_at: DateTime
error_data: JSONString

"""Added in 24.12.0."""
live_stat: JSONString
}

type InferenceSessionError {
Expand Down Expand Up @@ -1595,6 +1615,42 @@ type ModelCardEdge {
cursor: String!
}

"""Added in 24.12.0."""
type NetworkNode implements Node {
"""The ID of the object"""
id: ID!
row_id: UUID
name: String
ref_name: String
driver: String
project: UUID
domain_name: String
options: JSONString
created_at: DateTime
updated_at: DateTime
}

"""Added in 24.12.0."""
type NetworkConnection {
"""Pagination data for this connection."""
pageInfo: PageInfo!

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

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

"""Added in 24.12.0. A Relay edge containing a `Network` and its cursor."""
type NetworkEdge {
"""The item at the end of the edge"""
node: NetworkNode

"""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 @@ -1799,6 +1855,15 @@ type Mutations {

"""Added in 24.09.0."""
check_and_transit_session_status(input: CheckAndTransitStatusInput!): CheckAndTransitStatus

"""Added in 24.12.0."""
create_network(driver: String, name: String!, project_id: UUID!): CreateNetwork

"""Added in 24.12.0."""
modify_network(network: String!, props: ModifyNetworkInput!): ModifyNetwork

"""Added in 24.12.0."""
delete_network(network: String!): DeleteNetwork
}

type ModifyAgent {
Expand Down Expand Up @@ -2310,6 +2375,11 @@ input CreateProjectResourcePolicyInput {
"""
max_quota_scope_size: BigInt
max_vfolder_size: BigInt @deprecated(reason: "Deprecated since 23.09.2.")

"""
Added in 24.12.0. Limitation of the number of networks created on behalf of project. Set as -1 to allow creating unlimited networks.
"""
max_network_count: Int
}

type ModifyProjectResourcePolicy {
Expand All @@ -2328,6 +2398,11 @@ input ModifyProjectResourcePolicyInput {
"""
max_quota_scope_size: BigInt
max_vfolder_size: BigInt @deprecated(reason: "Deprecated since 23.09.2.")

"""
Added in 24.12.0. Limitation of the number of networks created on behalf of project. Set as -1 to allow creating unlimited networks.
"""
max_network_count: Int
}

type DeleteProjectResourcePolicy {
Expand Down Expand Up @@ -2555,7 +2630,10 @@ input ModifyEndpointInput {
resource_opts: JSONString
cluster_mode: String
cluster_size: Int
desired_session_count: Int

"""Added in 24.12.0. Replaces `desired_session_count`."""
replicas: Int
desired_session_count: Int @deprecated(reason: "Deprecated since 24.12.0. Use `replicas` instead.")
image: ImageRefType
name: String
resource_group: String
Expand Down Expand Up @@ -2610,4 +2688,29 @@ type CheckAndTransitStatus {
input CheckAndTransitStatusInput {
ids: [GlobalIDField]!
client_mutation_id: String
}

"""Added in 24.12.0."""
type CreateNetwork {
ok: Boolean
msg: String
network: NetworkNode
}

"""Added in 24.12.0."""
type ModifyNetwork {
ok: Boolean
msg: String
network: NetworkNode
}

"""Added in 24.12.0."""
input ModifyNetworkInput {
name: String!
}

"""Added in 24.12.0."""
type DeleteNetwork {
ok: Boolean
msg: String
}
13 changes: 13 additions & 0 deletions react/src/components/ProjectResourcePolicySettingModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const ProjectResourcePolicySettingModal: React.FC<Props> = ({
max_vfolder_count @since(version: "23.09.6")
max_quota_scope_size @since(version: "23.09.2")
# ---------------- END ---------------------
max_network_count @since(version: "24.12.0")
}
`,
projectResourcePolicyFrgmt,
Expand Down Expand Up @@ -103,6 +104,7 @@ const ProjectResourcePolicySettingModal: React.FC<Props> = ({
// Initialize unlimited values as a default when creating a new policy.\
max_vfolder_count: 0,
max_quota_scope_size: -1,
max_network_count: -1,
};
}
let maxQuotaScopeSize = projectResourcePolicy?.max_quota_scope_size;
Expand Down Expand Up @@ -134,6 +136,7 @@ const ProjectResourcePolicySettingModal: React.FC<Props> = ({
values?.max_quota_scope_size === -1
? -1
: GBToBytes(values?.max_quota_scope_size),
max_network_count: values?.max_network_count || -1,
};
if (!supportMaxVfolderCount) {
delete props.max_vfolder_count;
Expand Down Expand Up @@ -272,6 +275,16 @@ const ProjectResourcePolicySettingModal: React.FC<Props> = ({
<InputNumber min={0} addonAfter="GB" style={{ width: '100%' }} />
</FormItemWithUnlimited>
) : null}
{baiClient?.isManagerVersionCompatibleWith('24.12.0') ? (
<FormItemWithUnlimited
name={'max_network_count'}
unlimitedValue={-1}
label={t('resourcePolicy.MaxNetworkCount')}
style={{ width: '100%', margin: 0 }}
>
<InputNumber min={0} style={{ width: '100%' }} />
</FormItemWithUnlimited>
) : null}
</Flex>
</Form>
</BAIModal>
Expand Down
3 changes: 2 additions & 1 deletion resources/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,8 @@
"NoDataToExport": "Die Daten für den CSV-Extrakt sind nicht vorhanden.",
"ExportCSV": "CSV exportieren",
"Tools": "Werkzeuge",
"MemorySizeExceedsLimit": "Die Speichergröße sollte weniger als 300 PiB betragen"
"MemorySizeExceedsLimit": "Die Speichergröße sollte weniger als 300 PiB betragen",
"MaxNetworkCount": "Maximale Netzwerkanzahl"
},
"registry": {
"Hostname": "Hostname",
Expand Down
3 changes: 2 additions & 1 deletion resources/i18n/el.json
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,8 @@
"NoDataToExport": "Τα δεδομένα για το απόσπασμα CSV δεν υπάρχουν.",
"ExportCSV": "εξαγωγή CSV",
"Tools": "Εργαλεία",
"MemorySizeExceedsLimit": "Το μέγεθος της μνήμης πρέπει να είναι μικρότερο από 300 PiB"
"MemorySizeExceedsLimit": "Το μέγεθος της μνήμης πρέπει να είναι μικρότερο από 300 PiB",
"MaxNetworkCount": "Μέγιστος αριθμός δικτύου"
},
"registry": {
"Hostname": "Όνομα κεντρικού υπολογιστή",
Expand Down
3 changes: 2 additions & 1 deletion resources/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1212,7 +1212,8 @@
"NoDataToExport": "The data for the CSV extract does not exist.",
"ExportCSV": "export CSV",
"Tools": "Tools",
"MemorySizeExceedsLimit": "Memory size should be less than 300 PiB"
"MemorySizeExceedsLimit": "Memory size should be less than 300 PiB",
"MaxNetworkCount": "Max Network Count"
},
"registry": {
"Hostname": "Hostname",
Expand Down
3 changes: 2 additions & 1 deletion resources/i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,8 @@
"NoDataToExport": "Los datos para el extracto CSV no existen.",
"ExportCSV": "exportar CSV",
"Tools": "Herramientas",
"MemorySizeExceedsLimit": "El tamaño de la memoria debe ser inferior a 300 PiB"
"MemorySizeExceedsLimit": "El tamaño de la memoria debe ser inferior a 300 PiB",
"MaxNetworkCount": "Recuento máximo de red"
},
"resourcePreset": {
"AboutToDeletePreset": "Está a punto de borrar este preajuste:",
Expand Down
3 changes: 2 additions & 1 deletion resources/i18n/fi.json
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,8 @@
"NoDataToExport": "CSV-otteen tietoja ei ole olemassa.",
"ExportCSV": "vie CSV",
"Tools": "Työkalut",
"MemorySizeExceedsLimit": "Muistin koon tulee olla alle 300 PiB"
"MemorySizeExceedsLimit": "Muistin koon tulee olla alle 300 PiB",
"MaxNetworkCount": "Verkkojen enimmäismäärä"
},
"resourcePreset": {
"AboutToDeletePreset": "Olet poistamassa tätä esiasetusta:",
Expand Down
3 changes: 2 additions & 1 deletion resources/i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,8 @@
"NoDataToExport": "Les données pour l'extrait CSV n'existent pas.",
"ExportCSV": "exporter au format CSV",
"Tools": "Outils",
"MemorySizeExceedsLimit": "La taille de la mémoire doit être inférieure à 300 PiB"
"MemorySizeExceedsLimit": "La taille de la mémoire doit être inférieure à 300 PiB",
"MaxNetworkCount": "Nombre maximum de réseaux"
},
"registry": {
"Hostname": "Nom d'hôte",
Expand Down
3 changes: 2 additions & 1 deletion resources/i18n/id.json
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,8 @@
"NoDataToExport": "Data untuk ekstrak CSV tidak ada.",
"ExportCSV": "ekspor CSV",
"Tools": "Peralatan",
"MemorySizeExceedsLimit": "Ukuran memori harus kurang dari 300 PiB"
"MemorySizeExceedsLimit": "Ukuran memori harus kurang dari 300 PiB",
"MaxNetworkCount": "Jumlah Jaringan Maks"
},
"registry": {
"Hostname": "Nama host",
Expand Down
3 changes: 2 additions & 1 deletion resources/i18n/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,8 @@
"NoDataToExport": "I dati per l'estrazione CSV non esistono.",
"ExportCSV": "esportare CSV",
"Tools": "Utensili",
"MemorySizeExceedsLimit": "La dimensione della memoria deve essere inferiore a 300 PiB"
"MemorySizeExceedsLimit": "La dimensione della memoria deve essere inferiore a 300 PiB",
"MaxNetworkCount": "Conteggio massimo della rete"
},
"registry": {
"Hostname": "Nome host",
Expand Down
3 changes: 2 additions & 1 deletion resources/i18n/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,8 @@
"NoDataToExport": "CSV抽出用のデータが存在しません。",
"ExportCSV": "CSVエクスポート",
"Tools": "ツール",
"MemorySizeExceedsLimit": "メモリ サイズは 300 PiB 未満である必要があります"
"MemorySizeExceedsLimit": "メモリ サイズは 300 PiB 未満である必要があります",
"MaxNetworkCount": "最大ネットワーク数"
},
"registry": {
"Hostname": "ホスト名",
Expand Down
3 changes: 2 additions & 1 deletion resources/i18n/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -1199,7 +1199,8 @@
"NoDataToExport": "CSV 추출을 위한 데이터가 존재하지 않습니다. ",
"ExportCSV": "CSV로 내보내기",
"Tools": "도구",
"MemorySizeExceedsLimit": "메모리 크기는 300PiB 미만이어야 합니다."
"MemorySizeExceedsLimit": "메모리 크기는 300PiB 미만이어야 합니다.",
"MaxNetworkCount": "최대 네트워크 수"
},
"registry": {
"Hostname": "호스트명",
Expand Down
3 changes: 2 additions & 1 deletion resources/i18n/mn.json
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,8 @@
"NoDataToExport": "CSV хандалтын өгөгдөл байхгүй байна.",
"ExportCSV": "CSV экспортлох",
"Tools": "Багаж хэрэгсэл",
"MemorySizeExceedsLimit": "Санах ойн хэмжээ 300 PiB-ээс бага байх ёстой"
"MemorySizeExceedsLimit": "Санах ойн хэмжээ 300 PiB-ээс бага байх ёстой",
"MaxNetworkCount": "Хамгийн их сүлжээний тоо"
},
"registry": {
"Hostname": "Хостын нэр",
Expand Down
3 changes: 2 additions & 1 deletion resources/i18n/ms.json
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,8 @@
"NoDataToExport": "Data untuk ekstrak CSV tidak wujud.",
"ExportCSV": "eksport CSV",
"Tools": "Alatan",
"MemorySizeExceedsLimit": "Saiz memori hendaklah kurang daripada 300 PiB"
"MemorySizeExceedsLimit": "Saiz memori hendaklah kurang daripada 300 PiB",
"MaxNetworkCount": "Kiraan Rangkaian Maks"
},
"registry": {
"Hostname": "Nama Hos",
Expand Down
3 changes: 2 additions & 1 deletion resources/i18n/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,8 @@
"NoDataToExport": "Dane do ekstraktu CSV nie istnieją.",
"ExportCSV": "eksportuj plik CSV",
"Tools": "Narzędzia",
"MemorySizeExceedsLimit": "Rozmiar pamięci powinien być mniejszy niż 300 PiB"
"MemorySizeExceedsLimit": "Rozmiar pamięci powinien być mniejszy niż 300 PiB",
"MaxNetworkCount": "Maksymalna liczba sieci"
},
"registry": {
"Hostname": "Nazwa hosta",
Expand Down
3 changes: 2 additions & 1 deletion resources/i18n/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,8 @@
"NoDataToExport": "Os dados para a extração CSV não existem.",
"ExportCSV": "exportar CSV",
"Tools": "Ferramentas",
"MemorySizeExceedsLimit": "O tamanho da memória deve ser inferior a 300 PiB"
"MemorySizeExceedsLimit": "O tamanho da memória deve ser inferior a 300 PiB",
"MaxNetworkCount": "Contagem máxima de rede"
},
"registry": {
"Hostname": "nome de anfitrião",
Expand Down
3 changes: 2 additions & 1 deletion resources/i18n/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,8 @@
"NoDataToExport": "Os dados para a extração CSV não existem.",
"ExportCSV": "exportar CSV",
"Tools": "Ferramentas",
"MemorySizeExceedsLimit": "O tamanho da memória deve ser inferior a 300 PiB"
"MemorySizeExceedsLimit": "O tamanho da memória deve ser inferior a 300 PiB",
"MaxNetworkCount": "Contagem máxima de rede"
},
"registry": {
"Hostname": "nome de anfitrião",
Expand Down
3 changes: 2 additions & 1 deletion resources/i18n/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,8 @@
"NoDataToExport": "Данные для извлечения CSV не существуют.",
"ExportCSV": "экспортировать CSV",
"Tools": "Инструменты",
"MemorySizeExceedsLimit": "Размер памяти должен быть менее 300 ПиБ."
"MemorySizeExceedsLimit": "Размер памяти должен быть менее 300 ПиБ.",
"MaxNetworkCount": "Максимальное количество сетей"
},
"registry": {
"Hostname": "Имя хоста",
Expand Down
3 changes: 2 additions & 1 deletion resources/i18n/th.json
Original file line number Diff line number Diff line change
Expand Up @@ -1194,7 +1194,8 @@
"NoDataToExport": "ไม่มีข้อมูลสำหรับการส่งออก CSV",
"ExportCSV": "ส่งออก CSV",
"Tools": "เครื่องมือ",
"MemorySizeExceedsLimit": "ขนาดหน่วยความจำควรน้อยกว่า 300 PiB"
"MemorySizeExceedsLimit": "ขนาดหน่วยความจำควรน้อยกว่า 300 PiB",
"MaxNetworkCount": "จำนวนเครือข่ายสูงสุด"
},
"registry": {
"Hostname": "ชื่อโฮสต์",
Expand Down
Loading

0 comments on commit 9a113c2

Please sign in to comment.