Easily deploy an OpenStack platform in Docker Containers
Project description
Shaddock provides a platform deployed in http://docker.com containers following a predefined template (like an http://openstack.org infrastructure)
QuickStart
# Installation:
git clone https://github.com/epheo/shaddock
cd shaddock
sudo python setup.py install
# Configuration:
cd examples && ./set_ip.sh openstack.yml
# Usage:
shaddock -f examples/openstack.yml
(shaddock) ps
(shaddock) pull all
(shaddock) start all
Run the shaddock shell in a container:
Without installation but require the docker API to listen on a tcp port.
docker run --rm -i -v examples:/examples --env DOCKER_HOST="https://<docker_api>:2376" --env TEMPLATE_FILE=/examples/openstack.yml -t shaddock/shaddock
OpenStack template configuration
You can find a reference template for an OpenStack platform in the examples/ directory. This template point to OpenStack services Docker images hosted in the public Docker repository.
You can/should of course create your own template file following the same architecture using the needed Docker images.
In case you would build and use your own images you can specify a directory of Dockerfiles to Shaddock with the ‘-d’ option.
The directory should follow this hierarchy: directory/user/image/Dockerfile You will find the one used in order to build the demonstration OpenStack images at https://github.com/epheo/shaddock-openstack
Structure example of a template file:
- name: glance
image: shaddock/glance:latest
priority: 50
ports:
- 9292
- 4324
volumes:
- mount: /var/log/glance
host_dir: /var/log/shaddock/glance
depends-on:
- {name: mysql, port: 3306}
- {name: keystone, port: 5000, get: '/v2.0'}
- {name: keystone, port: 35357, get: '/v2.0'}
env:
MYSQL_HOST_IP: <your_ip>
KEYSTONE_HOST_IP: <your_ip>
GLANCE_DBPASS: panama
GLANCE_PASS: panama
Tests:
- {name: nova, status: stopped}
- {name: nova, port: 8774, type: tcp}
- {name: nova, port: 8774, state: down, type: tcp}
- {host: google.com, port: 8774, state: down, type: tcp}
- {name: nova, type: http, get: '/v2.0', port: 5000, code: 200}
- {host: google.com, type: http, get: '/v2.0', port: 5000, code: 200}
- {host: 127.0.0.1, type: http, get: '/', code: 200, useproxy: False }
- {name: nova, sleep: 20} # defaults to 10
- {name: nova, retry: 10} # defaults to 5
Usage
shaddock --help
usage: shaddock [--version] [-v] [--log-file LOG_FILE] [-q] [-h] [--debug]
[-H DOCKER_HOST] [--tlscert DOCKER_CERT_PATH]
[--tlskey DOCKER_KEY_PATH] [--tlscacert DOCKER_CACERT_PATH]
[--tlsverify DOCKER_TLS_VERIFY] [--tls DOCKER_TLS]
[--docker-version DOCKER_VERSION] [-f TEMPLATE_FILE]
[-d IMAGES_DIR]
optional arguments:
--version Show program's version number and exit.
-v, --verbose Increase verbosity of output. Can be repeated.
--log-file LOG_FILE Specify a file to log output. Disabled by default.
-q, --quiet Suppress output except warnings and errors.
-h, --help Show this help message and exit.
--debug Show tracebacks on errors.
-H DOCKER_HOST, --host DOCKER_HOST
IP/hostname to the Docker API. (Env: DOCKER_HOST)
--tlscert DOCKER_CERT_PATH
Path to TLS certificate file. (Env: DOCKER_CERT_PATH)
--tlskey DOCKER_KEY_PATH
Path to TLS key file. (Env: DOCKER_KEY_PATH)
--tlscacert DOCKER_CACERT_PATH
Trust only remotes providing a certificate signed by
the CA given here. (Env: DOCKER_CACERT_PATH)
--tlsverify DOCKER_TLS_VERIFY
Use TLS and verify the remote. (Env:
DOCKER_TLS_VERIFY)
--tls DOCKER_TLS Use TLS; implied by tls-verify flags. (Env:
DOCKER_TLS)
--docker-version DOCKER_VERSION
Docker API version number (Env: DOCKER_VERSION)
-f TEMPLATE_FILE, --template-file TEMPLATE_FILE
Template file to use. (Env: TEMPLATE_FILE)
-d IMAGES_DIR, --images-dir IMAGES_DIR
Directory to build Docker images from.(Env:
IMAGES_DIR)
Commands:
build Build a new container
create Create a new container
help print detailed help for another command
info Show details about a container
list Show a list of Containers.
logs Display the logs of a container
ps Show a list of Containers.
pull Pull a container from the Docker Repository
remove Remove a container
restart Restart a container
show Show details about a container
start Start a new container
stop Stop a container
Informations
License
Shaddock is licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
References
Docker-py API Documentation: http://docker-py.readthedocs.org/
OpenStack Official Documentation: http://docs.openstack.org/
Help
Set up the Docker remote API:
refs: https://docs.docker.com/reference/api/docker_remote_api/
cat /etc/default/docker.io
DOCKER_OPTS="-H tcp://0.0.0.0:2376 -H unix:///var/run/docker.sock"
Docker installation:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for shaddock-0.4.0.dev376-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bab017733d2b3b047a19ac117a5f09ae12c209b7700b90df752bd1df51891a83 |
|
MD5 | c9326d881ea98ce097c8efba946af722 |
|
BLAKE2b-256 | c3d9be12352d765a79ef761a23b3001241aa90becacfd7a0753b7c10489abf14 |
Hashes for shaddock-0.4.0.dev376-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d5d5acaa57962a3f5d16e50357876bf25c04e8311c2b0aec2b15434e36780c21 |
|
MD5 | 58ce7b148c724d93f0c4682a0e7c0018 |
|
BLAKE2b-256 | 0e2d8ff62e027a7bfc2edbd36dffc4c0a2cf51bc14e2878aafb6c323e2d6a8ea |