X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=ci%2Fdeploy.sh;h=0e789e8c1cc44701fd7343ce7f5b84a04401868d;hb=ac7fd699468ad9a02b250e5ef890aff8a03ce1bf;hp=4b6b916acf0277ffe2ec03bed7cab7272f29842b;hpb=beab14192ba234803bf2032af6cf190dfa6b25a8;p=fuel.git diff --git a/ci/deploy.sh b/ci/deploy.sh index 4b6b916ac..0e789e8c1 100755 --- a/ci/deploy.sh +++ b/ci/deploy.sh @@ -32,7 +32,7 @@ usage () { cat << EOF xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -$(notify "$(basename "$0"): Deploy the Fuel@OPNFV MCP stack" 3) +$(notify "$(basename "$0"): Deploy the OPNFV Fuel MCP stack" 3) $(notify "USAGE:" 2) $(basename "$0") -l lab-name -p pod-name -s deploy-scenario \\ @@ -59,9 +59,9 @@ $(notify "OPTIONS:" 2) -N Experimental: Do not virtualize control plane (novcp) $(notify_i "Description:" 2) -Deploys the Fuel@OPNFV stack on the indicated lab resource. +Deploys the OPNFV Fuel stack on the indicated lab resource. -This script provides the Fuel@OPNFV deployment abstraction. +This script provides the OPNFV Fuel deployment abstraction. It depends on the OPNFV official configuration directory/file structure and provides a fairly simple mechanism to execute a deployment. @@ -74,8 +74,6 @@ $(notify_i "Input parameters to the build script are:" 2) /labs//idf-.yaml The default is using the git submodule tracking 'OPNFV Pharos' in <./mcp/scripts/pharos>. - An example config is provided inside current repo in - <./mcp/config>, automatically linked as <./mcp/scripts/pharos/labs/local>. -d Dry-run - Produce deploy config files, but do not execute deploy -D Debug logging - Enable extra logging in sh deploy scripts (set -x) -e Do not launch environment deployment @@ -92,10 +90,7 @@ $(notify_i "Input parameters to the build script are:" 2) -h Print this message and exit -L Deployment log path and name, eg. -L /home/jenkins/job.log.tar.gz -l Lab name as defined in the configuration directory, e.g. lf - For the sample configuration in <./mcp/config>, lab name is 'local'. -p POD name as defined in the configuration directory, e.g. pod2 - For the sample configuration in <./mcp/config>, POD name is 'virtual1' - for virtual deployments or 'pod1' for baremetal (based on lf-pod2). -m Use single socket compute nodes. Instead of using default NUMA-enabled topology for virtual compute nodes created via libvirt, configure a single guest CPU socket. @@ -136,6 +131,8 @@ DEPLOY_DIR=$(cd "${MCP_REPO_ROOT_PATH}/mcp/scripts"; pwd) MCP_STORAGE_DIR='/var/lib/opnfv/tmpdir' URI_REGEXP='(file|https?|ftp)://.*' BASE_CONFIG_URI="file://${MCP_REPO_ROOT_PATH}/mcp/scripts/pharos" +OPNFV_BRANCH=$(sed -ne 's/defaultbranch=//p' "${MCP_REPO_ROOT_PATH}/.gitreview") +DEF_DOCKER_TAG=$(basename "${OPNFV_BRANCH/master/latest}") # Customize deploy workflow DRY_RUN=${DRY_RUN:-0} @@ -144,12 +141,14 @@ USE_EXISTING_INFRA=${USE_EXISTING_INFRA:-0} NO_DEPLOY_ENVIRONMENT=${NO_DEPLOY_ENVIRONMENT:-0} ERASE_ENV=${ERASE_ENV:-0} MCP_VCP=${MCP_VCP:-1} -MCP_DOCKER_TAG=${MCP_DOCKER_TAG:-latest} +MCP_DOCKER_TAG=${MCP_DOCKER_TAG:-${DEF_DOCKER_TAG}} MCP_CMP_SS=${MCP_CMP_SS:-0} source "${DEPLOY_DIR}/globals.sh" source "${DEPLOY_DIR}/lib.sh" source "${DEPLOY_DIR}/lib_template.sh" +source "${DEPLOY_DIR}/lib_jump_common.sh" +source "${DEPLOY_DIR}/lib_jump_deploy.sh" # # END of variables to customize @@ -246,7 +245,7 @@ pushd "${DEPLOY_DIR}" > /dev/null # Install required packages on jump server sudo mkdir -p "${MCP_STORAGE_DIR}" -sudo chown "${USER}:${USER}" "${MCP_STORAGE_DIR}" +sudo chown -R "${USER}:${USER}" "${MCP_STORAGE_DIR}" if [ ${USE_EXISTING_PKGS} -eq 1 ]; then notify "[NOTE] Skipping distro pkg installation" 2 else @@ -256,7 +255,7 @@ else virtinst_install "${MCP_STORAGE_DIR}" fi -if ! virsh list >/dev/null 2>&1; then +if ! ${VIRSH} list >/dev/null 2>&1; then notify_e "[ERROR] This script requires hypervisor access" fi @@ -277,10 +276,10 @@ fi generate_ssh_key export MAAS_SSH_KEY="$(cat "$(basename "${SSH_KEY}").pub")" -MCP_DPDK_MODE=$([[ "$DEPLOY_SCENARIO" =~ ovs ]] && echo 1 || echo 0) # Expand jinja2 templates based on PDF data and env vars -export MCP_REPO_ROOT_PATH MCP_VCP MCP_DPDK_MODE MCP_STORAGE_DIR MCP_DOCKER_TAG \ - MCP_CMP_SS MCP_JUMP_ARCH=$(uname -i) +[[ "${DEPLOY_SCENARIO}" =~ -ha$ ]] || MCP_VCP=0 +export MCP_REPO_ROOT_PATH MCP_VCP MCP_STORAGE_DIR MCP_DOCKER_TAG MCP_CMP_SS \ + MCP_JUMP_ARCH=$(uname -i) MCP_DEPLOY_SCENARIO="${DEPLOY_SCENARIO}" do_templates_scenario "${MCP_STORAGE_DIR}" "${TARGET_LAB}" "${TARGET_POD}" \ "${BASE_CONFIG_URI}" "${SCENARIO_DIR}" \ "${SCENARIO_DIR}/${DEPLOY_SCENARIO}.yaml" @@ -309,6 +308,7 @@ else do_sysctl_cfg do_udev_cfg create_vms "${MCP_STORAGE_DIR}" "${virtual_nodes_data}" "${OPNFV_BRIDGES[@]}" + update_mcpcontrol_network start_vms "${virtual_nodes[@]}" # https://github.com/docker/libnetwork/issues/1743 @@ -337,9 +337,9 @@ else reset_vms "${virtual_nodes[@]}" fi done -fi -./log.sh "${DEPLOY_LOG}" + ./log.sh "${DEPLOY_LOG}" +fi popd > /dev/null