string(defaultValue: '/home/jenkins/hive/port-mapping-etsi-vim.yaml',
description: 'Port mapping file for SDN assist in ETSI VIM',
name: 'ROBOT_PORT_MAPPING_VIM'),
+ string(defaultValue: '/home/jenkins/hive/etsi-vim-prometheus.json',
+ description: 'Prometheus configuration file in ETSI VIM',
+ name: 'PROMETHEUS_CONFIG_VIM'),
string(defaultValue: '/home/jenkins/hive/kubeconfig.yaml', description: '', name: 'KUBECONFIG'),
string(defaultValue: '/home/jenkins/hive/clouds.yaml', description: '', name: 'CLOUDS'),
string(defaultValue: 'Default', description: '', name: 'INSTALLER'),
// Helper Functions
////////////////////////////////////////////////////////////////////////////////////////
String execute_docker_run(String tagName, String osmHostname, String environmentFile,
- String portmappingfile, String kubeconfig, String clouds,
+ String portmappingfile, String prometheusconfigfile,
+ String kubeconfig, String clouds,
String entrypoint=null, String entrypointArgs="") {
try {
String entrypointCmd = entrypoint ? "--entrypoint ${entrypoint}" : ""
-v ${clouds}:/etc/openstack/clouds.yaml \
-v ${kubeconfig}:/root/.kube/config \
-v ${portmappingfile}:/root/port-mapping.yaml \
+ -v ${prometheusconfigfile}:/root/etsi-vim-prometheus.json \
opensourcemano/tests:${tagName} ${entrypointArgs}""")
return output
} catch (Exception e) {
String envfile=null,
String portmappingfile=null,
String kubeconfig=null,
- String clouds=null
+ String clouds=null,
+ String prometheusconfigfile=null
) {
String VIM_TARGET = "osm"
String VIM_MGMT_NET = "osm-ext"
String entrypointArgs = """vim-create --name ${VIM_TARGET} --user ${OS_USERNAME} \
--password ${OS_PASSWORD} --tenant ${OS_PROJECT_NAME} \
--auth_url ${OS_AUTH_URL} --account_type openstack --description vim \
+ --prometheus_config_file /root/etsi-vim-prometheus.json \
--config '{management_network_name: ${VIM_MGMT_NET}, dataplane_physical_net: physnet2}' || true"""
- String createOutput = execute_docker_run(tagName, osmHostname, environmentFile, portmappingfile, kubeconfig, clouds, entrypointCmd, entrypointArgs)
+ String createOutput = execute_docker_run(tagName, osmHostname, environmentFile, portmappingfile, prometheusconfigfile, kubeconfig, clouds, entrypointCmd, entrypointArgs)
println("VIM Creation Output: ${createOutput}")
}
while (statusChecks > 0) {
sleep(10) // Wait for 10 seconds before checking status
entrypointArgs = """vim-list --long | grep ${VIM_TARGET}"""
- String vimList = execute_docker_run(tagName, osmHostname, environmentFile, portmappingfile, kubeconfig, clouds, entrypointCmd, entrypointArgs)
+ String vimList = execute_docker_run(tagName, osmHostname, environmentFile, portmappingfile, prometheusconfigfile, kubeconfig, clouds, entrypointCmd, entrypointArgs)
println("VIM List output: ${vimList}")
if (vimList.contains("ENABLED")) {
println("VIM successfully registered and is ENABLED.")
// If stuck, delete and retry
println("VIM stuck for more than 50 seconds, deleting and retrying...")
entrypointArgs = """vim-delete --force ${VIM_TARGET}"""
- String deleteOutput = execute_docker_run(tagName, osmHostname, environmentFile, portmappingfile, kubeconfig, clouds, entrypointCmd, entrypointArgs)
+ String deleteOutput = execute_docker_run(tagName, osmHostname, environmentFile, portmappingfile, prometheusconfigfile, kubeconfig, clouds, entrypointCmd, entrypointArgs)
println("VIM Deletion Output: ${deleteOutput}")
sleep(5)
} catch (Exception e) {
String envfile=null,
String portmappingfile=null,
String kubeconfig=null,
- String clouds=null
+ String clouds=null,
+ String prometheusconfigfile=null
) {
String K8S_CLUSTER_TARGET = "osm"
String VIM_TARGET = "osm"
String entrypointArgs = """k8scluster-add ${K8S_CLUSTER_TARGET} --creds ${K8S_CREDENTIALS} --version "v1" \
--description "Robot-cluster" --skip-jujubundle --vim ${VIM_TARGET} \
--k8s-nets '{net1: ${VIM_MGMT_NET}}'"""
- String createOutput = execute_docker_run(tagName, osmHostname, environmentFile, portmappingfile, kubeconfig, clouds, entrypointCmd, entrypointArgs)
+ String createOutput = execute_docker_run(tagName, osmHostname, environmentFile, portmappingfile, prometheusconfigfile, kubeconfig, clouds, entrypointCmd, entrypointArgs)
println("K8s Cluster Addition Output: ${createOutput}")
// Check if the K8s cluster is ENABLED
while (statusChecks > 0) {
sleep(10) // Wait for 10 seconds before checking status
entrypointArgs = """k8scluster-list | grep ${K8S_CLUSTER_TARGET}"""
- String clusterList = execute_docker_run(tagName, osmHostname, environmentFile, portmappingfile, kubeconfig, clouds, entrypointCmd, entrypointArgs)
+ String clusterList = execute_docker_run(tagName, osmHostname, environmentFile, portmappingfile, prometheusconfigfile, kubeconfig, clouds, entrypointCmd, entrypointArgs)
println("K8s Cluster List Output: ${clusterList}")
if (clusterList.contains("ENABLED")) {
println("K8s cluster successfully registered and is ENABLED.")
// If stuck, delete and retry
println("K8s cluster stuck for more than 50 seconds, deleting and retrying...")
entrypointArgs = """k8scluster-show ${K8S_CLUSTER_TARGET}"""
- String showOutput = execute_docker_run(tagName, osmHostname, environmentFile, portmappingfile, kubeconfig, clouds, entrypointCmd, entrypointArgs)
+ String showOutput = execute_docker_run(tagName, osmHostname, environmentFile, portmappingfile, prometheusconfigfile, kubeconfig, clouds, entrypointCmd, entrypointArgs)
println("K8s Cluster Show Output: ${showOutput}")
entrypointArgs = """k8scluster-delete ${K8S_CLUSTER_TARGET}"""
- String deleteOutput = execute_docker_run(tagName, osmHostname, environmentFile, portmappingfile, kubeconfig, clouds, entrypointCmd, entrypointArgs)
+ String deleteOutput = execute_docker_run(tagName, osmHostname, environmentFile, portmappingfile, prometheusconfigfile, kubeconfig, clouds, entrypointCmd, entrypointArgs)
println("K8s Cluster Deletion Output: ${deleteOutput}")
sleep(5)
} catch (Exception e) {
params.ROBOT_VIM,
params.ROBOT_PORT_MAPPING_VIM,
params.KUBECONFIG,
- params.CLOUDS
+ params.CLOUDS,
+ params.PROMETHEUS_CONFIG_VIM
)
register_etsi_k8s_cluster(
containerName,
params.ROBOT_VIM,
params.ROBOT_PORT_MAPPING_VIM,
params.KUBECONFIG,
- params.CLOUDS
+ params.CLOUDS,
+ params.PROMETHEUS_CONFIG_VIM
)
run_robot_systest(
containerName,