Update CPU-Pooler version 57/957/5
authorKrisztian Lengyel <krisztian.lengyel@nokia.com>
Fri, 7 Jun 2019 09:45:44 +0000 (11:45 +0200)
committerKrisztian Lengyel <krisztian.lengyel@nokia.com>
Fri, 14 Jun 2019 08:22:54 +0000 (10:22 +0200)
Update to a yet unreleased version of CPU-Pooler.

Change-Id: Ib60165c9e5ece887a9ab4519515d4dbded3b6af4
Signed-off-by: Krisztian Lengyel <krisztian.lengyel@nokia.com>
ansible/roles/cpupooler/defaults/main.yaml [deleted file]
ansible/roles/cpupooler/templates/cpu_pooler_config.yaml.j2
docker-build/cpupooler/Dockerfile
docker-build/process-starter/Dockerfile
rpmbuild.spec

diff --git a/ansible/roles/cpupooler/defaults/main.yaml b/ansible/roles/cpupooler/defaults/main.yaml
deleted file mode 100644 (file)
index c0ebce3..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
----
-# Copyright 2019 Nokia
-#
-# 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.
-
-cpu_allocation_mapping:
-  caas_exclusive:
-    pool_name: exclusive_caas
-  caas_shared:
-    pool_name: shared_caas
-  caas_default:
-    pool_name: default
index c138125..c9ee90c 100644 (file)
@@ -21,8 +21,8 @@ limitations under the License.
   pools:
     {% set cpu_allocation = hostdata.get('ansible_local', {}).get('cpu_allocation', {}) %}
     {% for allocation_name, allocation in cpu_allocation.iteritems() %}
-      {% if allocation_name in cpu_allocation_mapping %}
-    {{ cpu_allocation_mapping[allocation_name]['pool_name'] }}:
+      {% if allocation_name in caas.cpu_allocation_mapping %}
+    {{ caas.cpu_allocation_mapping[allocation_name]['pool_name'] }}:
       cpus: "{{ allocation.get('list', '') }}"
       {% endif %}
     {% endfor %}
index 33dad86..52e3a26 100644 (file)
@@ -21,27 +21,29 @@ ARG CPUPOOLER
 ENV CPUPOOLER_VERSION=$CPUPOOLER
 ENV GOPATH /build
 ENV PATH /usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+ENV BUILD_DIR="$GOPATH/src/github.com/nokia/CPU-Pooler"
 
 RUN apk update \
 &&  apk upgrade \
 &&  apk add --no-cache --virtual .build-deps build-base git mercurial go glide bash tar curl \
-&&  mkdir -p $GOPATH/src/github.com/nokia/CPU-Pooler \
 &&  curl -fsSL -o /usr/local/bin/dep https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-linux-amd64 \
 &&  chmod +x /usr/local/bin/dep \
-&&  curl -fsSL -k https://github.com/nokia/CPU-Pooler/archive/v${CPUPOOLER_VERSION}.tar.gz | tar zx --strip-components=1 -C $GOPATH/src/github.com/nokia/CPU-Pooler \
-&&  cd $GOPATH/src/github.com/nokia/CPU-Pooler \
+&&  mkdir -p $BUILD_DIR \
+&&  git clone https://github.com/Levovar/CPU-Pooler.git $BUILD_DIR \
+&&  cd $BUILD_DIR \
+&&  git fetch --tags \
+&&  git checkout ${CPUPOOLER_VERSION} \
 &&  dep ensure --vendor-only \
 # cpu-device-plugin
 &&  CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' -o cpu-device-plugin ./cmd/cpu-device-plugin \
-&&  mv $GOPATH/src/github.com/nokia/CPU-Pooler/cpu-device-plugin /cpu-device-plugin \
+&&  mv $BUILD_DIR/cpu-device-plugin /cpu-device-plugin \
 # cpu-setter
 &&  CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' -o cpu-setter ./cmd/cpusetter \
-&&  mv $GOPATH/src/github.com/nokia/CPU-Pooler/cpu-setter /cpu-setter \
+&&  mv $BUILD_DIR/cpu-setter /cpu-setter \
 # cpu-webhook
 &&  CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' -o cpu-device-webhook ./cmd/webhook \
-&&  mv $GOPATH/src/github.com/nokia/CPU-Pooler/cpu-device-webhook /cpu-device-webhook \
+&&  mv $BUILD_DIR/cpu-device-webhook /cpu-device-webhook \
 &&  apk del .build-deps \
 &&  rm -rf $GOPATH \
 &&  rm -rf /build \
 &&  rm -rf /root/.glide
