diff options
Diffstat (limited to 'mcp/config')
-rw-r--r-- | mcp/config/scenario/defaults.yaml.j2 | 117 | ||||
-rwxr-xr-x | mcp/config/states/akraino_iec | 18 | ||||
-rwxr-xr-x | mcp/config/states/virtual_init | 6 |
3 files changed, 96 insertions, 45 deletions
diff --git a/mcp/config/scenario/defaults.yaml.j2 b/mcp/config/scenario/defaults.yaml.j2 index 3ea639bc3..5a9b4fd80 100644 --- a/mcp/config/scenario/defaults.yaml.j2 +++ b/mcp/config/scenario/defaults.yaml.j2 @@ -8,7 +8,6 @@ {%- import 'net_map.j2' as nm with context %} --- x86_64: - base_image: https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img default: disks: 100G # ';'-separated list of disk drives to create vcpus: 4 @@ -23,47 +22,87 @@ x86_64: - virtual_control_plane {%- endif %} {%- endif %} - common: - apt: - keys: - - https://repo.saltstack.com/apt/ubuntu/16.04/amd64/2017.7/SALTSTACK-GPG-KEY.pub - repos: - # <repo name> <repo prio> deb [arch=<arch>] <repo url> <repo dist> <repo comp> - - saltstack 500 deb [arch=amd64] http://repo.saltstack.com/apt/ubuntu/16.04/amd64/2017.7 xenial main - pkg: - install: - - linux-generic-hwe-16.04 - - salt-minion - control: - apt: ~ - pkg: - install: - - cloud-init + ubuntu1604: + base_image: https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img + common: + repo: + keys: + - https://repo.saltstack.com/apt/ubuntu/16.04/amd64/2017.7/SALTSTACK-GPG-KEY.pub + repos: + # <repo name> <repo prio> deb [arch=<arch>] <repo url> <repo dist> <repo comp> + - saltstack 500 deb [arch=amd64] http://repo.saltstack.com/apt/ubuntu/16.04/amd64/2017.7 xenial main + pkg: + install: + - linux-generic-hwe-16.04 + - salt-minion + control: + repo: ~ + pkg: + install: + - cloud-init + centos7: + base_image: https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2 + common: + repo: + keys: + - https://repo.saltstack.com/yum/redhat/$releasever/x86_64/2017.7/SALTSTACK-GPG-KEY.pub + repos: + # <repo name> <repo prio> rpm <repo url> + - saltstack 0 rpm https://repo.saltstack.com/yum/redhat/$releasever/x86_64/2017.7 + pkg: + install: + - salt-minion + - epel-release + control: + repo: ~ + pkg: + install: + - cloud-init aarch64: - base_image: https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-arm64-uefi1.img default: disks: 100G # ';'-separated list of disk drives to create vcpus: 6 ram: 4096 cluster: *arch_default_cluster_states - common: - apt: - keys: - - https://linux.enea.com/mcp-repos/rocky/xenial/archive-mcprocky.key - - https://repo.saltstack.com/apt/ubuntu/16.04/amd64/2017.7/SALTSTACK-GPG-KEY.pub - repos: - # <repo name> <repo prio> deb [arch=<arch>] <repo url> <repo dist> <repo comp> - - saltstack 500 deb [arch=amd64] http://repo.saltstack.com/apt/ubuntu/16.04/amd64/2017.7 xenial main - - armband_3 1201 deb [arch=arm64] http://linux.enea.com/mcp-repos/rocky/xenial rocky-armband main - pkg: - install: -{%- if '-iec-' in conf.MCP_DEPLOY_SCENARIO %} - - linux-generic-hwe-16.04 -{%- endif %} - - python-futures - - salt-minion - control: - apt: ~ - pkg: - install: - - cloud-init + ubuntu1604: + base_image: https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-arm64-uefi1.img + common: + apt: + keys: + - https://linux.enea.com/mcp-repos/rocky/xenial/archive-mcprocky.key + - https://repo.saltstack.com/apt/ubuntu/16.04/amd64/2017.7/SALTSTACK-GPG-KEY.pub + repos: + # <repo name> <repo prio> deb [arch=<arch>] <repo url> <repo dist> <repo comp> + - saltstack 500 deb [arch=amd64] http://repo.saltstack.com/apt/ubuntu/16.04/amd64/2017.7 xenial main + - armband_3 1201 deb [arch=arm64] http://linux.enea.com/mcp-repos/rocky/xenial rocky-armband main + pkg: + install: + {%- if '-iec-' in conf.MCP_DEPLOY_SCENARIO %} + - linux-generic-hwe-16.04 + {%- endif %} + - python-futures + - salt-minion + control: + apt: ~ + pkg: + install: + - cloud-init + centos7: + base_image: https://cloud.centos.org/altarch/7/images/aarch64/CentOS-7-aarch64-GenericCloud.qcow2.xz + common: + repo: + keys: + - https://repo.saltstack.com/yum/redhat/$releasever/x86_64/2017.7/SALTSTACK-GPG-KEY.pub + repos: + # <repo name> <repo prio> rpm <repo url> + - openstack-rocky 0 rpm http://mirror.centos.org/altarch/$releasever/cloud/aarch64/openstack-rocky + - saltstack 0 rpm https://repo.saltstack.com/yum/redhat/$releasever/x86_64/2017.7 + pkg: + install: + - salt-minion + - epel-release + control: + repo: ~ + pkg: + install: + - cloud-init diff --git a/mcp/config/states/akraino_iec b/mcp/config/states/akraino_iec index 4e30ca582..e61ca9451 100755 --- a/mcp/config/states/akraino_iec +++ b/mcp/config/states/akraino_iec @@ -1,4 +1,5 @@ #!/bin/bash -e +# shellcheck disable=SC1090 ############################################################################## # Copyright (c) 2019 Mirantis Inc., Enea AB and others. # All rights reserved. This program and the accompanying materials @@ -9,18 +10,25 @@ CI_DEBUG=${CI_DEBUG:-0}; [[ "${CI_DEBUG}" =~ (false|0) ]] || set -x -# shellcheck disable=SC1090 source "$(dirname "${BASH_SOURCE[0]}")/../../scripts/lib.sh" +source "$(dirname "${BASH_SOURCE[0]}")/../../scripts/xdf_data.sh" IEC_REPO_URI='https://gerrit.akraino.org/r/iec' -IEC_USER='ubuntu' -# shellcheck disable=SC2016 -IEC_REPO_PATH=$(su - "${IEC_USER}" -c 'echo ${HOME}/iec') +IEC_USER_L='ubuntu' +# shellcheck disable=SC2154 +if [[ "${base_image}" =~ centos ]]; then + IEC_USER='centos' +else + IEC_USER=${IEC_USER_L} +fi +IEC_REPO_PATH=/var/lib/akraino/iec IEC_SCRIPTS_PATH="${IEC_REPO_PATH}/src/foundation/scripts" POD_NETWORK_CIDR='100.100.0.0/16' # Avoid overlapping Fuel's PXE/admin net -[ -e "${IEC_REPO_PATH}" ] || su - "${IEC_USER}" -c \ +# shellcheck disable=SC2174 +mkdir -p -m 777 "$(dirname ${IEC_REPO_PATH})" +[ -e "${IEC_REPO_PATH}" ] || su - "${IEC_USER_L}" -c \ "git clone '${IEC_REPO_URI}' '${IEC_REPO_PATH}'" # shellcheck disable=SC2086 wait_for 3.0 "! salt-cp 'iec*' -C '${IEC_REPO_PATH}/' \ diff --git a/mcp/config/states/virtual_init b/mcp/config/states/virtual_init index 38a141a3e..77f4f5494 100755 --- a/mcp/config/states/virtual_init +++ b/mcp/config/states/virtual_init @@ -31,7 +31,11 @@ wait_for 3.0 "(for n in ${LOCAL_VIRT_NODES}; do salt -C \${n}.* test.ping || exi wait_for 3.0 "salt -C 'E@^(${NODE_MASK}).*' saltutil.sync_all" [[ ! "${NODE_MASK}" =~ mas01 ]] || exit 0 -wait_for 3.0 "salt -C 'E@^(${NODE_MASK}).*' state.sls linux" +if [[ "${base_image}" =~ centos ]]; then + # CentOS uses an older kernel, skip non-existing sysctl options + EXCLUDE_IDS="exclude='[{id: linux_kernel_net.core.netdev_budget_usecs}]'" +fi +wait_for 3.0 "salt -C 'E@^(${NODE_MASK}).*' state.sls linux ${EXCLUDE_IDS}" salt -C "E@^(${NODE_MASK}).*" cmd.run 'reboot' wait_for 90.0 "salt -C 'E@^(${NODE_MASK}).*' test.ping" |