From 92acbc1042c064c80ad34885e21aee874093a8be Mon Sep 17 00:00:00 2001 From: Dominik Hanak Date: Tue, 27 Feb 2024 09:19:02 +0100 Subject: [PATCH] Fix new getting-started guides not having resources --- serverlessworkflow/modules/ROOT/nav.adoc | 2 +- ...build-workflow-image-with-quarkus-cli.adoc | 63 +------------------ ...-serverless-workflow-quarkus-examples.adoc | 26 ++++++-- ...serverless-workflow-quarkus-examples.adoc} | 33 +++------- 4 files changed, 32 insertions(+), 92 deletions(-) rename serverlessworkflow/modules/ROOT/pages/use-cases/advanced-developer-use-cases/getting-started/{build-serverless-workflow-quarkus-examples.adoc => working-with-serverless-workflow-quarkus-examples.adoc} (72%) diff --git a/serverlessworkflow/modules/ROOT/nav.adoc b/serverlessworkflow/modules/ROOT/nav.adoc index 78a03ce2f..4fff5c654 100644 --- a/serverlessworkflow/modules/ROOT/nav.adoc +++ b/serverlessworkflow/modules/ROOT/nav.adoc @@ -89,7 +89,7 @@ *** Getting started **** xref:use-cases/advanced-developer-use-cases/getting-started/create-your-first-workflow-service.adoc[] **** xref:use-cases/advanced-developer-use-cases/getting-started/build-workflow-image-with-quarkus-cli.adoc[] -**** xref:use-cases/advanced-developer-use-cases/getting-started/build-serverless-workflow-quarkus-examples.adoc[] +**** xref:use-cases/advanced-developer-use-cases/getting-started/working-with-serverless-workflow-quarkus-examples.adoc[] **** xref:use-cases/advanced-developer-use-cases/getting-started/test-serverless-workflow-quarkus-examples.adoc[] *** Deployment **** xref:use-cases/advanced-developer-use-cases/deployments/deploying-on-minikube.adoc[Deploying on Minikube] diff --git a/serverlessworkflow/modules/ROOT/pages/use-cases/advanced-developer-use-cases/getting-started/build-workflow-image-with-quarkus-cli.adoc b/serverlessworkflow/modules/ROOT/pages/use-cases/advanced-developer-use-cases/getting-started/build-workflow-image-with-quarkus-cli.adoc index aac555629..4e12aa771 100644 --- a/serverlessworkflow/modules/ROOT/pages/use-cases/advanced-developer-use-cases/getting-started/build-workflow-image-with-quarkus-cli.adoc +++ b/serverlessworkflow/modules/ROOT/pages/use-cases/advanced-developer-use-cases/getting-started/build-workflow-image-with-quarkus-cli.adoc @@ -157,70 +157,11 @@ When you are building Container Images using a remote Docker Daemon, i.e. Miniku For more information about native builds, see link:{quarkus_native_builds_url}[Building a native executable]. -- -[[proc-testing-serverless-workflow-image]] -== Testing your workflow image - -After building your workflow image using Quarkus CLI, you can test the built image. - -.Prerequisites -* Latest version of Docker is installed. - -.Procedure -. Start JVM and native Container Images. -+ --- -[tabs] -==== -Example JVM image:: -+ -[source,shell] ----- -docker run -it -p 8080:8080 quay.io/kogito/serverless-workflow-greeting-quarkus:1.0 -... -INFO [io.quarkus] (main) serverless-workflow-greeting-quarkus 1.22.1.Final on JVM (powered by Quarkus 2.9.2.Final) started in 1.302s ----- -Example native image:: -+ -[source,shell] ----- -docker run -it -p 8080:8080 quay.io/kogito/serverless-workflow-greeting-quarkus:1.0-native -... -INFO [io.quarkus] (main) serverless-workflow-greeting-quarkus 1.22.1.Final native (powered by Quarkus 2.9.2.Final) started in 0.039s ----- -==== - -Note that the startup of native image is faster than the JVM image. --- - -. To invoke the workflow application, execute the following command once the container is started: -+ --- -[tabs] -==== -Example request:: -+ -[source,shell] ----- -curl -X POST -H 'Content-Type:application/json' -H 'Accept:application/json' -d '{"name": "John", "language": "English"}' http://localhost:8080/jsongreet ----- -Example response:: -+ -[source,json] ----- -{ - "id": "2acf710d-7e4a-481d-925c-dfd85a369987", - "workflowdata": { - "name": "John", - "language": "English", - "greeting": "Hello from JSON Workflow, " - } -} ----- -==== --- +Once you have the container image of you {product_name} application, you can proceed to deployments or start testing it locally. == Additional resources +* xref:use-cases/advanced-developer-use-cases/getting-started/test-serverless-workflow-quarkus-examples.adoc[] * xref:use-cases/advanced-developer-use-cases/deployments/deploying-on-minikube.adoc[Deploying your {product_name} application on Minikube] * xref:use-cases/advanced-developer-use-cases/deployments/deploying-on-kubernetes.adoc[Deploying your {product_name} application on Kubernetes] * xref:use-cases/advanced-developer-use-cases/deployments/deploying-on-openshift.adoc[Deploying your {product_name} application on OpenShift] diff --git a/serverlessworkflow/modules/ROOT/pages/use-cases/advanced-developer-use-cases/getting-started/test-serverless-workflow-quarkus-examples.adoc b/serverlessworkflow/modules/ROOT/pages/use-cases/advanced-developer-use-cases/getting-started/test-serverless-workflow-quarkus-examples.adoc index 10b6f4764..ef92915ce 100644 --- a/serverlessworkflow/modules/ROOT/pages/use-cases/advanced-developer-use-cases/getting-started/test-serverless-workflow-quarkus-examples.adoc +++ b/serverlessworkflow/modules/ROOT/pages/use-cases/advanced-developer-use-cases/getting-started/test-serverless-workflow-quarkus-examples.adoc @@ -1,11 +1,11 @@ -= Testing images of serverless workflow example applications using Quarkus CLI += Testing images of {product_name} example applications using Quarkus CLI -After building your workflow image using Quarkus CLI, you can test the built image. - -TODO: Add link to previous guides +After building the image of your application using Quarkus CLI, you can use the built image +to do some test with your application. .Prerequisites * Latest version of Docker is installed. +* Built image of your application. Go to xref:./build-workflow-image-with-quarkus-cli.adoc[] to see how. .Procedure . Start JVM and native Container Images. @@ -32,9 +32,11 @@ INFO [io.quarkus] (main) serverless-workflow-greeting-quarkus 1.22.1.Final nati ==== Note that the startup of native image is faster than the JVM image. +The docker deploys the image on your local and you can now execute commands and start testing +the workflows behavior. -- -. To invoke the workflow application, execute the following command once the container is started: +. To invoke the example greeting workflow application, execute the following command once the container is started: + -- [tabs] @@ -60,3 +62,17 @@ Example response:: ---- ==== -- + +This command will trigger the workflows execution and return its output. + +More complex workflows require different kind of testing, see the additional resources +how to extend the test coverage of your {product_name} applications. + + +== Additional resources + +* xref:use-cases/advanced-developer-use-cases/testing/basic-integration-tests-with-restassured.adoc[] +* xref:use-cases/advanced-developer-use-cases/testing/mocking-http-cloudevents-with-wiremock.adoc[] +* xref:use-cases/advanced-developer-use-cases/testing/mocking-openapi-services-with-wiremock.adoc[] + +include::../../../../pages/_common-content/report-issue.adoc[] diff --git a/serverlessworkflow/modules/ROOT/pages/use-cases/advanced-developer-use-cases/getting-started/build-serverless-workflow-quarkus-examples.adoc b/serverlessworkflow/modules/ROOT/pages/use-cases/advanced-developer-use-cases/getting-started/working-with-serverless-workflow-quarkus-examples.adoc similarity index 72% rename from serverlessworkflow/modules/ROOT/pages/use-cases/advanced-developer-use-cases/getting-started/build-serverless-workflow-quarkus-examples.adoc rename to serverlessworkflow/modules/ROOT/pages/use-cases/advanced-developer-use-cases/getting-started/working-with-serverless-workflow-quarkus-examples.adoc index ed8e6284f..7319fb7a8 100644 --- a/serverlessworkflow/modules/ROOT/pages/use-cases/advanced-developer-use-cases/getting-started/build-serverless-workflow-quarkus-examples.adoc +++ b/serverlessworkflow/modules/ROOT/pages/use-cases/advanced-developer-use-cases/getting-started/working-with-serverless-workflow-quarkus-examples.adoc @@ -1,4 +1,4 @@ -= Building image of {product_name} example application using Quarkus CLI += Working with {product_name} example application using Quarkus CLI :compat-mode!: // Metadata: :description: Build Serverless Application with Quarkus CLI @@ -15,11 +15,13 @@ This document describes how to build a images of {product_name} example applicat include::./../../../../pages/_common-content/getting-started-requirement.adoc[] * Latest version of Docker is installed. Alternatively, you can use link:{google_jib_url}[Jib] to build container images. However, Docker is required to build GraalVM native image using the Quarkus native builder image. * Optionally, GraalVM {graalvm_min_version} is installed. +* Install the Quarkus command line interface (CLI). For more information, see link:{quarkus_cli_url}[Installing the Quarkus CLI]. [[proc-using-example-application]] == Using an example application To get started with building workflow images, you can use the link:{kogito_sw_examples_url}/serverless-workflow-greeting-quarkus[`serverless-workflow-greeting-quarkus`] example application. +However, same procedure can be applied to any example located in link:{kogito_sw_examples_url}[{product_name} example repository] NOTE: You can skip the following procedure if you already have a workflow application. @@ -34,31 +36,12 @@ cd kogito-examples/serverless-workflow-examples/serverless-workflow-greeting-qua ---- . To run the example application, follow the instructions located in the README.md of the examples. Every example application provides a file with instructions on how to run and work with it. -. Install the Quarkus command line interface (CLI). For more information, see link:{quarkus_cli_url}[Installing the Quarkus CLI]. -. Add the required Quarkus extension using Quarkus CLI: -+ --- -.Add the Jib extension +. Play with the example and explore {product_name} capabilities. -[NOTE] -==== -The `kogito-examples` already have this extension added by default, and can be activated with the `container` Maven profile. -==== -The steps to add the extension in your Serverless Workflow application are: -[source,shell] ----- -quarkus extension add 'container-image-jib' ----- +== Additional resources -After adding the Jib extension, you can verify the newly added dependency in the `pom.xml` file: +* xref:./build-workflow-image-with-quarkus-cli.adoc[] +* xref:./test-serverless-workflow-quarkus-examples.adoc[] -.Verify the Jib extension -[source,xml] ----- - - io.quarkus - quarkus-container-image-jib - ----- --- \ No newline at end of file +include::../../../../pages/_common-content/report-issue.adoc[] \ No newline at end of file