From 0537eaab87f5995aaa04a563920b6f3d78bb3035 Mon Sep 17 00:00:00 2001 From: Dominik Hanak Date: Fri, 6 Dec 2024 14:55:14 +0100 Subject: [PATCH 01/12] SRVLOGIC-469: Deploying workflows chapter does not use kn worklow plugin Now it uses the kn workflow plugin --- ...lding-deploying-workflow-preview-mode.adoc | 73 +++++-------------- ...ss-logic-deploying-workflows-dev-mode.adoc | 67 ++++------------- 2 files changed, 35 insertions(+), 105 deletions(-) diff --git a/modules/serverless-logic-building-deploying-workflow-preview-mode.adoc b/modules/serverless-logic-building-deploying-workflow-preview-mode.adoc index 8748e46ff54d..d06ff118e666 100644 --- a/modules/serverless-logic-building-deploying-workflow-preview-mode.adoc +++ b/modules/serverless-logic-building-deploying-workflow-preview-mode.adoc @@ -12,70 +12,28 @@ 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 .yaml -n +$ kn workflow gen-manifest --mode=preview --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 `/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. + +. 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 ---- ++ . List all the build configurations by running the following command: + @@ -113,4 +71,13 @@ Ensure that the pod corresponding to your workflow is running. [source,terminal] ---- $ oc logs pod/ -n workflows ----- \ No newline at end of file +---- + +.Cleanup +. To cleanup the deployment, delete the projects resources running the following command: ++ +[source,terminal] +---- +$ kn workflow undeploy -n +---- ++ diff --git a/modules/serverless-logic-deploying-workflows-dev-mode.adoc b/modules/serverless-logic-deploying-workflows-dev-mode.adoc index 9a64dac27aa5..6902fe39bcba 100644 --- a/modules/serverless-logic-deploying-workflows-dev-mode.adoc +++ b/modules/serverless-logic-deploying-workflows-dev-mode.adoc @@ -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 + -.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= --server= ---- + +. 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 +---- -. To deploy the application, apply the YAML file by entering the following command: +. Deploy the application, by running the following command: + [source,terminal] ---- -$ oc apply -f -n +$ kn workflow deploy --namespace ---- ++ . Verify the deployment and check the status of the deployed workflow by entering the following command: + @@ -118,7 +81,7 @@ $ oc logs -n + [source,terminal] ---- -$ oc delete sonataflow -n +$ kn workflow undeploy -n ---- From bf355e5329366d5bbd0d996a8502da0da0d46513 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Han=C3=A1k?= Date: Mon, 9 Dec 2024 10:13:37 +0100 Subject: [PATCH 02/12] Fix incorrect flag used mode -> preview --- ...rverless-logic-building-deploying-workflow-preview-mode.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/serverless-logic-building-deploying-workflow-preview-mode.adoc b/modules/serverless-logic-building-deploying-workflow-preview-mode.adoc index d06ff118e666..5dc9704323b6 100644 --- a/modules/serverless-logic-building-deploying-workflow-preview-mode.adoc +++ b/modules/serverless-logic-building-deploying-workflow-preview-mode.adoc @@ -21,7 +21,7 @@ You can create a `SonataFlow` custom resource (CR) on {ocp-product-title} and {S + [source,terminal] ---- -$ kn workflow gen-manifest --mode=preview --namespace +$ kn workflow gen-manifest --profile=preview --namespace ---- + This command generates {ocp-product-title} YAML manifests based on your `workflow.sw.json|yaml` definition. Default location is `/manifests` directory. From c35c75bccfbda02d6a8d9f013b04affc69632f8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Han=C3=A1k?= Date: Tue, 14 Jan 2025 10:46:05 +0100 Subject: [PATCH 03/12] Update modules/serverless-logic-building-deploying-workflow-preview-mode.adoc --- ...erverless-logic-building-deploying-workflow-preview-mode.adoc | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/serverless-logic-building-deploying-workflow-preview-mode.adoc b/modules/serverless-logic-building-deploying-workflow-preview-mode.adoc index 5dc9704323b6..9c590a588676 100644 --- a/modules/serverless-logic-building-deploying-workflow-preview-mode.adoc +++ b/modules/serverless-logic-building-deploying-workflow-preview-mode.adoc @@ -33,7 +33,6 @@ You can modify these files to your liking, however when you run above command ag ---- $ kn workflow deploy --custom-manifests-dir=./manifests --namespace ---- -+ . List all the build configurations by running the following command: + From dd7ad30051185215023e0b138b308540e77ab70c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Han=C3=A1k?= Date: Tue, 14 Jan 2025 11:05:15 +0100 Subject: [PATCH 04/12] Update modules/serverless-logic-building-deploying-workflow-preview-mode.adoc --- ...erverless-logic-building-deploying-workflow-preview-mode.adoc | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/serverless-logic-building-deploying-workflow-preview-mode.adoc b/modules/serverless-logic-building-deploying-workflow-preview-mode.adoc index 9c590a588676..bfafc3a8226b 100644 --- a/modules/serverless-logic-building-deploying-workflow-preview-mode.adoc +++ b/modules/serverless-logic-building-deploying-workflow-preview-mode.adoc @@ -79,4 +79,3 @@ $ oc logs pod/ -n workflows ---- $ kn workflow undeploy -n ---- -+ From f3fe3b77f0e986c59e9d38dd2ce4e336003ba7d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Han=C3=A1k?= Date: Wed, 15 Jan 2025 08:24:02 +0100 Subject: [PATCH 05/12] Apply suggestions from code review Review from Kalyani Co-authored-by: Kalyani Desai <43639538+kaldesai@users.noreply.github.com> --- ...erless-logic-building-deploying-workflow-preview-mode.adoc | 4 ++-- modules/serverless-logic-deploying-workflows-dev-mode.adoc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/serverless-logic-building-deploying-workflow-preview-mode.adoc b/modules/serverless-logic-building-deploying-workflow-preview-mode.adoc index bfafc3a8226b..e1cda61715b5 100644 --- a/modules/serverless-logic-building-deploying-workflow-preview-mode.adoc +++ b/modules/serverless-logic-building-deploying-workflow-preview-mode.adoc @@ -24,8 +24,8 @@ You can create a `SonataFlow` custom resource (CR) on {ocp-product-title} and {S $ kn workflow gen-manifest --profile=preview --namespace ---- + -This command generates {ocp-product-title} YAML manifests based on your `workflow.sw.json|yaml` definition. Default location is `/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. +This command generates {ocp-product-title} YAML manifests based on your `workflow.sw.json|yaml` definition. The default location is the `/manifests` directory. +You can modify these files to your preference, however, when you rerun the above command, the changes will be overwritten. Use the `--custom-generated-manifests-dir` or `-c` flag to generate the files in different locations. . Deploy the `SonataFlow` workflow application to your {ocp-product-title} namespace by running the following command: + diff --git a/modules/serverless-logic-deploying-workflows-dev-mode.adoc b/modules/serverless-logic-deploying-workflows-dev-mode.adoc index 6902fe39bcba..e3216bb27f81 100644 --- a/modules/serverless-logic-deploying-workflows-dev-mode.adoc +++ b/modules/serverless-logic-deploying-workflows-dev-mode.adoc @@ -17,7 +17,7 @@ You can deploy your local workflow on {ocp-product-title} in Dev mode. You can u .Procedure -. Login to your cluster +. Login to your cluster. + [source,terminal] ---- From e85b0b28f390a4ba9308722965782b7cc52966e3 Mon Sep 17 00:00:00 2001 From: Dominik Hanak Date: Thu, 16 Jan 2025 08:26:19 +0100 Subject: [PATCH 06/12] SRVLOGC-469: Reorganize Deploying Workflow doc Reorder docs to make more sense and follow the precedures from basic (what user should do 1st, to more complex ones ) --- ...s-logic-building-deploying-workflow-preview-mode.adoc | 9 +++++++-- .../serverless-logic-deploying-workflows.adoc | 7 ++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/modules/serverless-logic-building-deploying-workflow-preview-mode.adoc b/modules/serverless-logic-building-deploying-workflow-preview-mode.adoc index e1cda61715b5..c58a9a3b20f2 100644 --- a/modules/serverless-logic-building-deploying-workflow-preview-mode.adoc +++ b/modules/serverless-logic-building-deploying-workflow-preview-mode.adoc @@ -47,8 +47,9 @@ $ oc get buildconfigs -n workflows ---- $ oc logs buildconfig/ -n ---- -+ + .Example command for the `greetings-workflow.yaml` file: ++ [source,terminal] ---- $ oc logs buildconfig/greeting -n workflows @@ -62,7 +63,7 @@ $ oc logs buildconfig/greeting -n workflows ---- $ oc get pods -n ---- -+ + Ensure that the pod corresponding to your workflow is running. . Check the running pods and their logs by running the following command: @@ -79,3 +80,7 @@ $ oc logs pod/ -n workflows ---- $ kn workflow undeploy -n ---- +<<<<<<< HEAD +======= + +>>>>>>> 650a6ddf00 (SRVLOGC-469: Reorganize Deploying Workflow doc) diff --git a/serverless-logic/serverless-logic-getting-started/serverless-logic-deploying-workflows.adoc b/serverless-logic/serverless-logic-getting-started/serverless-logic-deploying-workflows.adoc index 05171b0193ac..e85bd97cb5d7 100644 --- a/serverless-logic/serverless-logic-getting-started/serverless-logic-deploying-workflows.adoc +++ b/serverless-logic/serverless-logic-getting-started/serverless-logic-deploying-workflows.adoc @@ -25,6 +25,10 @@ To deploy a workflow in Preview mode, {ServerlessLogicOperatorName} uses the bui The following sections explain how to build and deploy your workflow on a cluster using the {ServerlessLogicOperatorName} with a `SonataFlow` custom resource. +include::modules/serverless-logic-building-deploying-workflow-preview-mode.adoc[leveloffset=+2] +include::modules/serverless-logic-verifying-workflow-deployment-preview-mode.adoc[leveloffset=+2] +include::modules/serverless-logic-restarting-the-build-preview-mode.adoc[leveloffset=+2] + [id="serverless-logic-configuring-workflows-preview-mode_{context}"] === Configuring workflows in Preview mode @@ -34,9 +38,6 @@ include::modules/serverless-logic-workflow-changing-resource-requirements.adoc[l include::modules/serverless-logic-workflow-passing-arguments-internal-builder.adoc[leveloffset=+3] include::modules/serverless-logic-workflow-env-variables-internal-builder.adoc[leveloffset=+3] include::modules/serverless-logic-workflow-changing-base-builder-image.adoc[leveloffset=+3] -include::modules/serverless-logic-building-deploying-workflow-preview-mode.adoc[leveloffset=+2] -include::modules/serverless-logic-verifying-workflow-deployment-preview-mode.adoc[leveloffset=+2] -include::modules/serverless-logic-restarting-the-build-preview-mode.adoc[leveloffset=+2] include::modules/serverless-logic-editing-workflows.adoc[leveloffset=+1] include::modules/serverless-logic-testing-workflows.adoc[leveloffset=+1] From e62ba73b3edf23f3298ae38d5a40d33a410b89bf Mon Sep 17 00:00:00 2001 From: Dominik Hanak Date: Thu, 16 Jan 2025 08:35:14 +0100 Subject: [PATCH 07/12] SRVLOGIC-469: Improve verifying-workflow-deployment-preview-mode Removes the example workflow from the module and replaces it with prerequsites that user should have the WF deployed. Adds steps to query all services. --- ...ying-workflow-deployment-preview-mode.adoc | 50 ++----------------- 1 file changed, 5 insertions(+), 45 deletions(-) diff --git a/modules/serverless-logic-verifying-workflow-deployment-preview-mode.adoc b/modules/serverless-logic-verifying-workflow-deployment-preview-mode.adoc index fa5ab63da538..8f03a5091477 100644 --- a/modules/serverless-logic-verifying-workflow-deployment-preview-mode.adoc +++ b/modules/serverless-logic-verifying-workflow-deployment-preview-mode.adoc @@ -13,62 +13,22 @@ You can verify that your {ServerlessLogicProductName} workflow is running by per * 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 OpenShift CLI `(oc)`. +* You have deployed your workflow in preview mode in the {ocp-product-title}. .Procedure -. Create a workflow `YAML` file similar to the following: +. Retrieve the list of service and identify the one matching ID of your workflow: + -[source,yaml] +[source,terminal] ---- -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 +$ oc get svc -n ---- . Create a route for the workflow service by running the following command: + [source,terminal] ---- -$ oc expose svc/ -n workflows +$ oc expose svc/ -n ---- + This command creates a public URL to access the workflow service. From 1230083ff1ec0dcac5963635c2659700b6da35ea Mon Sep 17 00:00:00 2001 From: Dominik Hanak Date: Thu, 16 Jan 2025 08:41:35 +0100 Subject: [PATCH 08/12] SRVLOGIC-469: Fix typos and rebase --- ...less-logic-building-deploying-workflow-preview-mode.adoc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/modules/serverless-logic-building-deploying-workflow-preview-mode.adoc b/modules/serverless-logic-building-deploying-workflow-preview-mode.adoc index c58a9a3b20f2..a85025706760 100644 --- a/modules/serverless-logic-building-deploying-workflow-preview-mode.adoc +++ b/modules/serverless-logic-building-deploying-workflow-preview-mode.adoc @@ -79,8 +79,4 @@ $ oc logs pod/ -n workflows [source,terminal] ---- $ kn workflow undeploy -n ----- -<<<<<<< HEAD -======= - ->>>>>>> 650a6ddf00 (SRVLOGC-469: Reorganize Deploying Workflow doc) +---- \ No newline at end of file From de488c5bd95b72aac1cc8f34d2573a7532a0117b Mon Sep 17 00:00:00 2001 From: Dominik Hanak Date: Thu, 16 Jan 2025 09:19:34 +0100 Subject: [PATCH 09/12] SRVLOGIC-469: Fix typos introducing formating issues --- ...erless-logic-building-deploying-workflow-preview-mode.adoc | 4 +--- modules/serverless-logic-deploying-workflows-dev-mode.adoc | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/modules/serverless-logic-building-deploying-workflow-preview-mode.adoc b/modules/serverless-logic-building-deploying-workflow-preview-mode.adoc index a85025706760..fdf610800810 100644 --- a/modules/serverless-logic-building-deploying-workflow-preview-mode.adoc +++ b/modules/serverless-logic-building-deploying-workflow-preview-mode.adoc @@ -47,9 +47,7 @@ $ oc get buildconfigs -n workflows ---- $ oc logs buildconfig/ -n ---- - -.Example command for the `greetings-workflow.yaml` file: -+ +.Example command for a workflow that has ID attribute with value `greeting`: [source,terminal] ---- $ oc logs buildconfig/greeting -n workflows diff --git a/modules/serverless-logic-deploying-workflows-dev-mode.adoc b/modules/serverless-logic-deploying-workflows-dev-mode.adoc index e3216bb27f81..abe4129d646b 100644 --- a/modules/serverless-logic-deploying-workflows-dev-mode.adoc +++ b/modules/serverless-logic-deploying-workflows-dev-mode.adoc @@ -37,7 +37,6 @@ $ oc create namespace ---- $ kn workflow deploy --namespace ---- -+ . Verify the deployment and check the status of the deployed workflow by entering the following command: + From edddd2990bf6a983c461badec2791408eb4e7520 Mon Sep 17 00:00:00 2001 From: Dominik Hanak Date: Thu, 16 Jan 2025 09:51:02 +0100 Subject: [PATCH 10/12] SRVLOGIC-469: Fix additonal typos, use instead of workflows --- ...s-logic-building-deploying-workflow-preview-mode.adoc | 9 +++++---- .../serverless-logic-deploying-workflows-dev-mode.adoc | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/modules/serverless-logic-building-deploying-workflow-preview-mode.adoc b/modules/serverless-logic-building-deploying-workflow-preview-mode.adoc index fdf610800810..a108863bba66 100644 --- a/modules/serverless-logic-building-deploying-workflow-preview-mode.adoc +++ b/modules/serverless-logic-building-deploying-workflow-preview-mode.adoc @@ -38,7 +38,7 @@ $ kn workflow deploy --custom-manifests-dir=./manifests --namespace ---- . Get the logs of the build process by running the following command: @@ -47,10 +47,11 @@ $ oc get buildconfigs -n workflows ---- $ oc logs buildconfig/ -n ---- ++ .Example command for a workflow that has ID attribute with value `greeting`: [source,terminal] ---- -$ oc logs buildconfig/greeting -n workflows +$ oc logs buildconfig/greeting -n ---- .Verification @@ -61,14 +62,14 @@ $ oc logs buildconfig/greeting -n workflows ---- $ oc get pods -n ---- - ++ Ensure that the pod corresponding to your workflow is running. . Check the running pods and their logs by running the following command: + [source,terminal] ---- -$ oc logs pod/ -n workflows +$ oc logs pod/ -n ---- .Cleanup diff --git a/modules/serverless-logic-deploying-workflows-dev-mode.adoc b/modules/serverless-logic-deploying-workflows-dev-mode.adoc index abe4129d646b..c023e207fd70 100644 --- a/modules/serverless-logic-deploying-workflows-dev-mode.adoc +++ b/modules/serverless-logic-deploying-workflows-dev-mode.adoc @@ -42,7 +42,7 @@ $ kn workflow deploy --namespace + [source,terminal] ---- -$ oc get workflow -n -w +$ oc get workflow -n ---- + Ensure that your workflow is listed and the status is `Running` or `Completed`. From 9670f45a0c6d4a55ba1b8705f68ca0d60dd52627 Mon Sep 17 00:00:00 2001 From: Dominik Hanak Date: Thu, 16 Jan 2025 15:32:12 +0100 Subject: [PATCH 11/12] SRVLOGIC-469: Improve deploying dev and preview mode docs Unify namespace usage. Use shorthand -n where possible. Add Testing section to deploying-workflows-dev-mode --- ...lding-deploying-workflow-preview-mode.adoc | 10 ++--- ...ss-logic-deploying-workflows-dev-mode.adoc | 42 +++++++++++++++---- ...ying-workflow-deployment-preview-mode.adoc | 2 +- 3 files changed, 40 insertions(+), 14 deletions(-) diff --git a/modules/serverless-logic-building-deploying-workflow-preview-mode.adoc b/modules/serverless-logic-building-deploying-workflow-preview-mode.adoc index a108863bba66..d2052d2e0a6e 100644 --- a/modules/serverless-logic-building-deploying-workflow-preview-mode.adoc +++ b/modules/serverless-logic-building-deploying-workflow-preview-mode.adoc @@ -21,7 +21,7 @@ You can create a `SonataFlow` custom resource (CR) on {ocp-product-title} and {S + [source,terminal] ---- -$ kn workflow gen-manifest --profile=preview --namespace +$ kn workflow gen-manifest --profile=preview -n ---- + This command generates {ocp-product-title} YAML manifests based on your `workflow.sw.json|yaml` definition. The default location is the `/manifests` directory. @@ -31,7 +31,7 @@ You can modify these files to your preference, however, when you rerun the above + [source,terminal] ---- -$ kn workflow deploy --custom-manifests-dir=./manifests --namespace +$ kn workflow deploy --custom-manifests-dir=./manifests -n ---- . List all the build configurations by running the following command: @@ -45,7 +45,7 @@ $ oc get buildconfigs -n + [source,terminal] ---- -$ oc logs buildconfig/ -n +$ oc logs buildconfig/ -n ---- + .Example command for a workflow that has ID attribute with value `greeting`: @@ -60,7 +60,7 @@ $ oc logs buildconfig/greeting -n + [source,terminal] ---- -$ oc get pods -n +$ oc get pods -n ---- + Ensure that the pod corresponding to your workflow is running. @@ -77,5 +77,5 @@ $ oc logs pod/ -n + [source,terminal] ---- -$ kn workflow undeploy -n +$ kn workflow undeploy -n ---- \ No newline at end of file diff --git a/modules/serverless-logic-deploying-workflows-dev-mode.adoc b/modules/serverless-logic-deploying-workflows-dev-mode.adoc index c023e207fd70..90cd77e0f6d6 100644 --- a/modules/serverless-logic-deploying-workflows-dev-mode.adoc +++ b/modules/serverless-logic-deploying-workflows-dev-mode.adoc @@ -17,7 +17,7 @@ You can deploy your local workflow on {ocp-product-title} in Dev mode. You can u .Procedure -. Login to your cluster. +. Login to your cluster, by running the following command: + [source,terminal] ---- @@ -28,21 +28,23 @@ $ oc login --token= --server= + [source,terminal] ---- -$ oc create namespace +$ oc create namespace ---- +. In your terminal, navigate to the root directory of your {ServerlessLogicProductName} project. + . Deploy the application, by running the following command: + [source,terminal] ---- -$ kn workflow deploy --namespace +$ kn workflow deploy -n ---- . Verify the deployment and check the status of the deployed workflow by entering the following command: + [source,terminal] ---- -$ oc get workflow -n +$ oc get workflow -n ---- + Ensure that your workflow is listed and the status is `Running` or `Completed`. @@ -51,7 +53,7 @@ Ensure that your workflow is listed and the status is `Running` or `Completed`. + [source,terminal] ---- -$ oc edit sonataflow -n +$ oc edit sonataflow -n ---- . After editing, save the changes. The {ServerlessLogicOperatorName} detects the changes and updates the workflow accordingly. @@ -64,15 +66,39 @@ $ oc edit sonataflow -n + [source,terminal] ---- -$ oc get sonataflows -n +$ oc get sonataflows -n +---- + +.. Find the pod of your application by running the following command: ++ +[source,terminal] +---- +$ oc get pods -n ---- .. View the workflow logs by running the following command: + [source,terminal] ---- -$ oc logs -n +$ oc logs -n +---- + +.Testing + +. The {ServerlessLogicOperatorName} automatically generates a route for workflow deployments using the `dev` profile. To test your workflow, you can use management console that is accessible via the created route. The management console allows you execute the workflow and inspect executed the instances in detail. +Access the management console by excuting following steps: + +.. Get the by running the following command: ++ +[source,terminal] +---- +$ oc get route/ -n ---- ++ +Note the `HOST/PORT` value, referenced as . + +.. Navigate to the `/q/dev-ui/org.apache.kie.sonataflow.sonataflow-quarkus-devui/workflows` in your browser. Please note that it may take some time until the management console is available. + .Next steps @@ -80,7 +106,7 @@ $ oc logs -n + [source,terminal] ---- -$ kn workflow undeploy -n +$ kn workflow undeploy -n ---- diff --git a/modules/serverless-logic-verifying-workflow-deployment-preview-mode.adoc b/modules/serverless-logic-verifying-workflow-deployment-preview-mode.adoc index 8f03a5091477..2be8b49b163d 100644 --- a/modules/serverless-logic-verifying-workflow-deployment-preview-mode.adoc +++ b/modules/serverless-logic-verifying-workflow-deployment-preview-mode.adoc @@ -17,7 +17,7 @@ You can verify that your {ServerlessLogicProductName} workflow is running by per .Procedure -. Retrieve the list of service and identify the one matching ID of your workflow: +. Retrieve the list of service and identify the one matching `name` of your workflow: + [source,terminal] ---- From b0c912c1b7e7cf538ef2a008f00482625bd49ba1 Mon Sep 17 00:00:00 2001 From: Dominik Hanak Date: Thu, 16 Jan 2025 16:14:15 +0100 Subject: [PATCH 12/12] SRVLOGIC-469: Improve deploying-workflows-dev-mode Testing section --- .../serverless-logic-deploying-workflows-dev-mode.adoc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/serverless-logic-deploying-workflows-dev-mode.adoc b/modules/serverless-logic-deploying-workflows-dev-mode.adoc index 90cd77e0f6d6..0944d3992bb2 100644 --- a/modules/serverless-logic-deploying-workflows-dev-mode.adoc +++ b/modules/serverless-logic-deploying-workflows-dev-mode.adoc @@ -85,17 +85,18 @@ $ oc logs -n .Testing -. The {ServerlessLogicOperatorName} automatically generates a route for workflow deployments using the `dev` profile. To test your workflow, you can use management console that is accessible via the created route. The management console allows you execute the workflow and inspect executed the instances in detail. -Access the management console by excuting following steps: +The {ServerlessLogicOperatorName} automatically generates a route for workflow deployments using the `dev` profile. To test your workflow, you can use management console that is accessible via the created route. The management console allows you execute the workflow and inspect executed the instances in detail. -.. Get the by running the following command: +. Access the management console by excuting following steps: + +.. Retrieve the public URL to access the workflow service by running the following command: + [source,terminal] ---- $ oc get route/ -n ---- + -Note the `HOST/PORT` value, referenced as . +Note the value of `HOST/PORT` from the result of tis command, referenced as `` in next step. .. Navigate to the `/q/dev-ui/org.apache.kie.sonataflow.sonataflow-quarkus-devui/workflows` in your browser. Please note that it may take some time until the management console is available.