From 881ebbbfaad033300d8406dd43c3e64ff563c9cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mathieu?= Date: Tue, 19 Apr 2022 15:07:27 +0200 Subject: [PATCH] Document the GCF and AppEngine Java 17 runtime --- .../asciidoc/deploying-to-google-cloud.adoc | 7 +++++- .../main/asciidoc/funqy-gcp-functions.adoc | 24 +++++++++++++++++++ .../src/main/asciidoc/gcp-functions-http.adoc | 5 ++++ docs/src/main/asciidoc/gcp-functions.adoc | 20 ++++++++++++++++ .../src/main/resources/application.properties | 6 ++--- 5 files changed, 58 insertions(+), 4 deletions(-) diff --git a/docs/src/main/asciidoc/deploying-to-google-cloud.adoc b/docs/src/main/asciidoc/deploying-to-google-cloud.adoc index fd0a952945189..12691aad6aaea 100644 --- a/docs/src/main/asciidoc/deploying-to-google-cloud.adoc +++ b/docs/src/main/asciidoc/deploying-to-google-cloud.adoc @@ -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] @@ -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 diff --git a/docs/src/main/asciidoc/funqy-gcp-functions.adoc b/docs/src/main/asciidoc/funqy-gcp-functions.adoc index ce391e82465c7..5d1f4bf77c33e 100644 --- a/docs/src/main/asciidoc/funqy-gcp-functions.adoc +++ b/docs/src/main/asciidoc/funqy-gcp-functions.adoc @@ -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. @@ -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. @@ -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. diff --git a/docs/src/main/asciidoc/gcp-functions-http.adoc b/docs/src/main/asciidoc/gcp-functions-http.adoc index 1a1837621ce0c..b0077233ae4e6 100644 --- a/docs/src/main/asciidoc/gcp-functions-http.adoc +++ b/docs/src/main/asciidoc/gcp-functions-http.adoc @@ -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: diff --git a/docs/src/main/asciidoc/gcp-functions.adoc b/docs/src/main/asciidoc/gcp-functions.adoc index 9a4de3293d694..7b0555fbfceaa 100644 --- a/docs/src/main/asciidoc/gcp-functions.adoc +++ b/docs/src/main/asciidoc/gcp-functions.adoc @@ -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 @@ -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] @@ -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] @@ -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 diff --git a/integration-tests/google-cloud-functions/src/main/resources/application.properties b/integration-tests/google-cloud-functions/src/main/resources/application.properties index 836825d753174..97124e554911e 100644 --- a/integration-tests/google-cloud-functions/src/main/resources/application.properties +++ b/integration-tests/google-cloud-functions/src/main/resources/application.properties @@ -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 \ No newline at end of file +#quarkus.google-cloud-functions.function=storageTest