Skip to content

Commit

Permalink
chore(doc): multi arch support update
Browse files Browse the repository at this point in the history
  • Loading branch information
squakez committed Jun 6, 2023
1 parent 84e56eb commit 97bfbaa
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/actions/kamel-build-binary/build-binary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ else
fi

if [ -n "${REGISTRY_PUSH_HOST}" ]; then
RULES="${RULES} images-push"
RULES="${RULES} image-push"
fi

make ${RULES}
Expand Down
11 changes: 11 additions & 0 deletions docs/modules/ROOT/pages/contributing/local-development.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ This command will build and publish your actual Camel K development version to t

You can provide any customization required such as `--log-level`, `--operator-id`, etcetera. Mind that you need to use `./kamel` in order to use the development binary you've just built, as tipically, `kamel` is the production CLI you have installed in your binary path.

[[local-camel-k-runtime]]
=== Local Camel K runtime

Camel K integrations are based on https://github.com/apache/camel-k-runtime[Camel K runtime], generally paired with the operator release. If you need to specify a different runtime, or you have a local Camel K Runtime that you want to test you need to build a Camel K version bundled with the local Camel K Runtime bits
Expand All @@ -41,3 +42,13 @@ make images CAMEL_K_RUNTIME_DIR=<path/to/local/ck-runtime/project>

Once this is done you need to re-install via `./kamel install`.

[[local-multi-arch]]
=== Local Multiple Architecture

Since Camel K version 2 we're introducing the support for multiple architecture. If you want to build your container image operator for a specific architecture, you can provide a parameter, `IMAGE_ARCH`. See the example:

----
IMAGE_ARCH=arm64 make images
----

With this configuration, you will build an ARM64 architecture container image that you can reference later as `apache/camel-k:<version>-arm64`.
Original file line number Diff line number Diff line change
@@ -1,37 +1,24 @@
[[multi-architecture-props]]
= Multi Architecture

To use kamel inside other architecture like arm64 you must build it and use Buildah as builder strategy.
NOTE: this part is evolving quickly during development of version 2 so it may be slightly inaccurate.

NOTE: For now only arm64 is supported as other architectures
To use Camel K operator with any architecture like `arm64` you must use Buildah as builder strategy.

[[multi-architecture-build]]
== Build and Publish Kamel

As first step it's necessary to build kamel project `https://github.com/apache/camel-k` manually and push image to own docker repository.

I suggest to create a free docker image repository with `docker-hub` or `ghcr`.

[source,shell]
.script/Makefile
----
make build images-arch images-push
----

NOTE: The base image of kamel operator is graalvm because multi architecture quarkus-mandrel image not published yet
Since version 2, Camel K is publishing an ARM64 architecture beside the default AMD64 architecture. You need to reference this as `apache/camel-k:<version>-arm64`. You can build your particular architecture from source, following the guidelines in xref:contributing/local-development.adoc[Local development].

[[multi-architecture-install]]
== Install Kamel
== Install Camel K ARM64 operator

Proceed with installation of kamel inside kubernetes cluster with the below command
Proceed with installation of kamel inside kubernetes cluster with the below command:

[source,shell]
----
./kamel install --build-publish-strategy=Buildah --registry YOUR_REGISTRY --registry-auth-username YOUR_USERNAME --registry-auth-password YOUR_PASSWORD
kamel install --operator-image=apache/camel-k:<version>-arm64 --build-publish-strategy Buildah --build-publish-strategy-option BuildahPlatform=linux/arm/v8 --registry ...
----

[[multi-architecture-use]]
== Use kamel
== Test an integration

Build and run an integration

Expand All @@ -52,7 +39,7 @@ kamel run hello.groovy
[[multi-architecture-configure-optional]]
== Optional Buildah Configuration

If you want change the default architecture of buildah build strategy, you must edit integration platform manually.
If you want change the default architecture of Buildah build strategy once this is installed, you must edit integration platform manually.

[source,shell]
----
Expand All @@ -78,4 +65,4 @@ status:
BuildahPlatform: linux/arm/v8
----

NOTE: It's important to know buidah supports only amd64 and arm64
NOTE: It's important to know Buidah supports only amd64 and arm64
4 changes: 4 additions & 0 deletions script/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,10 @@ else
docker build --platform=linux/$(IMAGE_ARCH) -t $(CUSTOM_IMAGE):$(CUSTOM_VERSION)-$(IMAGE_ARCH) -f build/Dockerfile .
endif

# Mainly used for internal CI purposes
image-push:
docker push $(CUSTOM_IMAGE):$(CUSTOM_VERSION)

images-push:
docker push $(CUSTOM_IMAGE):$(CUSTOM_VERSION)
docker push $(CUSTOM_IMAGE):$(CUSTOM_VERSION)-arm64
Expand Down

0 comments on commit 97bfbaa

Please sign in to comment.