aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-03-20 16:09:32 +0000
committerGerrit Code Review <review@openstack.org>2015-03-20 16:09:32 +0000
commitfb425db56db16ec4ac061a2ee49054eed4fc284a (patch)
tree3835ee826127b76fc92d8f6d15387e2655e4a586
parent9b7a84409462e05082246d9aaebdc60c3c21099c (diff)
parent888bb9cc8c68bf61fddc0ca08a69f764a4012121 (diff)
downloadkolla-fb425db56db16ec4ac061a2ee49054eed4fc284a.tar.gz
kolla-fb425db56db16ec4ac061a2ee49054eed4fc284a.zip
Merge "Move genenv.sh and start.sh to tools directory"
-rw-r--r--.gitignore7
-rw-r--r--compose/README.md4
-rw-r--r--docs/developer-env.md12
-rwxr-xr-xtools/genenv (renamed from compose/genenv.sh)8
-rwxr-xr-xtools/start (renamed from compose/start.sh)25
5 files changed, 33 insertions, 23 deletions
diff --git a/.gitignore b/.gitignore
index 8dcc4f5b7..08d55d211 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,8 +2,13 @@
*~
[._]*.s[a-w][a-z]
-# Any qcow images created from get-image script
+# Any disk images
*.qcow2
+*.img
.tox/
.buildconf
+
+# Files generated by tools/genenv
+openrc
+openstack.env
diff --git a/compose/README.md b/compose/README.md
index ba0ce74e5..a513f78a0 100644
--- a/compose/README.md
+++ b/compose/README.md
@@ -2,12 +2,12 @@ Docker compose
==============
These scripts and docker compose files can be used to stand up a simple
-installation of openstack. Running the 'genenv.sh' script creates an
+installation of openstack. Running the 'tools/genenv' script creates an
'openstack.env' suitable for running on a single host system as well as an
'openrc' to allow access to the installation.
Once you have run that you can either manually start the containers using the
-'docker-compose' command or try the 'start.sh' script which tries to start them
+'docker-compose' command or try the 'tools/start' script which tries to start them
all in a reasonable order, waiting at key points for services to become
available. Once stood up you can issue the typical openstack commands to use
the installation:
diff --git a/docs/developer-env.md b/docs/developer-env.md
index fe1916bb6..3d31aa530 100644
--- a/docs/developer-env.md
+++ b/docs/developer-env.md
@@ -7,18 +7,18 @@ compose directory.
To start, setup your environment variables.
$ cd kolla
- $ ./tools/genenv.sh
+ $ ./tools/genenv
-The `genenv.sh` script will create an openstack.env file
+The `genenv` script will create a compose/openstack.env file
and an openrc file in your current directory. The openstack.env
file contains all of your initialized environment variables, which
you can edit for a different setup.
Next, run the start script.
- $ ./start.sh
+ $ ./tools/start
-The `start.sh` script is responsible for starting the containers
+The `start` script is responsible for starting the containers
using `docker-compose -f <osp-service-container> up -d`.
If you want to start a container set by hand use this template
@@ -36,7 +36,9 @@ If any of the containers exited you can check the logs by doing
$ sudo docker logs <glance-api-container>
$ docker-compose logs <glance-api-container>
-If you want to start a individual service like `glance-api` by hand, then use this template. This is a good method to test and troubleshoot an individual container.
+If you want to start a individual service like `glance-api` by hand, then use
+this template. This is a good method to test and troubleshoot an individual
+container.
$ docker run --name glance-api -d \
--net=host
diff --git a/compose/genenv.sh b/tools/genenv
index dc1e52f80..91ac42cc4 100755
--- a/compose/genenv.sh
+++ b/tools/genenv
@@ -6,6 +6,10 @@
#
# It also creates a suitable 'openrc' for use with the installed system.
+# Move to top level directory
+REAL_PATH=$(python -c "import os,sys;print os.path.realpath('$0')")
+cd "$(dirname "$REAL_PATH")/.."
+
MY_IP=$(ip route get $(ip route | awk '$1 == "default" {print $3}') |
awk '$4 == "src" {print $5}')
@@ -58,14 +62,14 @@ NOVA_PUBLIC_INTERFACE=$MY_DEV
NOVA_FLAT_INTERFACE=$MY_DEV
CONFIG_NETWORK=True
-cat > openrc <<EOF
+cat > ./openrc <<EOF
export OS_AUTH_URL="http://${KEYSTONE_PUBLIC_SERVICE_HOST}:5000/v2.0"
export OS_USERNAME=$ADMIN_TENANT_NAME
export OS_PASSWORD=$PASSWORD
export OS_TENANT_NAME=$ADMIN_TENANT_NAME
EOF
-cat > openstack.env <<EOF
+cat > ./compose/openstack.env <<EOF
ADMIN_TENANT_NAME=$ADMIN_TENANT_NAME
CONFIG_NETWORK=$CONFIG_NETWORK
DB_ROOT_PASSWORD=$MYSQL_ROOT_PASSWORD
diff --git a/compose/start.sh b/tools/start
index fde554fc3..887ec8ab1 100755
--- a/compose/start.sh
+++ b/tools/start
@@ -6,10 +6,9 @@
# services are up. You will also need these in order to interact with the
# installation once started.
-if [[ $EUID -ne 0 ]]; then
- echo "You must execute this script as root." 1>&2
- exit 1
-fi
+# Move to top level directory
+REAL_PATH=$(python -c "import os,sys;print os.path.realpath('$0')")
+cd "$(dirname "$REAL_PATH")/.."
# Set SELinux to permissive
setenforce permissive
@@ -27,30 +26,30 @@ MY_IP=$(ip route get $(ip route | awk '$1 == "default" {print $3}') |
awk '$4 == "src" {print $5}')
# Source openrc for commands
-source openrc
+source ./openrc
echo Starting rabbitmq.
-docker-compose -f rabbitmq.yml up -d
+docker-compose -f ./compose/rabbitmq.yml up -d
echo Starting mariadb.
-docker-compose -f mariadb.yml up -d
+docker-compose -f ./compose/mariadb.yml up -d
echo Starting keystone.
-docker-compose -f keystone.yml up -d
+docker-compose -f ./compose/keystone.yml up -d
echo Starting glance.
-docker-compose -f glance-api-registry.yml up -d
+docker-compose -f ./compose/glance-api-registry.yml up -d
echo Starting nova.
-docker-compose -f nova-api-conductor-scheduler.yml up -d
+docker-compose -f ./compose/nova-api-conductor-scheduler.yml up -d
echo Starting nova compute with nova networking.
-docker-compose -f nova-compute-network.yml up -d
+docker-compose -f ./compose/nova-compute-network.yml up -d
IMAGE_URL=http://download.cirros-cloud.net/0.3.3/
IMAGE=cirros-0.3.3-x86_64-disk.img
if ! [ -f "$IMAGE" ]; then
- curl -o $IMAGE $IMAGE_URL/$IMAGE
+ curl -o ./$IMAGE $IMAGE_URL/$IMAGE
fi
until keystone user-list | grep glance
@@ -62,7 +61,7 @@ done
sleep 3
echo Creating glance image.
-glance image-create --name cirros --is-public false --disk-format qcow2 --container-format bare --file $IMAGE
+glance image-create --name cirros --is-public false --disk-format qcow2 --container-format bare --file ./$IMAGE
echo Example usage:
echo