Add cookied-cicd models for openstack configs: ovs/dvr/dpdk
Change-Id: If9e72928b90bb13fd51199c93f9255ec52576bc4
diff --git a/tcp_tests/templates/cookied-cicd-k8s-calico/cookiecutter-context-k8s.yaml b/tcp_tests/templates/cookied-cicd-k8s-calico/cookiecutter-context-k8s.yaml
index 693a589..45a0d80 100644
--- a/tcp_tests/templates/cookied-cicd-k8s-calico/cookiecutter-context-k8s.yaml
+++ b/tcp_tests/templates/cookied-cicd-k8s-calico/cookiecutter-context-k8s.yaml
@@ -1,4 +1,5 @@
default_context:
+ auditd_enabled: 'False'
backup_private_key: |-
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEA3ufjR+Eh/CJp84JZPKosMNL7ydXidfe9qdAnQIGGOsS/TBnc
@@ -109,12 +110,11 @@
internal_proxy_enabled: 'False'
kqueen_custom_mail_enabled: 'False'
kqueen_enabled: 'False'
- kubernetes_compute_node01_address: 10.167.4.101
- kubernetes_compute_node01_deploy_address: 10.167.5.101
- kubernetes_compute_node01_hostname: cmp01
- kubernetes_compute_node02_address: 10.167.4.102
- kubernetes_compute_node02_deploy_address: 10.167.5.102
- kubernetes_compute_node02_hostname: cmp02
+ kubernetes_compute_count: 2
+ kubernetes_compute_rack01_deploy_subnet: 10.167.5
+ kubernetes_compute_rack01_single_subnet: 10.167.4
+ kubernetes_compute_rack01_tenant_subnet: 10.167.6
+ kubernetes_compute_rack01_hostname: cmp
kubernetes_control_address: 10.167.4.10
kubernetes_control_node01_address: 10.167.4.11
kubernetes_control_node01_deploy_address: 10.167.5.11
@@ -132,6 +132,10 @@
kubernetes_virtlet_enabled: 'False'
local_repositories: 'False'
maas_deploy_address: 10.167.5.15
+ maas_deploy_range_end: 10.167.5.199
+ maas_deploy_range_start: 10.167.5.180
+ maas_deploy_vlan: '0'
+ maas_fabric_name: deploy-fabric0
maas_hostname: cfg01
mcp_common_scripts_branch: ''
mcp_version: proposed
@@ -153,7 +157,7 @@
salt_master_address: 10.167.4.15
salt_master_hostname: cfg01
salt_master_management_address: 10.167.5.15
- shared_reclass_branch: ''
+ shared_reclass_branch: 'proposed'
shared_reclass_url: https://gerrit.mcp.mirantis.net/salt-models/reclass-system.git
stacklight_enabled: 'False'
stacklight_version: '2'
diff --git a/tcp_tests/templates/cookied-cicd-k8s-calico/deploy-and-test.groovy b/tcp_tests/templates/cookied-cicd-k8s-calico/deploy-and-test.groovy
index 18a0c2c..2d691fb 100644
--- a/tcp_tests/templates/cookied-cicd-k8s-calico/deploy-and-test.groovy
+++ b/tcp_tests/templates/cookied-cicd-k8s-calico/deploy-and-test.groovy
@@ -1,85 +1,17 @@
+@Library('tcp-qa')_
+
common = new com.mirantis.mk.Common()
-
-def run_cmd(cmd, returnStdout=false) {
- common.printMsg("Run shell command:\n" + cmd, "blue")
- def VENV_PATH='/home/jenkins/fuel-devops30'
- script = "set +x; echo 'activate python virtualenv ${VENV_PATH}';. ${VENV_PATH}/bin/activate; bash -c 'set -ex;set -ex;${cmd.stripIndent()}'"
- return sh(script: script, returnStdout: returnStdout)
-}
-
-def run_cmd_stdout(cmd) {
- return run_cmd(cmd, true)
-}
+shared = new com.mirantis.system_qa.SharedPipeline()
node ("${NODE_NAME}") {
try {
- stage("Clean the environment") {
- println "Clean the working directory ${env.WORKSPACE}"
- deleteDir()
- // do not fail if environment doesn't exists
- println "Remove environment ${ENV_NAME}"
- run_cmd("""\
- dos.py erase ${ENV_NAME} || true
- """)
- println "Remove config drive ISO"
- run_cmd("""\
- rm /home/jenkins/images/${CFG01_CONFIG_IMAGE_NAME} || true
- """)
+ stage("Clean the environment and clone tcp-qa") {
+ shared.prepare_working_dir()
}
- stage("Clone tcp-qa project and install requirements") {
- run_cmd("""\
- git clone https://github.com/Mirantis/tcp-qa.git ${env.WORKSPACE}
- #cd tcp-qa
- if [ -n "$TCP_QA_REFS" ]; then
- set -e
- git fetch https://review.gerrithub.io/Mirantis/tcp-qa $TCP_QA_REFS && git checkout FETCH_HEAD || exit \$?
- fi
- pip install --upgrade --upgrade-strategy=only-if-needed -r tcp_tests/requirements.txt
- """)
- }
-
- // load shared methods from the clonned tcp-qa repository.
- // DO NOT MOVE this code before clonning the repo
- def rootDir = pwd()
- def shared = load "${rootDir}/tcp_tests/templates/SharedPipeline.groovy"
-
- stage("Create an environment ${ENV_NAME} in disabled state") {
- // do not fail if environment doesn't exists
- run_cmd("""\
- python ./tcp_tests/utils/create_devops_env.py
- """)
- }
-
- stage("Generate the model") {
- shared.generate_cookied_model()
- }
-
- stage("Generate config drive ISO") {
- shared.generate_configdrive_iso()
- }
-
- stage("Upload generated config drive ISO into volume on cfg01 node") {
- run_cmd("""\
- virsh vol-upload ${ENV_NAME}_cfg01.${LAB_CONFIG_NAME}.local_config /home/jenkins/images/${CFG01_CONFIG_IMAGE_NAME} --pool default
- virsh pool-refresh --pool default
- """)
- }
-
- stage("Run the 'underlay' and 'salt-deployed' fixtures to bootstrap salt cluster") {
- run_cmd("""\
- export MANAGER=devops
- export SHUTDOWN_ENV_ON_TEARDOWN=false
- export BOOTSTRAP_TIMEOUT=900
- export PYTHONIOENCODING=UTF-8
- export REPOSITORY_SUITE=${MCP_VERSION}
- #export SALT_STEPS_PATH=templates/${LAB_CONFIG_NAME}/salt.yaml
- export TEST_GROUP=test_install_local_salt
- py.test -vvv -s -p no:django -p no:ipdb --junit-xml=nosetests.xml -k \${TEST_GROUP}
- sleep 60 # wait for jenkins to start and IO calm down
-
- """)
+ stage("Create environment, generate mode, bootstrap the salt-cluster") {
+ shared.swarm_bootstrap_salt_cluster_devops()
}
// Install core and cicd
@@ -92,14 +24,14 @@
}
// Install the cluster
- for (stack in "${STACK_INSTALL}".split(",")) {
+ for (stack in "${PLATFORM_STACK_INSTALL}".split(",")) {
stage("Run Jenkins job on CICD [deploy_openstack:${stack}]") {
shared.run_job_on_cicd_nodes(stack)
}
}
stage("Run tests") {
- run_cmd("""\
+ shared.run_cmd("""\
export ENV_NAME=${ENV_NAME}
. ./tcp_tests/utils/env_salt
. ./tcp_tests/utils/env_k8s
@@ -127,7 +59,7 @@
} finally {
// TODO(ddmitriev): analyze the "def currentResult = currentBuild.result ?: 'SUCCESS'"
// and report appropriate data to TestRail
- run_cmd("""\
+ shared.run_cmd("""\
dos.py destroy ${ENV_NAME}
""")
}
diff --git a/tcp_tests/templates/cookied-cicd-k8s-calico/environment-context-k8s.yaml b/tcp_tests/templates/cookied-cicd-k8s-calico/environment-context-k8s.yaml
index 44c773f..66d7cec 100644
--- a/tcp_tests/templates/cookied-cicd-k8s-calico/environment-context-k8s.yaml
+++ b/tcp_tests/templates/cookied-cicd-k8s-calico/environment-context-k8s.yaml
@@ -109,8 +109,9 @@
ens4:
role: single_ctl
- cmp01:
- reclass_storage_name: kubernetes_compute_node01
+ # Generator-based computes. For compatibility only
+ cmp<<count>>:
+ reclass_storage_name: kubernetes_compute_rack01
roles:
- kubernetes_compute
- linux_system_codename_xenial
@@ -120,17 +121,3 @@
role: single_dhcp
ens4:
role: single_ctl
- single_address: ${_param:kubernetes_compute_node01_address}
-
- cmp02:
- reclass_storage_name: kubernetes_compute_node02
- roles:
- - kubernetes_compute
- - linux_system_codename_xenial
- - salt_master_host
- interfaces:
- ens3:
- role: single_dhcp
- ens4:
- role: single_ctl
- single_address: ${_param:kubernetes_compute_node02_address}
diff --git a/tcp_tests/templates/cookied-cicd-k8s-calico/salt.yaml b/tcp_tests/templates/cookied-cicd-k8s-calico/salt.yaml
index 1d51907..a7994a8 100644
--- a/tcp_tests/templates/cookied-cicd-k8s-calico/salt.yaml
+++ b/tcp_tests/templates/cookied-cicd-k8s-calico/salt.yaml
@@ -7,12 +7,6 @@
{% import 'shared-salt.yaml' as SHARED with context %}
-- description: Workaround, configure ntp and rsyslog on salt master node
- cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@salt:master' state.sls ntp,rsyslog
- node_name: {{ HOSTNAME_CFG01 }}
- retry: {count: 1, delay: 10}
- skip_fail: false
-
{{ SHARED.MACRO_INSTALL_SALT_MINIONS() }}
{{SHARED.MACRO_CHECK_SALT_VERSION_SERVICES_ON_CFG()}}
diff --git a/tcp_tests/templates/cookied-cicd-k8s-calico/underlay.yaml b/tcp_tests/templates/cookied-cicd-k8s-calico/underlay.yaml
index 921be9b..6168b6e 100644
--- a/tcp_tests/templates/cookied-cicd-k8s-calico/underlay.yaml
+++ b/tcp_tests/templates/cookied-cicd-k8s-calico/underlay.yaml
@@ -11,8 +11,8 @@
{% set HOSTNAME_CTL01 = os_env('HOSTNAME_CTL01', 'ctl01.' + DOMAIN_NAME) %}
{% set HOSTNAME_CTL02 = os_env('HOSTNAME_CTL02', 'ctl02.' + DOMAIN_NAME) %}
{% set HOSTNAME_CTL03 = os_env('HOSTNAME_CTL03', 'ctl03.' + DOMAIN_NAME) %}
-{% set HOSTNAME_CMP01 = os_env('HOSTNAME_CMP01', 'cmp01.' + DOMAIN_NAME) %}
-{% set HOSTNAME_CMP02 = os_env('HOSTNAME_CMP02', 'cmp02.' + DOMAIN_NAME) %}
+{% set HOSTNAME_CMP01 = os_env('HOSTNAME_CMP01', 'cmp001.' + DOMAIN_NAME) %}
+{% set HOSTNAME_CMP02 = os_env('HOSTNAME_CMP02', 'cmp002.' + DOMAIN_NAME) %}
{% set HOSTNAME_LOG01 = os_env('HOSTNAME_LOG01', 'log01.' + DOMAIN_NAME) %}
{% set HOSTNAME_LOG02 = os_env('HOSTNAME_LOG02', 'log02.' + DOMAIN_NAME) %}
{% set HOSTNAME_LOG03 = os_env('HOSTNAME_LOG03', 'log03.' + DOMAIN_NAME) %}