Update to a yet unreleased version of CPU-Pooler.
Change-Id: Ib60165c9e5ece887a9ab4519515d4dbded3b6af4
Signed-off-by: Krisztian Lengyel <krisztian.lengyel@nokia.com>
+++ /dev/null
----
-# 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
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 %}
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
-
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 \
&& 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
%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/
--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}/
--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}/