Skip to content

Commit

Permalink
Change event trigger replica properties to executions, add polling in… (
Browse files Browse the repository at this point in the history
#23810)

* Change event trigger replica properties to executions, add polling interval to event trigger, fix typos and descriptions to accommodate both apps and jobs

* Fix validation errors

* code review comments

* Fix formatting errors

* Code review comments
  • Loading branch information
trajkobal committed May 18, 2023
1 parent a7f520b commit 719fee7
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 80 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -530,11 +530,11 @@
}
},
"ScaleRuleAuth": {
"description": "Auth Secrets for Container App Scale Rule",
"description": "Auth Secrets for Scale Rule",
"type": "object",
"properties": {
"secretRef": {
"description": "Name of the Container App secret from which to pull the auth params.",
"description": "Name of the secret from which to pull the auth params.",
"type": "string"
},
"triggerParameter": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@
},
"eventTriggerConfig": {
"type": "object",
"description": "Manual trigger configuration for a single execution job. Properties replicaCompletionCount and parallelism would be set to 1 by default",
"description": "Trigger configuration of an event driven job.",
"properties": {
"replicaCompletionCount": {
"$ref": "#/definitions/ReplicaCompletionCount"
Expand All @@ -720,7 +720,7 @@
"$ref": "#/definitions/Parallelism"
},
"scale": {
"$ref": "./CommonDefinitions.json#/definitions/Scale"
"$ref": "#/definitions/JobScale"
}
}
},
Expand Down Expand Up @@ -935,6 +935,64 @@
"format": "int32",
"type": "integer"
},
"PollingInterval": {
"description": "Interval to check each event source in seconds. Defaults to 30s",
"format": "int32",
"type": "integer"
},
"JobScaleRule": {
"description": "Scaling rule.",
"type": "object",
"properties": {
"name": {
"description": "Scale Rule Name",
"type": "string"
},
"type": {
"description": "Type of the scale rule\neg: azure-servicebus, redis etc.",
"type": "string"
},
"metadata": {
"description": "Metadata properties to describe the scale rule.",
"type": "object"
},
"auth": {
"description": "Authentication secrets for the scale rule.",
"type": "array",
"items": {
"$ref": "./CommonDefinitions.json#/definitions/ScaleRuleAuth"
}
}
}
},
"JobScale": {
"description": "Scaling configurations for event driven jobs.",
"type": "object",
"properties": {
"pollingInterval": {
"$ref": "#/definitions/PollingInterval"
},
"minExecutions": {
"format": "int32",
"description": "Minimum number of job executions that are created for a trigger, default 0",
"type": "integer",
"default": 0
},
"maxExecutions": {
"format": "int32",
"description": "Maximum number of job executions that are created for a trigger, default 100.",
"type": "integer",
"default": 100
},
"rules": {
"description": "Scaling rules.",
"type": "array",
"items": {
"$ref": "#/definitions/JobScaleRule"
}
}
}
},
"JobExecutionBase": {
"description": "Container App's Job execution name.",
"type": "object",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,15 @@
"replicaCompletionCount": 1,
"parallelism": 4,
"scale": {
"minReplicas": 1,
"maxReplicas": 5,
"pollingInterval": 40,
"minExecutions": 1,
"maxExecutions": 5,
"rules": [
{
"name": "servicebuscalingrule",
"custom": {
"type": "azure-servicebus",
"metadata": {
"concurrentRequests": "50"
}
"type": "azure-servicebus",
"metadata": {
"topicName": "my-topic"
}
}
]
Expand All @@ -36,24 +35,7 @@
"containers": [
{
"image": "repo/testcontainerAppsJob0:v1",
"name": "testcontainerAppsJob0",
"probes": [
{
"type": "Liveness",
"httpGet": {
"path": "/health",
"port": 8080,
"httpHeaders": [
{
"name": "Custom-Header",
"value": "Awesome"
}
]
},
"initialDelaySeconds": 5,
"periodSeconds": 3
}
]
"name": "testcontainerAppsJob0"
}
],
"initContainers": [
Expand Down Expand Up @@ -95,16 +77,15 @@
"replicaCompletionCount": 1,
"parallelism": 4,
"scale": {
"minReplicas": 1,
"maxReplicas": 5,
"pollingInterval": 20,
"minExecutions": 1,
"maxExecutions": 5,
"rules": [
{
"name": "servicebuscalingrule",
"custom": {
"type": "azure-servicebus",
"metadata": {
"concurrentRequests": "50"
}
"name": "githubscalingrule",
"type": "github-runner",
"metadata": {
"githubAPIURL": "https://api.github.com"
}
}
]
Expand All @@ -120,24 +101,7 @@
"resources": {
"cpu": 0.2,
"memory": "100Mi"
},
"probes": [
{
"type": "Liveness",
"httpGet": {
"path": "/health",
"port": 8080,
"httpHeaders": [
{
"name": "Custom-Header",
"value": "Awesome"
}
]
},
"initialDelaySeconds": 3,
"periodSeconds": 3
}
]
}
}
],
"initContainers": [
Expand Down Expand Up @@ -181,16 +145,16 @@
"replicaCompletionCount": 1,
"parallelism": 4,
"scale": {
"minReplicas": 1,
"maxReplicas": 5,
"minExecutions": 1,
"maxExecutions": 5,
"pollingInterval": 20,
"rules": [
{
"name": "servicebuscalingrule",
"custom": {
"type": "azure-servicebus",
"metadata": {
"concurrentRequests": "50"
}
"type": "azure-servicebus",
"metadata": {
"queueName": "my-queue",
"messageCount": "50"
}
}
]
Expand All @@ -206,24 +170,7 @@
"resources": {
"cpu": 0.2,
"memory": "100Mi"
},
"probes": [
{
"type": "Liveness",
"httpGet": {
"path": "/health",
"port": 8080,
"httpHeaders": [
{
"name": "Custom-Header",
"value": "Awesome"
}
]
},
"initialDelaySeconds": 3,
"periodSeconds": 3
}
]
}
}
],
"initContainers": [
Expand Down

0 comments on commit 719fee7

Please sign in to comment.