aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--moonv4/README.md45
-rw-r--r--moonv4/templates/docker/keystone/Dockerfile3
-rw-r--r--moonv4/templates/docker/keystone/README.md60
3 files changed, 67 insertions, 41 deletions
diff --git a/moonv4/README.md b/moonv4/README.md
index 112338f3..e47f763c 100644
--- a/moonv4/README.md
+++ b/moonv4/README.md
@@ -14,7 +14,7 @@ sudo apt -y install docker-engine # ([Get Docker](https://docs.docker.com/engine
echo 127.0.0.1 messenger db keystone | sudo tee -a /etc/hosts
```
-### Install Docker
+### Install Docker Engine
```bash
sudo apt-get remove docker docker-engine
@@ -39,35 +39,13 @@ export MOON_HOME=$(pwd)
sudo ln -s $(pwd)/conf /etc/moon
```
-### Create an OpenStack environment
-
-```bash
-cd $MOON_HOME/templates/docker/keystone
-# Check the proxy settings in Dockerfile
-sudo docker build -t keystone:mitaka .
-```
-
-### Start RabbitMQ
-
-```bash
-sudo docker network create -d bridge --subnet=172.18.0.0/16 --gateway=172.18.0.1 moon
-sudo docker run -dti --net=moon --hostname messenger --name messenger --link messenger:messenger -e RABBITMQ_DEFAULT_USER=moon -e RABBITMQ_DEFAULT_PASS=p4sswOrd1 -e RABBITMQ_NODENAME=rabbit@messenger -e RABBITMQ_DEFAULT_VHOST=moon -p 5671:5671 -p 5672:5672 rabbitmq:3-management
-```
-
-### Start MySQL server
-
-```bash
-sudo docker run -dti --net=moon --hostname db --name db -e MYSQL_ROOT_PASSWORD=p4sswOrd1 -e MYSQL_DATABASE=moon -e MYSQL_USER=moon -e MYSQL_PASSWORD=p4sswOrd1 -p 3306:3306 mysql:latest
-```
-
-### Start an OpenStack environment
-
-```bash
-sudo docker run -dti --net moon --name keystone --hostname=keystone -e DB_HOST=db -e DB_PASSWORD_ROOT=p4sswOrd1 -p 35357:35357 -p 5000:5000 keystone:mitaka
-```
+## Create an OpenStack environment
+see the templates/docker/keystone/README.md
+Or execute directly `bin/start.sh`
+## Launch all other containers of Moon
### Build python packages for all components
-
+TODO: containerize moon_orchestrator
```bash
cd ${MOON_HOME}/moon_orchestrator
sudo pip3 install pip --upgrade
@@ -75,8 +53,8 @@ cd ${MOON_HOME}/bin
source build_all.sh
```
+## Moon_Orchestrator
### Start Orchestrator
-
To start the Moon platform, you have to run the Orchestrator.
```bash
@@ -100,7 +78,7 @@ cd ${MOON_HOME}/moon_interface/tests/apitests
pytest
```
-
+## Configure DB
### Relaunch Keystone docker
If error of `get_keystone_projects()`, then relaunch the Keystone docker, and wait 40 seconds!!!
```bash
@@ -115,9 +93,8 @@ cd ${MOON_HOME}/moon_interface/tests/apitests
python3 populate_default_values.py scenario/ rbac.py
```
-
+## Log
### Get some logs
-
```bash
docker ps
docker logs messenger
@@ -127,13 +104,11 @@ docker logs moon_interface
```
### Get some statistics
-
```bash
docker stats --format "table {{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.PIDs}}"
```
### Get the API in PDF
-
```bash
cd ${MOON_HOME}/moon_interface/tools
sudo pip3 install requests
@@ -144,8 +119,8 @@ pandoc api.rst -o api.pdf
evince api.pdf
```
-## How to hack the Moon platform
+## How to hack the Moon platform
### Force the build of components
If you want to rebuild one or more component, you have to modify the configuration file `moon.conf`.
diff --git a/moonv4/templates/docker/keystone/Dockerfile b/moonv4/templates/docker/keystone/Dockerfile
index a0be0fa2..1ab24de9 100644
--- a/moonv4/templates/docker/keystone/Dockerfile
+++ b/moonv4/templates/docker/keystone/Dockerfile
@@ -1,4 +1,3 @@
-# Pull base image.
FROM ubuntu:latest
ENV ADMIN_TOKEN=p4ssw0rd
@@ -18,8 +17,6 @@ RUN apt-get update && apt-get install apache2 rabbitmq-server keystone python-op
RUN apt-get update && apt-get install iputils-ping net-tools -y
-
-# ADD set-ops-env.source.sh /root
ADD run.sh /root
EXPOSE 35357
diff --git a/moonv4/templates/docker/keystone/README.md b/moonv4/templates/docker/keystone/README.md
index bbf80cbe..34926b91 100644
--- a/moonv4/templates/docker/keystone/README.md
+++ b/moonv4/templates/docker/keystone/README.md
@@ -1,8 +1,62 @@
# Keystone container
-## How to use
+## build keystone image
+### without proxy:
+```bash
+docker build -t keystone:mitaka .
+```
+
+### with a proxy:
```bash
docker build --build-arg https_proxy=http://proxy:3128 --build-arg http_proxy=http://proxy:3128 -t keystone:mitaka .
-docker run -dti --net moon --name keystone --hostname=keystone -e DB_HOST=db -e DB_PASSWORD_ROOT=my_password -p 35357:35357 -p 5000:5000 keystone:mitaka
-``` \ No newline at end of file
+```
+
+
+## set up an execution environment
+
+### clean up if necessary
+```bash
+docker container rm -f $(docker ps -a | grep moon | cut -d " " -f 1) 2>/dev/null
+docker container rm -f messenger db keystone 2>/dev/null
+```
+
+### create a network
+```bash
+docker network create -d bridge --subnet=172.18.0.0/16 --gateway=172.18.0.1 moon
+```
+
+### Start RabbitMQ
+```bash
+docker container run -dti --net=moon --hostname messenger --name messenger -e RABBITMQ_DEFAULT_USER=moon -e RABBITMQ_DEFAULT_PASS=p4sswOrd1 -e RABBITMQ_NODENAME=rabbit@messenger -e RABBITMQ_DEFAULT_VHOST=moon -e RABBITMQ_HIPE_COMPILE=1 -p 5671:5671 -p 5672:5672 -p 8080:15672 rabbitmq:3-management
+```
+
+
+### Start MySQL server
+```bash
+docker container run -dti --net=moon --hostname db --name db -e MYSQL_ROOT_PASSWORD=p4sswOrd1 -e MYSQL_DATABASE=moon -e MYSQL_USER=moon -e MYSQL_PASSWORD=p4sswOrd1 -p 3306:3306 mysql:latest
+```
+
+## launch a Keystone container
+```bash
+docker container run -dti --net moon --hostname keystone --name keystone -e DB_HOST=db -e DB_PASSWORD_ROOT=p4sswOrd1 -p 35357:35357 -p 5000:5000 keystone:mitaka
+```
+
+## check
+### log
+```bash
+docker logs keystone
+```
+
+
+### access to the container
+```bash
+docker container exec -ti keystone /bin/bash
+export OS_USERNAME=admin
+export OS_PASSWORD=p4ssw0rd
+export OS_REGION_NAME=Orange
+export OS_TENANT_NAME=admin
+export OS_AUTH_URL=http://localhost:5000/v3
+export OS_DOMAIN_NAME=Default
+openstack project list
+```