Skip to content

Commit

Permalink
Add workflow execution JSON schema (#270)
Browse files Browse the repository at this point in the history
* Add workflow execution jsonschema

Signed-off-by: Kevin Su <[email protected]>

* Updated schema

Signed-off-by: Kevin Su <[email protected]>

* Added Readme

Signed-off-by: Kevin Su <[email protected]>

* updated

Signed-off-by: Kevin Su <[email protected]>
  • Loading branch information
pingsutw authored Apr 7, 2022
1 parent 07c1beb commit f5cde4f
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 0 deletions.
17 changes: 17 additions & 0 deletions flyteidl/jsonschema/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# JSON SCHEMA

This folder contains the JSON Schema of execution event, and this schema will
be used by [cloudevent publisher](https://github.com/flyteorg/flyteadmin/blob/a0ca4b07d3b1c3cccfe3830307df50bc73152ddb/pkg/async/cloudevent/implementations/cloudevent_publisher.go#L96).

The URL for the JSON file will be included with the cloudevent message. For example
```json
{
"specversion" : "1.0",
"type" : "com.flyte.resource.workflow",
"source" : "https://github.com/flyteorg/flyteadmin",
"id" : "D234-1234-1234",
"time" : "2018-04-05T17:31:00Z",
"jsonschemaurl": "https://github.com/flyteorg/flyteidl/blob/master/jsonschema/workflow_execution.json",
"data" : "workflow execution event"
}
```
90 changes: 90 additions & 0 deletions flyteidl/jsonschema/workflow_execution.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
"$schema": "http://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin/workflow-execution-event-request",
"properties": {
"RequestId": {
"type": "string"
},
"Event": {
"type": "object",
"properties": {
"execution_id": {
"$ref": "#/$defs/WorkflowExecutionIdentifier"
},
"producer_id": {
"type": "string"
},
"phase": {
"type": "integer"
},
"occurred_at": {
"$ref": "#/$defs/Timestamp"
},
"output_result": {
"oneOf": [
{
"type": "object",
"properties": {
"output_uri": {
"type": "string"
}
}
},
{
"$ref": "#/$defs/ExecutionError"
}
]
}
}
}
},
"$defs": {
"WorkflowExecutionIdentifier": {
"properties": {
"project": {
"type": "string"
},
"domain": {
"type": "string"
},
"name": {
"type": "string"
}
},
"additionalProperties": false,
"type": "object"
},
"Timestamp": {
"properties": {
"seconds": {
"type": "integer"
},
"nanos": {
"type": "integer"
}
},
"additionalProperties": false,
"type": "object"
},
"ExecutionError": {
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"error_uri": {
"type": "string"
},
"kind": {
"type": "integer"
}
},
"additionalProperties": false,
"type": "object"
}
},
"additionalProperties": false,
"type": "object"
}

0 comments on commit f5cde4f

Please sign in to comment.