Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/smintz/nomadgen
Configuration util in python syntax for Hashicorp's Nomad
https://github.com/smintz/nomadgen
hcl nomad python thrift
Last synced: about 2 months ago
JSON representation
Configuration util in python syntax for Hashicorp's Nomad
- Host: GitHub
- URL: https://github.com/smintz/nomadgen
- Owner: smintz
- License: mit
- Created: 2017-03-01T14:54:58.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-07-10T07:09:22.000Z (3 months ago)
- Last Synced: 2024-07-10T09:05:11.876Z (3 months ago)
- Topics: hcl, nomad, python, thrift
- Language: Python
- Size: 97.7 KB
- Stars: 22
- Watchers: 5
- Forks: 3
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# nomadgen
Craft your [Hashicorp's Nomad](https://nomadproject.io) job specs in python.
Still under development.
### Motivation
Nomad is a great job/task scheduler but HCL is pretty limited. This tool will allow you to easily create job specs in python. Its heavily inspired by Facebook's [configerator](http://muratbuffalo.blogspot.co.il/2016/02/holistic-configuration-management-at.html).
### Install and run
1. `pip install nomadgen`
2. See JSON output: `python jobspec.py`
3. Apply to Nomad: `python jobspec.py --run`### Examples
* [Redis](https://github.com/smintz/nomadgen/blob/master/examples/redis.py) - See how to use same basic task spec config with different drivers (Docker, rkt, qemu).
* [Hashiapp](https://github.com/smintz/nomadgen/blob/master/examples/hashiapp.py) - Blue/Green deployments made easy.
* [periodic](https://github.com/smintz/nomadgen/blob/master/examples/periodic.py) - Periodic task example.
* [common/resources](https://github.com/smintz/nomadgen/blob/master/examples/common/resources.py) - How to simplfy your API even better.## Contribute:
1. Clone the repo
1. Install the thrift compiler
```
sudo apt-get install thrift-compiler
```
1. Install requirements
```
sudo pip install -r requirements.txt
```
1. Build and install locally
```
make
```
1. Run the examples/hashiapp.py to validate output
```
VAULT_TOKEN="" python examples/hashiapp.py
```
1. Run examples/hashiapp.py against nomad agent to run it
```
VAULT_TOKEN="" python examples/hashiapp.py --run
```License: MIT