Update default Docker configuration and documentation
Updated the default Docker configuration so it works with the default sqlite condfiguration. Also updated the README file. Updated .gitignore and .dockerignore to ignore .coverage.* files Change-Id: I698f8d0c97e2c5dc202af714470b6e055c74eea2
This commit is contained in:
parent
13b2b0fbaf
commit
a8abfae0f5
@ -35,6 +35,8 @@ pip-log.txt
|
|||||||
|
|
||||||
# Unit test / coverage reports
|
# Unit test / coverage reports
|
||||||
.coverage
|
.coverage
|
||||||
|
.coverage.*
|
||||||
|
.stestr
|
||||||
.tox
|
.tox
|
||||||
nosetests.xml
|
nosetests.xml
|
||||||
cover/*
|
cover/*
|
||||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -27,6 +27,7 @@ pip-log.txt
|
|||||||
.tox
|
.tox
|
||||||
nosetests.xml
|
nosetests.xml
|
||||||
cover/*
|
cover/*
|
||||||
|
.coverage.*
|
||||||
.testrepository/
|
.testrepository/
|
||||||
.stestr/
|
.stestr/
|
||||||
subunit.log
|
subunit.log
|
||||||
|
@ -1,30 +1,28 @@
|
|||||||
Using Mistral with Docker
|
Using Mistral with Docker
|
||||||
=========================
|
=========================
|
||||||
|
|
||||||
In order to minimize the work needed to run the current Mistral code, or
|
Docker containers provide an easy way to quickly deploy independent or
|
||||||
be able to spin up independent or networked Mistral instances in seconds,
|
networked Mistral instances in seconds. This guide describes the process
|
||||||
Docker containers are a very good option. This guide describes the process
|
|
||||||
to launch an all-in-one Mistral container.
|
to launch an all-in-one Mistral container.
|
||||||
|
|
||||||
|
|
||||||
Docker installation
|
Docker Installation
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
The links help you to install latest Docker software:
|
The following links contain instructions to install latest Docker software:
|
||||||
|
|
||||||
* `Docker Engine <https://docs.docker.com/engine/installation/>`_
|
* `Docker Engine <https://docs.docker.com/engine/installation/>`_
|
||||||
* `Docker Compose <https://docs.docker.com/compose/install/>`_
|
* `Docker Compose <https://docs.docker.com/compose/install/>`_
|
||||||
|
|
||||||
|
|
||||||
Build the Mistral image manually
|
Build the Mistral Image Manually
|
||||||
--------------------------------
|
--------------------------------
|
||||||
|
|
||||||
The `build.sh` script takes care of creating the `mistral-all` image locally.
|
Execute the following command from the repository top-level directory::
|
||||||
On the other hand you could execute the following command::
|
|
||||||
|
|
||||||
docker build -t mistral -f tools/docker/Dockerfile .
|
docker build -t mistral -f tools/docker/Dockerfile .
|
||||||
|
|
||||||
The Mistral Docker image has a build parameter.
|
The Mistral Docker image has one build parameter:
|
||||||
|
|
||||||
+-------------------------+-------------+--------------------------------------+
|
+-------------------------+-------------+--------------------------------------+
|
||||||
|Name |Default value| Description |
|
|Name |Default value| Description |
|
||||||
@ -51,13 +49,15 @@ To launch Mistral in the multi node configuration::
|
|||||||
-f tools/docker/docker-compose/mistral-multi-node.yaml \
|
-f tools/docker/docker-compose/mistral-multi-node.yaml \
|
||||||
-p mistral up -d
|
-p mistral up -d
|
||||||
|
|
||||||
The infrastructure docker-compose file contains a example of RabbitMQ,
|
The infrastructure docker-compose file contains examples of RabbitMQ,
|
||||||
PostgreSQL and MySQL. Fill free to modify docker-compose files.
|
PostgreSQL and MySQL configurations. Feel free to modify the docker-compose
|
||||||
|
files as needed.
|
||||||
|
|
||||||
Also the docker-compose contains the Clould-flow container.
|
The docker-compose Mistral configurations also include the CloudFlow container.
|
||||||
It is available by `link <http://localhost:8000/>`_
|
It is available at `link <http://localhost:8000/>`_
|
||||||
|
|
||||||
If you want to rebuild image you should add `--build` option, for example::
|
The `--build` option can be used when it is necessary to rebuild the image,
|
||||||
|
for example::
|
||||||
|
|
||||||
docker-compose -f tools/docker/docker-compose/infrastructure.yaml \
|
docker-compose -f tools/docker/docker-compose/infrastructure.yaml \
|
||||||
-f tools/docker/docker-compose/mistral-single-node.yaml \
|
-f tools/docker/docker-compose/mistral-single-node.yaml \
|
||||||
@ -75,8 +75,8 @@ by default:
|
|||||||
|`MESSAGE_BROKER_URL`|rabbit://guest:gu\|The message broker URL |
|
|`MESSAGE_BROKER_URL`|rabbit://guest:gu\|The message broker URL |
|
||||||
| |est@rabbitmq:5672 | |
|
| |est@rabbitmq:5672 | |
|
||||||
+--------------------+------------------+----------------------+---------------+
|
+--------------------+------------------+----------------------+---------------+
|
||||||
|`DATABASE_URL` |sqlite://mistral.\|The database URL |
|
|`DATABASE_URL` |sqlite:///mistral\|The database URL |
|
||||||
| |db | |
|
| |.db | |
|
||||||
+--------------------+------------------+----------------------+---------------+
|
+--------------------+------------------+----------------------+---------------+
|
||||||
|`UPGRADE_DB` |false |If the `UPGRADE_DB` equals `true`, |
|
|`UPGRADE_DB` |false |If the `UPGRADE_DB` equals `true`, |
|
||||||
| | |a database upgrade will be launched |
|
| | |a database upgrade will be launched |
|
||||||
@ -94,8 +94,9 @@ by default:
|
|||||||
| | |launched inside container |
|
| | |launched inside container |
|
||||||
+--------------------+------------------+----------------------+---------------+
|
+--------------------+------------------+----------------------+---------------+
|
||||||
|
|
||||||
Other way you can mount the your config file to a Mistral Docker container.
|
The `/etc/mistral/mistral.conf` configuration file can be mounted to the Mistral
|
||||||
You should uncomment the volume sections in the docker-compose files.
|
Docker container by uncommenting and editing the `volumes` sections in the Mistral
|
||||||
|
docker-compose files.
|
||||||
|
|
||||||
|
|
||||||
Launch tests inside Container
|
Launch tests inside Container
|
||||||
@ -120,8 +121,7 @@ or PostgreSQL::
|
|||||||
Using Mistral Client
|
Using Mistral Client
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
The script also configures the containers so that the Mistral API will be
|
The Mistral API will be accessible from the host machine on the default
|
||||||
accessible from the host machine on the default port 8989. So it is also
|
port 8989. Install `python-mistralclient` on the host machine to
|
||||||
possible to install the `mistral-pythonclient` to the host machine and
|
execute mistral commands.
|
||||||
execute commands there.
|
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ ENV MISTRAL_DIR="/opt/stack/mistral" \
|
|||||||
CONFIG_FILE="/etc/mistral/mistral.conf" \
|
CONFIG_FILE="/etc/mistral/mistral.conf" \
|
||||||
INI_SET="crudini --set /etc/mistral/mistral.conf" \
|
INI_SET="crudini --set /etc/mistral/mistral.conf" \
|
||||||
MESSAGE_BROKER_URL="rabbit://guest:guest@rabbitmq:5672/" \
|
MESSAGE_BROKER_URL="rabbit://guest:guest@rabbitmq:5672/" \
|
||||||
DATABASE_URL="sqlite://mistral.db" \
|
DATABASE_URL="sqlite:///mistral.db" \
|
||||||
UPGRADE_DB="false" \
|
UPGRADE_DB="false" \
|
||||||
RUN_TESTS="false" \
|
RUN_TESTS="false" \
|
||||||
DEBIAN_FRONTEND="noninteractive" \
|
DEBIAN_FRONTEND="noninteractive" \
|
||||||
|
@ -16,12 +16,17 @@ if [ ! -f ${CONFIG_FILE} ]; then
|
|||||||
${INI_SET} DEFAULT debug "${LOG_DEBUG}"
|
${INI_SET} DEFAULT debug "${LOG_DEBUG}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if "${UPGRADE_DB}";
|
if [ ${DATABASE_URL} == "sqlite:///mistral.db" -a ! -f ./mistral.db ]
|
||||||
then
|
then
|
||||||
mistral-db-manage --config-file "${CONFIG_FILE}" upgrade head
|
python ./tools/sync_db.py --config-file "${CONFIG_FILE}"
|
||||||
mistral-db-manage --config-file "${CONFIG_FILE}" populate
|
mistral-db-manage --config-file "${CONFIG_FILE}" populate
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if "${UPGRADE_DB}";
|
||||||
|
then
|
||||||
|
/usr/local/bin/mistral-db-manage --config-file "${CONFIG_FILE}" upgrade head
|
||||||
|
mistral-db-manage --config-file "${CONFIG_FILE}" populate
|
||||||
|
fi
|
||||||
if "${RUN_TESTS}";
|
if "${RUN_TESTS}";
|
||||||
then
|
then
|
||||||
cp "${CONFIG_FILE}" .mistral.conf
|
cp "${CONFIG_FILE}" .mistral.conf
|
||||||
|
Loading…
x
Reference in New Issue
Block a user