Skip to content

Commit 6f6a62e

Browse files
committed
feat(FR-2862): add preset mode for deployment revision creation
1 parent 3b92854 commit 6f6a62e

37 files changed

Lines changed: 2575 additions & 3485 deletions

data/schema.graphql

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9235,10 +9235,10 @@ input ModelConfigInput
92359235
@join__type(graph: STRAWBERRY)
92369236
{
92379237
"""Name of the model."""
9238-
name: String!
9238+
name: String = null
92399239

92409240
"""Path to the model file."""
9241-
modelPath: String!
9241+
modelPath: String = null
92429242

92439243
"""Configuration for the model service."""
92449244
service: ModelServiceConfigInput = null
@@ -9264,7 +9264,7 @@ input ModelDefinitionInput
92649264
@join__type(graph: STRAWBERRY)
92659265
{
92669266
"""List of models in the model definition."""
9267-
models: [ModelConfigInput!]!
9267+
models: [ModelConfigInput!] = null
92689268
}
92699269

92709270
"""
@@ -9431,22 +9431,22 @@ input ModelHealthCheckInput
94319431
@join__type(graph: STRAWBERRY)
94329432
{
94339433
"""Interval in seconds between health checks."""
9434-
interval: Float! = 10
9434+
interval: Float = null
94359435

94369436
"""Path to check for health status."""
9437-
path: String!
9437+
path: String = null
94389438

94399439
"""Maximum number of retries for health check."""
9440-
maxRetries: Int! = 10
9440+
maxRetries: Int = null
94419441

94429442
"""Maximum time in seconds to wait for a health check response."""
9443-
maxWaitTime: Float! = 15
9443+
maxWaitTime: Float = null
94449444

94459445
"""Expected HTTP status code for a healthy response."""
9446-
expectedStatusCode: Int! = 200
9446+
expectedStatusCode: Int = null
94479447

94489448
"""Initial delay in seconds before the first health check."""
9449-
initialDelay: Float! = 60
9449+
initialDelay: Float = null
94509450
}
94519451

94529452
"""Added in 26.4.2. Metadata describing a model entry."""
@@ -9558,7 +9558,7 @@ input ModelMountConfigInput
95589558
{
95599559
vfolderId: ID!
95609560
mountDestination: String!
9561-
definitionPath: String!
9561+
definitionPath: String = null
95629562
}
95639563

95649564
"""
@@ -9808,16 +9808,16 @@ input ModelServiceConfigInput
98089808
"""
98099809
List of pre-start actions to execute before starting the model service.
98109810
"""
9811-
preStartActions: [PreStartActionInput!]!
9811+
preStartActions: [PreStartActionInput!] = null
98129812

98139813
"""Command to start the model service."""
98149814
startCommand: [String!] = null
98159815

98169816
"""Shell configured for the model service."""
9817-
shell: String! = "/bin/bash"
9817+
shell: String = null
98189818

9819-
"""Port number for the model service. Must be greater than 1."""
9820-
port: Int!
9819+
"""Port number for the model service."""
9820+
port: Int = null
98219821

98229822
"""Health check configuration for the model service."""
98239823
healthCheck: ModelHealthCheckInput = null

packages/backend.ai-ui/src/helper/index.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,23 @@ export const isValidUUID = (uuid: string) => {
430430
return regex.test(uuid);
431431
};
432432

433+
/**
434+
* Resolve a UUID from either a raw UUID or a Strawberry global id like
435+
* `ImageV2:<uuid>`. Useful for mutation inputs that are declared as `ID!`
436+
* but parsed as `UUID!` server-side — callers can pass either form and get
437+
* a clean UUID back. `toLocalId` calls `atob`, which throws on non-base64
438+
* input, so we guard with try/catch and verify the decoded value is a UUID.
439+
*/
440+
export const safeDecodeUuid = (idOrGlobalId: string): string | undefined => {
441+
if (isValidUUID(idOrGlobalId)) return idOrGlobalId;
442+
try {
443+
const decoded = toLocalId(idOrGlobalId);
444+
return decoded && isValidUUID(decoded) ? decoded : undefined;
445+
} catch {
446+
return undefined;
447+
}
448+
};
449+
433450
export const convertToUUID = (id: string): string => {
434451
if (isValidUUID(id) && /^[0-9a-fA-F]{36}$/.test(id)) {
435452
return id;

0 commit comments

Comments
 (0)