AArch64 support 71/1671/3
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Fri, 27 Sep 2019 22:52:58 +0000 (00:52 +0200)
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Wed, 2 Oct 2019 14:31:03 +0000 (16:31 +0200)
- spec: change hardcoded x86_64 arch to current platform arch;
- Dockerfile: Instead of pulling CentOS base images from dockerhub,
  create them from scratch from the official SIG-cloudinstance repo:
  http://artifacts.ci.centos.org/sig-cloudinstance/
- 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: Ieef973a42c9754dc17dfdd29e3c0cdee1d2d1add

SPECS/caas-chartrepo.spec
SPECS/caas-helm.spec
docker-build/helm-builder/Dockerfile

index 4a86c64..664e0c0 100644 (file)
@@ -15,7 +15,7 @@
 %define COMPONENT chartrepo
 %define RPM_NAME caas-%{COMPONENT}
 %define RPM_MAJOR_VERSION 1.0.0
-%define RPM_MINOR_VERSION 9
+%define RPM_MINOR_VERSION 10
 %define go_version 1.12.9
 %define IMAGE_TAG %{RPM_MAJOR_VERSION}-%{RPM_MINOR_VERSION}
 %define docker_build_dir %{_builddir}/%{RPM_NAME}-%{RPM_MAJOR_VERSION}/docker-build
@@ -26,7 +26,7 @@ Version:        %{RPM_MAJOR_VERSION}
 Release:        %{RPM_MINOR_VERSION}%{?dist}
 Summary:        Containers as a Service %{COMPONENT} component
 License:        %{_platform_licence} and MIT license and BSD and Apache License and Lesser General Public License
-BuildArch:      x86_64
+BuildArch:      %{_arch}
 Vendor:         %{_platform_vendor} and kubernetes/kubernetes unmodified
 Source0:        %{name}-%{version}.tar.gz
 
index a6122fa..9c73599 100644 (file)
 %define COMPONENT helm
 %define RPM_NAME caas-%{COMPONENT}
 %define RPM_MAJOR_VERSION 2.14.3
-%define RPM_MINOR_VERSION 2
+%define RPM_MINOR_VERSION 3
 %define IMAGE_TAG %{RPM_MAJOR_VERSION}-%{RPM_MINOR_VERSION}
 %define go_version 1.12.9
 %define binary_build_dir %{_builddir}/%{RPM_NAME}-%{RPM_MAJOR_VERSION}/binary-save
 %define docker_build_dir %{_builddir}/%{RPM_NAME}-%{RPM_MAJOR_VERSION}/docker-build
 %define docker_save_dir %{_builddir}/%{RPM_NAME}-%{RPM_MAJOR_VERSION}/docker-save
 %define built_binaries_dir /binary-save
+%define centos_build 191001
 
 Name:           %{RPM_NAME}
 Version:        %{RPM_MAJOR_VERSION}
 Release:        %{RPM_MINOR_VERSION}%{?dist}
 Summary:        Containers as a Service %{COMPONENT} component
 License:        %{_platform_licence} and MIT license and BSD and Apache License and Lesser General Public License
-BuildArch:      x86_64
+BuildArch:      %{_arch}
 Vendor:         %{_platform_vendor} and helm/helm unmodified
 Source0:        %{name}-%{version}.tar.gz
 
 Requires: docker-ce >= 18.09.2, rsync
-BuildRequires: docker-ce-cli >= 18.09.2, rsync, xz
+BuildRequires: docker-ce-cli >= 18.09.2, rsync, xz, wget
 
 %description
 This rpm contains the %{COMPONENT} container for CaaS subsystem.
@@ -43,6 +44,7 @@ This container contains the %{COMPONENT} service.
 %autosetup
 
 %build
+wget --progress=dot:giga http://artifacts.ci.centos.org/sig-cloudinstance/centos-7-%{centos_build}/%{_arch}/centos-7-%{_arch}-docker.tar.xz -O %{docker_build_dir}/helm-builder/centos-7-docker.tar.xz
 # Build Helm binaries
 docker build \
   --network=host \
index 7f1caaa..23b41d8 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-FROM centos:7.6.1810
+FROM scratch
+ADD centos-7-docker.tar.xz /
+CMD ["/bin/bash"]
+
 MAINTAINER Krisztian Lengyel <krisztian.lengyel@nokia.com>
 
 ARG HELM_VERSION
@@ -28,7 +31,8 @@ ENV PATH="$GOPATH/bin:$go_install_dir/bin:$PATH"
 RUN yum install -y --setopt=skip_missing_names_on_install=False \
       ${build_packages} \
 &&  mkdir -p $go_install_dir \
-&&  curl -fsSL -k https://dl.google.com/go/go${go_version}.linux-amd64.tar.gz | tar zx --strip-components=1 -C ${go_install_dir} \
+&&  if [ $(uname -m) == 'aarch64' ]; then HOST_ARCH=arm64; else HOST_ARCH=amd64; fi \
+&&  curl -fsSL -k https://dl.google.com/go/go${go_version}.linux-${HOST_ARCH}.tar.gz | tar zx --strip-components=1 -C ${go_install_dir} \
 \
 # Build Helm
 &&  mkdir -p $GOPATH/src/k8s.io \
@@ -37,8 +41,8 @@ RUN yum install -y --setopt=skip_missing_names_on_install=False \
 &&  cd helm \
 &&  make GIT_TAG=v${HELM_VERSION} bootstrap build-cross \
 &&  mkdir -p ${binaries} \
-&&  mv ./_dist/linux-amd64/tiller ${binaries}/ \
-&&  mv ./_dist/linux-amd64/helm ${binaries}/ \
+&&  mv ./_dist/linux-${HOST_ARCH}/tiller ${binaries}/ \
+&&  mv ./_dist/linux-${HOST_ARCH}/helm ${binaries}/ \
 &&  rm -rf $GOPATH \
 &&  rm -rf $go_install_dir \
 &&  rm -rf /build \