This is an automated email from the ASF dual-hosted git repository. astefanutti pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit 49c0903c1d30d349754ce853d35bc81123a97f20 Author: Antonin Stefanutti <[email protected]> AuthorDate: Wed Sep 8 16:54:56 2021 +0200 doc(native): Add automatic rollout to native integration example --- deploy/traits.yaml | 17 ++++++++++------- docs/modules/traits/pages/quarkus.adoc | 30 ++++++++++++++++++++++-------- pkg/resources/resources.go | 4 ++-- pkg/trait/quarkus.go | 14 +++++++++----- 4 files changed, 43 insertions(+), 22 deletions(-) diff --git a/deploy/traits.yaml b/deploy/traits.yaml index 073fff9..46bfcb1 100755 --- a/deploy/traits.yaml +++ b/deploy/traits.yaml @@ -808,7 +808,11 @@ traits: - Kubernetes - Knative - OpenShift - description: The Quarkus trait configures the Quarkus runtime. It's enabled by default. + description: 'The Quarkus trait configures the Quarkus runtime. It''s enabled by + default. NOTE: Compiling to a native executable, i.e. when using `package-type=native`, + requires at least 4GiB of memory. Make sure enough memory is available for the + Pod running the native build, that is either the operator Pod, or the build Pod, + depending on the build strategy configured for the platform.' properties: - name: enabled type: bool @@ -817,12 +821,11 @@ traits: - name: package-type type: '[]./pkg/trait.quarkusPackageType' description: The Quarkus package types, either `fast-jar` or `native` (default - `fast-jar`).In case both `fast-jar` and `native` are specified, two IntegrationKits - are created,with the `native` kit having precedence over the `fast-jar' one - once ready.The order influences the resolution of the current IntegrationKit - for the Integration.The IntegrationKit corresponding to the first package type - will be assigned to theIntegration in case no existing IntegrationKit that matches - the Integration exists. + `fast-jar`).In case both `fast-jar` and `native` are specified, two `IntegrationKit` + resources are created,with the `native` kit having precedence over the `fast-jar` + one once ready.The order influences the resolution of the current kit for the + integration.The kit corresponding to the first package type will be assigned + to theintegration in case no existing kit that matches the integration exists. - name: route platform: false profiles: diff --git a/docs/modules/traits/pages/quarkus.adoc b/docs/modules/traits/pages/quarkus.adoc index 5127c0d..d90ad66 100755 --- a/docs/modules/traits/pages/quarkus.adoc +++ b/docs/modules/traits/pages/quarkus.adoc @@ -5,6 +5,10 @@ The Quarkus trait configures the Quarkus runtime. It's enabled by default. +NOTE: Compiling to a native executable, i.e. when using `package-type=native`, requires at least 4GiB of memory. +Make sure enough memory is available for the Pod running the native build, that is either the operator Pod, or +the build Pod, depending on the build strategy configured for the platform. + This trait is available in the following profiles: **Kubernetes, Knative, OpenShift**. @@ -32,11 +36,11 @@ The following configuration options are available: | quarkus.package-type | []./pkg/trait.quarkusPackageType | The Quarkus package types, either `fast-jar` or `native` (default `fast-jar`). -In case both `fast-jar` and `native` are specified, two IntegrationKits are created, -with the `native` kit having precedence over the `fast-jar' one once ready. -The order influences the resolution of the current IntegrationKit for the Integration. -The IntegrationKit corresponding to the first package type will be assigned to the -Integration in case no existing IntegrationKit that matches the Integration exists. +In case both `fast-jar` and `native` are specified, two `IntegrationKit` resources are created, +with the `native` kit having precedence over the `fast-jar` one once ready. +The order influences the resolution of the current kit for the integration. +The kit corresponding to the first package type will be assigned to the +integration in case no existing kit that matches the integration exists. |=== @@ -44,7 +48,17 @@ Integration in case no existing IntegrationKit that matches the Integration exis == Supported Camel Components -When running with Quarkus enabled, then Camel K only supports out of the box, those Camel components that -are available as Camel Quarkus Extensions. +Camel K only supports the Camel components that are available as Camel Quarkus Extensions out-of-the-box. These extensions are listed in the xref:2.0.0@camel-quarkus::reference/index.adoc[Camel Quarkus documentation]. + +== Examples + +=== Automatic Rollout Deployment to Native Integration + +While the compilation to native executables produces integrations that start faster and consume less memory at runtime, the build process is resources intensive, and takes a longer time than the packaging to traditional Java applications. + +In order to combine the best of both worlds, it's possible to configure the Quarkus trait to run both traditional and native builds in parallel when running an integration, e.g.: + +[source,console] +$ kamel run -t quarkus.package-type=fast-jar -t quarkus.package-type=native ... -You can see the list of extensions from the xref:2.0.0@camel-quarkus::reference/index.adoc[Camel Quarkus documentation]. +The integration pod will run as soon as the `fast-jar` build completes, and a rollout deployment to the `native` image will be triggered, as soon as the `native` build completes, with no service interruption. diff --git a/pkg/resources/resources.go b/pkg/resources/resources.go index 815ff3b..0cd7ac2 100644 --- a/pkg/resources/resources.go +++ b/pkg/resources/resources.go @@ -467,9 +467,9 @@ var assets = func() http.FileSystem { "/traits.yaml": &vfsgen۰CompressedFileInfo{ name: "traits.yaml", modTime: time.Time{}, - uncompressedSize: 39715, + uncompressedSize: 40006, - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x7d\xfb\x73\x24\xb7\xd1\xd8\xef\xf7\x57\xa0\xf8\xa5\x8a\x8f\xda\x1d\x52\x76\xec\x4f\x61\xa2\xb8\xe8\xbb\x93\x45\xe9\x1e\xcc\x91\x92\x2b\x75\x51\x79\xb1\x33\xbd\xbb\x38\x62\x80\x31\x80\x21\x6f\x9d\x2f\xff\x7b\x0a\xdd\x78\xcd\xec\x92\x5c\x9e\x44\x95\x98\x8a\xfd\x83\x8e\xe4\xa0\xd1\x68\x34\xfa\x8d\x86\x33\x5c\x38\x7b\xfa\x62\xca\x14\x6f\xe1\x94\xf1\xc5\x42\x28\xe1\xd6\x2f\x18\xeb\x24\x77\x0b\x6d\xda\x53\xb6\xe0\xd2\x [...] + compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x7d\xfd\x73\x24\xb7\xb1\xd8\xef\xf7\x57\xa0\xf8\x52\x75\x24\x6b\x77\x78\xb2\x9f\x6d\x85\x89\xe2\xa2\xee\x4e\x16\xa5\xfb\x60\x8e\x94\x5c\x29\x45\xe5\xc5\xce\xf4\xee\xe2\x16\x03\x8c\x01\x0c\x79\xeb\xbc\xfc\xef\x29\x74\xe3\x6b\x76\x87\xe4\xf2\x24\xaa\xc4\xd4\xb3\x7f\xd0\x91\x1c\x00\x8d\x46\xa3\xbf\xbb\xe1\x0c\x17\xce\x9e\x3e\x9b\x32\xc5\x5b\x38\x65\x7c\xb1\x10\x4a\xb8\xcd\x33\xc6\x3a\xc9\xdd\x42\x9b\xf6\x94\x2d\xb8\x [...] }, } fs["/"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ diff --git a/pkg/trait/quarkus.go b/pkg/trait/quarkus.go index 49a180e..c4dd613 100644 --- a/pkg/trait/quarkus.go +++ b/pkg/trait/quarkus.go @@ -48,15 +48,19 @@ var kitPriority = map[quarkusPackageType]string{ // // It's enabled by default. // +// NOTE: Compiling to a native executable, i.e. when using `package-type=native`, requires at least 4GiB of memory. +// Make sure enough memory is available for the Pod running the native build, that is either the operator Pod, or +// the build Pod, depending on the build strategy configured for the platform. +// // +camel-k:trait=quarkus type quarkusTrait struct { BaseTrait `property:",squash"` // The Quarkus package types, either `fast-jar` or `native` (default `fast-jar`). - // In case both `fast-jar` and `native` are specified, two IntegrationKits are created, - // with the `native` kit having precedence over the `fast-jar' one once ready. - // The order influences the resolution of the current IntegrationKit for the Integration. - // The IntegrationKit corresponding to the first package type will be assigned to the - // Integration in case no existing IntegrationKit that matches the Integration exists. + // In case both `fast-jar` and `native` are specified, two `IntegrationKit` resources are created, + // with the `native` kit having precedence over the `fast-jar` one once ready. + // The order influences the resolution of the current kit for the integration. + // The kit corresponding to the first package type will be assigned to the + // integration in case no existing kit that matches the integration exists. PackageTypes []quarkusPackageType `property:"package-type" json:"packageTypes,omitempty"` }
