AArch64 support 72/1672/2
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Fri, 27 Sep 2019 23:02:31 +0000 (01:02 +0200)
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Fri, 27 Sep 2019 23:40:35 +0000 (01:40 +0200)
- spec: change hardcoded x86_64 arch to current platform arch;
- spec: bump dependency manager version from 0.5.0 to 0.5.4,
  the first golang/dep release to include arm64 (aarch64) bins;
- Dockerfile(s): download arch-specific golang/dep binaries;
- spec: Bump minor RPM version;

Co-authored-by: Jimmy Lafontaine Rivera <lafonj@gmail.com>
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Change-Id: Ic2d1cf245bb1a2eff6ee508c10a7ccb0d7f135ef

SPECS/caas-custom_metrics.spec
SPECS/caas-metrics_server.spec
SPECS/caas-prometheus.spec
docker-build/custom_metrics/Dockerfile
docker-build/metrics_server/Dockerfile

index 98382e0..fff433a 100644 (file)
@@ -15,9 +15,9 @@
 %define COMPONENT custom_metrics
 %define RPM_NAME caas-%{COMPONENT}
 %define RPM_MAJOR_VERSION 0.5.0
-%define RPM_MINOR_VERSION 2
+%define RPM_MINOR_VERSION 3
 %define go_version 1.12.9
-%define DEP_MAN_VERSION 0.5.0
+%define DEP_MAN_VERSION 0.5.4
 %define IMAGE_TAG %{RPM_MAJOR_VERSION}-%{RPM_MINOR_VERSION}
 
 Name:           %{RPM_NAME}
@@ -26,7 +26,7 @@ Release:        %{RPM_MINOR_VERSION}%{?dist}
 Summary:        Containers as a Service Custom Metrics component
 License:        %{_platform_license} and Apache License
 URL:            https://github.com/DirectXMan12/k8s-prometheus-adapter
-BuildArch:      x86_64
+BuildArch:      %{_arch}
 Vendor:         %{_platform_vendor} and DirectXMan12/k8s-prometheus-adapter unmodified
 Source0:        %{name}-%{version}.tar.gz
 
index c09b0dd..4fc5e6d 100644 (file)
@@ -15,9 +15,9 @@
 %define COMPONENT metrics_server
 %define RPM_NAME caas-%{COMPONENT}
 %define RPM_MAJOR_VERSION 0.3.3
-%define RPM_MINOR_VERSION 2
+%define RPM_MINOR_VERSION 3
 %define go_version 1.12.9
-%define DEP_MAN_VERSION 0.5.0
+%define DEP_MAN_VERSION 0.5.4
 %define IMAGE_TAG %{RPM_MAJOR_VERSION}-%{RPM_MINOR_VERSION}
 
 Name:           %{RPM_NAME}
@@ -26,7 +26,7 @@ Release:        %{RPM_MINOR_VERSION}%{?dist}
 Summary:        Containers as a Service Metrics Server component
 License:        %{_platform_license} and MIT license and BSD and Apache License and GNU LGPLv3
 URL:            https://github.com/kubernetes-incubator/metrics-server
-BuildArch:      x86_64
+BuildArch:      %{_arch}
 Vendor:         %{_platform_vendor} and kubernetes-incubator/metrics-server unmodified
 Source0:        %{name}-%{version}.tar.gz
 
index e5d86db..3de617f 100644 (file)
@@ -15,7 +15,7 @@
 %define COMPONENT prometheus
 %define RPM_NAME caas-%{COMPONENT}
 %define RPM_MAJOR_VERSION 2.11.1
-%define RPM_MINOR_VERSION 1
+%define RPM_MINOR_VERSION 2
 %define go_version 1.12.9
 %define IMAGE_TAG %{RPM_MAJOR_VERSION}-%{RPM_MINOR_VERSION}
 
@@ -25,7 +25,7 @@ Release:        %{RPM_MINOR_VERSION}%{?dist}
 Summary:        Containers as a Service Prometheus component
 License:        %{_platform_license} and BSD and Apache License and MIT license and Mozilla Public License and Lesser General Public License and GNU General Public License v2.0 only
 URL:            https://github.com/prometheus/prometheus
-BuildArch:      x86_64
+BuildArch:      %{_arch}
 Vendor:         %{_platform_vendor} and prometheus/prometheus unmodified
 Source0:        %{name}-%{version}.tar.gz
 
index 902ab79..e013656 100644 (file)
@@ -29,8 +29,9 @@ RUN apk add --no-cache --virtual .build-deps build-base go godep curl tar git gl
 && mkdir -p ${GOPATH}/src/github.com/directxman12/k8s-prometheus-adapter \
 && curl -fsSL -k https://github.com/DirectXMan12/k8s-prometheus-adapter/archive/v${CUSTOM_METRICS_VERSION}.tar.gz | tar zx --strip-components=1 -C ${GOPATH}/src/github.com/directxman12/k8s-prometheus-adapter \
 && cd ${GOPATH}/src/github.com/directxman12/k8s-prometheus-adapter \
-&& make all \
-&& mv _output/amd64/adapter /adapter \
+&& if [ $(uname -m) == 'aarch64' ]; then HOST_ARCH=arm64; else HOST_ARCH=amd64; fi \
+&& make all ARCH=${HOST_ARCH} \
+&& mv _output/${HOST_ARCH}/adapter /adapter \
 && chmod +x /adapter \
 && apk del .build-deps \
 && rm -rf ${GOPATH} \
index 7c012b5..4a7a792 100644 (file)
@@ -29,7 +29,8 @@ RUN apk add --no-cache --virtual .build-deps build-base go godep curl tar git ba
 &&  curl -fsSL -k https://dl.google.com/go/go${go_version}.src.tar.gz | tar zx --strip-components=1 -C ${go_install_dir} \
 &&  cd ${go_install_dir}/src/ \
 &&  ./make.bash \
-&&  curl -fsSL -o /usr/local/bin/dep https://github.com/golang/dep/releases/download/v${DEP_MAN_VERSION}/dep-linux-amd64 \
+&&  if [ $(uname -m) == 'aarch64' ]; then HOST_ARCH=arm64; else HOST_ARCH=amd64; fi \
+&&  curl -fsSL -o /usr/local/bin/dep https://github.com/golang/dep/releases/download/v${DEP_MAN_VERSION}/dep-linux-${HOST_ARCH} \
 &&  chmod +x /usr/local/bin/dep \
 &&  mkdir -p ${GOPATH}/src/github.com/kubernetes-incubator/metrics-server/ \
 &&  curl -fsSL -k https://github.com/kubernetes-incubator/metrics-server/archive/v${METRICS_SERVER_VERSION}.tar.gz | tar zx --strip-components=1 -C ${GOPATH}/src/github.com/kubernetes-incubator/metrics-server/ \
@@ -37,8 +38,8 @@ RUN apk add --no-cache --virtual .build-deps build-base go godep curl tar git ba
 &&  dep ensure --vendor-only \
 # static linking added
 &&  sed -i "s?LDFLAGS=-w \$(VERSION_LDFLAGS)?LDFLAGS='-extldflags "-static"' -w \$(VERSION_LDFLAGS)?" ./Makefile \
-&&  make \
-&&  mv ./_output/amd64/metrics-server /metrics-server \
+&&  make ARCH=${HOST_ARCH} \
+&&  mv ./_output/${HOST_ARCH}/metrics-server /metrics-server \
 &&  apk del .build-deps \
 &&  rm -rf ${GOPATH} \
 &&  rm -rf $go_install_dir \