Coder Social home page Coder Social logo

bhodges / uwsgi-emperor-formula Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zulily/uwsgi-emperor-formula

0.0 2.0 0.0 8 KB

A SaltStack formula for managing uwsgi-emperor and vassals.

License: Apache License 2.0

SaltStack 80.82% HTML 19.18%

uwsgi-emperor-formula's Introduction

uwsgi-emperor

The uwsgi-emperor salt formula manages the installation of uwsgi and its configuration files, including an arbitrary number of vassal ini (webapp configurations) files, running uwsgi in "emperor" mode.

Available states

The main entry point, install uwsgi-emperor, plugins, and bring up any configured vassals. uwsgi-emperor vassal files define one or more webapps. It is expected that these webapps are already in place, including any python virtual environments, prior to installing uwsgi-emperor. The formula has no concept of a 'first run / initial install' check built-in, any changes to pillar will cause a uwsgi restart which may not be desirable!

Manages the emperor.ini file and more importantly, individual vassal ini files that instruct uwsgi on how to interface with webapps, as well as the locations for python virtual enviroments.

Installs the uwsgi-emperor package, plugins (e.g. the python plugin), configures the log directory and pushes the uwsgi_params file that nginx is dependent on.

Configures log rotation for all vassals. Logrotation for emperor is already included in the debian package

(warning) init.sls for the uwsgi_emperor formula includes config.sls, which performs a restart if the emperor.ini or any of the vassal ini files change. Running these states should only be performed on new or out-of-rotation servers. Pillar Data

Other Notes

  • For all vassals, nginx must be made aware of vassal sockets and uwsgi apps through the nginx configuration, specifically "upstream" and "location" stanzas, for example:
upstream api {
  server 127.0.0.1:8000;
}

...

location / {
  uwsgi_pass api;
  include /etc/uwsgi-emperor/uwsgi_params;
}

ToDo / Known Issues

  • Add support for non-Debian-based distributions

License

Apache License, version 2.0. Please see LICENSE

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.