compose: update schema for alpha (#4539)

Update schema.alpha.json for composability.

Contributes to #4397,  https://github.com/Azure/azure-dev-pr/issues/1682
This commit is contained in:
Wei Lim 2024-11-12 13:12:20 -08:00 коммит произвёл GitHub
Родитель bdfe989315
Коммит db0927019c
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
1 изменённых файлов: 139 добавлений и 0 удалений

Просмотреть файл

@ -352,6 +352,44 @@
]
}
},
"resources": {
"type": "object",
"additionalProperties": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"title": "Type of resource",
"description": "The type of resource to be created. (Example: db.postgres)",
"enum": [
"db.postgres",
"db.redis",
"db.mongo",
"ai.openai.model",
"host.containerapp"
]
},
"uses": {
"type": "array",
"title": "Other resources that this resource uses",
"items": {
"type": "string"
},
"uniqueItems": true
}
},
"allOf": [
{ "if": { "properties": { "type": { "const": "host.containerapp" }}}, "then": { "$ref": "#/definitions/containerAppResource" } },
{ "if": { "properties": { "type": { "const": "ai.openai.model" }}}, "then": { "$ref": "#/definitions/aiModelResource" } },
{ "if": { "properties": { "type": { "const": "db.postgres" }}}, "then": { "$ref": "#/definitions/resource"} },
{ "if": { "properties": { "type": { "const": "db.redis" }}}, "then": { "$ref": "#/definitions/resource"} },
{ "if": { "properties": { "type": { "const": "db.mongo" }}}, "then": { "$ref": "#/definitions/resource"} }
]
}
},
"pipeline": {
"type": "object",
"title": "Definition of continuous integration pipeline",
@ -1159,6 +1197,107 @@
}
}
}
},
"resource": {
"type": "object",
"additionalProperties": false,
"properties": {
"type": {
"type": "string",
"title": "Type of resource",
"description": "The type of resource to be created. (Example: db.postgres)",
"enum": [
"db.postgres",
"db.redis",
"db.mongo",
"host.containerapp",
"ai.openai.model"
]
},
"uses": {
"type": "array",
"title": "Other resources that this resource uses",
"items": {
"type": "string"
},
"uniqueItems": true
}
}
},
"containerAppResource": {
"type": "object",
"description": "A Docker-based container app.",
"additionalProperties": false,
"required": [
"port"
],
"properties": {
"type": true,
"uses": true,
"port": {
"type": "integer",
"title": "Port that the container app listens on",
"description": "Optional. The port that the container app listens on. (Default: 80)"
},
"env": {
"type": "array",
"title": "Environment variables to set for the container app",
"items": {
"type": "object",
"required": [
"name"
],
"additionalProperties": false,
"properties": {
"name": {
"type": "string",
"title": "Name of the environment variable"
},
"value": {
"type": "string",
"title": "Value of the environment variable. Supports environment variable substitution."
},
"secret": {
"type": "string",
"title": "Secret value of the environment variable. Supports environment variable substitution."
}
}
}
}
}
},
"aiModelResource": {
"type": "object",
"description": "A deployed, ready-to-use AI model.",
"additionalProperties": false,
"required": [
"model"
],
"properties": {
"type": true,
"uses": true,
"model": {
"type": "object",
"description": "The underlying AI model.",
"additionalProperties": false,
"required": [
"name",
"version"
],
"properties": {
"name": {
"type": "string",
"title": "The name of the AI model.",
"description": "Required. The name of the AI model."
},
"version": {
"type": "string",
"title": "The version of the AI model.",
"description": "Required. The version of the AI model."
}
}
}
}
}
}
}