summaryrefslogtreecommitdiffstats
path: root/ci
diff options
context:
space:
mode:
Diffstat (limited to 'ci')
-rwxr-xr-xci/deploy.sh22
1 files changed, 15 insertions, 7 deletions
diff --git a/ci/deploy.sh b/ci/deploy.sh
index 11218196e..103f83b9e 100755
--- a/ci/deploy.sh
+++ b/ci/deploy.sh
@@ -107,7 +107,9 @@ $(notify_i "Input parameters to the build script are:" 2)
Note that without the required packages, deploy will fail.
-s Deployment-scenario, this points to a short deployment scenario name, which
has to be defined in config directory (e.g. os-odl-nofeature-ha).
--S Storage dir for VM images, default is mcp/deploy/images
+-S Storage dir for VM images, default is /var/lib/opnfv/tmpdir
+ It is recommended to store the deploy artifacts on a fast disk, outside of
+ the current git repository (so clean operations won't erase it).
$(notify_i "[NOTE] sudo & virsh priviledges are needed for this script to run" 3)
@@ -116,7 +118,8 @@ Example:
$(notify_i "sudo $(basename "$0") \\
-b file:///home/jenkins/securedlab \\
-l lf -p pod2 \\
- -s os-odl-nofeature-ha" 2)
+ -s os-odl-nofeature-ha \\
+ -S /home/jenkins/tmpdir" 2)
EOF
}
@@ -130,7 +133,7 @@ EOF
CI_DEBUG=${CI_DEBUG:-0}; [[ "${CI_DEBUG}" =~ (false|0) ]] || set -x
MCP_REPO_ROOT_PATH=$(readlink -f "$(dirname "${BASH_SOURCE[0]}")/..")
DEPLOY_DIR=$(cd "${MCP_REPO_ROOT_PATH}/mcp/scripts"; pwd)
-MCP_STORAGE_DIR=$(cd "${MCP_REPO_ROOT_PATH}/mcp/deploy/images"; pwd)
+MCP_STORAGE_DIR='/var/lib/opnfv/tmpdir'
URI_REGEXP='(file|https?|ftp)://.*'
BASE_CONFIG_URI="file://${MCP_REPO_ROOT_PATH}/mcp/scripts/pharos"
@@ -242,6 +245,8 @@ pushd "${DEPLOY_DIR}" > /dev/null
# scenario, etc.
# Install required packages on jump server
+sudo mkdir -p "${MCP_STORAGE_DIR}"
+sudo chown "${USER}:${USER}" "${MCP_STORAGE_DIR}"
if [ ${USE_EXISTING_PKGS} -eq 1 ]; then
notify "[NOTE] Skipping distro pkg installation" 2
else
@@ -272,10 +277,9 @@ 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)
+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"
@@ -300,12 +304,16 @@ elif [ ${USE_EXISTING_INFRA} -gt 0 ]; then
else
prepare_vms "${base_image}" "${MCP_STORAGE_DIR}" "${virtual_repos_pkgs}" \
"${virtual_nodes[@]}"
- prepare_containers "${MCP_STORAGE_DIR}"
create_networks "${OPNFV_BRIDGES[@]}"
do_sysctl_cfg
do_udev_cfg
create_vms "${MCP_STORAGE_DIR}" "${virtual_nodes_data}" "${OPNFV_BRIDGES[@]}"
start_vms "${virtual_nodes[@]}"
+
+ # https://github.com/docker/libnetwork/issues/1743
+ # rm -f /var/lib/docker/network/files/local-kv.db
+ sudo systemctl restart docker
+ prepare_containers "${MCP_STORAGE_DIR}"
fi
start_containers "${MCP_STORAGE_DIR}"