From 5cb375645c0b48e4bdc13f94b8ef6b6a1bd91fbc Mon Sep 17 00:00:00 2001 From: Paul Bourke Date: Fri, 7 Apr 2017 12:53:24 +0100 Subject: Add a Kolla 'devstack' mode Add a new variable 'kolla_devmode', which when enabled, clones and bindmounts service source code into the containers. This commit adds the relevant changes for Heat, more services can be added and built upon. Usage: * Set 'kolla_devmode: yes' * Code is cloned to /opt/stack/{{ project_name }} on target node(s) * Users can develop in these repos, and simply restart the container to pick up / test changes. Debugging can be done from the host via 'remote_pdb'[0]. [0] https://pypi.python.org/pypi/remote-pdb Implements: blueprint mount-sources Change-Id: Ic0431b10d723bf84eeefc72039376fe0058dd902 --- tools/cleanup-host | 5 +++++ tools/kolla-ansible | 18 ++++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) (limited to 'tools') diff --git a/tools/cleanup-host b/tools/cleanup-host index cc2aa322a..bf7584d3c 100755 --- a/tools/cleanup-host +++ b/tools/cleanup-host @@ -63,3 +63,8 @@ for dir in $FOLDER_PATH*; do rm -rfv $dir fi done + +if [[ "$destroy_include_dev" == "yes" ]]; then + echo "Cleaning up dev repos..." + rm -rfv "${kolla_dev_repos_directory}" +fi diff --git a/tools/kolla-ansible b/tools/kolla-ansible index 47bae34a1..53174cae4 100755 --- a/tools/kolla-ansible +++ b/tools/kolla-ansible @@ -51,7 +51,8 @@ Commands: mariadb_recovery Recover a completely stopped mariadb cluster bootstrap-servers bootstrap servers with kolla deploy dependencies destroy Destroy Kolla containers, volumes and host configuration - (--include-images to also destroy Kolla images) + --include-images to also destroy Kolla images + --include-dev to also destroy dev mode repos deploy Deploy and start all kolla containers deploy-bifrost Deploy and start bifrost container deploy-servers Enroll and deploy servers with bifrost @@ -96,7 +97,7 @@ EOF } SHORT_OPTS="hi:p:t:k:e:v" -LONG_OPTS="help,inventory:,playbook:,tags:,key:,extra:,verbose,configdir:,passwords:,limit:,yes-i-really-really-mean-it,include-images" +LONG_OPTS="help,inventory:,playbook:,tags:,key:,extra:,verbose,configdir:,passwords:,limit:,yes-i-really-really-mean-it,include-images,include-dev" ARGS=$(getopt -o "${SHORT_OPTS}" -l "${LONG_OPTS}" --name "$0" -- "$@") || { usage >&2; exit 2; } eval set -- "$ARGS" @@ -111,8 +112,9 @@ CONFIG_DIR="/etc/kolla" PASSWORDS_FILE="${CONFIG_DIR}/passwords.yml" DANGER_CONFIRM= INCLUDE_IMAGES= -# Serial is not recommended and disabled by default. User could enable it by -# simply configuring ANSIBLE_SERIAL variable. +INCLUDE_DEV= +# Serial is not recommended and disabled by default. Users can enable it by +# configuring ANSIBLE_SERIAL variable. ANSIBLE_SERIAL=${ANSIBLE_SERIAL:-0} while [ "$#" -gt 0 ]; do @@ -153,6 +155,11 @@ while [ "$#" -gt 0 ]; do shift 1 ;; + (--include-dev) + INCLUDE_DEV="$1" + shift 1 + ;; + (--key|-k) VAULT_PASS_FILE="$2" EXTRA_OPTS="$EXTRA_OPTS --vault-password-file=$VAULT_PASS_FILE" @@ -211,6 +218,9 @@ case "$1" in if [[ "${INCLUDE_IMAGES}" == "--include-images" ]]; then EXTRA_OPTS="$EXTRA_OPTS -e destroy_include_images=yes" fi + if [[ "${INCLUDE_DEV}" == "--include-dev" ]]; then + EXTRA_OPTS="$EXTRA_OPTS -e destroy_include_dev=yes" + fi if [[ "${DANGER_CONFIRM}" != "--yes-i-really-really-mean-it" ]]; then cat << EOF WARNING: -- cgit v1.2.3