Highly trained cats for managing servers.
Project description
.. raw:: html
<h1 align="center" >CatOps</h1>
Highly trained cats for managing servers.
.. image:: https://github.com/BBOXX/CatOps/blob/master/docs/catops.jpg
:width: 100
:alt: Dedicated server support agent.
:align: center
What is CatOps?
---------------
CatOps is a very simple NoOps framework for deploying your own ChatOps bot.
Commands you wish to add to your CatOps implementation are added to a `plugins`
folder in the same directory, and will then be automatically imported and callable
using the function name.
Why CatOps?
--------------------------
- NoOps.
- Deploy, rewrite, and redeploy FaaS easily with no worrying about setting up and managing servers.
- Only charged when CatOps is called.
- Codify common maintenance procedures.
- Perform high level actions without intimate low level knowledge.
- Prevent errors doing complicated but routine tasks.
- Unify documentation.
- CatOps can act as a unified go-to location for help, merging/pooling all documentation into one place.
- Transparency.
- Team members can see all actions taken by others in solving a problem. Organic learning.
- No 'go-to' person for certain maintenance tasks.
- Everyone aware of server changes. No-one surprised that the server is down if they see `/meow restart server` in the chat.
- Spread knowledge; everyone becomes equally capable of solving problems.
- Out of date help messages or documentation is more obvious to everyone.
- Context-aware suggestions, suggest actions and display help depending on context.
- Docs/procedures/etc are useful, but can be too much to read through, hard to find, not up to date.
- Reduce clutter when trying to figure out next actions.
- Reduce context switching.
- No need for bash, Linux, ssh or VPN to fix most server issues.
- No checking server logs.
- Easily accesible and readble output.
- Control access.
- Only gives necessary access, no unnecessary ssh-ing into production!
Features
--------
- Completely NoOps.
- Easily extensible.
- Pay per invocation.
- Provider agnostic.
Example
--------
Python handler
^^^^^^^^^^^^^^^
.. code-block:: python
from catops import dispatch
import json
def endpoint(event, context):
# event = {'command':['meow', 'hi']} # example event passed to lambda
params = event['command']
try:
s = dispatch(params)
except Exception as err:
s = str(err)
response = {
"statusCode": 200,
"body": json.dumps(s)
}
return response
Example plugin
^^^^^^^^^^^^^^
.. code-block:: python
"""example.py - example plugin for ChatOps."""
def hi(*args):
return "Meow!"
Serverless configuration
^^^^^^^^^^^^^^^^^^^^^^^^
.. code-block:: yaml
service: CatOps
package:
include:
- handler.py
- plugins/**
custom:
pythonRequirements:
slim: true
provider:
name: aws
runtime: python3.6
profile: serverless
functions:
dispatcher:
handler: handler.endpoint
events:
- http:
path: ping
method: get
plugins:
- serverless-python-requirements
Deploy and Test
^^^^^^^^^^^^^^^
.. code-block:: bash
serverless deploy
serverless invoke --function dispatcher --path /path/to/json/data --log
See examples_ for more.
.. _examples: https://github.com/bboxx/catops/example/
Installation
------------
.. code-block:: bash
sudo apt-get install npm
sudo npm install -g serverless
npm install serverless-python-requirements
pip install catops
Install :code:`serverless-python-requirements` in the same dir as :code:`serverless.yml`.
Limitations
-----------
- Passive rather than active; needs to be triggered (e.g. by Slack slash commands)
- Limitations of FaaS
- Max size (256MB for AWS Lambda)
- Execution time limit (5 minute for AWS Lambda)
- No state (recommend using a cloud-based database for state e.g. DynamoDB for AWS)
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
catops-0.0.6.tar.gz
(7.3 kB
view hashes)
Built Distribution
Close
Hashes for catops-0.0.6-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71be1e167d62b65a614afb23002463b4901372d0bc05d3e2b14fefd16fa42593 |
|
MD5 | 42d4ca3bec09d18c8349efb567256d6d |
|
BLAKE2b-256 | fde622b60985037722a39b5f01d7a0652d13320b6e251d14de11b7e7a89edbeb |