Skip to content

Commit

Permalink
Document the GCF and AppEngine Java 17 runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
loicmathieu committed Apr 19, 2022
1 parent eb63ba7 commit 881ebbb
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 4 deletions.
7 changes: 6 additions & 1 deletion docs/src/main/asciidoc/deploying-to-google-cloud.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ runtime: java11

This will create a default service for your App Engine application.

[NOTE]
====
You can also use the new Java 17 runtime by defining `runtime: java17` instead.
====

App Engine Standard does not support the default Quarkus' specific packaging layout, therefore, you must set up your application to be packaged as an uber-jar via your `application.properties` file:

[source, properties]
Expand Down Expand Up @@ -160,7 +165,7 @@ It uses Cloud Build to build your Docker image and deploy it to Google Container
When done, the output will display the URL of your application (target url), you can use it with curl or directly open it in your browser using `gcloud app browse`.

NOTE: App Engine Flexible custom runtimes support link:https://cloud.google.com/appengine/docs/flexible/custom-runtimes/configuring-your-app-with-app-yaml#updated_health_checks[health checks],
it is strongly advised to provide them thanks to Quarkus xref:microprofile-health.adoc[Microprofile Health] support.
it is strongly advised to provide them thanks to Quarkus xref:smallrye-health.adoc[Smallrye Health] support.

== Deploying to Google Cloud Run

Expand Down
24 changes: 24 additions & 0 deletions docs/src/main/asciidoc/funqy-gcp-functions.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,16 @@ gcloud functions deploy quarkus-example-funky-pubsub \
--source=target/deployment
----

[IMPORTANT]
====
The entry point always needs to be `io.quarkus.funqy.gcp.functions.FunqyBackgroundFunction` as it will be this class
that will bootstrap Quarkus.
====

[NOTE]
====
You can also use the new Java 17 runtime by using `--runtime=java17` in the gcloud command line.
====

The `--trigger-resource` option defines the name of the PubSub topic, and the `--trigger-event google.pubsub.topic.publish` option
define that this function will be triggered by all message publication inside the topic.
Expand Down Expand Up @@ -200,8 +208,16 @@ gcloud functions deploy quarkus-example-funky-storage \
--source=target/deployment
----

[IMPORTANT]
====
The entry point always needs to be `io.quarkus.funqy.gcp.functions.FunqyBackgroundFunction` as it will be this class
that will bootstrap Quarkus.
====

[NOTE]
====
You can also use the new Java 17 runtime by using `--runtime=java17` in the gcloud command line.
====

The `--trigger-resource` option defines the name of the Cloud Storage bucket, and the `--trigger-event google.storage.object.finalize` option
define that this function will be triggered by all new file inside this bucket.
Expand Down Expand Up @@ -237,8 +253,16 @@ gcloud beta functions deploy quarkus-example-cloud-event --gen2 \
--runtime=java11 --trigger-bucket=example-cloud-event --source=target/deployment
----

[IMPORTANT]
====
The entry point always needs to be `io.quarkus.funqy.gcp.functions.FunqyCloudEventsFunction` as it will be this class
that will bootstrap Quarkus.
====

[NOTE]
====
You can also use the new Java 17 runtime by using `--runtime=java17` in the gcloud command line.
====

The `--trigger-bucket=` option defines the name of the Cloud Storage bucket.

Expand Down
5 changes: 5 additions & 0 deletions docs/src/main/asciidoc/gcp-functions-http.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,11 @@ gcloud functions deploy quarkus-example-http \
The entry point must always be set to `io.quarkus.gcp.functions.http.QuarkusHttpFunction` as this is the class that integrates Cloud Functions with Quarkus.
====

[NOTE]
====
You can also use the new Java 17 runtime by using `--runtime=java17` in the gcloud command line.
====

[WARNING]
====
The first time you launch this command, you can have the following error message:
Expand Down
20 changes: 20 additions & 0 deletions docs/src/main/asciidoc/gcp-functions.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,11 @@ gcloud functions deploy quarkus-example-http \
The entry point must always be set to `io.quarkus.gcp.functions.QuarkusHttpFunction` as this is the class that integrates Cloud Functions with Quarkus.
====

[NOTE]
====
You can also use the new Java 17 runtime by using `--runtime=java17` in the gcloud command line.
====

This command will give you as output a `httpsTrigger.url` that points to your function.

=== The BackgroundFunction
Expand Down Expand Up @@ -297,6 +302,11 @@ gcloud functions deploy quarkus-example-storage \
The entry point must always be set to `io.quarkus.gcp.functions.QuarkusBackgroundFunction` as this is the class that integrates Cloud Functions with Quarkus.
====

[NOTE]
====
You can also use the new Java 17 runtime by using `--runtime=java17` in the gcloud command line.
====

To trigger the event, you can send a file to the GCS `quarkus-hello` bucket or you can use gcloud to simulate one:

[source,bash]
Expand All @@ -323,6 +333,11 @@ gcloud functions deploy quarkus-example-pubsub \
The entry point must always be set to `io.quarkus.gcp.functions.QuarkusBackgroundFunction` as this is the class that integrates Cloud Functions with Quarkus.
====

[NOTE]
====
You can also use the new Java 17 runtime by using `--runtime=java17` in the gcloud command line.
====

To trigger the event, you can send a file to the `hello_topic` topic or you can use gcloud to simulate one:

[source,bash]
Expand All @@ -349,6 +364,11 @@ gcloud beta functions deploy quarkus-example-cloud-event --gen2 \
The entry point must always be set to `io.quarkus.gcp.functions.QuarkusCloudEventsFunction` as this is the class that integrates Cloud Functions with Quarkus.
====

[NOTE]
====
You can also use the new Java 17 runtime by using `--runtime=java17` in the gcloud command line.
====

To trigger the event, you can send a file to the GCS `example-cloud-event` bucket.

== Testing locally
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#quarkus.google-cloud-functions.function=httpTest
quarkus.google-cloud-functions.function=cloudEventTest
quarkus.google-cloud-functions.function=httpTest
#quarkus.google-cloud-functions.function=cloudEventTest
#quarkus.google-cloud-functions.function=rawPubSubTest
#quarkus.google-cloud-functions.function=storageTest
#quarkus.google-cloud-functions.function=storageTest

0 comments on commit 881ebbb

Please sign in to comment.