diff --git a/dev-support/jenkins/Dockerfile b/dev-support/jenkins/Dockerfile index 5b7aac29a9..17bcf30645 100644 --- a/dev-support/jenkins/Dockerfile +++ b/dev-support/jenkins/Dockerfile @@ -20,16 +20,29 @@ FROM hadolint/hadolint:latest-debian as hadolint FROM maven:3.8-jdk-8 - -# hadolint ignore=DL3008 -RUN apt-get -q update && apt-get -q install --no-install-recommends -y \ - binutils \ - git \ - rsync \ - shellcheck \ - wget && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +# hadolint ignore=SC1091 +RUN install -m 0755 -d /etc/apt/keyrings \ + && curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg \ + && chmod a+r /etc/apt/keyrings/docker.gpg \ + && echo \ + "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \ + "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \ + tee /etc/apt/sources.list.d/docker.list > /dev/null \ + && apt-get -q update \ + && apt-get -q install --no-install-recommends -y \ + binutils=* \ + ca-certificates=* \ + curl=* \ + docker-buildx-plugin=* \ + docker-ce-cli=* \ + git=* \ + gnupg=* \ + rsync=* \ + shellcheck=* \ + wget=* \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* COPY --from=hadolint /bin/hadolint /bin/hadolint diff --git a/dev-support/jenkins/jenkins_precommit_github_yetus.sh b/dev-support/jenkins/jenkins_precommit_github_yetus.sh index 2cede2f047..40f3ead1a9 100755 --- a/dev-support/jenkins/jenkins_precommit_github_yetus.sh +++ b/dev-support/jenkins/jenkins_precommit_github_yetus.sh @@ -111,6 +111,8 @@ YETUS_ARGS+=("--tests-filter=test4tests") # Dockerfile since we don't want to use the auto-pulled version. YETUS_ARGS+=("--docker") YETUS_ARGS+=("--dockerfile=${DOCKERFILE}") +# enabled docker-in-docker so that we can build container images +YETUS_ARGS+=("--dockerind=true") YETUS_ARGS+=("--mvn-custom-repos") YETUS_ARGS+=("--java-home=${SET_JAVA_HOME}") # effectively treat dev-support as a custom maven module @@ -127,4 +129,4 @@ YETUS_ARGS+=("--proclimit=5000") echo "Launching yetus with command line:" echo "${TESTPATCHBIN} ${YETUS_ARGS[*]}" -/usr/bin/env bash "${TESTPATCHBIN}" "${YETUS_ARGS[@]}" \ No newline at end of file +/usr/bin/env bash "${TESTPATCHBIN}" "${YETUS_ARGS[@]}" diff --git a/hbase-kubernetes-deployment/hbase-kubernetes-testing-image/README.md b/hbase-kubernetes-deployment/hbase-kubernetes-testing-image/README.md new file mode 100644 index 0000000000..31755c0a12 --- /dev/null +++ b/hbase-kubernetes-deployment/hbase-kubernetes-testing-image/README.md @@ -0,0 +1,70 @@ + + +# hbase-kubernetes-testing-image + +This directory builds a docker image containing everything required to run `kubectl-kuttl` in +"mocked control plane" mode. This image is used as the basis for both dev and test environments. + +## Build + +Building the docker image locally is a little picky because there's lots of input arguments. These +are managed via the [docker-bake.override.hcl](./src/main/docker/docker-bake.override.hcl). + +Start by creating a buildx context that supports (optionally) multi-platform images. If you've +created this context previously, it's enough to ensure that it's active via `docker buildx ls`. + +```shell +$ docker buildx create \ + --driver docker-container \ + --platform linux/amd64,linux/arm64 \ + --use \ + --bootstrap +``` + +Finally, build the image using `maven package`, or manually, using, + +```shell +$ docker buildx bake \ + --file src/main/docker/docker-bake.hcl \ + --file src/main/docker/docker-bake.override.hcl \ + --pull \ + --load +``` + +This exports an image to your local repository that is tagged as `${USER}/hbase/operator-tools/kuttl:latest`. + +## Usage + +The image is configured with `kuttle` as the entrypoint. + +```shell +$ docker container run --rm -it ${USER}/hbase/operator-tools/kuttl:latest --help + +``` + +Running tests in the image requires mounting the workspace into the container image and passing +appropriate parameters to `kuttl`. For example, run the "small" tests like this: + +```shell +$ docker container run \ + --mount type=bind,source=$(pwd),target=/workspace \ + --workdir /workspace \ + ${USER}/hbase/operator-tools/kuttl:latest \ + --config tests/kuttl-test-small.yaml +``` diff --git a/hbase-kubernetes-deployment/hbase-kubernetes-testing-image/pom.xml b/hbase-kubernetes-deployment/hbase-kubernetes-testing-image/pom.xml new file mode 100644 index 0000000000..f6b7c0e65a --- /dev/null +++ b/hbase-kubernetes-deployment/hbase-kubernetes-testing-image/pom.xml @@ -0,0 +1,126 @@ + + + + 4.0.0 + + hbase-kubernetes-deployment + org.apache.hbase.operator.tools + ${revision} + .. + + + hbase-kubernetes-testing-image + Apache HBase - Kubernetes Testing Image + A container image to facilitate testing of Kubernetes Deployment. + pom + + + linux/amd64 + + + + + + + + org.codehaus.mojo + exec-maven-plugin + + true + + + + docker-buildx-bake-print + + exec + + package + + /usr/bin/env + + sh + -c + + 2>&1 \ + docker buildx bake \ + --print \ + --file src/main/docker/docker-bake.hcl \ + --file src/main/docker/docker-bake.override.hcl + + + + + + docker-buildx-bake + + exec + + package + + /usr/bin/env + + sh + -c + + 2>&1 \ + docker buildx bake \ + --progress plain \ + --pull \ + --load \ + --set *.platform=${container_image.platforms} \ + --file src/main/docker/docker-bake.hcl \ + --file src/main/docker/docker-bake.override.hcl + + + + + + + + + + + + amd64 + + + x86_64 + + + + linux/amd64 + + + + arm64 + + + aarch64 + + + + linux/arm64 + + + + diff --git a/hbase-kubernetes-deployment/hbase-kubernetes-testing-image/src/main/docker/Dockerfile b/hbase-kubernetes-deployment/hbase-kubernetes-testing-image/src/main/docker/Dockerfile new file mode 100644 index 0000000000..847724c09e --- /dev/null +++ b/hbase-kubernetes-deployment/hbase-kubernetes-testing-image/src/main/docker/Dockerfile @@ -0,0 +1,161 @@ +# syntax=docker/dockerfile:1.4 +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# hadolint global ignore=DL3020 + +ARG IMG_BASE='golang' +ARG IMG_BASE_TAG='1.19-alpine' +ARG BASE_IMG_ALPINE='alpine' +ARG BASE_IMG_TAG_ALPINE='latest' +ARG YQ_IMG='mikefarah/yq' +ARG YQ_IMG_TAG='latest' + +FROM ${BASE_IMG_ALPINE}:${BASE_IMG_TAG_ALPINE} as alpine +RUN apk add --no-cache bash~=5 + +FROM ${YQ_IMG}:${YQ_IMG_TAG} as yq + +## -- Stages kubectl_${TARGETARCH} -- +# Define stages that facilitate bringing in platform-specific binaries. +FROM alpine as kubectl_amd64 +ARG KUBECTL_SHA_AMD64_URL +ARG KUBECTL_SHA_AMD64 +ARG KUBECTL_BIN_AMD64_URL +ARG KUBECTL_BIN_AMD64 +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +WORKDIR /tmp +ADD --link ${KUBECTL_SHA_AMD64_URL} /tmp/ +ADD --link ${KUBECTL_BIN_AMD64_URL} /tmp/ +RUN echo "$(cat "${KUBECTL_SHA_AMD64}") ${KUBECTL_BIN_AMD64}" | sha512sum -c +ENV KUBECTL_BIN "${KUBECTL_BIN_AMD64}" + +FROM alpine as kubectl_arm64 +ARG KUBECTL_SHA_ARM64_URL +ARG KUBECTL_SHA_ARM64 +ARG KUBECTL_BIN_ARM64_URL +ARG KUBECTL_BIN_ARM64 +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +WORKDIR /tmp +ADD --link ${KUBECTL_SHA_ARM64_URL} /tmp/ +ADD --link ${KUBECTL_BIN_ARM64_URL} /tmp/ +RUN echo "$(cat "${KUBECTL_SHA_ARM64}") ${KUBECTL_BIN_ARM64}" | sha512sum -c +ENV KUBECTL_BIN "${KUBECTL_BIN_ARM64}" + +ARG TARGETARCH +# hadolint ignore=DL3006 +FROM kubectl_${TARGETARCH} as kubectl +RUN mv "/tmp/${KUBECTL_BIN}" /tmp/kubectl \ + && chmod a+x /tmp/kubectl + +## -- Stages kuttl_${TARGETARCH} -- +# Define stages that facilitate bringing in platform-specific binaries. +FROM alpine as kuttl_amd64 +ARG KUTTL_CHECKSUMS_URL +ARG KUTTL_CHECKSUMS +ARG KUTTL_BIN_AMD64_URL +ARG KUTTL_BIN_AMD64 +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +WORKDIR /tmp +ADD --link ${KUTTL_CHECKSUMS_URL} /tmp/ +ADD --link ${KUTTL_BIN_AMD64_URL} /tmp/ +RUN sha256sum -c <(grep "${KUTTL_BIN_AMD64}" "${KUTTL_CHECKSUMS}") +ENV KUTTL_BIN "${KUTTL_BIN_AMD64}" + +FROM alpine as kuttl_arm64 +ARG KUTTL_CHECKSUMS_URL +ARG KUTTL_CHECKSUMS +ARG KUTTL_BIN_ARM64_URL +ARG KUTTL_BIN_ARM64 +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +WORKDIR /tmp +ADD --link ${KUTTL_CHECKSUMS_URL} /tmp/ +ADD --link ${KUTTL_BIN_ARM64_URL} /tmp/ +RUN sha256sum -c <(grep "${KUTTL_BIN_ARM64}" "${KUTTL_CHECKSUMS}") +ENV KUTTL_BIN "${KUTTL_BIN_ARM64}" + +ARG TARGETARCH +# hadolint ignore=DL3006 +FROM kuttl_${TARGETARCH} as kuttl +RUN mv "/tmp/${KUTTL_BIN}" /tmp/kubectl-kuttl \ + && chmod a+x /tmp/kubectl-kuttl + +## -- Stages kustomize_${TARGETARCH} -- +# Define stages that facilitate bringing in platform-specific binaries. +FROM alpine as kustomize_amd64 +ARG KUSTOMIZE_CHECKSUMS_URL +ARG KUSTOMIZE_CHECKSUMS +ARG KUSTOMIZE_BIN_AMD64_TGZ_URL +ARG KUSTOMIZE_BIN_AMD64_TGZ +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +WORKDIR /tmp +ADD --link ${KUSTOMIZE_CHECKSUMS_URL} /tmp/ +ADD --link ${KUSTOMIZE_BIN_AMD64_TGZ_URL} /tmp/ +RUN sha256sum -c <(grep "${KUSTOMIZE_BIN_AMD64_TGZ}" "${KUSTOMIZE_CHECKSUMS}") +ENV KUSTOMIZE_BIN_TGZ "${KUSTOMIZE_BIN_AMD64_TGZ}" + +FROM alpine as kustomize_arm64 +ARG KUSTOMIZE_CHECKSUMS_URL +ARG KUSTOMIZE_CHECKSUMS +ARG KUSTOMIZE_BIN_ARM64_TGZ_URL +ARG KUSTOMIZE_BIN_ARM64_TGZ +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +WORKDIR /tmp +ADD --link ${KUSTOMIZE_CHECKSUMS_URL} /tmp/ +ADD --link ${KUSTOMIZE_BIN_ARM64_TGZ_URL} /tmp/ +RUN sha256sum -c <(grep "${KUSTOMIZE_BIN_ARM64_TGZ}" "${KUSTOMIZE_CHECKSUMS}") +ENV KUSTOMIZE_BIN_TGZ "${KUSTOMIZE_BIN_ARM64_TGZ}" + +ARG TARGETARCH +# hadolint ignore=DL3006 +FROM kustomize_${TARGETARCH} as kustomize +RUN tar xzf "/tmp/${KUSTOMIZE_BIN_TGZ}" \ + && chmod a+x /tmp/kustomize + +FROM ${IMG_BASE}:${IMG_BASE_TAG} as final +ARG IMG_BASE +ARG IMG_BASE_TAG + +COPY --from=yq /usr/bin/yq /usr/bin/yq +COPY --from=kubectl /tmp/kubectl /usr/local/bin/ +COPY --from=kuttl /tmp/kubectl-kuttl /usr/local/bin/ +COPY --from=kustomize /tmp/kustomize /usr/local/bin/ +COPY src/main/docker/entrypoint.sh /bin/ + +# nonroot user as defined in https://github.com/GoogleContainerTools/distroless +ENV NON_ROOT_USER=nonroot +ENV NON_ROOT_USER_ID=65532 +ENV NON_ROOT_USER_HOME=/home/nonroot + +# hadolint ignore=DL3018 +RUN apk add --update --no-cache \ + bash~=5 \ + docker-cli \ + && adduser -D -u "${NON_ROOT_USER_ID}" -h "${NON_ROOT_USER_HOME}" "${NON_ROOT_USER}" + +# replicate the test-related bits generated by `kubebuilder` into its Makefile. +ENV GOBIN="${GOPATH}/bin" +ENV ENVTEST_K8S_VERSION='1.23.x' +RUN chmod a+x /bin/entrypoint.sh \ + && go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest +WORKDIR "${NON_ROOT_USER_HOME}" +USER "${NON_ROOT_USER}" +RUN "${GOBIN}/setup-envtest" use "${ENVTEST_K8S_VERSION}" +# disable downloading remote content henceforth +ENV ENVTEST_INSTALLED_ONLY=true + +ENTRYPOINT ["/bin/entrypoint.sh"] diff --git a/hbase-kubernetes-deployment/hbase-kubernetes-testing-image/src/main/docker/docker-bake.hcl b/hbase-kubernetes-deployment/hbase-kubernetes-testing-image/src/main/docker/docker-bake.hcl new file mode 100644 index 0000000000..54c4d83017 --- /dev/null +++ b/hbase-kubernetes-deployment/hbase-kubernetes-testing-image/src/main/docker/docker-bake.hcl @@ -0,0 +1,88 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# A convenience script for build the kuttl image. +# See hbase-kubernetes-deployment/dockerfiles/kuttl/README.md +# + +# input variables +variable KUBECTL_SHA_AMD64_URL {} +variable KUBECTL_SHA_AMD64 {} +variable KUBECTL_BIN_AMD64_URL {} +variable KUBECTL_BIN_AMD64 {} +variable KUBECTL_SHA_ARM64_URL {} +variable KUBECTL_SHA_ARM64 {} +variable KUBECTL_BIN_ARM64_URL {} +variable KUBECTL_BIN_ARM64 {} +variable KUTTL_CHECKSUMS_URL {} +variable KUTTL_CHECKSUMS {} +variable KUTTL_BIN_AMD64_URL {} +variable KUTTL_BIN_AMD64 {} +variable KUTTL_BIN_ARM64_URL {} +variable KUTTL_BIN_ARM64 {} +variable KUSTOMIZE_CHECKSUMS_URL {} +variable KUSTOMIZE_CHECKSUMS {} +variable KUSTOMIZE_BIN_AMD64_TGZ_URL {} +variable KUSTOMIZE_BIN_AMD64_TGZ {} +variable KUSTOMIZE_BIN_ARM64_TGZ_URL {} +variable KUSTOMIZE_BIN_ARM64_TGZ {} + +# output variables +variable USER { + default = "apache" +} +variable IMAGE_TAG { + default = "latest" +} +variable IMAGE_NAME { + default = "${USER}/hbase/operator-tools/kuttl" +} + +group default { + targets = [ "kuttl" ] +} + +target kuttl { + dockerfile = "src/main/docker/Dockerfile" + args = { + KUBECTL_SHA_AMD64_URL = KUBECTL_SHA_AMD64_URL + KUBECTL_SHA_AMD64 = KUBECTL_SHA_AMD64 + KUBECTL_BIN_AMD64_URL = KUBECTL_BIN_AMD64_URL + KUBECTL_BIN_AMD64 = KUBECTL_BIN_AMD64 + KUBECTL_SHA_ARM64_URL = KUBECTL_SHA_ARM64_URL + KUBECTL_SHA_ARM64 = KUBECTL_SHA_ARM64 + KUBECTL_BIN_ARM64_URL = KUBECTL_BIN_ARM64_URL + KUBECTL_BIN_ARM64 = KUBECTL_BIN_ARM64 + KUTTL_CHECKSUMS_URL = KUTTL_CHECKSUMS_URL + KUTTL_CHECKSUMS = KUTTL_CHECKSUMS + KUTTL_BIN_AMD64_URL = KUTTL_BIN_AMD64_URL + KUTTL_BIN_AMD64 = KUTTL_BIN_AMD64 + KUTTL_BIN_ARM64_URL = KUTTL_BIN_ARM64_URL + KUTTL_BIN_ARM64 = KUTTL_BIN_ARM64 + KUSTOMIZE_CHECKSUMS_URL = KUSTOMIZE_CHECKSUMS_URL + KUSTOMIZE_CHECKSUMS = KUSTOMIZE_CHECKSUMS + KUSTOMIZE_BIN_AMD64_TGZ_URL = KUSTOMIZE_BIN_AMD64_TGZ_URL + KUSTOMIZE_BIN_AMD64_TGZ = KUSTOMIZE_BIN_AMD64_TGZ + KUSTOMIZE_BIN_ARM64_TGZ_URL = KUSTOMIZE_BIN_ARM64_TGZ_URL + KUSTOMIZE_BIN_ARM64_TGZ = KUSTOMIZE_BIN_ARM64_TGZ + } + target = "final" + platforms = [ + "linux/amd64", + "linux/arm64" + ] + tags = [ "${IMAGE_NAME}:${IMAGE_TAG}" ] +} diff --git a/hbase-kubernetes-deployment/hbase-kubernetes-testing-image/src/main/docker/docker-bake.override.hcl b/hbase-kubernetes-deployment/hbase-kubernetes-testing-image/src/main/docker/docker-bake.override.hcl new file mode 100644 index 0000000000..fa33354830 --- /dev/null +++ b/hbase-kubernetes-deployment/hbase-kubernetes-testing-image/src/main/docker/docker-bake.override.hcl @@ -0,0 +1,115 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Externalize default values of build parameters and document how to retrieve them. +# + +function "basename" { + params = [a] + result = split("/", a)[length(split("/", a)) - 1] +} + +variable KUBECTL_VERSION { + default = "1.24.10" +} + +variable KUBECTL_SHA_AMD64_URL { + default = "https://dl.k8s.io/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl.sha512" +} + +variable KUBECTL_SHA_AMD64 { + default = "${basename(KUBECTL_SHA_AMD64_URL)}" +} + +variable KUBECTL_BIN_AMD64_URL { + default = "https://dl.k8s.io/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl" +} + +variable KUBECTL_BIN_AMD64 { + default = "${basename(KUBECTL_BIN_AMD64_URL)}" +} + +variable KUBECTL_SHA_ARM64_URL { + default = "https://dl.k8s.io/release/v${KUBECTL_VERSION}/bin/linux/arm64/kubectl.sha512" +} + +variable KUBECTL_SHA_ARM64 { + default = "${basename(KUBECTL_SHA_ARM64_URL)}" +} + +variable KUBECTL_BIN_ARM64_URL { + default = "https://dl.k8s.io/release/v${KUBECTL_VERSION}/bin/linux/arm64/kubectl" +} + +variable KUBECTL_BIN_ARM64 { + default = "${basename(KUBECTL_BIN_ARM64_URL)}" +} + +variable KUTTL_VERSION { + default = "0.15.0" +} + +variable KUTTL_CHECKSUMS_URL { + default = "https://github.com/kudobuilder/kuttl/releases/download/v${KUTTL_VERSION}/checksums.txt" +} + +variable KUTTL_CHECKSUMS { + default = "${basename(KUTTL_CHECKSUMS_URL)}" +} + +variable KUTTL_BIN_AMD64_URL { + default = "https://github.com/kudobuilder/kuttl/releases/download/v${KUTTL_VERSION}/kubectl-kuttl_${KUTTL_VERSION}_linux_x86_64" +} + +variable KUTTL_BIN_AMD64 { + default = "${basename(KUTTL_BIN_AMD64_URL)}" +} + +variable KUTTL_BIN_ARM64_URL { + default = "https://github.com/kudobuilder/kuttl/releases/download/v${KUTTL_VERSION}/kubectl-kuttl_${KUTTL_VERSION}_linux_arm64" +} + +variable KUTTL_BIN_ARM64 { + default = "${basename(KUTTL_BIN_ARM64_URL)}" +} + +variable KUSTOMIZE_VERSION { + default = "4.5.4" +} + +variable KUSTOMIZE_CHECKSUMS_URL { + default = "https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv${KUSTOMIZE_VERSION}/checksums.txt" +} + +variable KUSTOMIZE_CHECKSUMS { + default = "${basename(KUSTOMIZE_CHECKSUMS_URL)}" +} + +variable KUSTOMIZE_BIN_AMD64_TGZ_URL { + default = "https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv${KUSTOMIZE_VERSION}/kustomize_v${KUSTOMIZE_VERSION}_linux_amd64.tar.gz" +} + +variable KUSTOMIZE_BIN_AMD64_TGZ { + default = "${basename(KUSTOMIZE_BIN_AMD64_TGZ_URL)}" +} + +variable KUSTOMIZE_BIN_ARM64_TGZ_URL { + default = "https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv${KUSTOMIZE_VERSION}/kustomize_v${KUSTOMIZE_VERSION}_linux_arm64.tar.gz" +} + +variable KUSTOMIZE_BIN_ARM64_TGZ { + default = "${basename(KUSTOMIZE_BIN_ARM64_TGZ_URL)}" +} diff --git a/hbase-kubernetes-deployment/hbase-kubernetes-testing-image/src/main/docker/entrypoint.sh b/hbase-kubernetes-deployment/hbase-kubernetes-testing-image/src/main/docker/entrypoint.sh new file mode 100644 index 0000000000..8436e82600 --- /dev/null +++ b/hbase-kubernetes-deployment/hbase-kubernetes-testing-image/src/main/docker/entrypoint.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -e +set -o pipefail +set -x + +declare ENVTEST_K8S_VERSION + +declare KUBEBUILDER_ASSETS +KUBEBUILDER_ASSETS="$(setup-envtest use -i "${ENVTEST_K8S_VERSION}" -p path)" +export KUBEBUILDER_ASSETS + +/usr/local/bin/kubectl kuttl test "$@" diff --git a/hbase-kubernetes-deployment/pom.xml b/hbase-kubernetes-deployment/pom.xml index f0f8053dd8..22ee23955f 100644 --- a/hbase-kubernetes-deployment/pom.xml +++ b/hbase-kubernetes-deployment/pom.xml @@ -2,40 +2,44 @@ - - 4.0.0 - - hbase-operator-tools - org.apache.hbase.operator.tools - ${revision} - .. - + + 4.0.0 + + hbase-operator-tools + org.apache.hbase.operator.tools + ${revision} + .. + - hbase-kubernetes-deployment - Apache HBase - Kubernetes Deployment - Resource definitions for deploying HBase on Kubernetes. - pom + hbase-kubernetes-deployment + Apache HBase - Kubernetes Deployment + Resource definitions for deploying HBase on Kubernetes. + pom - + + hbase-kubernetes-testing-image + - - + + + + diff --git a/pom.xml b/pom.xml index 3bfeff5b07..392d4e242a 100644 --- a/pom.xml +++ b/pom.xml @@ -163,6 +163,12 @@ hbase-tools ${project.version} + + org.apache.hbase.operator.tools + hbase-kubernetes-testing-image + pom + ${project.version} + @@ -322,6 +328,11 @@ true + + org.codehaus.mojo + exec-maven-plugin + 3.1.0 + @@ -429,6 +440,13 @@ + + + kr.motd.maven + os-maven-plugin + 1.7.1 + +