if ! command -v yq > /dev/null 2>&1; then
echo "yq is not installed. Installing yq..."
- sudo snap install yq --channel=v4/stable
+ ARCH=$(case $(uname -m) in x86_64) echo "amd64";; aarch64) echo "arm64";; *) uname -m;; esac)
+ VERSION="v4.45.4"
+ wget https://github.com/mikefarah/yq/releases/download/${VERSION}/yq_linux_${ARCH} -O /usr/local/bin/yq
+ chmod +x /usr/local/bin/yq
fi
INSTALL_KONG=$(cat $OVERRIDEYAML | yq e '.nonrtric.installKong' -)
def proxies=''
stage('Checkout') {
echo 'printenv'
- checkout scm: [$class: 'GitSCM', userRemoteConfigs: [[url: 'https://gerrit.o-ran-sc.org/r/it/dep']], branches: [[name: env.BRANCH]], extensions: [[$class: 'SubmoduleOption', recursiveSubmodules: true]]], poll: false
+ checkout scm: [$class: 'GitSCM', userRemoteConfigs: [[url: env.REPO]], branches: [[name: env.BRANCH]], extensions: [[$class: 'SubmoduleOption', recursiveSubmodules: true]]], poll: false
}
container('jenkins-ubuntu') {
stage ('Proxy settings') {
-podTemplate(yaml: '''
- apiVersion: v1
- kind: Pod
- spec:
- containers:
- - name: jenkins-ubuntu
- image: ubuntu:20.04
- command:
- - sleep
- args:
- - 99d
-''') {
-
- node(POD_LABEL) {
- def proxies=''
- stage('Checkout') {
- checkout scm: [$class: 'GitSCM', userRemoteConfigs: [[url: 'https://gerrit.o-ran-sc.org/r/it/dep']], branches: [[name: env.BRANCH]], extensions: [[$class: 'SubmoduleOption', recursiveSubmodules: true]]], poll: false
- }
- container('jenkins-ubuntu') {
- stage ('Proxy settings') {
- echo 'Proxy check'
- script {
- if (env.http_proxy) {
- sh 'echo \'Acquire::http::Proxy "' + env.http_proxy + '";\' > /etc/apt/apt.conf.d/proxy.conf'
- sh 'cat /etc/apt/apt.conf.d/proxy.conf'
- sh 'echo "http_proxy = "'+env.http_proxy+' > ~/.wgetrc'
- sh 'cat ~/.wgetrc'
-
- sh 'echo \'Acquire::https::Proxy "' + env.http_proxy + '";\' >> /etc/apt/apt.conf.d/proxy.conf'
- sh 'cat /etc/apt/apt.conf.d/proxy.conf'
- sh 'echo "https_proxy = "'+env.http_proxy+' >> ~/.wgetrc'
- sh 'cat ~/.wgetrc'
-
- proxies='HTTPS_PROXY='+env.http_proxy+' '
+lock('smo') {
+ podTemplate(yaml: '''
+ apiVersion: v1
+ kind: Pod
+ spec:
+ containers:
+ - name: jenkins-ubuntu
+ image: ubuntu:20.04
+ command:
+ - sleep
+ args:
+ - 99d
+ ''') {
+
+ node(POD_LABEL) {
+ def proxies=''
+ stage('Checkout') {
+ checkout scm: [$class: 'GitSCM', userRemoteConfigs: [[url: env.REPO]], branches: [[name: env.BRANCH]], extensions: [[$class: 'SubmoduleOption', recursiveSubmodules: true]]], poll: false
+ }
+ container('jenkins-ubuntu') {
+ stage ('Proxy settings') {
+ echo 'Proxy check'
+ script {
+ if (env.http_proxy) {
+ sh 'echo \'Acquire::http::Proxy "' + env.http_proxy + '";\' > /etc/apt/apt.conf.d/proxy.conf'
+ sh 'cat /etc/apt/apt.conf.d/proxy.conf'
+ sh 'echo "http_proxy = "'+env.http_proxy+' > ~/.wgetrc'
+ sh 'cat ~/.wgetrc'
+
+ sh 'echo \'Acquire::https::Proxy "' + env.http_proxy + '";\' >> /etc/apt/apt.conf.d/proxy.conf'
+ sh 'cat /etc/apt/apt.conf.d/proxy.conf'
+ sh 'echo "https_proxy = "'+env.http_proxy+' >> ~/.wgetrc'
+ sh 'cat ~/.wgetrc'
+
+ proxies='HTTPS_PROXY='+env.http_proxy+' '
+ }
+ }
+ sh 'printenv'
+ }
+
+ stage('Setup tools') {
+ sh 'apt-get update -y'
+ sh 'DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata'
+ sh 'apt-get install git wget sudo -y'
+ sh 'wget https://dl.k8s.io/release/v1.22.0/bin/linux/amd64/kubectl'
+ sh 'mv kubectl /usr/bin'
+ sh 'chmod a+x /usr/bin/kubectl'
+ sh 'kubectl version'
+ sh 'cd /tmp && wget https://get.helm.sh/helm-v3.12.3-linux-amd64.tar.gz && pwd'
+ sh 'tar xvfz /tmp/helm-v3.12.3-linux-amd64.tar.gz'
+ sh 'mv linux-amd64/helm /usr/local/bin/helm'
}
+ stage('Stop SMO') {
+ sh './smo-install/scripts/sub-scripts/uninstall-nonrtric.sh'
+ sh './smo-install/scripts/sub-scripts/uninstall-onap.sh'
+ sh './smo-install/scripts/sub-scripts/uninstall-smo.sh'
+ }
+
}
- sh 'printenv'
- }
-
- stage('Setup tools') {
- sh 'apt-get update -y'
- sh 'DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata'
- sh 'apt-get install git wget sudo -y'
- sh 'wget https://dl.k8s.io/release/v1.22.0/bin/linux/amd64/kubectl'
- sh 'mv kubectl /usr/bin'
- sh 'chmod a+x /usr/bin/kubectl'
- sh 'kubectl version'
- }
- stage('Stop SMO') {
- sh './smo-install/scripts/sub-scripts/uninstall-nonrtric.sh'
- sh './smo-install/scripts/sub-scripts/uninstall-onap.sh'
- }
-
+
}
-
- }
+ }
}
kubectl create namespace tests
echo '### Installing ORAN Tests part ###'
-helm install --debug oran-tests-suite local/oran-tests-suite --namespace tests -f $1
+helm upgrade --install --debug oran-tests-suite local/oran-tests-suite --namespace tests -f $1
OVERRIDEYAML=$1
if ! command -v yq > /dev/null 2>&1; then
+ ARCH=$(case $(uname -m) in x86_64) echo "amd64";; aarch64) echo "arm64";; *) uname -m;; esac)
+ VERSION="v4.45.4"
echo "yq is not installed. Installing yq..."
- sudo snap install yq --channel=v4/stable
+ wget https://github.com/mikefarah/yq/releases/download/${VERSION}/yq_linux_${ARCH} -O /usr/local/bin/yq
+ chmod +x /usr/local/bin/yq
fi
MODE=$2
if [ "$MODE" == "dev" ]; then
echo "Installing NONRTRIC in dev mode"
- helm install --debug oran-nonrtric local/nonrtric --namespace nonrtric -f $OVERRIDEYAML --set nonrtric.persistence.mountPath="/dockerdata-nfs/deployment-$3" --set kong.kongpv.enabled=$kongPvEnabled
+ helm upgrade --install --debug oran-nonrtric local/nonrtric --namespace nonrtric -f $OVERRIDEYAML --set nonrtric.persistence.mountPath="/dockerdata-nfs/deployment-$3" --set kong.kongpv.enabled=$kongPvEnabled
else
echo "Installing NONRTRIC in release mode"
# This following should be modified once the charts are uploaded and available in the nexus repository
# helm repo add nonrtric https://nexus3.o-ran-sc.org/repository/smo-helm-snapshots/
# helm repo update
# helm install oran-nonrtric nonrtric/nonrtric --namespace nonrtric -f $OVERRIDEYAML --create-namespace
- helm install oran-nonrtric local/nonrtric --namespace nonrtric -f $OVERRIDEYAML --set nonrtric.persistence.mountPath="/dockerdata-nfs/deployment-$3" --set kong.kongpv.enabled=$kongPvEnabled
+ helm upgrade --install oran-nonrtric local/nonrtric --namespace nonrtric -f $OVERRIDEYAML --set nonrtric.persistence.mountPath="/dockerdata-nfs/deployment-$3" --set kong.kongpv.enabled=$kongPvEnabled
fi
echo "### Installing Strimzi Kafka Operator (Dev Mode) ###"
helm cm-push ../packages/strimzi-kafka-operator-helm-3-chart-0.45.0.tgz local
helm repo update
- helm install strimzi-kafka-operator local/strimzi-kafka-operator --namespace strimzi-system --version 0.45.0 --set watchAnyNamespace=true --create-namespace
+ helm upgrade --install strimzi-kafka-operator local/strimzi-kafka-operator --namespace strimzi-system --version 0.45.0 --set watchAnyNamespace=true --create-namespace
echo "Waiting for Strimzi Kafka Operator to be ready..."
kubectl wait --for=condition=available --timeout=600s deployment/strimzi-cluster-operator -n strimzi-system
helm repo add strimzi https://strimzi.io/charts/
helm repo update
- helm install strimzi-kafka-operator strimzi/strimzi-kafka-operator --namespace strimzi-system --version 0.45.0 --set watchAnyNamespace=true --create-namespace
+ helm upgrade --install strimzi-kafka-operator strimzi/strimzi-kafka-operator --namespace strimzi-system --version 0.45.0 --set watchAnyNamespace=true --create-namespace
echo "Waiting for Strimzi Kafka Operator to be ready..."
kubectl wait --for=condition=available --timeout=600s deployment/strimzi-cluster-operator -n strimzi-system
kubectl create namespace network
echo '### Installing ORAN SIMULATORS part ###'
-helm install --debug oran-simulator local/ru-du-simulators --namespace network -f $1 -f $2
+helm upgrade --install --debug oran-simulator local/ru-du-simulators --namespace network -f $1 -f $2
kubectl create namespace smo
if ! command -v yq > /dev/null 2>&1; then
+ ARCH=$(case $(uname -m) in x86_64) echo "amd64";; aarch64) echo "arm64";; *) uname -m;; esac)
+ VERSION="v4.45.4"
echo "yq is not installed. Installing yq..."
- sudo snap install yq --channel=v4/stable
+ wget https://github.com/mikefarah/yq/releases/download/${VERSION}/yq_linux_${ARCH} -O /usr/local/bin/yq
+ chmod +x /usr/local/bin/yq
fi
OVERRIDEYAML=$1
if [ "$MODE" == "dev" ]; then
echo "Installing SMO in dev mode"
- helm install --debug oran-smo local/smo --namespace smo -f $OVERRIDEYAML --timeout 15m
+ helm upgrade --install --debug oran-smo local/smo --namespace smo -f $OVERRIDEYAML --timeout 15m
else
echo "Installing SMO in release mode"
# This following should be modified once the charts are uploaded and available in the nexus repository
# Till then, we are using the local chart
# helm repo add smo https://nexus3.o-ran-sc.org/repository/smo-helm-snapshots/
# helm repo update
- # helm install oran-smo smo/smo --namespace nonrtric -f $OVERRIDEYAML --create-namespace
- helm install oran-smo local/smo --namespace smo -f $OVERRIDEYAML --timeout 15m
+ # helm upgrade --install oran-smo smo/smo --namespace nonrtric -f $OVERRIDEYAML --create-namespace
+ helm upgrade --install oran-smo local/smo --namespace smo -f $OVERRIDEYAML --timeout 15m
fi
check_for_secrets() {
# Configure service manager with the installed services
if ! command -v yq > /dev/null 2>&1; then
+ ARCH=$(case $(uname -m) in x86_64) echo "amd64";; aarch64) echo "arm64";; *) uname -m;; esac)
+ VERSION="v4.45.4"
echo "yq is not installed. Installing yq..."
- sudo snap install yq --channel=v4/stable
+ wget https://github.com/mikefarah/yq/releases/download/${VERSION}/yq_linux_${ARCH} -O /usr/local/bin/yq
+ chmod +x /usr/local/bin/yq
fi
OVERRIDEYAML=$1
kubectl create ns mariadb-operator
helm repo add mariadb-operator https://helm.mariadb.com/mariadb-operator
helm repo update
-helm install mariadb-operator-crds mariadb-operator/mariadb-operator-crds -n mariadb-operator
-helm install mariadb-operator mariadb-operator/mariadb-operator -n mariadb-operator
+helm upgrade --install mariadb-operator-crds mariadb-operator/mariadb-operator-crds -n mariadb-operator
+helm upgrade --install mariadb-operator mariadb-operator/mariadb-operator -n mariadb-operator
kubectl wait deployment mariadb-operator -n mariadb-operator --for=condition=available --timeout=120s
# K8s Volume creation as required
logger.info("Start the network slicing simulators")
cmd = "kubectl create namespace nssimulators"
check_output(cmd, shell=True).decode('utf-8')
- cmd = f"helm install --debug ns-simulators local/ns-simulators --namespace nssimulators"
+ cmd = f"helm upgrade --install --debug ns-simulators local/ns-simulators --namespace nssimulators"
check_output(cmd, shell=True).decode('utf-8')
def start_and_wait_ns_simulators(self):
logger.info("Start the network simulators")
cmd = "kubectl create namespace network"
check_output(cmd, shell=True).decode('utf-8')
- cmd = f"helm install --debug oran-simulator local/ru-du-simulators --namespace network -f {self.resources_path}/network-simulators-topology/network-simulators-override.yaml -f {self.resources_path}/network-simulators-topology/network-simulators-topology-override.yaml"
+ cmd = f"helm upgrade --install --debug oran-simulator local/ru-du-simulators --namespace network -f {self.resources_path}/network-simulators-topology/network-simulators-override.yaml -f {self.resources_path}/network-simulators-topology/network-simulators-topology-override.yaml"
check_output(cmd, shell=True).decode('utf-8')
def start_and_wait_network_simulators(self):
cmd = "kubectl create namespace test"
check_output(cmd, shell=True).decode('utf-8')
- cmd = "helm install test test/chartmuseum --version 3.1.0 --namespace test --set env.open.DISABLE_API=false"
+ cmd = "helm upgrade --install test test/chartmuseum --version 3.1.0 --namespace test --set env.open.DISABLE_API=false"
check_output(cmd, shell=True).decode('utf-8')
wait(lambda: is_chartmuseum_up(), sleep_seconds=10, timeout_seconds=60, waiting_for="chartmuseum to be ready")