Skip to content

Commit

Permalink
Merge branch 'main' into feat/add_ci
Browse files Browse the repository at this point in the history
  • Loading branch information
masayag authored Nov 3, 2024
2 parents 2f4e0bb + 1cadbc8 commit 456b8e0
Show file tree
Hide file tree
Showing 26 changed files with 270 additions and 32 deletions.
2 changes: 1 addition & 1 deletion charts/create-ocp-project/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.3.0-rc3
version: 1.3.0-rc4

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,19 @@ data:
"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": "../shared/schemas/workflow-result-schema.json",
"type": "object"
}
}
}
kind: ConfigMap
metadata:
creationTimestamp: null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
annotations:
sonataflow.org/description: Creating an OpenShift Project
sonataflow.org/expressionLang: jq
sonataflow.org/profile: prod
sonataflow.org/profile: gitops
sonataflow.org/version: "1.0"
creationTimestamp: null
labels:
Expand Down Expand Up @@ -41,6 +41,15 @@ spec:
- name: print
operation: sysout
type: custom
- name: successResult
operation: '{ "completedWith":"success", "message": "Project " + .projectName + " active", "outputs":[] }'
type: expression
- name: errorProjectNotActiveResult
operation: '{ "completedWith":"error", "message": "Project " + .projectName + " not active" }'
type: expression
- name: errorAuthorizationDeniedResult
operation: '{ "completedWith":"error", "message": "Creation of project " + .projectName + " denied", "outputs":[ { "key":"Jira issue", "value": $SECRET.jira_url + "/jira/servicedesk/projects/" + .operationsProjectKey + "/issues/" + .operationsJiraCreateIssueResult.key, "format":"link" }] }'
type: expression
start:
stateName: '[Audit]: workflow started'
states:
Expand Down Expand Up @@ -210,6 +219,12 @@ spec:
invoke: sync
refName: createNotification
name: 'Create notification: project active'
- actionDataFilter:
useResults: true
functionRef:
invoke: sync
refName: successResult
name: setOutput
name: Notify project active
transition:
nextState: '[Audit]: Close issue on Jira'
Expand All @@ -231,6 +246,12 @@ spec:
invoke: sync
refName: createNotification
name: 'Create notification: project not active'
- actionDataFilter:
useResults: true
functionRef:
invoke: sync
refName: errorProjectNotActiveResult
name: setOutput
name: Notify project not active
transition:
nextState: '[Audit]: Close issue on Jira'
Expand Down Expand Up @@ -267,6 +288,12 @@ spec:
type: operation
- actionMode: sequential
actions:
- actionDataFilter:
useResults: true
functionRef:
invoke: sync
refName: errorAuthorizationDeniedResult
name: setOutput
- actionDataFilter:
toStateData: .jiraGetTransitionResult
useResults: true
Expand Down Expand Up @@ -298,7 +325,7 @@ spec:
podTemplate:
container:
resources: {}
image: quay.io/orchestrator/serverless-workflow-create-ocp-project:579ccba10961697faa471493e9038d7e6682fc0d
image: quay.io/orchestrator/serverless-workflow-create-ocp-project:be3e8e3c8099f475b29a7c67b61c6cb604f8b66c
envFrom:
- secretRef:
name: create-ocp-project-creds
Expand Down
2 changes: 1 addition & 1 deletion charts/extendable-workflow/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.3.0-rc2
version: 1.3.0-rc3

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,19 @@ data:
"required": ["personalInfo", "languageInfo"]
}
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
annotations:
sonataflow.org/description: YAML based extendable-workflow workflow
sonataflow.org/expressionLang: jq
sonataflow.org/profile: prod
sonataflow.org/profile: gitops
sonataflow.org/version: "1.0"
creationTimestamp: null
labels:
Expand All @@ -31,6 +31,9 @@ spec:
- name: GreetInFrench
operation: '{ greeting: "Bienvenue " + .personalInfo.firstName + " " + .personalInfo.lastName + " du merveilleux pays de " + .personalInfo.country + " ! Vos mots de passes sont bien reçus: " + .personalInfo.password + " et ils correspondent: " + .personalInfo.confirmPassword + "... Il serait bon de les changer maintenant." }'
type: expression
- name: successResult
operation: '{ "completedWith":"success", "message": "Extendable workflow completed successfully", "outputs":[ { "key":"Selected language", "value": .languageInfo.language }, { "key":"Greeting message", "value": .greeting } ] }'
type: expression
start:
stateName: ChooseOnLanguage
states:
Expand Down Expand Up @@ -91,14 +94,20 @@ spec:
invoke: sync
refName: greetFunction
name: greetAction
- actionDataFilter:
useResults: true
functionRef:
invoke: sync
refName: successResult
name: setOutput
end:
terminate: true
name: GreetPerson
type: operation
podTemplate:
container:
resources: {}
image: quay.io/orchestrator/serverless-workflow-extendable-workflow:7c4866215908760015ded6d848d32cf937a2ca98
image: quay.io/orchestrator/serverless-workflow-extendable-workflow:be3e8e3c8099f475b29a7c67b61c6cb604f8b66c
resources:
configMaps:
- configMap:
Expand Down
2 changes: 1 addition & 1 deletion charts/greeting/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.3.0-rc5
version: 1.3.0-rc6

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,19 @@ data:
}
}
}
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
Expand Down
13 changes: 11 additions & 2 deletions charts/greeting/templates/03-sonataflow_greeting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
annotations:
sonataflow.org/description: YAML based greeting workflow
sonataflow.org/expressionLang: jq
sonataflow.org/profile: prod
sonataflow.org/profile: gitops
sonataflow.org/version: "1.0"
creationTimestamp: null
labels:
Expand All @@ -22,6 +22,9 @@ spec:
- name: greetFunction
operation: sysout
type: custom
- name: successResult
operation: '{ "completedWith":"success", "message": "Greeting workflow completed successfully", "outputs":[ { "key":"Selected language", "value": .language }, { "key":"Greeting message", "value": .greeting } ] }'
type: expression
start:
stateName: ChooseOnLanguage
states:
Expand Down Expand Up @@ -59,14 +62,20 @@ spec:
invoke: sync
refName: greetFunction
name: greetAction
- actionDataFilter:
useResults: true
functionRef:
invoke: sync
refName: successResult
name: setOutput
end:
terminate: true
name: GreetPerson
type: operation
podTemplate:
container:
resources: {}
image: quay.io/orchestrator/serverless-workflow-greeting:c3b7031d91ae42fa423d1d25060e50dc6267031c
image: quay.io/orchestrator/serverless-workflow-greeting:be3e8e3c8099f475b29a7c67b61c6cb604f8b66c
resources:
configMaps:
- configMap:
Expand Down
2 changes: 1 addition & 1 deletion charts/modify-vm-resources/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.3.0-rc3
version: 1.3.0-rc4

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,19 @@ data:
"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": "../shared/schemas/workflow-result-schema.json",
"type": "object"
}
}
}
kind: ConfigMap
metadata:
creationTimestamp: null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
annotations:
sonataflow.org/description: Modify VM Resources (Memory/CPU)
sonataflow.org/expressionLang: jq
sonataflow.org/profile: prod
sonataflow.org/profile: gitops
sonataflow.org/version: "1.0"
creationTimestamp: null
labels:
Expand Down Expand Up @@ -41,6 +41,15 @@ spec:
- name: fillEmptyValues
operation: '{ vm_new_memory:(if (.vm_new_memory == null or .vm_new_memory =="") then .vm.spec.template.spec.domain.memory.guest else .vm_new_memory end), vm_new_cpu_cores:(if .vm_new_cpu_cores == null then .vm.spec.template.spec.domain.cpu.cores else .vm_new_cpu_cores end), vm_new_cpu_sockets:(if .vm_new_cpu_sockets == null then .vm.spec.template.spec.domain.cpu.sockets else .vm_new_cpu_sockets end), vm_new_cpu_threads:if .vm_new_cpu_threads == null then .vm.spec.template.spec.domain.cpu.threads else .vm_new_cpu_threads end }'
type: expression
- name: successResult
operation: '{ "completedWith":"success", "message": "VM" + .vm_name + " in namespace " + .vm_namespace + " updated.", "outputs":[ { "key":"Console URL", "value": $SECRET.cluster_console_url + "/k8s/ns/" + .vm_namespace + "/kubevirt.io~v1~VirtualMachine/" + .vm_name + "/console/standalone", "format":"link" } ] }'
type: expression
- name: errorVMNotRunningResult
operation: '{ "completedWith":"error", "message": "VM" + .vm_name + " in namespace " + .vm_namespace + " not ready after the update after checking" + .vmStatusRunningRetries + " times: " + .vm.status }'
type: expression
- name: errorAuthorizationDeniedResult
operation: '{ "completedWith":"error", "message": "Authorization denied to update VM " + .vm_name + " in namespace " + .vm_namespace + ". Memory: " + .vm_new_memory + ". CPU cores: " + (.vm_new_cpu_cores|tostring) + ". CPU threads: " + (.vm_new_cpu_threads|tostring) + ". CPU sockets: " + (.vm_new_cpu_sockets|tostring), "outputs":[ { "key":"Jira issue", "value": $SECRET.jira_url + "/jira/servicedesk/projects/" + .projectKey + "/issues/" + .jiraCreateIssueResult.key, "format":"link" }] }'
type: expression
start:
stateName: Get VM
states:
Expand Down Expand Up @@ -314,6 +323,14 @@ spec:
refName: createNotification
name: 'Create notification: VM update running'
name: 'Create notification: VM running'
- actions:
- actionDataFilter:
useResults: true
functionRef:
invoke: sync
refName: successResult
name: setOutput
name: setOutput
completionType: allOf
end:
terminate: true
Expand All @@ -337,7 +354,7 @@ spec:
functionRef:
arguments:
payload:
description: '"VM" + .vm_name + " in namespace " + .vm_namespace + " not ready after the update after checking" +.vmStatusRunningRetries+" times: " + .vm.status'
description: '"VM" + .vm_name + " in namespace " + .vm_namespace + " not ready after the update after checking" + .vmStatusRunningRetries + " times: " + .vm.status'
severity: high
title: '"VM" + .vm_name + " in namespace " + .vm_namespace + " not ready"'
topic: Modify VM Resources workflow
Expand All @@ -348,6 +365,14 @@ spec:
refName: createNotification
name: 'Create notification: VM update not running'
name: 'Create notification: VM not running'
- actions:
- actionDataFilter:
useResults: true
functionRef:
invoke: sync
refName: errorVMNotRunningResult
name: setOutput
name: setOutput
completionType: allOf
end:
terminate: true
Expand Down Expand Up @@ -383,6 +408,14 @@ spec:
refName: createNotification
name: 'Create notification: VM update denied'
name: 'Create notification: VM update denied'
- actions:
- actionDataFilter:
useResults: true
functionRef:
invoke: sync
refName: errorAuthorizationDeniedResult
name: setOutput
name: setOutput
completionType: allOf
end:
terminate: true
Expand All @@ -392,7 +425,7 @@ spec:
podTemplate:
container:
resources: {}
image: quay.io/orchestrator/serverless-workflow-modify-vm-resources:579ccba10961697faa471493e9038d7e6682fc0d
image: quay.io/orchestrator/serverless-workflow-modify-vm-resources:be3e8e3c8099f475b29a7c67b61c6cb604f8b66c
envFrom:
- secretRef:
name: modify-vm-resources-creds
Expand Down
2 changes: 1 addition & 1 deletion charts/move2kube/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.3.0-rc3
version: 1.3.0-rc5

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,19 @@ data:
"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": "../shared/schemas/workflow-result-schema.json",
"type": "object"
}
}
}
kind: ConfigMap
metadata:
creationTimestamp: null
Expand Down
Loading

0 comments on commit 456b8e0

Please sign in to comment.