AArch64 support 69/1669/3
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Fri, 27 Sep 2019 20:33:39 +0000 (22:33 +0200)
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Tue, 15 Oct 2019 23:25:22 +0000 (01:25 +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;
- 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: Id201364bd38ef5af2756a8b5083e8a1cb45976a1

docker-build/cpupooler/Dockerfile
docker-build/process-starter/Dockerfile
rpmbuild.spec

index 8267df1..117d34d 100644 (file)
@@ -31,7 +31,8 @@ RUN apk update \
 &&  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 $BUILD_DIR \
 &&  git clone https://github.com/nokia/CPU-Pooler.git $BUILD_DIR \
index 0dbc5f9..cecd2a4 100644 (file)
@@ -12,7 +12,9 @@
 # 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 Balazs Szekeres <balazs.szekeres@nokia.com>
 
 ARG DEP_MAN_VERSION
@@ -39,8 +41,9 @@ RUN yum update -y \
       gcc \
       gcc-c++ \
 &&  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} \
-&&  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 -k https://dl.google.com/go/go${go_version}.linux-$HOST_ARCH.tar.gz | tar zx --strip-components=1 -C ${go_install_dir} \
+&&  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/nokia/CPU-Pooler \
 &&  git clone https://github.com/nokia/CPU-Pooler.git $GOPATH/src/github.com/nokia/CPU-Pooler \
index 6620a96..7618b4b 100644 (file)
 %define COMPONENT_PART process-starter
 %define RPM_NAME caas-%{COMPONENT}
 %define RPM_MAJOR_VERSION 0.3.0
-%define RPM_MINOR_VERSION 6
+%define RPM_MINOR_VERSION 7
 %define go_version 1.12.10
 %define CPUPOOLER_VERSION 603d1128aa982493d50d682b2edb37fe17b73031
-%define DEP_MAN_VERSION 0.5.0
+%define DEP_MAN_VERSION 0.5.4
 %define IMAGE_TAG %{RPM_MAJOR_VERSION}-%{RPM_MINOR_VERSION}
 %define PROCESS_STARTER_INSTALL_PATH /opt/bin/
+%define centos_build 191001
 
 Name:           %{RPM_NAME}
 Version:        %{RPM_MAJOR_VERSION}
@@ -29,12 +30,12 @@ Release:        %{RPM_MINOR_VERSION}%{?dist}
 Summary:        Containers as a Service cpu-pooler component
 License:        %{_platform_license} and BSD 3-Clause License
 URL:            https://github.com/nokia/CPU-Pooler
-BuildArch:      x86_64
+BuildArch:      %{_arch}
 Vendor:         %{_platform_vendor} and Nokia
 Source0:        %{name}-%{version}.tar.gz
 
 Requires: docker-ce >= 18.09.2, rsync
-BuildRequires: docker-ce-cli >= 18.09.2, xz
+BuildRequires: docker-ce-cli >= 18.09.2, xz, wget
 
 # I was able to pack an executable via this.
 # more info at https://fedoraproject.org/wiki/Packaging:Debuginfo
@@ -47,6 +48,7 @@ This RPM contains the cpu-pooler container image, process-starter binary and rel
 %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 %{_builddir}/%{RPM_NAME}-%{RPM_MAJOR_VERSION}/docker-build/%{COMPONENT_PART}/centos-7-docker.tar.xz
 # build the process-starter binary inside a builder conatiner
 docker build \
   --network=host \