Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
713 changes: 713 additions & 0 deletions scripts/build.sh

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ quarkus.flyway.migrate-at-start=true
# Possible values: OFF, FATAL, ERROR, WARN, INFO, DEBUG, ALL.
# and see https://quarkus.io/guides/logging for documentation
quarkus.log.category."org.apache.http".level=INFO
quarkus.log.level=INFO
quarkus.log.level=INFO
kie.flyway.enabled = true

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
data:
application.properties: |
application.properties: |-
# Backstage Notifications service
quarkus.rest-client.notifications.url=${BACKSTAGE_NOTIFICATIONS_URL}
quarkus.openapi-generator.notifications.auth.BearerToken.bearer-token=${NOTIFICATIONS_BEARER_TOKEN}
Expand All @@ -24,6 +24,9 @@ metadata:
creationTimestamp: null
labels:
app: user-onboarding
app.kubernetes.io/component: serverless-workflow
app.kubernetes.io/managed-by: sonataflow-operator
app.kubernetes.io/name: user-onboarding
sonataflow.org/workflow-app: user-onboarding
sonataflow.org/workflow-namespace: ""
name: user-onboarding-props
namespace: ""
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: v1
kind: Secret
metadata:
creationTimestamp: null
labels:
app: user-onboarding
app.kubernetes.io/component: serverless-workflow
app.kubernetes.io/managed-by: sonataflow-operator
app.kubernetes.io/name: user-onboarding
sonataflow.org/workflow-app: user-onboarding
sonataflow.org/workflow-namespace: ""
name: user-onboarding-secrets
stringData:
BACKSTAGE_NOTIFICATIONS_URL: http://backstage-backstage.rhdh-operator
NOTIFICATIONS_BEARER_TOKEN: ""
ONBOARDING_SERVER_URL: http://user-onboarding-server.sonataflow-infra:8080
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
apiVersion: v1
data:
user-onboarding-schema.json: |2
{
"$id": "classpath:/schemas/user-onboarding-schema.json",
"title": "Workflow input data",
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"userId": {
"title": "The user ID that triggers the workflow",
"description": "The user that triggers the workflow",
"type": "string",
"default": "user:default/guest"
},
"iterationNum": {
"title": "The iteration number for running the workflow",
"description": "The iteration number for running the workflow",
"type": "integer"
},
"username": {
"title": "The name of the user",
"description": "The name of the user",
"type": "string",
"pattern": "^[a-zA-Z]*"
},
"recipients": {
"title": "Recipients",
"type": "array",
"description": "A list of recipients for the notification in the format of 'user:<namespace>/<username>' or 'group:<namespace>/<groupname>', i.e. 'user:default/jsmith'",
"items": {
"title": "Recipient",
"type": "string",
"pattern": "^(user|group):[a-z0-9]([-a-z0-9]*[a-z0-9])?/([a-z0-9]([-a-z0-9]*[a-z0-9])?)$"
},
"minItems": 1
}
},
"required": [
"userId",
"iterationNum",
"recipients"
]
}
workflow-output-schema.json: |-
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "WorkflowResult",
"description": "Schema of workflow output",
"type": "object",
"properties": {
"result": {
"$ref": "./workflow-result-schema.json",
"type": "object"
}
}
}
workflow-result-schema.json: |-
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "WorkflowResult",
"description": "Result of a workflow execution",
"type": "object",
"properties": {
"message": {
"description": "High-level summary of the current status, free-form text, human readable.",
"type": "string"
},
"nextWorkflows": {
"description": "List of workflows suggested to run next. Items at lower indexes are of higher priority.",
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"description": "Workflow identifier",
"type": "string"
},
"name": {
"description": "Human readable title describing the workflow.",
"type": "string"
}
},
"required": [
"id",
"name"
]
}
},
"outputs": {
"description": "Additional structured output of workflow processing. This can contain identifiers of created resources, links to resources, logs or other output.",
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"description": "Unique identifier of the option. Preferably human-readable.",
"type": "string"
},
"value": {
"description": "Free form value of the option.",
"anyOf": [
{
"type": "string"
},
{
"type": "number"
}
]
},
"format": {
"description": "More detailed type of the 'value' property. Defaults to 'text'.",
"enum": [
"text",
"number",
"link"
]
}
},
"required": [
"key",
"value"
]
}
}
}
}
kind: ConfigMap
metadata:
creationTimestamp: null
name: 01-user-onboarding-resources-schemas
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
apiVersion: v1
data:
onboarding-openapi.yaml: |
openapi: 3.0.3
info:
title: User Onboarding API
description: API for simulating a user onboarding process, where a user reaches "Ready" status after three requests.
version: 1.0.0
paths:
/onboard:
post:
summary: Initiates or checks the onboarding status of a user
description: |
- The first two requests for a given `user_id` return `"In Progress"`.
- The third request returns `"Ready"`, and starts a **5-minute** cleanup timer.
- After 5 minutes, the user is removed from the cache and starts fresh.
operationId: onboardUser
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/OnboardRequest"
responses:
"200":
description: Successfully retrieved onboarding status.
content:
application/json:
schema:
$ref: "#/components/schemas/OnboardResponse"
"400":
description: Invalid request payload.
"405":
description: Invalid request method.
components:
schemas:
OnboardRequest:
type: object
required:
- user_id
- name
properties:
user_id:
type: string
description: Unique identifier for the user.
example: "12345"
name:
type: string
description: Name of the user.
example: "Alice Johnson"
OnboardResponse:
type: object
properties:
user_id:
type: string
description: Unique identifier for the user.
example: "12345"
status:
type: string
description: Current onboarding status.
enum:
- "In Progress"
- "Ready"
example: "In Progress"
kind: ConfigMap
metadata:
creationTimestamp: null
name: 02-user-onboarding-resources-specs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ metadata:
creationTimestamp: null
labels:
app: user-onboarding
app.kubernetes.io/component: serverless-workflow
app.kubernetes.io/managed-by: sonataflow-operator
app.kubernetes.io/name: user-onboarding
sonataflow.org/workflow-app: user-onboarding
sonataflow.org/workflow-namespace: ""
name: user-onboarding
namespace: ""
spec:
flow:
dataInputSchema:
Expand Down Expand Up @@ -180,11 +183,24 @@ spec:
type: operation
podTemplate:
container:
env:
- name: ONBOARDING_SERVER_URL
valueFrom:
secretKeyRef:
key: ONBOARDING_SERVER_URL
name: user-onboarding-secrets
- name: BACKSTAGE_NOTIFICATIONS_URL
valueFrom:
secretKeyRef:
key: BACKSTAGE_NOTIFICATIONS_URL
name: user-onboarding-secrets
- name: NOTIFICATIONS_BEARER_TOKEN
valueFrom:
secretKeyRef:
key: NOTIFICATIONS_BEARER_TOKEN
name: user-onboarding-secrets
image: quay.io/orchestrator/demo-user-onboarding:osl_1_37
resources: {}
image: quay.io/orchestrator/demo-user-onboarding:latest
envFrom:
- secretRef:
name: user-onboarding-creds
resources:
configMaps:
- configMap:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ spec:
type: operation
podTemplate:
container:
image: quay.io/orchestrator/fail-switch:latest
image: quay.io/orchestrator/fail-switch:osl_1_37
resources: {}
resources:
configMaps:
Expand Down
22 changes: 22 additions & 0 deletions workflows/greeting/manifests/01-configmap_greeting-props.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: v1
data:
application.properties: |
# This property is used to select the log level, which controls the amount
# of information logged on HTTP requests based on the severity of the events.
# Possible values: OFF, FATAL, ERROR, WARN, INFO, DEBUG, ALL.
# and see https://quarkus.io/guides/logging for documentation
quarkus.log.category."org.apache.http".level=INFO
quarkus.log.level=INFO

kie.flyway.enabled=true
kind: ConfigMap
metadata:
creationTimestamp: null
labels:
app: greeting
app.kubernetes.io/component: serverless-workflow
app.kubernetes.io/managed-by: sonataflow-operator
app.kubernetes.io/name: greeting
sonataflow.org/workflow-app: greeting
sonataflow.org/workflow-namespace: ""
name: greeting-props
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
apiVersion: v1
data:
greeting.sw.input-schema.json: |
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"language": {
"title": "Language",
"description": "Language to greet",
"type": "string",
"enum": ["English", "Spanish"],
"default": "English"
}
}
}
workflow-output-schema.json: |-
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "WorkflowResult",
"description": "Schema of workflow output",
"type": "object",
"properties": {
"result": {
"$ref": "../shared/schemas/workflow-result-schema.json",
"type": "object"
}
}
}
kind: ConfigMap
metadata:
creationTimestamp: null
name: 01-greeting-resources-schemas
Loading