misterio CLI
Project description
What is Misterio?
Docker-compose based Ansible/SaltStack/NameYour minimalistic alternative.
It is super-easy to use.
Cool! The new python version is easier to use and understand.
Misterio is a python command you can use to "apply" a set of roles to a infinite numbers of hosts. Less then 150 lines of python code HELP INCLUDED (sorry Ansible :)
Misterio is able to manage a set of compose target as an one, appling status changes easily.
Simple usage example
Suppose to have two hosts called alice and bob. You want to run elasticsearch on both of them, and one gitlab instance on bob. So you define:
misterio_project/ # Misterio home directory
├── hosts/
│ ├── alice/
│ │ └── elasticsearch.env # empty file
│ └── bob/
│ └── gitlab.env # empty file
| elasticsearch.env # empty file
└── roles/
├── elasticsearch/
│ └── docker-compose.yml
└── gitlab/
└── docker-compose.yml
Then running something like
misterio --home ./misterio_project rebuild
will build the service and run them. To see the log you can use
misterio --home ./misterio_project -- logs --tail 10
For simple stats on a single host:
misterio -h xwing -- stats --no-stream
You can further customize the roles, adding variable inside the elasticsearch.env file (like Elastic Search cluster details)
Why?
- The only dependency is a recent version of
dockerCE (on target hosts) andpython3 (on misterio host). - It does not rely on docker swarm or on K8s. It can run even on ultra-small nano containers on Amazon (1GB RAM), provided you have a little swap (tested)
- It is agent-less. It depends only on
docker daemonon the target. Docker communication is done via ssh and can be further configured via the.ssh/configfile (for instance to setup keys, tunneling, etc) - Everything must be versioned to work: you cannot easily "forget" something on your local machine. It respect the Infrastructure as Code paradigm.
Details on env file
For every hostname, define a directory inside hosts/
Put in it an env file based on this syntax:
<rolename>[@inst].env
where @inst is OPTIONAL and can be used to have multiple instances of a role on the same machine. Misterio will configure them one by one.
The magic
For every role on the target machine misterio will:
- for each role, copy the correct
envfile calling it .env - pass the command you provide to
docker-compose - fail fast or loop
The "rebuild" pseudo-command will do a down + build and up in one step.
Distributed
Because misterio manage the DOCKER_HOST automatically, it is already distributed.
Python official version
Look at https://pypi.org/project/misterio/ for the latest version
Python development version
Install on your virtualenv with
python -m venv .venv
. .venv/bin/activate
pip install -e .
misterio --help
Support command
misterio-mv command can be used to migrate a staless service from one host to another. It remove (compose down) the source service, move the env file and then reboot (up -d) the other one.
misterio-rm command delete a role from a host, ensuring it is destroied and no dandling instances are kept.
The Bonus: stacks
Misterio is also a collection of ready-made docker-compose infrastructure you can jump into. For instance, jenkins-with-docker show you how to get a dockerized-jenkins with:
- self running git server
- access to docker daemon to self-build stuff using docker plugin
Tips
You can use the pseudo command --list to get the list of all the roles, and the --single-role option to restrict only to a role.
Under docker for Windows, add COMPOSE_CONVERT_WINDOWS_PATHS=1 to your env path if you plan to bind stuff like
/var/run/docker.sock:/var/run/docker.sock
This will enable your roles to run on Windows and on Linux dameons seamlessly. See https://stackoverflow.com/a/52866439/75540 for more details
The Hype
- You can add git submodules below
roles/to link recipes (your personal "ansible galaxy" is... docker hub!) - No complex stuff to learn: it is just DOCKER!
Podman
Podman is not tested, and it could require a modification to the way the DOCKER_HOST variable is addressed too. anyway, if you are able to create a pull request with a --podman option, I will be happy to merge it.
Other alternative
https://github.com/piku/piku is an heroku-like alternative, based on python and not requiring docker.
Legacy
The old misterio bash version can be found under ./old_sh_version folder: it is a 4 years old version, which can still be used if want to further reduce depencencies on misterio controlling host.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file misterio-0.1.2.tar.gz.
File metadata
- Download URL: misterio-0.1.2.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c8e24431f8b697876a488b58539870af06475ba28f1c6978585466787af7e12c
|
|
| MD5 |
44e96f420bf553a659b4028f9f4d8c1f
|
|
| BLAKE2b-256 |
533bb4d3aead75e581e9f3da36de57f3849afa9e179f1923ab2d20c2cce1e2bb
|
File details
Details for the file misterio-0.1.2-py3-none-any.whl.
File metadata
- Download URL: misterio-0.1.2-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f3f423a67f8de09a0ec646b485933ac633d5fb3358e29ad6f2846cf4fd52200a
|
|
| MD5 |
335bb342a7f9c4f12c4ae266bd5e86b4
|
|
| BLAKE2b-256 |
f238f0c1454e2540b6cc0df5a1e82c2cda3c9925a34fff6a7e8c34667b042b76
|