Commit d888df46 authored by Raphael Defosseux's avatar Raphael Defosseux

CI: lock mechanism around the VM usage

Signed-off-by: default avatarRaphael Defosseux <raphael.defosseux@eurecom.fr>
parent 562fd82f
...@@ -35,6 +35,9 @@ def doFlexranCtrlTest = false ...@@ -35,6 +35,9 @@ def doFlexranCtrlTest = false
// Location of the executor node // Location of the executor node
def nodeExecutor = params.nodeExecutor def nodeExecutor = params.nodeExecutor
// VM Lockable resources
def vmResource = params.vmLockableResource
pipeline { pipeline {
agent { agent {
label nodeExecutor label nodeExecutor
...@@ -159,65 +162,81 @@ pipeline { ...@@ -159,65 +162,81 @@ pipeline {
stage ("Start VM -- basic-sim") { stage ("Start VM -- basic-sim") {
steps { steps {
lock (vmResource) {
timeout (time: 5, unit: 'MINUTES') { timeout (time: 5, unit: 'MINUTES') {
sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant basic-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon" sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant basic-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon"
} }
}
} }
} }
stage ("Start VM -- gnb-usrp") { stage ("Start VM -- gnb-usrp") {
steps { steps {
lock (vmResource) {
timeout (time: 5, unit: 'MINUTES') { timeout (time: 5, unit: 'MINUTES') {
sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant gnb-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon" sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant gnb-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon"
} }
}
} }
} }
stage ("Start VM -- nr-ue-usrp") { stage ("Start VM -- nr-ue-usrp") {
steps { steps {
lock (vmResource) {
timeout (time: 5, unit: 'MINUTES') { timeout (time: 5, unit: 'MINUTES') {
sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant nr-ue-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon" sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant nr-ue-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon"
} }
}
} }
} }
stage ("Start VM -- enb-usrp") { stage ("Start VM -- enb-usrp") {
steps { steps {
lock (vmResource) {
timeout (time: 5, unit: 'MINUTES') { timeout (time: 5, unit: 'MINUTES') {
sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant enb-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon" sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant enb-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon"
} }
}
} }
} }
stage ("Start VM -- phy-sim") { stage ("Start VM -- phy-sim") {
steps { steps {
lock (vmResource) {
timeout (time: 5, unit: 'MINUTES') { timeout (time: 5, unit: 'MINUTES') {
sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant phy-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon" sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant phy-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon"
} }
}
} }
} }
stage ("Start VM -- enb-ethernet") { stage ("Start VM -- enb-ethernet") {
steps { steps {
lock (vmResource) {
timeout (time: 7, unit: 'MINUTES') { timeout (time: 7, unit: 'MINUTES') {
sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant enb-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon" sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant enb-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon"
} }
}
} }
} }
stage ("Start VM -- ue-ethernet") { stage ("Start VM -- ue-ethernet") {
steps { steps {
lock (vmResource) {
timeout (time: 7, unit: 'MINUTES') { timeout (time: 7, unit: 'MINUTES') {
sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant ue-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon" sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant ue-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon"
} }
}
} }
} }
stage ("Start VM -- cppcheck") { stage ("Start VM -- cppcheck") {
steps { steps {
lock (vmResource) {
timeout (time: 7, unit: 'MINUTES') { timeout (time: 7, unit: 'MINUTES') {
sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant cppcheck --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon" sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant cppcheck --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon"
} }
}
} }
} }
...@@ -288,11 +307,14 @@ pipeline { ...@@ -288,11 +307,14 @@ pipeline {
} }
stage ("Build UE-ethernet") { stage ("Build UE-ethernet") {
steps { steps {
// This is typically the last one to finish.
lock (vmResource) {
gitlabCommitStatus(name: "Build UE-ethernet") { gitlabCommitStatus(name: "Build UE-ethernet") {
timeout (time: 20, unit: 'MINUTES') { timeout (time: 20, unit: 'MINUTES') {
sh "./ci-scripts/oai-ci-vm-tool wait --workspace $WORKSPACE --variant ue-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive" sh "./ci-scripts/oai-ci-vm-tool wait --workspace $WORKSPACE --variant ue-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
} }
} }
}
} }
} }
} }
...@@ -354,6 +376,7 @@ pipeline { ...@@ -354,6 +376,7 @@ pipeline {
stages { stages {
stage ("Test physical simulators") { stage ("Test physical simulators") {
steps { steps {
lock (vmResource) {
script { script {
timeout (time: 90, unit: 'MINUTES') { timeout (time: 90, unit: 'MINUTES') {
try { try {
...@@ -365,6 +388,7 @@ pipeline { ...@@ -365,6 +388,7 @@ pipeline {
} }
} }
} }
}
} }
} }
stage ("Build Flexran Controller") { stage ("Build Flexran Controller") {
...@@ -372,6 +396,7 @@ pipeline { ...@@ -372,6 +396,7 @@ pipeline {
expression {doFlexranCtrlTest} expression {doFlexranCtrlTest}
} }
steps { steps {
lock (vmResource) {
script { script {
timeout (time: 20, unit: 'MINUTES') { timeout (time: 20, unit: 'MINUTES') {
try { try {
...@@ -381,10 +406,12 @@ pipeline { ...@@ -381,10 +406,12 @@ pipeline {
} }
} }
} }
}
} }
} }
stage ("Test basic simulator") { stage ("Test basic simulator") {
steps { steps {
lock (vmResource) {
script { script {
timeout (time: 30, unit: 'MINUTES') { timeout (time: 30, unit: 'MINUTES') {
try { try {
...@@ -396,10 +423,12 @@ pipeline { ...@@ -396,10 +423,12 @@ pipeline {
} }
} }
} }
}
} }
} }
stage ("Test L1 simulator") { stage ("Test L1 simulator") {
steps { steps {
lock (vmResource) {
script { script {
timeout (time: 30, unit: 'MINUTES') { timeout (time: 30, unit: 'MINUTES') {
try { try {
...@@ -411,10 +440,12 @@ pipeline { ...@@ -411,10 +440,12 @@ pipeline {
} }
} }
} }
}
} }
} }
stage ("Test RF simulator") { stage ("Test RF simulator") {
steps { steps {
lock (vmResource) {
script { script {
timeout (time: 40, unit: 'MINUTES') { timeout (time: 40, unit: 'MINUTES') {
try { try {
...@@ -426,10 +457,12 @@ pipeline { ...@@ -426,10 +457,12 @@ pipeline {
} }
} }
} }
}
} }
} }
stage ("Test L2 simulator") { stage ("Test L2 simulator") {
steps { steps {
lock (vmResource) {
script { script {
timeout (time: 30, unit: 'MINUTES') { timeout (time: 30, unit: 'MINUTES') {
try { try {
...@@ -441,11 +474,14 @@ pipeline { ...@@ -441,11 +474,14 @@ pipeline {
} }
} }
} }
}
} }
} }
stage ("Destroy all Virtual Machines") { stage ("Destroy all Virtual Machines") {
steps { steps {
lock (vmResource) {
sh "./ci-scripts/oai-ci-vm-tool destroy --job-name ${JOB_NAME} --build-id ${BUILD_ID}" sh "./ci-scripts/oai-ci-vm-tool destroy --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
}
} }
} }
} }
......
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