Skip to content

Commit

Permalink
architecture doc
Browse files Browse the repository at this point in the history
includes image + xml source for image used on https://draw.io/
  • Loading branch information
stone committed Mar 15, 2017
1 parent c9d7805 commit 84ec88c
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 1 deletion.
64 changes: 64 additions & 0 deletions docs_mkdocs/docs/about/architecture.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# The Fermentrack architecture

The Fermentrack stack is based on a front end application, a controller and a firmware
running on the device that handles reading temperatures, switching cooling and heating etc.
Everything but the firmware part is running under a process manager, which takes care of
launching the front end and brewpi.py controller scripts.

![Fermentrack Architechture](img/fermentrack.png)

See [components](components.md) documentation for links and licenses.

## The webserver nginx and chausette WSGI server

Used to proxy http requests to chausette over WSGI to the Fermentrack django application.

## cron

Used to start the Fermentrack stack, it starts the Circus process manager via a @reboot job,
it also checks the status of circus every 10 seconds, if it not running it will start it.
All this is handled by a script: *updateCronCircus.sh*

Supports the following arguments: *{start|stop|status|startifstopped|add2cron}* where:

* *start* - will start circusd and all the services
* *stop* - will quit circusd and all processes (note it would be started again in 10 minutes)
* *status* - will output a status of all processes running (see below)
* *startifstopped* - will start the process manager if stopped (called from cron every 10 minutes)
* *add2cron* - if crontab entries are missing, it will add them back.

Crontab entries added with *add2cron*:

@reboot ~/fermentrack/brewpi-script/utils/updateCronCircus.sh start
*/10 * * * * ~/fermentrack/brewpi-script/utils/updateCronCircus.sh startifstopped


Example *status* output:

$ ~/fermentrack/brewpi-script/utils/updateCronCircus.sh status
Fermentrack: active
brewpi-spawner: active
circusd-stats: active
dev-brewpi1: active


## The process manager *circus*

Fermentrack is started at boot with the help of cron (see *cron*), the process manager handles
all the different processes needed by Fermentrack.

* **Fermentrack** - The django application (web interface) runs under chausette
* **brewpi-spawner** - An internal Fermentrack process for spawning controller scripts for controlling controllers like brewpi-esp8266.
* **circusd-stats** - An Internal circus process for stats, not used yet.
* **dev-brewpi1** - Is a controller script spawned by brewpi-spawner, handing a controller.

Circus documentation can be found [here](https://circus.readthedocs.io/en/latest/).

## Logging

* Circus process manager logs:
- */home/fermentrack/fermentrack/log/circusd.log*
* Controller script (brewpi.py) log:
- */home/fermentrack/fermentrack/log/dev-[name]-stdout.log*
* Controller script (brewpi.py) error/info log:
- */home/fermentrack/fermentrack/log/dev-[name]-stderr.log*
Binary file added docs_mkdocs/docs/about/img/fermentrack.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs_mkdocs/docs/about/img/fermentrack.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<mxfile userAgent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36" version="6.3.4" editor="www.draw.io" type="device"><diagram name="Page-1">7Vvfc5s4EP5rPNN7uAwgwPgxcZL2Zq53nfqh7VNHBhmrwYgTcmzfX38rQOaHZJ9TY3vqJA+J2BUgfd9qd7UiAzRerN9znM0/sogkA8eK1gN0P3Ac23Vc+CMlm1IytP1SEHMaVZ1qwYT+SyqhVUmXNCJ5q6NgLBE0awtDlqYkFC0Z5pyt2t1mLGm/NcMx0QSTECe69AuNxLyUBo5fyz8QGs/Vm21/VGqmOHyKOVum1fsGDpoVP6V6gdWzqonmcxyxVUOEHgZozBkTZWuxHpNEYqtgK+973KHdjpuTVBxyA6rG8YyTZTX3zzjPpoTzDYg/0WqYYqOgKSZH5O32AN2t5lSQSYZDqV2BMYBsLhZJpY45jigMZcwSxov7FRzobsZSUTFvw7zvcELjFC5C6E+g890z4YICJ7eVQjD59Gq8oCPrnZO2t1CCiRK2IKKYjroBBeUtmzYIq5pqL6hk8wbNnjJPXJlXvH10DTE0KpTNiHsa4APHxws5tXSalzO0ehONKQ+XuWSSs5DksvURp2C+/Dhiu+SZuZrRJGlQH3kkiFyQ54KzJ9LQBM4U+X7DCBIyE/9jPz0YguOMWoZg+7olIJMlILcHS3A1CkgEXqi6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gr/lrGPVF7cVPD/1OmqiOU3adHnqqPGXuf/wnePqeZvz577+MJ4bSGuT5U/0Vb/l7VyFMewSk3c9y+x/OSfh0mkPGS+8CNH4N5woj07fbL9/sw2X9IX5Jff3fDujhPw==</diagram></mxfile>
3 changes: 2 additions & 1 deletion docs_mkdocs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ pages:
- 'Native Python (Fuscus)': 'hardware/Native Python.md'
- 'Spark Core': 'hardware/Spark.md'
- About:
- 'Architecture': 'about/architecture.md'
- 'Contribute': 'about/contribute.md'
- 'Changelog': 'about/changelog.md'
- 'License': 'about/license.md'
- 'Included Components': 'about/components.md'

- Develop:
- 'Index': 'develop/index.md'
- 'Models': 'develop/models.md'
- 'Models': 'develop/models.md'

0 comments on commit 84ec88c

Please sign in to comment.