Implement app.yaml job schema

This commit is contained in:
Arshia Ghafoori
2025-01-11 01:04:16 +04:00
parent 7f23611243
commit a01ead1834
5 changed files with 387 additions and 5 deletions

View File

@@ -67,6 +67,15 @@
"$ref": "#/definitions/HealthCheckV1"
}
},
"jobs": {
"type": [
"array",
"null"
],
"items": {
"$ref": "#/definitions/Job"
}
},
"locality": {
"description": "Location-related configuration for the app.",
"anyOf": [
@@ -246,6 +255,85 @@
}
}
},
"ExecutableJob": {
"type": "object",
"properties": {
"capabilities": {
"anyOf": [
{
"$ref": "#/definitions/ExecutableJobCompatibilityMapV1"
},
{
"type": "null"
}
]
},
"cli_args": {
"description": "CLI arguments passed to the runner. Only applicable for runners that accept CLI arguments.",
"type": [
"array",
"null"
],
"items": {
"type": "string"
}
},
"command": {
"description": "The command to run. Defaults to the package's entrypoint.",
"type": [
"string",
"null"
]
},
"env": {
"description": "Environment variables.",
"type": [
"object",
"null"
],
"additionalProperties": {
"type": "string"
}
},
"package": {
"description": "The package that contains the command to run. Defaults to the app config's package.",
"anyOf": [
{
"$ref": "#/definitions/PackageSource"
},
{
"type": "null"
}
]
},
"volumes": {
"type": [
"array",
"null"
],
"items": {
"$ref": "#/definitions/AppVolume"
}
}
}
},
"ExecutableJobCompatibilityMapV1": {
"type": "object",
"properties": {
"memory": {
"description": "Instance memory settings.",
"anyOf": [
{
"$ref": "#/definitions/AppConfigCapabilityMemoryV1"
},
{
"type": "null"
}
]
}
},
"additionalProperties": true
},
"HealthCheckHttpV1": {
"description": "Health check configuration for http endpoints.",
"type": "object",
@@ -443,6 +531,45 @@
}
}
},
"Job": {
"description": "Job configuration.",
"type": "object",
"required": [
"name",
"trigger"
],
"properties": {
"execute": {
"anyOf": [
{
"$ref": "#/definitions/ExecutableJob"
},
{
"type": "null"
}
]
},
"fetch": {
"anyOf": [
{
"$ref": "#/definitions/HttpRequest"
},
{
"type": "null"
}
]
},
"name": {
"type": "string"
},
"trigger": {
"$ref": "#/definitions/JobTrigger"
}
}
},
"JobTrigger": {
"type": "string"
},
"Locality": {
"type": "object",
"required": [