-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(build): enable arm64 auto build (#1650)
* feat(build): enable auto arm64 builds - add support for building arm64 images from travis ci - enabled arm64 support for m-upgrade - enabled arm64 support for cspc-operator - enabled arm64 support for admission-server - fixed bug in amr64 build of cvc-operator - add support to push images of amd64 and arm64 from travis ci - removed auto build of old m-upgrade binaries * fix(script, test): exit script if the test fails exit ci, if the test fails * fix(build, script): execute unit tests only for amd64 unit tests and kubegen will be executed only for amd64 Signed-off-by: Akhil Mohan <akhil.mohan@mayadata.io>
- Loading branch information
Showing
12 changed files
with
257 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
|
||
# Specify the name for the binaries | ||
WEBHOOK=admission-server | ||
|
||
# Specify the name of the docker repo for amd64 | ||
ADMISSION_SERVER_REPO_NAME?=admission-server | ||
|
||
# Specify the name of the docker repo for arm64 | ||
ADMISSION_SERVER_REPO_NAME_ARM64?=admission-server-arm64 | ||
|
||
.PHONY: admission-server | ||
admission-server: | ||
@echo "----------------------------" | ||
@echo -n "--> ${WEBHOOK} " | ||
@echo "----------------------------" | ||
@PNAME=${WEBHOOK} CTLNAME=${WEBHOOK} sh -c "'$(PWD)/buildscripts/build.sh'" | ||
|
||
.PHONY: admission-server-image | ||
admission-server-image: admission-server | ||
@echo "----------------------------" | ||
@echo -n "--> ${WEBHOOK} image" | ||
@echo "${HUB_USER}/${ADMISSION_SERVER_REPO_NAME}:${IMAGE_TAG}" | ||
@echo "----------------------------" | ||
@cp bin/${WEBHOOK}/${WEBHOOK} buildscripts/admission-server/ | ||
@cd buildscripts/${WEBHOOK} && sudo docker build -t ${HUB_USER}/${ADMISSION_SERVER_REPO_NAME}:${IMAGE_TAG} --build-arg BUILD_DATE=${BUILD_DATE} . | ||
@rm buildscripts/${WEBHOOK}/${WEBHOOK} | ||
|
||
.PHONY: admission-server-image.arm64 | ||
admission-server-image.arm64: admission-server | ||
@echo "----------------------------" | ||
@echo -n "--> ${WEBHOOK} image" | ||
@echo "${HUB_USER}/${ADMISSION_SERVER_REPO_NAME_ARM64}:${IMAGE_TAG}" | ||
@echo "----------------------------" | ||
@cp bin/${WEBHOOK}/${WEBHOOK} buildscripts/admission-server/ | ||
@cd buildscripts/${WEBHOOK} && sudo docker build -t ${HUB_USER}/${ADMISSION_SERVER_REPO_NAME_ARM64}:${IMAGE_TAG} --build-arg BUILD_DATE=${BUILD_DATE} . | ||
@rm buildscripts/${WEBHOOK}/${WEBHOOK} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Specify the name for the binaries | ||
CSPC_OPERATOR=cspc-operator | ||
CSPC_OPERATOR_DEBUG=cspc-operator-debug | ||
|
||
# Specify the name of the docker repo for amd64 | ||
CSPC_OPERATOR_REPO_NAME?=cspc-operator | ||
|
||
.PHONY: cspc-operator-debug | ||
cspc-operator-debug: | ||
@echo "----------------------------" | ||
@echo -n "--> ${CSPC_OPERATOR} " | ||
@echo "----------------------------" | ||
@PNAME=${CSPC_OPERATOR_DEBUG} CTLNAME=${CSPC_OPERATOR} BUILD_TAG="-tags=debug" sh -c "'$(PWD)/buildscripts/build.sh'" | ||
|
||
.PHONY: cspc-operator-debug-image | ||
cspc-operator-debug-image: cspc-operator-debug | ||
@echo "----------------------------" | ||
@echo -n "--> ${CSPC_OPERATOR} image " | ||
@echo "${HUB_USER}/${CSPC_OPERATOR_REPO_NAME}:${IMAGE_TAG}" | ||
@echo "----------------------------" | ||
@cp bin/${CSPC_OPERATOR_DEBUG}/${CSPC_OPERATOR} buildscripts/cspc-operator-debug/ | ||
@cd buildscripts/${CSPC_OPERATOR_DEBUG} && sudo docker build -t ${HUB_USER}/${CSPC_OPERATOR_REPO_NAME}:inject --build-arg BUILD_DATE=${BUILD_DATE} . | ||
@rm buildscripts/${CSPC_OPERATOR_DEBUG}/${CSPC_OPERATOR} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#Make the base image configurable. If BASE IMAGES is not provided | ||
#docker command will fail | ||
ARG BASE_IMAGE=arm64v8/alpine | ||
FROM $BASE_IMAGE | ||
|
||
RUN apk add --no-cache \ | ||
iproute2 \ | ||
bash \ | ||
curl \ | ||
net-tools \ | ||
mii-tool \ | ||
procps \ | ||
libc6-compat \ | ||
ca-certificates | ||
|
||
COPY cspc-operator /usr/local/bin/cspc-operator | ||
|
||
ARG BUILD_DATE | ||
LABEL org.label-schema.name="cspc-operator" | ||
LABEL org.label-schema.description="CSPC Operator for OpenEBS cStor engine" | ||
LABEL org.label-schema.url="http://www.openebs.io/" | ||
LABEL org.label-schema.vcs-url="https://github.com/openebs/maya" | ||
LABEL org.label-schema.schema-version="1.0" | ||
LABEL org.label-schema.build-date=$BUILD_DATE | ||
|
||
ENTRYPOINT ["/usr/local/bin/cspc-operator"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
|
||
# Specify the name for the binaries | ||
CSPC_OPERATOR=cspc-operator | ||
|
||
# Specify the name of the docker repo for amd64 | ||
CSPC_OPERATOR_REPO_NAME?=cspc-operator | ||
|
||
# Specify the name of the docker repo for arm64 | ||
CSPC_OPERATOR_REPO_NAME_ARM64?=cspc-operator-arm64 | ||
|
||
.PHONY: cspc-operator | ||
cspc-operator: | ||
@echo "----------------------------" | ||
@echo -n "--> ${CSPC_OPERATOR} " | ||
@echo "----------------------------" | ||
@PNAME=${CSPC_OPERATOR} CTLNAME=${CSPC_OPERATOR} sh -c "'$(PWD)/buildscripts/build.sh'" | ||
|
||
.PHONY: cspc-operator-image | ||
cspc-operator-image: cspc-operator | ||
@echo "----------------------------" | ||
@echo -n "--> ${CSPC_OPERATOR} image " | ||
@echo "${HUB_USER}/${CSPC_OPERATOR_REPO_NAME}:${IMAGE_TAG}" | ||
@echo "----------------------------" | ||
@cp bin/${CSPC_OPERATOR}/${CSPC_OPERATOR} buildscripts/cspc-operator/ | ||
@cd buildscripts/${CSPC_OPERATOR} && sudo docker build -t ${HUB_USER}/${CSPC_OPERATOR_REPO_NAME}:${IMAGE_TAG} --build-arg BUILD_DATE=${BUILD_DATE} . | ||
@rm buildscripts/${CSPC_OPERATOR}/${CSPC_OPERATOR} | ||
|
||
.PHONY: cspc-operator-image.arm64 | ||
cspc-operator-image.arm64: cspc-operator | ||
@echo "----------------------------" | ||
@echo -n "--> ${CSPC_OPERATOR} image " | ||
@echo "${HUB_USER}/${CSPC_OPERATOR_REPO_NAME_ARM64}:${IMAGE_TAG}" | ||
@echo "----------------------------" | ||
@cp bin/${CSPC_OPERATOR}/${CSPC_OPERATOR} buildscripts/cspc-operator/ | ||
@cd buildscripts/${CSPC_OPERATOR} && sudo docker build -t ${HUB_USER}/${CSPC_OPERATOR_REPO_NAME_ARM64}:${IMAGE_TAG} -f Dockerfile.arm64 --build-arg BUILD_DATE=${BUILD_DATE} . | ||
@rm buildscripts/${CSPC_OPERATOR}/${CSPC_OPERATOR} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/bin/bash | ||
# Copyright 2020 The OpenEBS Authors. | ||
# | ||
# Licensed 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 | ||
|
||
# Determine the arch/os we're building for | ||
ARCH=$(uname -m) | ||
|
||
if [ "${ARCH}" = "x86_64" ]; then | ||
APISERVER_IMG="openebs/m-apiserver" | ||
M_EXPORTER_IMG="openebs/m-exporter" | ||
CSTOR_POOL_MGMT_IMG="openebs/cstor-pool-mgmt" | ||
CSPI_MGMT_IMG="openebs/cspi-mgmt" | ||
CSTOR_VOLUME_MGMT_IMG="openebs/cstor-volume-mgmt" | ||
ADMISSION_SERVER_IMG="openebs/admission-server" | ||
CSPC_OPERATOR_IMG="openebs/cspc-operator" | ||
UPGRADE_IMG="openebs/m-upgrade" | ||
PROVISIONER_LOCALPV="openebs/provisioner-localpv" | ||
CVC_OPERATOR_IMG="openebs/cvc-operator" | ||
elif [ "${ARCH}" = "aarch64" ]; then | ||
APISERVER_IMG="openebs/m-apiserver-arm64" | ||
M_EXPORTER_IMG="openebs/m-exporter-arm64" | ||
CSTOR_POOL_MGMT_IMG="openebs/cstor-pool-mgmt-arm64" | ||
CSPI_MGMT_IMG="openebs/cspi-mgmt-arm64" | ||
CSTOR_VOLUME_MGMT_IMG="openebs/cstor-volume-mgmt-arm64" | ||
ADMISSION_SERVER_IMG="openebs/admission-server-arm64" | ||
CSPC_OPERATOR_IMG="openebs/cspc-operator-arm64" | ||
UPGRADE_IMG="openebs/m-upgrade-arm64" | ||
PROVISIONER_LOCALPV="openebs/provisioner-localpv-arm64" | ||
CVC_OPERATOR_IMG="openebs/cvc-operator-arm64" | ||
fi | ||
|
||
# tag and push all the images | ||
DIMAGE="${APISERVER_IMG}" ./buildscripts/push | ||
DIMAGE="${M_EXPORTER_IMG}" ./buildscripts/push | ||
DIMAGE="${CSTOR_POOL_MGMT_IMG}" ./buildscripts/push | ||
DIMAGE="${CSPI_MGMT_IMG}" ./buildscripts/push | ||
DIMAGE="${CSTOR_VOLUME_MGMT_IMG}" ./buildscripts/push | ||
DIMAGE="${ADMISSION_SERVER_IMG}" ./buildscripts/push | ||
DIMAGE="${CSPC_OPERATOR_IMG}" ./buildscripts/push | ||
DIMAGE="${UPGRADE_IMG}" ./buildscripts/push | ||
DIMAGE="${PROVISIONER_LOCALPV}" ./buildscripts/push | ||
DIMAGE="${CVC_OPERATOR_IMG}" ./buildscripts/push |
Oops, something went wrong.