From a6f555ba1e0827b2534d26f8c927276e1e2aabca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Han=C3=A1k?= Date: Fri, 1 Sep 2023 20:18:45 +0200 Subject: [PATCH 1/5] KOGITO-9460: Create a new guide describing the workflow CLI (#432) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * KOGITO-9460: Update KN CLI plugin guide * KOGITO-9460: Create a new guide describing the workflow CLI Updates the guide to include run, create, deploy and undeploy commands without quarkus sections. Moves quarkus section down and improves them to reflect latest changes. Adds new additional resource that will be added later. * KOGITO-9460: Fix quarkus CLI guides * Update serverlessworkflow/modules/ROOT/pages/testing-and-troubleshooting/kn-plugin-workflow-overview.adoc Co-authored-by: Kalyani Desai <43639538+kaldesai@users.noreply.github.com> * Update serverlessworkflow/modules/ROOT/pages/testing-and-troubleshooting/kn-plugin-workflow-overview.adoc Co-authored-by: Kalyani Desai <43639538+kaldesai@users.noreply.github.com> * Update serverlessworkflow/modules/ROOT/pages/testing-and-troubleshooting/kn-plugin-workflow-overview.adoc Co-authored-by: Kalyani Desai <43639538+kaldesai@users.noreply.github.com> * KOGITO-9460: Remove obsolete part in deploy * Improve /kn-plugin-workflow-overview.adoc to mention devUI auto opens Co-authored-by: Zbyněk Drápela <61500440+zdrapela@users.noreply.github.com> --------- Co-authored-by: Kalyani Desai <43639538+kaldesai@users.noreply.github.com> Co-authored-by: Zbyněk Drápela <61500440+zdrapela@users.noreply.github.com> --- .../kn-plugin-workflow-overview.adoc | 163 ++++++++++++++---- 1 file changed, 132 insertions(+), 31 deletions(-) diff --git a/serverlessworkflow/modules/ROOT/pages/testing-and-troubleshooting/kn-plugin-workflow-overview.adoc b/serverlessworkflow/modules/ROOT/pages/testing-and-troubleshooting/kn-plugin-workflow-overview.adoc index ec9e18336..58f6940fc 100644 --- a/serverlessworkflow/modules/ROOT/pages/testing-and-troubleshooting/kn-plugin-workflow-overview.adoc +++ b/serverlessworkflow/modules/ROOT/pages/testing-and-troubleshooting/kn-plugin-workflow-overview.adoc @@ -60,32 +60,35 @@ kn-workflow .Example output [source,text] ---- -Manage Kogito Serverless Workflow projects +Manage SonataFlow projects Usage: kn workflow [command] Available Commands: - build Build a Kogito Serverless Workflow project and generate a container image completion Generate the autocompletion script for the specified shell - create Create a Kogito Serverless Workflow project - deploy Deploy a Kogito Serverless Workflow project + create Creates a new SonataFlow project + deploy Deploy a SonataFlow project on Kubernetes via SonataFlow Operator help Help about any command + quarkus Manage SonataFlow projects built in Quarkus + run Run a SonataFlow project in development mode + undeploy Undeploy a SonataFlow project on Kubernetes via SonataFlow Operator + version Show the version Flags: - -h, --help help for kn-workflow - -v, --verbose Print verbose logs + -h, --help help for kn + -v, --version version for kn -Use "kn workflow [command] --help" for more information about a command. +Use "kn [command] --help" for more information about a command. ---- -- [[proc-create-sw-project-kn-cli]] == Creating a workflow project using Knative CLI -After installing the {product_name} plug-in, you can use the `create` command with `kn workflow` to scaffold a new workflow project in your current directory. +After installing the {product_name} plug-in, you can use the `create` command with `kn workflow` to scaffold a new {product_name} project in your current directory. -The `create` command sets up Quarkus project containing minimal extensions to build a workflow project. Also, the generated workflow project contains a "hello world" `workflow.sw.json` file in your `.//src/main/resources` directory. +The `create` command sets up {product_name} project containing minimal a "hello world" `workflow.sw.json` file in your `./` directory. .Prerequisites * {product_name} plug-in for Knative CLI is installed. @@ -114,27 +117,123 @@ kn workflow create --name my-project ---- -- -. Add more extensions to the Quarkus project during its creation by using the `[-e|--extension]` flag as follows: +[[proc-build-sw-project-kn-cli]] +== Running a workflow project using Knative CLI + +After creating your workflow project, you can use the `run` command with `kn workflow` to build & run your workflow project in your current directory. + +This will start a {product_name} docker image and map your local folder to this image. + +.Prerequisites +* {product_name} plug-in for Knative CLI is installed. ++ +For more information about installing the plug-in, see <>. + +* A workflow project is created. ++ +For more information about creating a workflow project, see <>. +* Minikube cluster is running locally. + + +.Procedure +. In Knative CLI, enter the following command to build and run your workflow project: + -- -.Create a project with `quarkus-jsonp` and `quarkus-smallrye-openapi` extensions +.Run the project and start a local development image. [source,shell] ---- -kn workflow create --extension quarkus-jsonp,quarkus-smallrye-openapi +kn workflow run ---- +-- +. Once the project is ready, the Development UI will be opened up in a browser automatically (on `localhost:8080/q/dev`). -You can add multiple extensions using the comma-separated names of the extensions in the previous command. +[[proc-deploy-sw-project-kn-cli]] +== Deploying a workflow project using Knative CLI + +You can use the `deploy` command combined with `kn workflow` to deploy your workflow project in your current directory. + +.Prerequisites +* {product_name} plug-in for Knative CLI is installed. ++ +For more information about installing the plug-in, see <>. + +* A workflow project is created. ++ +For more information about created a workflow project, see <>. + +* A minikube cluster is running locally. + +.Procedure +. In Knative CLI, enter the following command to deploy your workflow project: ++ +-- +.Deploy a workflow project +[source,shell] +---- +kn workflow deploy +---- + +Also, ensure that you have access to your cluster and your cluster can access the generated container image. +For more options with `deploy` command use `[-h|--help]`. [NOTE] -==== +==== +You can use the `kubectl` command line if you want to use a complex deployment setup for your workflow project. +==== +-- + +[[proc-create-quarkus-sw-project-kn-cli]] +== Creating a Quarkus Workflow project using Knative CLI + +After installing the {product_name} plug-in, you can use the `quarkus create` command with `kn workflow` to scaffold a new Quarkus Workflow project in your current directory. + +The `quarkus create` command sets up {product_name} project containing minimal extensions to build a workflow project. The `create` command sets up a Quarkus project containing minimal extensions to build a workflow project. Also, the generated workflow project contains a "hello world" `workflow.sw.json` file in your `.//src/main/resources` directory. + +.Prerequisites +* {product_name} plug-in for Knative CLI is installed. +For more information about installing the plug-in, see <>. +ifeval::["{kogito_version_redhat}" != ""] +* You followed the steps in xref:getting-started/create-your-first-workflow-service.adoc#proc-configuring-maven-rhbq[Configuring your Maven project to Red Hat build of Quarkus and OpenShift Serverless Logic] +endif::[] + +.Procedure +. In Knative CLI, enter the following command to create a new project: ++ +-- +.Creates a project named `new-project` +[source,shell] +---- +kn workflow quarkus create +---- + +By default, the generated project is named as `new-project`. You can overwrite the project name by using the `[-n|--name]` flag as follows: + +.Create a project named `my-project` +[source,shell] +---- +kn workflow quarkus create --name my-project +---- +-- + +. Add more extensions to the Quarkus project during its creation by using the `[-e|--extension]` flag as follows: ++ +-- +.Create a project with `quarkus-jsonp and quarkus-smallrye-openai` extensions +[source,shell] +---- +kn workflow quarkus create --extension quarkus-jsonp,quarkus-smallrye-openapi +---- +You can add multiple extensions using the comma-separated names of the extensions in the previous command. +[NOTE] +==== When you run the `create` command for the first time, it might take a while due to the necessity of downloading the required dependencies for the Quarkus project. ==== -- -[[proc-build-sw-project-kn-cli]] -== Building a workflow project using Knative CLI +[[proc-build-quarkus-sw-project-kn-cli]] +== Building a Quarkus workflow project using Knative CLI -After creating your workflow project, you can use the `build` command with `kn workflow` to build your workflow project in your current directory and to generate a container image. +After creating your workflow project, you can use the `quarkus build` command with `kn workflow` to build your workflow project in your current directory and to generate a container image. The process of building your workflow project produces a `knative.yml` file in the `./target/kubernetes` folder. If your workflow contains events, then the building process also generates a `kogito.yml` file. @@ -154,7 +253,7 @@ For more information about creating a workflow project, see < Date: Mon, 4 Sep 2023 14:14:25 +0200 Subject: [PATCH 2/5] Update serverlessworkflow/modules/ROOT/pages/testing-and-troubleshooting/kn-plugin-workflow-overview.adoc --- .../kn-plugin-workflow-overview.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/serverlessworkflow/modules/ROOT/pages/testing-and-troubleshooting/kn-plugin-workflow-overview.adoc b/serverlessworkflow/modules/ROOT/pages/testing-and-troubleshooting/kn-plugin-workflow-overview.adoc index 58f6940fc..2c8d17ea4 100644 --- a/serverlessworkflow/modules/ROOT/pages/testing-and-troubleshooting/kn-plugin-workflow-overview.adoc +++ b/serverlessworkflow/modules/ROOT/pages/testing-and-troubleshooting/kn-plugin-workflow-overview.adoc @@ -159,7 +159,7 @@ For more information about installing the plug-in, see <>. +For more information about creating a workflow project, see <>. * A minikube cluster is running locally. From bf75b3dfc92099dface4fc033827a1a4fb27a6e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mari=C3=A1n=20Macik?= Date: Mon, 4 Sep 2023 14:14:37 +0200 Subject: [PATCH 3/5] Update serverlessworkflow/modules/ROOT/pages/testing-and-troubleshooting/kn-plugin-workflow-overview.adoc --- .../kn-plugin-workflow-overview.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/serverlessworkflow/modules/ROOT/pages/testing-and-troubleshooting/kn-plugin-workflow-overview.adoc b/serverlessworkflow/modules/ROOT/pages/testing-and-troubleshooting/kn-plugin-workflow-overview.adoc index 2c8d17ea4..cdfc4d09a 100644 --- a/serverlessworkflow/modules/ROOT/pages/testing-and-troubleshooting/kn-plugin-workflow-overview.adoc +++ b/serverlessworkflow/modules/ROOT/pages/testing-and-troubleshooting/kn-plugin-workflow-overview.adoc @@ -88,7 +88,7 @@ Use "kn [command] --help" for more information about a command. After installing the {product_name} plug-in, you can use the `create` command with `kn workflow` to scaffold a new {product_name} project in your current directory. -The `create` command sets up {product_name} project containing minimal a "hello world" `workflow.sw.json` file in your `./` directory. +The `create` command sets up {product_name} project containing a minimal "hello world" `workflow.sw.json` file in your `./` directory. .Prerequisites * {product_name} plug-in for Knative CLI is installed. From 857a691b9b760e4f5eec7145ac99af73229b93ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mari=C3=A1n=20Macik?= Date: Mon, 4 Sep 2023 14:14:44 +0200 Subject: [PATCH 4/5] Update serverlessworkflow/modules/ROOT/pages/testing-and-troubleshooting/kn-plugin-workflow-overview.adoc --- .../kn-plugin-workflow-overview.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/serverlessworkflow/modules/ROOT/pages/testing-and-troubleshooting/kn-plugin-workflow-overview.adoc b/serverlessworkflow/modules/ROOT/pages/testing-and-troubleshooting/kn-plugin-workflow-overview.adoc index cdfc4d09a..b94fb21f5 100644 --- a/serverlessworkflow/modules/ROOT/pages/testing-and-troubleshooting/kn-plugin-workflow-overview.adoc +++ b/serverlessworkflow/modules/ROOT/pages/testing-and-troubleshooting/kn-plugin-workflow-overview.adoc @@ -218,7 +218,7 @@ kn workflow quarkus create --name my-project . Add more extensions to the Quarkus project during its creation by using the `[-e|--extension]` flag as follows: + -- -.Create a project with `quarkus-jsonp and quarkus-smallrye-openai` extensions +.Create a project with `quarkus-jsonp and quarkus-smallrye-openapi` extensions [source,shell] ---- kn workflow quarkus create --extension quarkus-jsonp,quarkus-smallrye-openapi From 5d3b2ea17761b1bb2806251e9d74e246871ab9fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mari=C3=A1n=20Macik?= Date: Mon, 4 Sep 2023 14:16:25 +0200 Subject: [PATCH 5/5] Update serverlessworkflow/modules/ROOT/pages/testing-and-troubleshooting/kn-plugin-workflow-overview.adoc --- .../kn-plugin-workflow-overview.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/serverlessworkflow/modules/ROOT/pages/testing-and-troubleshooting/kn-plugin-workflow-overview.adoc b/serverlessworkflow/modules/ROOT/pages/testing-and-troubleshooting/kn-plugin-workflow-overview.adoc index b94fb21f5..809ee8870 100644 --- a/serverlessworkflow/modules/ROOT/pages/testing-and-troubleshooting/kn-plugin-workflow-overview.adoc +++ b/serverlessworkflow/modules/ROOT/pages/testing-and-troubleshooting/kn-plugin-workflow-overview.adoc @@ -187,7 +187,7 @@ You can use the `kubectl` command line if you want to use a complex deployment s After installing the {product_name} plug-in, you can use the `quarkus create` command with `kn workflow` to scaffold a new Quarkus Workflow project in your current directory. -The `quarkus create` command sets up {product_name} project containing minimal extensions to build a workflow project. The `create` command sets up a Quarkus project containing minimal extensions to build a workflow project. Also, the generated workflow project contains a "hello world" `workflow.sw.json` file in your `.//src/main/resources` directory. +The `quarkus create` command sets up a {product_name} Quarkus project containing minimal extensions to build a workflow project. Also, the generated workflow project contains a "hello world" `workflow.sw.json` file in your `.//src/main/resources` directory. .Prerequisites * {product_name} plug-in for Knative CLI is installed.