-
index 2f474e1..bcb1e0c 100644 (file)
@@ -20,6 +20,7 @@ ENV DEP_VERSION=$DEPENDENCY_MANAGER
 ARG CPUPOOLER
 ENV CPUPOOLER_VERSION=$CPUPOOLER
 ENV GOPATH /build
+ENV BUILD_DIR="$GOPATH/src/github.com/nokia/CPU-Pooler"
 
 RUN yum update -y \
 &&  yum install -y \
@@ -42,13 +43,13 @@ RUN yum update -y \
 &&  yum install -y golang \
 &&  curl -fsSL -o /usr/local/bin/dep https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-linux-amd64 \
 &&  chmod +x /usr/local/bin/dep \
-&&  mkdir -p $GOPATH/src/github.com/nokia/CPU-Pooler \
-&&  curl -fsSL -k https://github.com/nokia/CPU-Pooler/archive/v${CPUPOOLER_VERSION}.tar.gz | tar zx --strip-components=1 -C $GOPATH/src/github.com/nokia/CPU-Pooler \
-&&  cd $GOPATH/src/github.com/nokia/CPU-Pooler \
+&&  mkdir -p $BUILD_DIR \
+&&  git clone https://github.com/Levovar/CPU-Pooler.git $BUILD_DIR \
+&&  cd $BUILD_DIR \
+&&  git fetch --tags \
+&&  git checkout ${CPUPOOLER_VERSION} \
 &&  dep ensure --vendor-only \
 # process-starter
 &&  CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' -o process-starter ./cmd/process-starter \
-&&  mv $GOPATH/src/github.com/nokia/CPU-Pooler/process-starter /process-starter \
-&&  rm -rf $GOPATH 
-
-
+&&  mv $BUILD_DIR/process-starter /process-starter \
+&&  rm -rf $GOPATH
index bae169b..0d75738 100644 (file)
@@ -16,7 +16,8 @@
 %define COMPONENT_PART process-starter
 %define RPM_NAME caas-%{COMPONENT}
 %define RPM_MAJOR_VERSION 0.2.0
-%define RPM_MINOR_VERSION 2
+%define RPM_MINOR_VERSION 3
+%define CPUPOOLER_VERSION 808b717165c10b0752bbafd4e2898d4e20c2fae8
 %define DEPENDENCY_MANAGER_VERSION 0.5.0
 %define IMAGE_TAG %{RPM_MAJOR_VERSION}-%{RPM_MINOR_VERSION}
 %define PROCESS_STARTER_INSTALL_PATH /opt/bin/
@@ -57,7 +58,7 @@ docker build \
   --build-arg https_proxy="${https_proxy}" \
   --build-arg no_proxy="${no_proxy}" \
   --build-arg DEPENDENCY_MANAGER="%{DEPENDENCY_MANAGER_VERSION}" \
-  --build-arg CPUPOOLER="%{RPM_MAJOR_VERSION}" \
+  --build-arg CPUPOOLER="%{CPUPOOLER_VERSION}" \
   --tag %{COMPONENT_PART}:builder \
   %{_builddir}/%{RPM_NAME}-%{RPM_MAJOR_VERSION}/docker-build/%{COMPONENT_PART}/
 
@@ -103,7 +104,7 @@ docker build \
   --build-arg https_proxy="${https_proxy}" \
   --build-arg no_proxy="${no_proxy}" \
   --build-arg DEPENDENCY_MANAGER="%{DEPENDENCY_MANAGER_VERSION}" \
-  --build-arg CPUPOOLER="%{RPM_MAJOR_VERSION}" \
+  --build-arg CPUPOOLER="%{CPUPOOLER_VERSION}" \
   --tag %{COMPONENT}:%{IMAGE_TAG} \
   %{_builddir}/%{RPM_NAME}-%{RPM_MAJOR_VERSION}/docker-build/%{COMPONENT}/