Skip to content

Commit 0e965cd

Browse files
Using new task runner, phased out most bash scripts, templated manifests, templated config files, building from Kazoo 4.1.40
1 parent 8000bba commit 0e965cd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+1573
-1342
lines changed

.gitattributes

-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
images/couchdb-data/*.tar.gz filter=lfs diff=lfs merge=lfs -text
2-
images/couchdb-data-preset/*.tar.gz filter=lfs diff=lfs merge=lfs -text

.travis.yml

+4-12
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ python:
44
services: docker
55
env:
66
global:
7-
- DOCKER_USER=joeblackwaslike
8-
- DOCKER_ORG=telephoneorg
97
# DOCKER_PASS
108
- secure: "jH8BW9v76umQKxJ8I+yRza1JvdERGTr1Rs1Ea3DmT163RI8QTZ8gDjguWIFP8wmuvqG5PT6ndq1Jq7wM0pUewjQA49T+1JGlz27HP98E2C1luBCVyTjkrGP0iAan4GfmAXYScG8idnPOPaKqbOAe9sSVhVSiSOTefTvU3ord64GG3A0xKw/q2OG8rjr4SarLLc68MCLA9+PdcypEG1jl7SXiwNoAGAsOiLHo7MKMdmHWtqq8CwYAB9k3s0q74ibe8pYmPVwk5YG2VsI7ckf78hVciaIncAOldy0CGw0qqcaXnDpb/uxjKCXryvivwmC8ynDbyWiu1OEhfyGc7iGrFuigEKt0VhmaW3VNecplbcNDNnzbeYVlzSVqGR1GFDwZhAx5pRrFJSUsQ7hfLz2vJ2icPv/EJfDns72PsIBmRZsZ7JCNmK8eqyYQZZ6pcrOerKxhx9tOkqG8Zao2jk/Ii1wLN+5dUZsr0vj7QbhmXl/wcoJVoMD1h8cvRT8dYXZJRnI5T63ZEqq/mdXeMRLTzV0jEsA74LtUOw6ZswSwtGvkQ+Va/v2vEIirzBt3icepU5+PvvJCiJcvIs/Gw3x/PqsoOSK9NQtrMYkp5k/Db+1dWwbyBxbopGY067UJBP/+XJetiupcy94H1HNz8YVlKWGdaEdILCH55T8o5dK3xw4="
119

@@ -19,30 +17,24 @@ notifications:
1917
on_success: always
2018
on_failure: always
2119

22-
before_install:
23-
- source scripts/ci/environment.sh
24-
- pip install --upgrade docker-compose
25-
- pip install invoke
20+
before_install: pip install --upgrade docker-compose invoke pyyaml
2621

2722
install: inv dc.build
2823

2924
script: true
3025
# inv test
3126

3227
after_success:
33-
- ci-tag-build
34-
- hub-push
35-
- hub-updated-readme
36-
# - inv hub.push
37-
# - inv hub.update-readme
28+
- inv ci.tag-build
29+
- inv hub.push
30+
- inv hub.update-readme
3831

3932
deploy:
4033
provider: releases
4134
api_key:
4235
secure: p7a0iK9Ej3+DBhsxDjJKFQuGkpoVtt9FbedOc6mWTvIhxWUTnYoC60w4SUiuWg+A4fbUu+9SZYjFqQowQaFbDJKQfgBiM/DWD65n9FCZgYx9nRZ+fgqrHldKo9nElBMWfWk5KL/RRavB9YKSh+B5yCJAQiEMZn9K5QVL4uuRIXSEs5aLVKsrsNJJR7Wxs5D3UvmbkAxaSJhPfBAj5m1uSkrn6AzOZBJQ+PdnhnU2UhQqAgsx+c4UXJeVBpKbBt+3dWWcAiouQJLiTv0muGjys8UqY3wLcBDSvDPlEWrhhnQiI/8cTGUmvUoFF+sTAh+07/rEyyqC474tb6HF0SmbUWQzQvo96aepFGD0ObE6y0gmJJhc/Tj8vdGPmt8Qq8S2eP31j6wGt4JDLCOsEqGQM/KgknQ8pB03QOAyBUMhYVBTYj68vjeBm0CVH+EoeQLtRiNjXoGhcFnnsQlVwyJjHKIYxLl60Aksvj4ZzzsnnN5KY3mGpA+Q0VIGC7Zs1M3ljgoV+gGYLr6TUndsrt7kJhFoSKhQFBboKF4e2yW/ID/79SGz18aoCI38GjtUYx4WM4m714JZlqBhQUzTl9a/er2aQZBm6sOTxe5QUBsbfuHahjkuU6P+UEgDlgMiI7+WkoTv36uFT25He4B0H+cPDVTAC54jdx+uhGjGL+QQcCg=
4336
file:
4437
- images/couchdb-data/couchdb-data.tar.gz
45-
- images/couchdb-data-preset/couchdb-data-preset.tar.gz
4638
overwrite: true
4739
on:
4840
repo: telephoneorg/docker-kazoo

README.md

+18-45
Original file line numberDiff line numberDiff line change
@@ -35,55 +35,28 @@ The following variables are standard in most of our Dockerfiles to reduce duplic
3535

3636
## Run Environment
3737
Run environment variables are used in the entrypoint script to render configuration templates, perform flow control, etc. These values can be overridden when inheriting from the base dockerfile, specified during `docker run`, or in kubernetes manifests in the `env` array.
38-
39-
* `KAZOO_APPS`: a comma delimited list used directly by the kazoo_apps erlang vm as the list of default apps to start. Defaults to `blackhole,callflow,cdr,conference,crossbar,doodle,ecallmgr,fax,hangups,hotornot,konami,jonny5,media_mgr,milliwatt,omnipresence,pivot,registrar,reorder,stepswitch,sysconf,teletype,trunkstore,webhooks`.
40-
41-
* `ERLANG_VM`: `_app` is appended to the end and passed to the `-s` argument in vm.args as well as used for the erlang node name. Defaults to `kazoo_apps`.
42-
43-
* `ERLANG_THREADS`: passed to the `+A` argument in vm.args. Defaults to `64`.
44-
45-
* `ERLANG_COOKIE`: written to `~/.erlang.cookie` by the `erlang-cookie` script in `/usr/local/bin`. Defaults to `insecure-cookie`.
46-
47-
* `KAZOO_LOG_LEVEL`: lowercased and used as the value for the console log level in the log section of `config.ini` Defaults to `info`
48-
49-
* `KAZOO_LOG_COLOR`: used as the value for the `colored` tuple in `sys.config`. Defaults to `true`
50-
51-
* `KAZOO_SASL_ERRLOG_TYPE`: used as the value for `-sasl errlog_type` in `vm.args`. Defaults to `error`, choices include: error, progress, all.
52-
53-
* `KAZOO_SASL_ERROR_LOGGER`: used as the value for `-sasl sasl_error_logger` in `vm.args`. Defaults to `tty`. *This shouldn't be changed without good reason inside docker and is provided for testing purposes*
54-
55-
* `REGION`: interpolated with `DATACENTER` as such `${REGION}-${DATACENTER}` and stored in `KAZOO_ZONE`. See `KAZOO_ZONE`. Defaults to local.
56-
57-
* `DATACENTER`: interpolated with `REGION` as such `${REGION}-${DATACENTER}` and stored in `KAZOO_ZONE`. See `KAZOO_ZONE`. Defaults to dev.
58-
59-
* `KAZOO_ZONE`: when provided, interpolation of `DATACENTER` and `REGION` is ignored and the value of `KAZOO_ZONE` is used directly. This is useful for local test and dev environments where ZONE's don't matter. Used as name in `[zone]` section and as `zone` attribute in other sections of `config.ini`. Defaults to the interpolation described.
60-
61-
* `COUCHDB_HOST`: the hostname or ip address of the load balancer to reach bigcouch or couchdb through. Used in the `bigcouch` section of `config.ini`. Defaults to `couchdb-lb`.
62-
63-
* `COUCHDB_DATA_PORT`: used as the value for the `port` key in the `bigcouch` section of `config.ini`. Defaults to `5984`.
64-
65-
* `COUCHDB_ADMIN_PORT`: used as the value for the `admin_port` key in the `bigcouch` section of `config.ini`. Defaults to `5986`.
66-
67-
* `COUCHDB_COMPACT_AUTOMATICALLY`: used as the value for the `compact_automatically` key in the `bigcouch` section of `config.ini`. Defaults to `true`.
68-
69-
* `COUCHDB_USER`: used as the value for the `username` key in the `bigcouch` section of `config.ini`. Defaults to `admin`.
70-
71-
* `COUCHDB_PASS`: used as the value for the `password` key in the `bigcouch` section of `config.ini`. Defaults to `secret`
72-
73-
* `RABBITMQ_USER`: interpolated as such `"amqp://user:pass@host:5672"` and used for all `uri` keys in the `amqp` section or the `amqp_uri` keys in the `zone` section of `config.ini`. Defaults to `guest`.
74-
75-
* `RABBITMQ_PASS`: interpolated as such `"amqp://user:pass@host:5672"` and used for all `uri` keys in the `amqp` section or the `amqp_uri` keys in the `zone` section of `config.ini`. Defaults to `guest`.
76-
77-
* `RABBITMQ_HOSTS`: comma delimited list of hostnames or ip addresses that are split on comma's, interpolated as such `"amqp://{user}:{pass}@{host}:5672"`, and used to build a list of `amqp_uri`'s' for the `zone` section of `config.ini`. Defaults to `rabbitmq`.
38+
* `KAZOO_APPS`: a comma delimited list used directly by the kazoo_apps erlang vm as the list of default apps to start.
39+
* `ERLANG_THREADS`: passed to the `+A` argument in vm.args.
40+
* `ERLANG_COOKIE`: written to `~/.erlang.cookie` by the `erlang-cookie` script in `/usr/local/bin`.
41+
* `KAZOO_LOG_LEVEL`: lowercased and used as the value for the console log level in the log section of `config.ini`.
42+
* `KAZOO_LOG_COLOR`: used as the value for the `colored` tuple in `sys.config`.
43+
* `REGION`: interpolated with `DATACENTER` as such `${COUNTRY}-${REGION}` and stored in `KAZOO_ZONE`. See `KAZOO_ZONE`.
44+
* `COUNTRY`: interpolated with `REGION` as such `${COUNTRY}-${REGION}` and stored in `KAZOO_ZONE`. See `KAZOO_ZONE`.
45+
* `KAZOO_ZONE`: when provided, interpolation of `COUNTRY` and `REGION` is ignored and the value of `KAZOO_ZONE` is used directly. This is useful for local test and dev environments where ZONE's don't matter. Used as name in `[zone]` section and as `zone` attribute in other sections of `config.ini`.
46+
* `COUCHDB_HOST`: the hostname or ip address of the load balancer to reach bigcouch or couchdb through. Used in the `bigcouch` section of `config.ini`.
47+
* `COUCHDB_DATA_PORT`: used as the value for the `port` key in the `bigcouch` section of `config.ini`.
48+
* `COUCHDB_ADMIN_PORT`: used as the value for the `admin_port` key in the `bigcouch` section of `config.ini`.
49+
* `COUCHDB_USER`: used as the value for the `username` key in the `bigcouch` section of `config.ini`.
50+
* `COUCHDB_PASS`: used as the value for the `password` key in the `bigcouch` section of `config.ini`.
51+
* `RABBITMQ_USER`: interpolated as such `"amqp://user:pass@host:5672"` and used for all `uri` keys in the `amqp` section or the `amqp_uri` keys in the `zone` section of `config.ini`.
52+
* `RABBITMQ_PASS`: interpolated as such `"amqp://user:pass@host:5672"` and used for all `uri` keys in the `amqp` section or the `amqp_uri` keys in the `zone` section of `config.ini`.
53+
* `RABBITMQ_HOST`: hostname or ip address, interpolated as such `"amqp://{user}:{pass}@{host}:5672"`, and used in the `amqp_uri` property of the `zone` section of `config.ini`.
7854

7955

8056
## Extra tools
8157
### In container
8258
There is a binary called [kazoo-tool](build/kazoo-tool) in `~/bin`. It contains the useful functions such as remote_console, upgrade, etc found in the original kazoo service file. Since using service files in a docker container is largely a very bad idea, I've extracted the useful functions and adapted them to work in the container environment.
8359

84-
### Outside container
85-
In the [scripts](scripts) directory, there are two scripts: `do-kube`, and `do-local` that allow you to run a sup command on a local or remote instance of kazoo as well as the basic initialization commands for a new kazoo cluster. Run either command without arguments for usage.
86-
8760

8861
## Usage
8962
### Under docker
@@ -100,7 +73,7 @@ docker run -d \
10073
--name kazoo \
10174
-h kazoo.local \
10275
-e "COUCHDB_HOST=bigcouch.local" \
103-
-e "KAZOO_AMQP_HOSTS=rabbitmq-alpha.local" \
76+
-e "RABBITMQ_HOST=rabbitmq.local" \
10477
-e "KAZOO_LOG_LEVEL=debug" \
10578
-e "KAZOO_APPS=blackhole,callflow,cdr,conference,crossbar,doodle,ecallmgr,hangups,hotornot,konami,jonny5,media_mgr,milliwatt,omnipresence,pivot,registrar,reorder,stepswitch,sysconf,teletype,trunkstore,webhooks" \
10679
-e "ERLANG_COOKIE=test-cookie" \
@@ -132,7 +105,7 @@ Edit the manifests under `kubernetes/<environment>` to reflect your specific env
132105

133106
Create a secret for the erlang cookie:
134107
```bash
135-
kubectl create secret generic erlang --from-literal=erlang.cookie=$(LC_ALL=C tr -cd '[:alnum:]' < /dev/urandom | head -c 64)
108+
kubectl create secret generic erlang --from-literal=cookie=$(LC_ALL=C tr -cd '[:alnum:]' < /dev/urandom | head -c 64)
136109
```
137110

138111
Ensure that:

docker-compose-couchdb-data.yaml docker-compose-db.yaml

+15-11
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,21 @@ services:
33
kazoo:
44
container_name: kazoo
55
hostname: kazoo.local
6-
build: images/kazoo
7-
image: telephoneorg/kazoo:${TAG:-latest}
6+
build:
7+
args:
8+
KAZOO_VERSION: 4.1.40
9+
KAZOO_CONFIGS_VERSION: 4.1.21
10+
context: images/kazoo
11+
image: telephoneorg/kazoo:${DOCKER_TAG:-latest}
812
environment:
913
ERLANG_HOSTNAME: long
1014
ERLANG_COOKIE: test-cookie
11-
RABBITMQ_HOSTS: rabbitmq.local
15+
RABBITMQ_HOST: rabbitmq.local
1216
COUCHDB_HOST: couchdb.local
1317
COUCHDB_USER: admin
1418
COUCHDB_PASS: secret
1519
KAZOO_LOG_LEVEL: info
16-
KAZOO_APPS: blackhole,callflow,cdr,conference,crossbar,doodle,ecallmgr,fax,hangups,hotornot,konami,jonny5,media_mgr,milliwatt,omnipresence,pivot,registrar,reorder,stepswitch,sysconf,tasks,teletype,trunkstore,webhooks
20+
KAZOO_APPS: blackhole,callflow,cdr,conference,crossbar,doodle,ecallmgr,hangups,hotornot,konami,jonny5,media_mgr,milliwatt,omnipresence,pivot,registrar,reorder,stepswitch,sysconf,tasks,teletype,trunkstore,webhooks
1721
ports:
1822
- "5555:5555"
1923
- "8000:8000"
@@ -51,22 +55,22 @@ services:
5155
hostname: couchdb.local
5256
image: telephoneorg/couchdb:latest
5357
environment:
54-
ERLANG_HOSTNAME: long
5558
COUCHDB_DEV_INIT: 'true'
59+
ERLANG_COOKIE: test-cookie
5660
COUCHDB_ADMIN_USER: admin
5761
COUCHDB_ADMIN_PASS: secret
58-
ERLANG_COOKIE: test-cookie
59-
COUCHDB_SHARDS: 1
60-
COUCHDB_LOG_LEVEL: warn
62+
COUCHDB_SHARDS: '1'
63+
COUCHDB_LOG_LEVEL: info
6164
ports:
6265
- "5984:5984"
6366
- "5986:5986"
6467
networks:
6568
local:
6669
aliases:
6770
- couchdb.local
68-
cap_add:
69-
- SYS_NICE
70-
- SYS_RESOURCE
71+
couchdb-data:
72+
container_name: couchdb-data
73+
image: telephoneorg/couchdb-data:${DOCKER_TAG:-latest}
74+
command: sleep 9999
7175
networks:
7276
local:

docker-compose-minimal.yaml

-75
This file was deleted.

0 commit comments

Comments
 (0)