-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[SRVLOGIC-469]: Deploying workflows chapter does not use kn worklow plugin #85916
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: serverless-docs-main
Are you sure you want to change the base?
Changes from 4 commits
0537eaa
bf355e5
c35c75b
dd7ad30
f3fe3b7
e85b0b2
e62ba73
1230083
de488c5
edddd29
9670f45
b0c912c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -12,69 +12,26 @@ You can create a `SonataFlow` custom resource (CR) on {ocp-product-title} and {S | |||||
|
||||||
* You have an {ServerlessLogicOperatorName} installed on your cluster. | ||||||
* You have access to an {ServerlessLogicProductName} project with the appropriate roles and permissions to create applications and other workloads in {ocp-product-title}. | ||||||
* You have installed the {ServerlessLogicProductName} `kn-workflow` CLI plugin. | ||||||
* You have installed the OpenShift CLI `(oc)`. | ||||||
|
||||||
.Procedure | ||||||
|
||||||
. Create a workflow YAML file similar to the following: | ||||||
+ | ||||||
[source,yaml] | ||||||
---- | ||||||
apiVersion: sonataflow.org/v1alpha08 | ||||||
kind: SonataFlow | ||||||
metadata: | ||||||
name: greeting | ||||||
annotations: | ||||||
sonataflow.org/description: Greeting example on k8s! | ||||||
sonataflow.org/version: 0.0.1 | ||||||
spec: | ||||||
flow: | ||||||
start: ChooseOnLanguage | ||||||
functions: | ||||||
- name: greetFunction | ||||||
type: custom | ||||||
operation: sysout | ||||||
states: | ||||||
- name: ChooseOnLanguage | ||||||
type: switch | ||||||
dataConditions: | ||||||
- condition: "${ .language == \"English\" }" | ||||||
transition: GreetInEnglish | ||||||
- condition: "${ .language == \"Spanish\" }" | ||||||
transition: GreetInSpanish | ||||||
defaultCondition: GreetInEnglish | ||||||
- name: GreetInEnglish | ||||||
type: inject | ||||||
data: | ||||||
greeting: "Hello from JSON Workflow, " | ||||||
transition: GreetPerson | ||||||
- name: GreetInSpanish | ||||||
type: inject | ||||||
data: | ||||||
greeting: "Saludos desde JSON Workflow, " | ||||||
transition: GreetPerson | ||||||
- name: GreetPerson | ||||||
type: operation | ||||||
actions: | ||||||
- name: greetAction | ||||||
functionRef: | ||||||
refName: greetFunction | ||||||
arguments: | ||||||
message: ".greeting+.name" | ||||||
end: true | ||||||
---- | ||||||
|
||||||
. Apply the `SonataFlow` workflow definition to your {ocp-product-title} namespace by running the following command: | ||||||
. In your project application directory, execute the following command: | ||||||
+ | ||||||
[source,terminal] | ||||||
---- | ||||||
$ oc apply -f <workflow-name>.yaml -n <your_namespace> | ||||||
$ kn workflow gen-manifest --profile=preview --namespace <your_namespace> | ||||||
---- | ||||||
+ | ||||||
.Example command for the `greetings-workflow.yaml` file: | ||||||
This command generates {ocp-product-title} YAML manifests based on your `workflow.sw.json|yaml` definition. Default location is `<project_application_dir>/manifests` directory. | ||||||
You can modify these files to your liking, however when you run above command again, the changes are going to be overwritten. Use `--custom-generated-manifests-dir` or `-c` flag to generate the files in different location. | ||||||
domhanak marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
. Deploy the `SonataFlow` workflow application to your {ocp-product-title} namespace by running the following command: | ||||||
+ | ||||||
[source,terminal] | ||||||
---- | ||||||
$ oc apply -f greetings-workflow.yaml -n workflows | ||||||
$ kn workflow deploy --custom-manifests-dir=./manifests --namespace <your_namespace> | ||||||
domhanak marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
---- | ||||||
|
||||||
. List all the build configurations by running the following command: | ||||||
|
@@ -113,4 +70,12 @@ Ensure that the pod corresponding to your workflow is running. | |||||
[source,terminal] | ||||||
---- | ||||||
$ oc logs pod/<pod-name> -n workflows | ||||||
---- | ||||||
---- | ||||||
|
||||||
.Cleanup | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Technically Could this instead just be the last step in the normal |
||||||
. To cleanup the deployment, delete the projects resources running the following command: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Either way though, if this stays as a single-step procedure, use an unordered list (per guidelines) and use "by running":
Suggested change
|
||||||
+ | ||||||
[source,terminal] | ||||||
---- | ||||||
$ kn workflow undeploy -n <your_namespace> | ||||||
---- |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -12,69 +12,32 @@ You can deploy your local workflow on {ocp-product-title} in Dev mode. You can u | |||||
|
||||||
* You have {ServerlessLogicOperatorName} installed on your cluster. | ||||||
* You have access to a {ServerlessLogicProductName} project with the appropriate roles and permissions to create applications and other workloads in {ocp-product-title}. | ||||||
* You have installed the {ServerlessLogicProductName} `kn-workflow` CLI plugin. | ||||||
* You have installed the OpenShift CLI `(oc)`. | ||||||
|
||||||
.Procedure | ||||||
|
||||||
. Create the workflow configuration YAML file. | ||||||
. Login to your cluster | ||||||
domhanak marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
+ | ||||||
.Example `workflow-dev.yaml` file | ||||||
[source,yaml] | ||||||
---- | ||||||
apiVersion: sonataflow.org/v1alpha08 | ||||||
kind: SonataFlow | ||||||
metadata: | ||||||
name: greeting <1> | ||||||
annotations: | ||||||
sonataflow.org/description: Greeting example on k8s! | ||||||
sonataflow.org/version: 0.0.1 | ||||||
sonataflow.org/profile: dev <2> | ||||||
spec: | ||||||
flow: | ||||||
start: ChooseOnLanguage | ||||||
functions: | ||||||
- name: greetFunction | ||||||
type: custom | ||||||
operation: sysout | ||||||
states: | ||||||
- name: ChooseOnLanguage | ||||||
type: switch | ||||||
dataConditions: | ||||||
- condition: "${ .language == \"English\" }" | ||||||
transition: GreetInEnglish | ||||||
- condition: "${ .language == \"Spanish\" }" | ||||||
transition: GreetInSpanish | ||||||
defaultCondition: GreetInEnglish | ||||||
- name: GreetInEnglish | ||||||
type: inject | ||||||
data: | ||||||
greeting: "Hello from JSON Workflow, " | ||||||
transition: GreetPerson | ||||||
- name: GreetInSpanish | ||||||
type: inject | ||||||
data: | ||||||
greeting: "Saludos desde JSON Workflow, " | ||||||
transition: GreetPerson | ||||||
- name: GreetPerson | ||||||
type: operation | ||||||
actions: | ||||||
- name: greetAction | ||||||
functionRef: | ||||||
refName: greetFunction | ||||||
arguments: | ||||||
message: ".greeting + .name" | ||||||
end: true | ||||||
[source,terminal] | ||||||
---- | ||||||
$ oc login --token=<your_token> --server=<your_clusters_server_url> | ||||||
---- | ||||||
|
||||||
. Create a namespace in your cluster, by running the following command: | ||||||
+ | ||||||
<1> is a workflow_name | ||||||
<2> indicates that you must deploy the workflow in Dev mode | ||||||
[source,terminal] | ||||||
---- | ||||||
$ oc create namespace <your_namespace> | ||||||
---- | ||||||
|
||||||
. To deploy the application, apply the YAML file by entering the following command: | ||||||
. Deploy the application, by running the following command: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
+ | ||||||
[source,terminal] | ||||||
---- | ||||||
$ oc apply -f <filename> -n <your_namespace> | ||||||
$ kn workflow deploy --namespace <your_namespace> | ||||||
domhanak marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
---- | ||||||
+ | ||||||
|
||||||
. Verify the deployment and check the status of the deployed workflow by entering the following command: | ||||||
+ | ||||||
|
@@ -118,7 +81,7 @@ $ oc logs <workflow_pod_name> -n <your_namespace> | |||||
+ | ||||||
[source,terminal] | ||||||
---- | ||||||
$ oc delete sonataflow <workflow_name> -n <your_namespace> | ||||||
$ kn workflow undeploy -n <your_namespace> | ||||||
---- | ||||||
|
||||||
|
||||||
|
Uh oh!
There was an error while loading. Please reload this page.