Commit 4093a485 authored by Jaroslava Fiedlerova's avatar Jaroslava Fiedlerova

Merge remote-tracking branch 'origin/nu-ci-colosseum-integration' into integration_2024_w39

parents ccdabb4c 18a51529
#!/bin/groovy
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (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.openairinterface.org/?page_id=698
*
* 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.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
def node = "porcepix"
def resource = "CI-NEU-CI"
pipeline {
agent {
label node
}
options {
timestamps()
ansiColor('xterm')
timeout(time: 3, unit: 'HOURS')
}
stages {
stage ("Trigger NEU CI") {
steps {
lock (resource) {
script {
withCredentials([
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.ColosseumCredentials}", usernameVariable: 'col_username', passwordVariable: 'col_password'],
]) {
// use eNB target branch variable if eNB repository is empty
def git_Branch = ""
if (params.eNB_Branch.isEmpty()) {
echo 'eNB_Branch parameter is empty, using eNB_TargetBranch instead'
git_Branch = params.eNB_TargetBranch
} else {
git_Branch = params.eNB_Branch
}
// use default 10011 rf scenario if not specified
if (params.Colosseum_Rf_Scenario.isEmpty()) {
echo 'Colosseum_Rf_Scenario parameter is empty, defaulting to 10011'
rf_scenario = "10011"
} else {
rf_scenario = params.Colosseum_Rf_Scenario
}
sh "echo Testing reachability of Colosseum endpoint"
sh "ping -c 3 10.100.1.253"
sh "./ci-scripts/colosseum_scripts/launch-job.sh ${col_username} ${col_password} ${currentBuild.number} ${params.eNB_Repository} ${git_Branch} ${rf_scenario} ${env.JOB_URL}"
}
}
}
}
}
stage ("Wait for job to finish") {
steps {
lock (resource) {
script {
withCredentials([
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.ColosseumCredentials}", usernameVariable: 'col_username', passwordVariable: 'col_password'],
]) {
timeout (time: 2, unit: 'HOURS') {
sh "./ci-scripts/colosseum_scripts/wait-job-end.sh ${col_username} ${col_password}"
}
}
}
}
}
}
stage ("Get test results") {
steps {
lock (resource) {
script {
withCredentials([
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.ColosseumCredentials}", usernameVariable: 'col_username', passwordVariable: 'col_password'],
]) {
sh "./ci-scripts/colosseum_scripts/get-test-results.sh ${col_username} ${col_password}"
}
if(fileExists("results.tar.xz")) {
archiveArtifacts "results.tar.xz"
sh "mkdir -p results"
sh "tar -xf results.tar.xz -C results --strip-components=1"
if(fileExists("results/test_summary.html")) {
archiveArtifacts "results/test_summary.html"
}
// check if test passed
sh "./ci-scripts/colosseum_scripts/check-results.sh results/test_summary.html"
sh "rm -Rf ./results"
}
}
}
}
}
stage ("Set job status") {
steps {
lock (resource) {
script {
echo 'Set job status'
sh "./ci-scripts/colosseum_scripts/set-job-status.sh"
}
}
}
}
}
}
# Colosseum Automated Testing
These scripts are used by a Jenkins [job](../Jenkinsfile-colosseum) to trigger automated testing of OpenAirInterface (OAI) gNB and softUE on the [Colosseum](https://www.northeastern.edu/colosseum/) Open RAN digital twin.
Once a test is triggered, a new OAI LXC container at the specified OAI version will be built on Colosseum (if not already present), and gNB and softUE will perform TCP uplink and downlink connectivity test via the iPerf [tool](https://iperf.fr/).
The OAI branch to build and test can be specified through the `eNB_Branch` parameter passed through Jenkins (`eNB_TargetBranch`, which defaults to the `develop` branch, is used if `eNB_Branch` is not specified).
The Colosseum network scenario to test is specified through the `Colosseum_Rf_Scenario` Jenkins parameter, which defaults to a base Colosseum scenario without artificially added channel effects (e.g., only hardware impariments of software-defined radios, cables, and channel emulator).
Once the test ends, results are analyzed through the OAI automated test report generation tool available [here](https://github.com/ztouchnetworks/openairinterface-automated-test-reports), which builds a test report from the iPerf and OAI logs, and marks the test as successful or unsuccessful.
Results from successful tests are saved in history files and used to compare more recent tests.
A test is considered successful if the downlink throughput achieved during the test is greather than or equal to the average of the test history, which spans successful test executed since May 2024.
This is used to identify possible regressions of OAI runs executed on the Colosseum testbed.
#!/bin/bash
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (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.openairinterface.org/?page_id=698
# *
# * 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.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
set -x
RESULT_FILE=$1
grep -A 1 "Final Status" ${RESULT_FILE} | grep "PASS"
if [ "$?" = 0 ]; then
echo '{"status": "successful"}' > results.json
else
echo '{"status": "failed"}' > results.json
fi
#!/bin/bash
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (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.openairinterface.org/?page_id=698
# *
# * 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.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
set -eu
AWX_API_URL=https://10.100.1.253
AWX_JOB_EVENT_QUERY=job_events/?search=results_url
COL_USER=$1
COL_PASS=$2
AWX_API_JOB_PATH=$(jq -r '.url' launch.json)
# get result url and download test results
curl -s -f -k -u ${COL_USER}:${COL_PASS} -X GET ${AWX_API_URL}${AWX_API_JOB_PATH}${AWX_JOB_EVENT_QUERY} > result.json
set -x
RESULT=$(jq -r '.results[0].event_data.res.ansible_facts.results_url' result.json)
wget -q -O - ${RESULT} > results.tar.xz
#!/bin/bash
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (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.openairinterface.org/?page_id=698
# *
# * 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.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
set -eu
AWX_API_URL=https://10.100.1.253
AWX_JOB_ID=16
AWX_API_LAUNCH_PATH=/api/v2/job_templates/${AWX_JOB_ID}/launch/
COL_USER=$1
COL_PASS=$2
JENKINS_JOB_ID=$3
GIT_REPOSITORY=$4
GIT_BRANCH=$5
COLOSSEUM_RF_SCENARIO=$6
JENKINS_JOB_URL=$7
# assemble data to send
CURL_DATA=$(cat <<-END | jq -c .
{
"extra_vars":
{
"oai_repo": "${GIT_REPOSITORY}",
"oai_branch": "${GIT_BRANCH}",
"colosseum_rf_scenario": "${COLOSSEUM_RF_SCENARIO}",
"jenkins_job_id": "${JENKINS_JOB_ID}",
"jenkins_job_url": "${JENKINS_JOB_URL}"
}
}
END
)
# launch job
curl -s -f -k -u ${COL_USER}:${COL_PASS} -X POST -H "Content-Type: application/json" -d ${CURL_DATA} ${AWX_API_URL}${AWX_API_LAUNCH_PATH} > launch.json
#!/bin/bash
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (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.openairinterface.org/?page_id=698
# *
# * 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.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
set -eu
# sets final exit code and thus jenkins pass or fail
STATUS=$(jq -r '.status' results.json)
echo "job status: ${STATUS}"
[ "${STATUS}" = "successful" ]
#!/bin/bash
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (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.openairinterface.org/?page_id=698
# *
# * 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.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
set -xeu
AWX_API_URL=https://10.100.1.253
AWX_MAX_API_CHECKS=120
COL_USER=$1
COL_PASS=$2
AWX_API_JOB_PATH=$(jq -r '.url' launch.json)
# wait for job to complete
for ((try = 1; try <= ${AWX_MAX_API_CHECKS}; try++)); do
set +x
curl -s -f -k -u ${COL_USER}:${COL_PASS} -X GET ${AWX_API_URL}${AWX_API_JOB_PATH} > status.json
set -x
FINISHED=$(jq -r '.finished' status.json)
[ "${FINISHED}" = "null" ] || break
sleep 60
done
[ $try != $AWX_MAX_API_CHECKS ] || echo "WARNING: stopped retrying after $AWX_MAX_API_CHECKS times; timed out?"
echo "AWX job completed $FINISHED"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment