Skip to content

Commit

Permalink
enable arm support for travis builds
Browse files Browse the repository at this point in the history
Signed-off-by: prateekpandey14 <[email protected]>
  • Loading branch information
prateekpandey14 committed Dec 30, 2019
1 parent 6bc7c5e commit 75d0f4e
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 14 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ language: go
go:
- 1.12.10

arch:
- amd64
- arm64
addons:
apt:
update: true
Expand Down
19 changes: 5 additions & 14 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ HUB_USER?=openebs
ADMISSION_SERVER_REPO_NAME?=admission-server
M_UPGRADE_REPO_NAME?=m-upgrade
CSPC_OPERATOR_REPO_NAME?=cspc-operator
CVC_OPERATOR_REPO_NAME?=cvc-operator

ifeq (${IMAGE_TAG}, )
IMAGE_TAG = ci
Expand Down Expand Up @@ -109,7 +108,6 @@ endif
WEBHOOK=admission-server
CSPC_OPERATOR=cspc-operator
CSPC_OPERATOR_DEBUG=cspc-operator-debug
CVC_OPERATOR=cvc-operator

# Specify the date o build
BUILD_DATE = $(shell date +'%Y%m%d%H%M%S')
Expand All @@ -123,14 +121,17 @@ include ./buildscripts/exporter/Makefile.mk
include ./buildscripts/cstor-pool-mgmt/Makefile.mk
include ./buildscripts/cstor-volume-mgmt/Makefile.mk
include ./buildscripts/cspi-mgmt/Makefile.mk
include ./buildscripts/cvc-operator/Makefile.mk

.PHONY: all
all: compile-tests apiserver-image exporter-image pool-mgmt-image volume-mgmt-image \
admission-server-image cspc-operator-image cspc-operator-debug-image \
cvc-operator-image cspi-mgmt-image upgrade-image provisioner-localpv-image

.PHONY: all.arm64
all.arm64: apiserver-image.arm64 provisioner-localpv-image.arm64 exporter-image.arm64 pool-mgmt-image.arm64 volume-mgmt-image.arm64 cspi-mgmt-image.arm64
all.arm64: apiserver-image.arm64 provisioner-localpv-image.arm64 exporter-image.arm64 \
pool-mgmt-image.arm64 volume-mgmt-image.arm64 cspi-mgmt-image.arm64 \
cvc-operator-image-arm64

.PHONY: initialize
initialize: bootstrap
Expand Down Expand Up @@ -333,17 +334,6 @@ cspc-operator-debug-image:
@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}

.PHONY: cvc-operator-image
cvc-operator-image:
@echo "----------------------------"
@echo -n "--> cvc-operator image "
@echo "${HUB_USER}/${CVC_OPERATOR_REPO_NAME}:${IMAGE_TAG}"
@echo "----------------------------"
@PNAME=${CVC_OPERATOR} CTLNAME=${CVC_OPERATOR} sh -c "'$(PWD)/buildscripts/build.sh'"
@cp bin/${CVC_OPERATOR}/${CVC_OPERATOR} buildscripts/cvc-operator/
@cd buildscripts/${CVC_OPERATOR} && sudo docker build -t ${HUB_USER}/${CVC_OPERATOR_REPO_NAME}:${IMAGE_TAG} --build-arg BUILD_DATE=${BUILD_DATE} .
@rm buildscripts/${CVC_OPERATOR}/${CVC_OPERATOR}

# Push images
.PHONY: deploy-images
deploy-images:
Expand All @@ -356,3 +346,4 @@ deploy-images:
@DIMAGE="openebs/cspc-operator" ./buildscripts/push
@DIMAGE="${HUB_USER}/${M_UPGRADE_REPO_NAME}" ./buildscripts/push
@DIMAGE="openebs/provisioner-localpv" ./buildscripts/push
@DIMAGE="openebs/cvc-operator" ./buildscripts/push
27 changes: 27 additions & 0 deletions buildscripts/cvc-operator/Dockerfile.arm64
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#Make the base image configurable. If BASE IMAGES is not provided
#docker command will fail
#ARG BASE_IMAGE=arm64v8/alpine
#FROM $BASE_IMAGE
FROM arm64v8/alpine

RUN apk add --no-cache \
iproute2 \
bash \
curl \
net-tools \
mii-tool \
procps \
libc6-compat \
ca-certificates

COPY cvc-operator /usr/local/bin/cvc-operator

ARG BUILD_DATE
LABEL org.label-schema.name="cvc-operator"
LABEL org.label-schema.description="Operator for OpenEBS cStor csi volumes"
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/cvc-operator"]
31 changes: 31 additions & 0 deletions buildscripts/cvc-operator/Makefile.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Specify the name of the docker repo for amd64
CVC_OPERATOR?=cvc-operator
# Specify the name of the docker repo for amd64
CVC_OPERATOR_REPO_NAME?=cvc-operator

# Specify the name of the docker repo for arm64
CVC_OPERATOR_REPO_NAME_ARM64?=cvc-operator-arm64

.PHONY: cvc-operator-image
cvc-operator-image:
@echo "----------------------------"
@echo -n "--> cvc-operator image "
@echo "${HUB_USER}/${CVC_OPERATOR_REPO_NAME}:${IMAGE_TAG}"
@echo "----------------------------"
@PNAME=${CVC_OPERATOR} CTLNAME=${CVC_OPERATOR} sh -c "'$(PWD)/buildscripts/build.sh'"
@cp bin/${CVC_OPERATOR}/${CVC_OPERATOR} buildscripts/cvc-operator/
@cd buildscripts/${CVC_OPERATOR} && sudo docker build -t ${HUB_USER}/${CVC_OPERATOR_REPO_NAME}:${IMAGE_TAG} --build-arg BUILD_DATE=${BUILD_DATE} .
@rm buildscripts/${CVC_OPERATOR}/${CVC_OPERATOR}

.PHONY: cvc-operator-image.arm64
cvc-operator-image.arm64:
@echo "----------------------------"
@echo -n "--> arm64 based cstor-volume-mgmt image "
@echo "${HUB_USER}/${CVC_OPERATOR_REPO_NAME}:${IMAGE_TAG}"
@echo "----------------------------"
@PNAME=${CVC_OPERATOR} CTLNAME=${CVC_OPERATOR} sh -c "'$(PWD)/buildscripts/build.sh'"
@cp bin/${CVC_OPERATOR}/${CVC_OPERATOR} buildscripts/cvc-operator/
@cd buildscripts/${CVC_OPERATOR} && sudo docker build -t ${HUB_USER}/${CSTOR_VOLUME_MGMT_REPO_NAME_ARM64}:${IMAGE_TAG} -f Dockerfile.arm64 --build-arg BUILD_DATE=${BUILD_DATE} .
@rm buildscripts/${CVC_OPERATOR}/${CVC_OPERATOR}


0 comments on commit 75d0f4e

Please sign in to comment.