This repository has been archived by the owner on Feb 2, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
config: Now JSON and Etcd based by default.
- Loading branch information
Showing
15 changed files
with
375 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,9 @@ | |
__pycache__/ | ||
*.py[cod] | ||
|
||
# Generated doc | ||
doc/_build | ||
|
||
# C extensions | ||
*.so | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"version": 1, | ||
"formatters": { | ||
"simple": { | ||
"format": "%(asctime)s - %(name)s - %(process)d - %(thread)d - %(levelname)s - %(message)s" | ||
} | ||
}, | ||
"handlers": { | ||
"console": { | ||
"class": "logging.StreamHandler", | ||
"formatter": "simple", | ||
"level": "DEBUG", | ||
"stream": "ext://sys.stdout" | ||
} | ||
}, | ||
"loggers": { | ||
"authentication": { | ||
"handlers": ["console"], | ||
"level": "DEBUG", | ||
"propagate": false | ||
}, | ||
"resources": { | ||
"handlers": ["console"], | ||
"level": "DEBUG", | ||
"propagate": false | ||
}, | ||
"watcher": { | ||
"handlers": ["console"], | ||
"level": "DEBUG", | ||
"propagate": false | ||
} | ||
}, | ||
"root": { | ||
"handlers": ["console"], | ||
"level": "DEBUG" | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"a": { | ||
"hash": "$2b$12$PtOoiwTvFBAJPMfrZn7pXubcx5MBbQiLVEDv3LAVWGeKiZZiYRGlu" | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
Getting Started | ||
=============== | ||
|
||
Installation | ||
------------ | ||
|
||
Development/Manual | ||
~~~~~~~~~~~~~~~~~~ | ||
To test out the current development code you will need the following installed: | ||
|
||
* Python2.7 | ||
* virtualenv | ||
* etcd2 (running) | ||
|
||
Set up virtualenv | ||
````````````````` | ||
|
||
.. code-block:: shell | ||
$ virtualenv /where/you/want/it/to/live | ||
... | ||
(virtualenv)$ . /where/you/want/it/to/live/bin/activate | ||
(virtualenv)$ pip install -r requirements.txt | ||
... | ||
(Optional): Run Unittests | ||
````````````````````````` | ||
From the repo root... | ||
|
||
.. code-block:: shell | ||
(virtualenv)$ pip install -r test-requirements.txt | ||
... | ||
(virtualenv)$ nosetests -v --with-coverage --cover-package commissaire --cover-min-percentage 80 test/ | ||
Adding a Host Manually | ||
`````````````````````` | ||
Verify that etcd is running then execute... | ||
|
||
.. code-block:: shell | ||
(virtualenv)$ etcdctl set /commissaire/hosts/10.0.0.1 '{"address": "10.0.0.1","status": "available","os": "atomic","cpus": 2,"memory": 11989228,"space": 487652,"last_check": "2015-12-17T15:48:18.710454"}' | ||
(Optional): Put Configs in Etcd | ||
``````````````````````````````` | ||
commissaire will default back to the local files but using Etcd is where configuration should be stored. | ||
|
||
.. code-block:: shell | ||
(virtualenv)$ cat conf/users.json | etcdctl set '/commissaire/config/httpbasicauthbyuserlist' | ||
... | ||
(virtualenv)$ cat conf/logger.json | etcdctl set '/commissaire/config/logger' | ||
... | ||
Running the service | ||
``````````````````` | ||
From the repo root... | ||
|
||
.. code-block:: shell | ||
(virtualenv)$ PYTHONPATH=`pwd`/src python src/commissaire/script.py http://127.0.0.1:2379 & | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,8 @@ Contents: | |
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
gettingstarted | ||
logging | ||
authentication | ||
endpoints | ||
enums | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Logging | ||
======= | ||
Logging configuration is defined either in Etcd or via a local file. In both | ||
cases the syntax is the same. | ||
|
||
|
||
Example: Default Local file | ||
--------------------------- | ||
|
||
.. literalinclude:: ../conf/logger.json | ||
:language: json | ||
|
||
|
||
Using Etcd | ||
---------- | ||
|
||
To put the configuration in Etcd set the ``/commissaire/config/logger`` key with | ||
valid JSON. | ||
|
||
.. code-block:: shell | ||
(virtualenv)$ cat conf/logger.json | etcdctl set '/commissaire/config/logger' | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
gevent==1.1rc3 | ||
falcon>=0.3 | ||
bcrypt | ||
PyYAML | ||
python-etcd==0.4.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.