Gantt is the new breakout of the scheduler code from the Nova
source tree. These changes allow devstack to install/configure/startup
gantt as the scheduler service for openstack.
Change-Id: Ia2b6001f5ccf2469ee9fdee67564c9a915a13862
| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,31 @@ |
| 0 |
+# gantt.sh - Devstack extras script to install Gantt |
|
| 1 |
+ |
|
| 2 |
+if is_service_enabled n-sch; then |
|
| 3 |
+ disable_service gantt |
|
| 4 |
+fi |
|
| 5 |
+ |
|
| 6 |
+if is_service_enabled gantt; then |
|
| 7 |
+ if [[ "$1" == "source" ]]; then |
|
| 8 |
+ # Initial source |
|
| 9 |
+ source $TOP_DIR/lib/gantt |
|
| 10 |
+ elif [[ "$1" == "stack" && "$2" == "install" ]]; then |
|
| 11 |
+ echo_summary "Installing Gantt" |
|
| 12 |
+ install_gantt |
|
| 13 |
+ cleanup_gantt |
|
| 14 |
+ elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then |
|
| 15 |
+ echo_summary "Configuring Gantt" |
|
| 16 |
+ configure_gantt |
|
| 17 |
+ |
|
| 18 |
+ elif [[ "$1" == "stack" && "$2" == "extra" ]]; then |
|
| 19 |
+ # Initialize gantt |
|
| 20 |
+ init_gantt |
|
| 21 |
+ |
|
| 22 |
+ # Start gantt |
|
| 23 |
+ echo_summary "Starting Gantt" |
|
| 24 |
+ start_gantt |
|
| 25 |
+ fi |
|
| 26 |
+ |
|
| 27 |
+ if [[ "$1" == "unstack" ]]; then |
|
| 28 |
+ stop_gantt |
|
| 29 |
+ fi |
|
| 30 |
+fi |
| 0 | 31 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,96 @@ |
| 0 |
+# lib/gantt |
|
| 1 |
+# Install and start **Gantt** scheduler service |
|
| 2 |
+ |
|
| 3 |
+# Dependencies: |
|
| 4 |
+# |
|
| 5 |
+# - functions |
|
| 6 |
+# - DEST, DATA_DIR, STACK_USER must be defined |
|
| 7 |
+ |
|
| 8 |
+# stack.sh |
|
| 9 |
+# --------- |
|
| 10 |
+# - install_gantt |
|
| 11 |
+# - configure_gantt |
|
| 12 |
+# - init_gantt |
|
| 13 |
+# - start_gantt |
|
| 14 |
+# - stop_gantt |
|
| 15 |
+# - cleanup_gantt |
|
| 16 |
+ |
|
| 17 |
+# Save trace setting |
|
| 18 |
+XTRACE=$(set +o | grep xtrace) |
|
| 19 |
+set +o xtrace |
|
| 20 |
+ |
|
| 21 |
+# Defaults |
|
| 22 |
+# -------- |
|
| 23 |
+ |
|
| 24 |
+# set up default directories |
|
| 25 |
+GANTT_DIR=$DEST/gantt |
|
| 26 |
+GANTT_STATE_PATH=${GANTT_STATE_PATH:=$DATA_DIR/gantt}
|
|
| 27 |
+GANTT_REPO=${GANTT_REPO:-${GIT_BASE}/openstack/gantt.git}
|
|
| 28 |
+GANTT_BRANCH=${GANTT_BRANCH:-master}
|
|
| 29 |
+ |
|
| 30 |
+GANTTCLIENT_DIR=$DEST/python-ganttclient |
|
| 31 |
+GANTTCLIENT_REPO=${GANTT_REPO:-${GIT_BASE}/openstack/python-ganttclient.git}
|
|
| 32 |
+GANTTCLIENT_BRANCH=${GANTT_BRANCH:-master}
|
|
| 33 |
+ |
|
| 34 |
+# eventually we will have a separate gantt config |
|
| 35 |
+# file but for compatibility reasone stick with |
|
| 36 |
+# nova.conf for now |
|
| 37 |
+GANTT_CONF_DIR=${GANTT_CONF_DIR:-/etc/nova}
|
|
| 38 |
+GANTT_CONF=$GANTT_CONF_DIR/nova.conf |
|
| 39 |
+ |
|
| 40 |
+# Support entry points installation of console scripts |
|
| 41 |
+GANTT_BIN_DIR=$(get_python_exec_prefix) |
|
| 42 |
+ |
|
| 43 |
+ |
|
| 44 |
+# Functions |
|
| 45 |
+# --------- |
|
| 46 |
+ |
|
| 47 |
+# cleanup_gantt() - Remove residual data files, anything left over from previous |
|
| 48 |
+# runs that a clean run would need to clean up |
|
| 49 |
+function cleanup_gantt() {
|
|
| 50 |
+ echo "Cleanup Gantt" |
|
| 51 |
+} |
|
| 52 |
+ |
|
| 53 |
+# configure_gantt() - Set config files, create data dirs, etc |
|
| 54 |
+function configure_gantt() {
|
|
| 55 |
+ echo "Configure Gantt" |
|
| 56 |
+} |
|
| 57 |
+ |
|
| 58 |
+# init_gantt() - Initialize database and volume group |
|
| 59 |
+function init_gantt() {
|
|
| 60 |
+ echo "Initialize Gantt" |
|
| 61 |
+} |
|
| 62 |
+ |
|
| 63 |
+# install_gantt() - Collect source and prepare |
|
| 64 |
+function install_gantt() {
|
|
| 65 |
+ git_clone $GANTT_REPO $GANTT_DIR $GANTT_BRANCH |
|
| 66 |
+ setup_develop $GANTT_DIR |
|
| 67 |
+} |
|
| 68 |
+ |
|
| 69 |
+# install_ganttclient() - Collect source and prepare |
|
| 70 |
+function install_ganttclient() {
|
|
| 71 |
+ echo "Install Gantt Client" |
|
| 72 |
+# git_clone $GANTTCLIENT_REPO $GANTTCLIENT_DIR $GANTTCLIENT_BRANCH |
|
| 73 |
+# setup_develop $GANTTCLIENT_DIR |
|
| 74 |
+} |
|
| 75 |
+ |
|
| 76 |
+# start_gantt() - Start running processes, including screen |
|
| 77 |
+function start_gantt() {
|
|
| 78 |
+ if is_service_enabled gantt; then |
|
| 79 |
+ screen_it gantt "cd $GANTT_DIR && $GANTT_BIN_DIR/gantt-scheduler --config-file $GANTT_CONF" |
|
| 80 |
+ fi |
|
| 81 |
+} |
|
| 82 |
+ |
|
| 83 |
+# stop_gantt() - Stop running processes |
|
| 84 |
+function stop_gantt() {
|
|
| 85 |
+ echo "Stop Gantt" |
|
| 86 |
+ screen_stop gantt |
|
| 87 |
+} |
|
| 88 |
+ |
|
| 89 |
+# Restore xtrace |
|
| 90 |
+$XTRACE |
|
| 91 |
+ |
|
| 92 |
+# Tell emacs to use shell-script-mode |
|
| 93 |
+## Local variables: |
|
| 94 |
+## mode: shell-script |
|
| 95 |
+## End: |