From abf59d601e8f49d9f3fee915ee167854e5f90098 Mon Sep 17 00:00:00 2001 From: bdfreeman1421 Date: Fri, 22 Nov 2019 22:23:22 +0000 Subject: [PATCH] Sync to 1.16 k8 suppress kubectl headers added robotImplementation tag update tag to match version.properties 0.3.0 fix deployment.yaml fix repository references fix linkage to new ric-platform-recipe fix ricdeployment resource path references Change-Id: I91000e3d1c34354722ea2b57f138b20c5508c7ed Signed-off-by: bdfreeman1421 --- ric_robot_suite/helm/ric-robot/demo-k8s.sh | 2 +- ric_robot_suite/helm/ric-robot/ete-k8s.e2sim.sh | 2 +- ric_robot_suite/helm/ric-robot/ete-k8s.sh | 2 +- .../helm/ric-robot/templates/deployment.yaml | 17 +++-- ric_robot_suite/helm/ric-robot/values.yaml | 13 ++-- ric_robot_suite/helm/robot_install.sh | 79 ++++++++++------------ .../robot/testsuites/ricdeployment.robot | 5 +- ric_robot_suite/version.properties | 2 +- 8 files changed, 62 insertions(+), 60 deletions(-) diff --git a/ric_robot_suite/helm/ric-robot/demo-k8s.sh b/ric_robot_suite/helm/ric-robot/demo-k8s.sh index 67a41c3..38c0db1 100755 --- a/ric_robot_suite/helm/ric-robot/demo-k8s.sh +++ b/ric_robot_suite/helm/ric-robot/demo-k8s.sh @@ -39,7 +39,7 @@ if [ $# -lt 2 ];then fi NAMESPACE=$1 -POD=$(kubectl --namespace $NAMESPACE get pods | sed 's/ .*//'| grep robot) +POD=$(kubectl --namespace $NAMESPACE get pods -l robotImplementation=ric-robot --no-headers=true | sed 's/ .*//') shift diff --git a/ric_robot_suite/helm/ric-robot/ete-k8s.e2sim.sh b/ric_robot_suite/helm/ric-robot/ete-k8s.e2sim.sh index 3171bbe..15b54ec 100755 --- a/ric_robot_suite/helm/ric-robot/ete-k8s.e2sim.sh +++ b/ric_robot_suite/helm/ric-robot/ete-k8s.e2sim.sh @@ -146,7 +146,7 @@ fi export NAMESPACE="$1" -POD=$(kubectl --namespace $NAMESPACE get pods | sed 's/ .*//'| grep robot) +POD=$(kubectl --namespace $NAMESPACE get pods | sed 's/ .*//'| grep robot | grep -v nano) TAG="$2" TAGS="-i $2" diff --git a/ric_robot_suite/helm/ric-robot/ete-k8s.sh b/ric_robot_suite/helm/ric-robot/ete-k8s.sh index 4f41a8a..9ff031f 100755 --- a/ric_robot_suite/helm/ric-robot/ete-k8s.sh +++ b/ric_robot_suite/helm/ric-robot/ete-k8s.sh @@ -50,7 +50,7 @@ fi export NAMESPACE="$1" -POD=$(kubectl --namespace $NAMESPACE get pods | sed 's/ .*//'| grep robot) +POD=$(kubectl --namespace $NAMESPACE get pod -l robotImplementation=ric-robot --no-headers=true | sed 's/ .*//') TAGS="-i $2" diff --git a/ric_robot_suite/helm/ric-robot/templates/deployment.yaml b/ric_robot_suite/helm/ric-robot/templates/deployment.yaml index 6dea20e..871742a 100644 --- a/ric_robot_suite/helm/ric-robot/templates/deployment.yaml +++ b/ric_robot_suite/helm/ric-robot/templates/deployment.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "ric-robot.fullname" . }} @@ -24,11 +24,20 @@ metadata: heritage: {{ .Release.Service }} spec: replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + app: {{ include "ric-robot.name" . }} + release: {{ .Release.Name }} template: metadata: + {{- if .Values.rtmgr.annotations }} + annotations: + {{- .Values.rtmgr.annotations | nindent 8 -}} + {{ end }} labels: - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} + app: {{ include "ric-robot.name" . }} + release: {{ .Release.Name }} + robotImplementation: {{ .Values.robotImplementation }} spec: containers: - name: {{ include "ric-robot.name" . }} @@ -38,7 +47,7 @@ spec: - name: RICPLT_NAMESPACE value: {{ .Release.Namespace }} - name: RICPLT_RELEASE_NAME - value: {{ .Values.Release.HelmReleaseName }} + value: {{ .Release.Name }} - name: RICPLT_COMPONENTS value: {{ keys .Values.ric.platform.components | join " " }} ports: diff --git a/ric_robot_suite/helm/ric-robot/values.yaml b/ric_robot_suite/helm/ric-robot/values.yaml index d9a394a..e9d7b04 100755 --- a/ric_robot_suite/helm/ric-robot/values.yaml +++ b/ric_robot_suite/helm/ric-robot/values.yaml @@ -22,20 +22,23 @@ replicaCount: 1 image: - repository: snapshot.docker.ranco-dev-tools.eastus.cloudapp.azure.com:10001 + repository: nexus3.o-ran-sc.org:10004 repositoryCred: docker-reg-cred # for local testing #repository: ric/testsuite - name: test/ric-robot - tag: 0.2.0-latest + name: o-ran-sc/it-test-ric-robot + tag: 0.3.0 pullPolicy: IfNotPresent nameOverride: "" fullnameOverride: "" +robotImplementation: "ric-robot" config: - dashboardExternalIp: REPLACE_WITH_EXTERNAL_K8_IP_OF_DASHBOARD - dashboardExternalPort: REPLACE_WITH_NODEPORT_OF_KONG_PROXY_31080 + #dashboardExternalIp: REPLACE_WITH_EXTERNAL_K8_IP_OF_DASHBOARD + #dashboardExternalPort: REPLACE_WITH_NODEPORT_OF_KONG_PROXY_31080 + dashboardExternalIp: 192.168.130.122 + dashboardExternalPort: 32080 service: port: 88 type: NodePort diff --git a/ric_robot_suite/helm/robot_install.sh b/ric_robot_suite/helm/robot_install.sh index 867eb98..8bc364c 100755 --- a/ric_robot_suite/helm/robot_install.sh +++ b/ric_robot_suite/helm/robot_install.sh @@ -1,4 +1,6 @@ -opyright (c) 2019 AT&T Intellectual Property. # +#!/bin/bash +################################################################################ +# Copyright (c) 2019 AT&T Intellectual Property. # # Copyright (c) 2019 Nokia. # # # # Licensed under the Apache License, Version 2.0 (the "License"); # @@ -13,65 +15,54 @@ opyright (c) 2019 AT&T Intellectual Property. # # See the License for the specific language governing permissions and # # limitations under the License. # ################################################################################ +while [ -n "$1" ]; do # while loop starts + case "$1" in -OVERRIDEYAML=$1 - - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" - -#/root/test/ric_robot_suite/helm -# extract the base to find root to dep - -BASE=${DIR%/test*} - -# /data/ORAN-OSC/it/dep/ric-platform/50-RIC-Platform/bin/install -BASEDIR50=$BASE/dep/ric-platform/50-RIC-Platform/ -BASEDIRCOMMON=$BASE/dep/ric-common/Common-Template/helm/ric-common + -f) OVERRIDEYAML=$2 + shift + ;; + *) echo "Option $1 not recognized" ;; # In case you typed a different option other than a,b,c -echo "Using etc/ric.conf from $BASEDIR50" + esac -source $BASEDIR50/etc/ric.conf + shift +done -if [ -z "$RICPLT_RELEASE_NAME" ];then - RELEASE_NAME=$helm_release_name -else - RELEASE_NAME=$RICPLT_RELEASE_NAME -fi -# Namespace configuration -if [ -z "$RICPLT_NAMESPACE" ];then - PLT_NAMESPACE=$plt_namespace -else - PLT_NAMESPACE=$RICPLT_NAMESPACE +if [ -z "$OVERRIDEYAML" ];then + echo "****************************************************************************************************************" + echo " ERROR " + echo "****************************************************************************************************************" + echo "RIC robot deployment without deployment recipe/override is currently disabled. Please specify an recipe/ovrride with the -f option." + echo " the deployment recipe/override should be the same file as is used for RIC platform deplpoyment " + echo "****************************************************************************************************************" + exit 1 fi -RICPLT_COMPONENTS="ric-robot" - -echo "Deploying RIC Platform components [$RICPLT_COMPONENTS]" -echo "Platform Namespace: $PLT_NAMESPACE" -echo "Helm Release Name: $RELEASE_NAME" - +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" +GLOBAL_BLOCK=$(cat $OVERRIDEYAML | awk '/^global:/{getline; while ($0 ~ /^ +.*|^ *$/) {print $0; if (getline == 0) {break}}}') +NAMESPACE_BLOCK=$(cat $OVERRIDEYAML | awk '/^ namespace:/{getline; while ($0 ~ /^ .*|^ *$/) {print $0; if (getline == 0) {break}}}') +NAMESPACE=$(echo "$NAMESPACE_BLOCK" | awk '/^ *platform:/{print $2}') +RELEASE_PREFIX=$(echo "$GLOBAL_BLOCK" | awk '/^ *releasePrefix:/{print $2}') +COMPONENTS=ric-robot -#COMMON_CHART_VERSION=$(cat $BASEDIR50/helm/common/Chart.yaml | grep version | awk '{print $2}') -COMMON_CHART_VERSION=$(cat $BASEDIRCOMMON/Chart.yaml | grep version | awk '{print $2}') +echo "Deploying RIC [$COMPONENTS]" +COMMON_CHART_VERSION=$(cat $DIR/../../../dep/ric-common/Common-Template/helm/ric-common/Chart.yaml | grep version | awk '{print $2}') +helm package -d /tmp $DIR/../../../dep/ric-common/Common-Template/helm/ric-common -helm package -d /tmp $BASEDIRCOMMON +for component in $COMPONENTS; do -for component in $RICPLT_COMPONENTS; do - echo "Preparing chart for comonent $component" mkdir -p $DIR/$component/charts/ cp /tmp/ric-common-$COMMON_CHART_VERSION.tgz $DIR/$component/charts/ - if [ -z $OVERRIDEYAML ]; then - echo "helm install --namespace \"${PLT_NAMESPACE}\" --set \"Release.HelmReleaseName=${RELEASE_NAME}\" --name \"${RELEASE_NAME}-$component\" $DIR/../helm/$component" - helm install --namespace "${PLT_NAMESPACE}" --set "Release.HelmReleaseName=${RELEASE_NAME}" --name "${RELEASE_NAME}-$component" $DIR/$component - else - echo "helm install -f $OVERRIDEYAML --namespace \"${PLT_NAMESPACE}\" --set \"Release.HelmReleaseName=${RELEASE_NAME}\" --name \"${RELEASE_NAME}-$component\" $DIR/../helm/$component" - helm install -f $OVERRIDEYAML --namespace "${PLT_NAMESPACE}" --set "Release.HelmReleaseName=${RELEASE_NAME}" --name "${RELEASE_NAME}-$component" $DIR/$component - fi + helm install -f $OVERRIDEYAML --namespace "${NAMESPACE}" --name "${RELEASE_PREFIX}-$component" $DIR/../helm/$component done +echo "RELEASE_NAMESPACE=${NAMESPACE}" > /tmp/ric-robot.conf +echo "RELEASE_NAME=${RELEASE_PREFIX}" >> /tmp/ric-robot.conf +echo "OVERRIDEYAML=${OVERRIDEYAML}" >> /tmp/ric-robot.conf + diff --git a/ric_robot_suite/robot/testsuites/ricdeployment.robot b/ric_robot_suite/robot/testsuites/ricdeployment.robot index db952c2..0185ea5 100644 --- a/ric_robot_suite/robot/testsuites/ricdeployment.robot +++ b/ric_robot_suite/robot/testsuites/ricdeployment.robot @@ -16,9 +16,8 @@ *** Settings *** Documentation Tests for the existence and functionality of RIC components -Resource ../global_properties.robot - -Resource ../ric/ric_utils.robot +Resource ../resources/global_properties.robot +Resource ../resources/ric/ric_utils.robot Library KubernetesEntity ${GLOBAL_RICPLT_NAMESPACE} Library Collections diff --git a/ric_robot_suite/version.properties b/ric_robot_suite/version.properties index ac51f1f..cb064b2 100644 --- a/ric_robot_suite/version.properties +++ b/ric_robot_suite/version.properties @@ -3,7 +3,7 @@ # because they are used in Jenkins, whose plug-in doesn't support major=0 -minor=2 +minor=3 patch=0 base_version=${major}.${minor}.${patch} -- 2.16.6