diff --git a/Makefile b/Makefile index f381e297cc1..b91a160850d 100644 --- a/Makefile +++ b/Makefile @@ -73,6 +73,17 @@ DOCKER_PUSH += docker-push-goosefsruntime-controller DOCKER_PUSH += docker-push-juicefsruntime-controller DOCKER_PUSH += docker-push-init-users +# Buildx docker images +DOCKER_BUILDX := docker-buildx-dataset-controller +DOCKER_BUILDX += docker-buildx-application-controller +DOCKER_BUILDX += docker-buildx-alluxioruntime-controller +DOCKER_BUILDX += docker-buildx-jindoruntime-controller +DOCKER_BUILDX += docker-buildx-goosefsruntime-controller +DOCKER_BUILDX += docker-buildx-csi +DOCKER_BUILDX += docker-buildx-webhook +DOCKER_BUILDX += docker-buildx-juicefsruntime-controller +DOCKER_BUILDX += docker-buildx-init-users + override LDFLAGS += \ -X ${PACKAGE}.version=${VERSION} \ -X ${PACKAGE}.buildDate=${BUILD_DATE} \ @@ -225,10 +236,37 @@ docker-push-init-users: docker-build-init-users docker-push-webhook: docker-build-webhook docker push ${WEBHOOK_IMG}:${GIT_VERSION} +# Buildx the docker image +docker-buildx-dataset-controller: generate gen-openapi fmt vet + docker buildx build --push --platform linux/amd64,linux/arm64 --no-cache . -f docker/Dockerfile.dataset -t ${DATASET_CONTROLLER_IMG}:${GIT_VERSION} + +docker-buildx-application-controller: generate fmt vet + docker buildx build --push --platform linux/amd64,linux/arm64 --no-cache . -f docker/Dockerfile.application -t ${APPLICATION_CONTROLLER_IMG}:${GIT_VERSION} + +docker-buildx-alluxioruntime-controller: generate gen-openapi fmt vet + docker buildx build --push --platform linux/amd64,linux/arm64 --no-cache . -f docker/Dockerfile.alluxioruntime -t ${ALLUXIORUNTIME_CONTROLLER_IMG}:${GIT_VERSION} + +docker-buildx-jindoruntime-controller: generate gen-openapi fmt vet + docker buildx build --push --platform linux/amd64,linux/arm64 --no-cache . -f docker/Dockerfile.jindoruntime -t ${JINDORUNTIME_CONTROLLER_IMG}:${GIT_VERSION} + +docker-buildx-goosefsruntime-controller: generate gen-openapi fmt vet + docker buildx build --push --platform linux/amd64,linux/arm64 --no-cache . -f docker/Dockerfile.goosefsruntime -t ${GOOSEFSRUNTIME_CONTROLLER_IMG}:${GIT_VERSION} + +docker-buildx-juicefsruntime-controller: generate gen-openapi fmt vet juicefsruntime-controller-build + docker buildx build --push --platform linux/amd64,linux/arm64 --no-cache . -f docker/Dockerfile.juicefsruntime -t ${JUICEFSRUNTIME_CONTROLLER_IMG}:${GIT_VERSION} + +docker-buildx-csi: generate fmt vet + docker buildx build --push --platform linux/amd64,linux/arm64 --no-cache . -f docker/Dockerfile.csi -t ${CSI_IMG}:${GIT_VERSION} + +docker-buildx-init-users: + docker buildx build --push --platform linux/amd64,linux/arm64 --no-cache charts/alluxio/docker/init-users -t ${INIT_USERS_IMG}:${GIT_VERSION} +docker-buildx-webhook: + docker buildx build --push --platform linux/amd64,linux/arm64 --no-cache . -f docker/Dockerfile.webhook -t ${WEBHOOK_IMG}:${GIT_VERSION} docker-build-all: ${DOCKER_BUILD} docker-push-all: ${DOCKER_PUSH} +docker-buildx-all: ${DOCKER_BUILDX} gen-sdk: ./hack/sdk/gen-sdk.sh diff --git a/docker/Dockerfile.alluxioruntime b/docker/Dockerfile.alluxioruntime index 74caa41d2e4..6636e987366 100644 --- a/docker/Dockerfile.alluxioruntime +++ b/docker/Dockerfile.alluxioruntime @@ -13,14 +13,19 @@ RUN apk add --update curl tzdata iproute2 bash libc6-compat vim && \ cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \ echo "Asia/Shanghai" > /etc/timezone -RUN curl -o helm-v3.0.3-linux-amd64.tar.gz http://aliacs-k8s-cn-hongkong.oss-cn-hongkong.aliyuncs.com/public/pkg/helm/helm-v3.0.3-linux-amd64.tar.gz && \ +RUN if [ `uname -m` == "aarch64" ] ; then curl -o helm-v3.0.3-linux-arm64.tar.gz https://get.helm.sh/helm-v3.7.2-linux-arm64.tar.gz && \ + tar -xvf helm-v3.0.3-linux-arm64.tar.gz && \ + mv linux-arm64/helm /usr/local/bin/ddc-helm && \ + chmod u+x /usr/local/bin/ddc-helm && \ + rm -f helm-v3.0.3-linux-arm64.tar.gz; else curl -o helm-v3.0.3-linux-amd64.tar.gz http://aliacs-k8s-cn-hongkong.oss-cn-hongkong.aliyuncs.com/public/pkg/helm/helm-v3.0.3-linux-amd64.tar.gz && \ tar -xvf helm-v3.0.3-linux-amd64.tar.gz && \ mv linux-amd64/helm /usr/local/bin/ddc-helm && \ chmod u+x /usr/local/bin/ddc-helm && \ - rm -f helm-v3.0.3-linux-amd64.tar.gz + rm -f helm-v3.0.3-linux-amd64.tar.gz; fi ENV K8S_VERSION v1.14.8 -RUN curl -o /usr/local/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/${K8S_VERSION}/bin/linux/amd64/kubectl && chmod +x /usr/local/bin/kubectl +RUN if [ `uname -m` == "aarch64" ] ; then ARCH="arm64"; else ARCH="amd64"; fi +RUN curl -o /usr/local/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/${K8S_VERSION}/bin/linux/${ARCH}/kubectl && chmod +x /usr/local/bin/kubectl ADD charts/ /charts diff --git a/docker/Dockerfile.application b/docker/Dockerfile.application index cc22cdc7e62..70c10081284 100644 --- a/docker/Dockerfile.application +++ b/docker/Dockerfile.application @@ -16,14 +16,19 @@ RUN apk add --update curl tzdata iproute2 bash libc6-compat vim && \ cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \ echo "Asia/Shanghai" > /etc/timezone -RUN curl -o helm-v3.0.3-linux-amd64.tar.gz http://aliacs-k8s-cn-hongkong.oss-cn-hongkong.aliyuncs.com/public/pkg/helm/helm-v3.0.3-linux-amd64.tar.gz && \ +RUN if [ `uname -m` == "aarch64" ] ; then curl -o helm-v3.0.3-linux-arm64.tar.gz https://get.helm.sh/helm-v3.7.2-linux-arm64.tar.gz && \ + tar -xvf helm-v3.0.3-linux-arm64.tar.gz && \ + mv linux-arm64/helm /usr/local/bin/ddc-helm && \ + chmod u+x /usr/local/bin/ddc-helm && \ + rm -f helm-v3.0.3-linux-arm64.tar.gz; else curl -o helm-v3.0.3-linux-amd64.tar.gz http://aliacs-k8s-cn-hongkong.oss-cn-hongkong.aliyuncs.com/public/pkg/helm/helm-v3.0.3-linux-amd64.tar.gz && \ tar -xvf helm-v3.0.3-linux-amd64.tar.gz && \ mv linux-amd64/helm /usr/local/bin/ddc-helm && \ chmod u+x /usr/local/bin/ddc-helm && \ - rm -f helm-v3.0.3-linux-amd64.tar.gz + rm -f helm-v3.0.3-linux-amd64.tar.gz; fi ENV K8S_VERSION v1.14.8 -RUN curl -o /usr/local/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/${K8S_VERSION}/bin/linux/amd64/kubectl && chmod +x /usr/local/bin/kubectl +RUN if [ `uname -m` == "aarch64" ] ; then ARCH="arm64"; else ARCH="amd64"; fi +RUN curl -o /usr/local/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/${K8S_VERSION}/bin/linux/${ARCH}/kubectl && chmod +x /usr/local/bin/kubectl ADD charts/ /charts diff --git a/docker/Dockerfile.dataset b/docker/Dockerfile.dataset index 373bce7275a..50b352af3b7 100644 --- a/docker/Dockerfile.dataset +++ b/docker/Dockerfile.dataset @@ -16,14 +16,19 @@ RUN apk add --update curl tzdata iproute2 bash libc6-compat vim && \ cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \ echo "Asia/Shanghai" > /etc/timezone -RUN curl -o helm-v3.0.3-linux-amd64.tar.gz http://aliacs-k8s-cn-hongkong.oss-cn-hongkong.aliyuncs.com/public/pkg/helm/helm-v3.0.3-linux-amd64.tar.gz && \ +RUN if [ `uname -m` == "aarch64" ] ; then curl -o helm-v3.0.3-linux-arm64.tar.gz https://get.helm.sh/helm-v3.7.2-linux-arm64.tar.gz && \ + tar -xvf helm-v3.0.3-linux-arm64.tar.gz && \ + mv linux-arm64/helm /usr/local/bin/ddc-helm && \ + chmod u+x /usr/local/bin/ddc-helm && \ + rm -f helm-v3.0.3-linux-arm64.tar.gz; else curl -o helm-v3.0.3-linux-amd64.tar.gz http://aliacs-k8s-cn-hongkong.oss-cn-hongkong.aliyuncs.com/public/pkg/helm/helm-v3.0.3-linux-amd64.tar.gz && \ tar -xvf helm-v3.0.3-linux-amd64.tar.gz && \ mv linux-amd64/helm /usr/local/bin/ddc-helm && \ chmod u+x /usr/local/bin/ddc-helm && \ - rm -f helm-v3.0.3-linux-amd64.tar.gz + rm -f helm-v3.0.3-linux-amd64.tar.gz; fi ENV K8S_VERSION v1.14.8 -RUN curl -o /usr/local/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/${K8S_VERSION}/bin/linux/amd64/kubectl && chmod +x /usr/local/bin/kubectl +RUN if [ `uname -m` == "aarch64" ] ; then ARCH="arm64"; else ARCH="amd64"; fi +RUN curl -o /usr/local/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/${K8S_VERSION}/bin/linux/${ARCH}/kubectl && chmod +x /usr/local/bin/kubectl ADD charts/ /charts diff --git a/docker/Dockerfile.goosefsruntime b/docker/Dockerfile.goosefsruntime index a1a613ab950..45cfa5df695 100644 --- a/docker/Dockerfile.goosefsruntime +++ b/docker/Dockerfile.goosefsruntime @@ -16,14 +16,19 @@ RUN apk add --update curl tzdata iproute2 bash libc6-compat vim && \ cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \ echo "Asia/Shanghai" > /etc/timezone -RUN curl -o helm-v3.0.3-linux-amd64.tar.gz http://aliacs-k8s-cn-hongkong.oss-cn-hongkong.aliyuncs.com/public/pkg/helm/helm-v3.0.3-linux-amd64.tar.gz && \ +RUN if [ `uname -m` == "aarch64" ] ; then curl -o helm-v3.0.3-linux-arm64.tar.gz https://get.helm.sh/helm-v3.7.2-linux-arm64.tar.gz && \ + tar -xvf helm-v3.0.3-linux-arm64.tar.gz && \ + mv linux-arm64/helm /usr/local/bin/ddc-helm && \ + chmod u+x /usr/local/bin/ddc-helm && \ + rm -f helm-v3.0.3-linux-arm64.tar.gz; else curl -o helm-v3.0.3-linux-amd64.tar.gz http://aliacs-k8s-cn-hongkong.oss-cn-hongkong.aliyuncs.com/public/pkg/helm/helm-v3.0.3-linux-amd64.tar.gz && \ tar -xvf helm-v3.0.3-linux-amd64.tar.gz && \ mv linux-amd64/helm /usr/local/bin/ddc-helm && \ chmod u+x /usr/local/bin/ddc-helm && \ - rm -f helm-v3.0.3-linux-amd64.tar.gz + rm -f helm-v3.0.3-linux-amd64.tar.gz; fi ENV K8S_VERSION v1.14.8 -RUN curl -o /usr/local/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/${K8S_VERSION}/bin/linux/amd64/kubectl && chmod +x /usr/local/bin/kubectl +RUN if [ `uname -m` == "aarch64" ] ; then ARCH="arm64"; else ARCH="amd64"; fi +RUN curl -o /usr/local/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/${K8S_VERSION}/bin/linux/${ARCH}/kubectl && chmod +x /usr/local/bin/kubectl ADD charts/ /charts diff --git a/docker/Dockerfile.jindoruntime b/docker/Dockerfile.jindoruntime index 499bf0e0edc..d4b20c1276a 100644 --- a/docker/Dockerfile.jindoruntime +++ b/docker/Dockerfile.jindoruntime @@ -16,14 +16,19 @@ RUN apk add --update curl tzdata iproute2 bash libc6-compat vim && \ cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \ echo "Asia/Shanghai" > /etc/timezone -RUN curl -o helm-v3.0.3-linux-amd64.tar.gz http://aliacs-k8s-cn-hongkong.oss-cn-hongkong.aliyuncs.com/public/pkg/helm/helm-v3.0.3-linux-amd64.tar.gz && \ +RUN if [ `uname -m` == "aarch64" ] ; then curl -o helm-v3.0.3-linux-arm64.tar.gz https://get.helm.sh/helm-v3.7.2-linux-arm64.tar.gz && \ + tar -xvf helm-v3.0.3-linux-arm64.tar.gz && \ + mv linux-arm64/helm /usr/local/bin/ddc-helm && \ + chmod u+x /usr/local/bin/ddc-helm && \ + rm -f helm-v3.0.3-linux-arm64.tar.gz; else curl -o helm-v3.0.3-linux-amd64.tar.gz http://aliacs-k8s-cn-hongkong.oss-cn-hongkong.aliyuncs.com/public/pkg/helm/helm-v3.0.3-linux-amd64.tar.gz && \ tar -xvf helm-v3.0.3-linux-amd64.tar.gz && \ mv linux-amd64/helm /usr/local/bin/ddc-helm && \ chmod u+x /usr/local/bin/ddc-helm && \ - rm -f helm-v3.0.3-linux-amd64.tar.gz + rm -f helm-v3.0.3-linux-amd64.tar.gz; fi ENV K8S_VERSION v1.14.8 -RUN curl -o /usr/local/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/${K8S_VERSION}/bin/linux/amd64/kubectl && chmod +x /usr/local/bin/kubectl +RUN if [ `uname -m` == "aarch64" ] ; then ARCH="arm64"; else ARCH="amd64"; fi +RUN curl -o /usr/local/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/${K8S_VERSION}/bin/linux/${ARCH}/kubectl && chmod +x /usr/local/bin/kubectl ADD charts/jindofs /charts/jindofs ADD charts/jindofsx /charts/jindofsx diff --git a/docker/Dockerfile.juicefsruntime b/docker/Dockerfile.juicefsruntime index 813e59f781c..d8025fb067b 100644 --- a/docker/Dockerfile.juicefsruntime +++ b/docker/Dockerfile.juicefsruntime @@ -16,14 +16,19 @@ RUN apk add --update curl tzdata iproute2 bash libc6-compat vim && \ cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \ echo "Asia/Shanghai" > /etc/timezone -RUN curl -o helm-v3.0.3-linux-amd64.tar.gz http://aliacs-k8s-cn-hongkong.oss-cn-hongkong.aliyuncs.com/public/pkg/helm/helm-v3.0.3-linux-amd64.tar.gz && \ +RUN if [ `uname -m` == "aarch64" ] ; then curl -o helm-v3.0.3-linux-arm64.tar.gz https://get.helm.sh/helm-v3.7.2-linux-arm64.tar.gz && \ + tar -xvf helm-v3.0.3-linux-arm64.tar.gz && \ + mv linux-arm64/helm /usr/local/bin/ddc-helm && \ + chmod u+x /usr/local/bin/ddc-helm && \ + rm -f helm-v3.0.3-linux-arm64.tar.gz; else curl -o helm-v3.0.3-linux-amd64.tar.gz http://aliacs-k8s-cn-hongkong.oss-cn-hongkong.aliyuncs.com/public/pkg/helm/helm-v3.0.3-linux-amd64.tar.gz && \ tar -xvf helm-v3.0.3-linux-amd64.tar.gz && \ mv linux-amd64/helm /usr/local/bin/ddc-helm && \ chmod u+x /usr/local/bin/ddc-helm && \ - rm -f helm-v3.0.3-linux-amd64.tar.gz + rm -f helm-v3.0.3-linux-amd64.tar.gz; fi ENV K8S_VERSION v1.14.8 -RUN curl -o /usr/local/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/${K8S_VERSION}/bin/linux/amd64/kubectl && chmod +x /usr/local/bin/kubectl +RUN if [ `uname -m` == "aarch64" ] ; then ARCH="arm64"; else ARCH="amd64"; fi +RUN curl -o /usr/local/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/${K8S_VERSION}/bin/linux/${ARCH}/kubectl && chmod +x /usr/local/bin/kubectl ADD charts/ /charts diff --git a/docker/Dockerfile.webhook b/docker/Dockerfile.webhook index 8d729bb024d..20e72a7904d 100644 --- a/docker/Dockerfile.webhook +++ b/docker/Dockerfile.webhook @@ -17,7 +17,8 @@ RUN apk add --update curl tzdata iproute2 bash libc6-compat vim && \ echo "Asia/Shanghai" > /etc/timezone ENV K8S_VERSION v1.14.8 -RUN curl -o /usr/local/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/${K8S_VERSION}/bin/linux/amd64/kubectl && chmod +x /usr/local/bin/kubectl +RUN if [ `uname -m` == "aarch64" ] ; then ARCH="arm64"; else ARCH="amd64"; fi +RUN curl -o /usr/local/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/${K8S_VERSION}/bin/linux/${ARCH}/kubectl && chmod +x /usr/local/bin/kubectl COPY --from=builder /go/bin/fluid-webhook /usr/local/bin/fluid-webhook COPY --from=builder /go/bin/dlv /usr/local/bin/dlv diff --git a/docs/en/dev/how_to_develop.md b/docs/en/dev/how_to_develop.md index 4156eb04164..7a9141ac2d8 100644 --- a/docs/en/dev/how_to_develop.md +++ b/docs/en/dev/how_to_develop.md @@ -54,6 +54,9 @@ By default, the binary would be put under `/bin`. # build all images $ make docker-build-all + + # build and push all images using docker buildx + $ make docker-buildx-all ``` Before running Fluid, you need to push the built image to an accessible image registry. diff --git a/docs/zh/dev/how_to_develop.md b/docs/zh/dev/how_to_develop.md index cb0d14e0fed..b15e610c372 100644 --- a/docs/zh/dev/how_to_develop.md +++ b/docs/zh/dev/how_to_develop.md @@ -291,4 +291,4 @@ $ dlv debug --headless --listen ":12345" --log --api-version=2 cmd/alluxio/main. $ dlv connect ":12345" --api-version=2 ``` -> 注意:要进行远程调试,请确保远程主机指定的端口未被占用并且已经对远程主机的防火墙进行了适当的配置 \ No newline at end of file +> 注意:要进行远程调试,请确保远程主机指定的端口未被占用并且已经对远程主机的防火墙进行了适当的配置