Skip to content

Commit

Permalink
Fix new getting-started guides not having resources
Browse files Browse the repository at this point in the history
  • Loading branch information
domhanak committed Feb 27, 2024
1 parent 94f7eaf commit 92acbc1
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 92 deletions.
2 changes: 1 addition & 1 deletion serverlessworkflow/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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]
Expand All @@ -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[]
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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.

Expand All @@ -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]
----
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-container-image-jib</artifactId>
</dependency>
----
--
include::../../../../pages/_common-content/report-issue.adoc[]

0 comments on commit 92acbc1

Please sign in to comment.