Package: birdhousebuilder.recipe.supervisor
Introductionbirdhousebuilder.recipe.supervisoris aBuildoutrecipe to configureSupervisorservices withAnaconda.
This recipe is used by theBirdhouseproject.UsageThe recipe requires that Anaconda is already installed. You can use the buildout optionanaconda-hometo set the prefix for the anaconda installation. Otherwise the environment variableCONDA_PREFIX(variable is set when activating a conda environment) is used as conda prefix.The recipe will install thesupervisorpackage from a conda channel in a conda environment defined byCONDA_PREFIX. It deploys a supervisor configuration for a given service. The intallation folder is given by theprefixbuildout option. The configuration will be deployed in the birdhouse enviroment${prefix}/etc/supervisor/conf.d/myapp.conf. Supervisor can be started with${prefix}/etc/init.d/supervisordstart.The recipe depends onbirdhousebuilder.recipe.condaandzc.recipe.deployment.Supported optionsThis recipe supports the following options:anaconda-homeBuildout option pointing to the root folder of the Anaconda installation. Default:$HOME/anaconda.Buildout options forsupervisord:supervisor-portBuildout option to set the supervisor port. Default is 9001.supervisor-hostBuildout option to set supervisor host. Default is 127.0.0.1.supervisor-usernameBuildout option to set username for http monitor access. Default: Nonesupervisor-passwordBuildout option to set password for http monitor access. Default: Nonesupervisor-use-monitorBuildout option wheather to enable http monitor interface. Default: truesupervisor-loglevelBuildout option for supervisor log level. Default: infoBuildout part options for the program section:prefixDeployment option to set the prefix of the installation folder. Default:/userDeployment option to set the run user.etc-userDeployment option to set the user of the/etcdirectory. Default:rootprogramThe name of the supervisor service.commandThe command to start the service.directoryThe directory where the command is started.priorityThe priority to start service (optional). Default is 999.autostartStart service automatically (optional). Default istrue.autorestartRestart service automatically (optional). Default isfalse.stdout-logfilelogfile for stdout (optional). Default is${prefix}/var/log/supervisor/${program}.logstderr-logfilelogfile for stderr (optional). Default is${prefix}/var/log/supervisor/${program}.logstartsecsSeconds the service needs to be online before marked asstarted(optional). Default is 1.stopwaitsecsSeconds to wait before killing service (optional). Default 10.killasgroupKill also child processes (optional). Defaultfalse.NoteTheDAEMON_OPTSenvironment variable can be used to set additional start parameters for supervisord.
For exampleDAEMON_OPTS=-nto start supervisord in foreground.For supervisor configuration details see thedocumentation.Example usageThe following examplebuildout.cfginstalls a Supervisor configuration formyappweb application:[buildout]
parts = myapp

anaconda-home = /opt/anaconda
supervisor-host = 127.0.0.1
supervisor-port = 9001
supervisor-use-monitor = true

[myapp]
recipe = birdhousebuilder.recipe.supervisor
prefix = /
user = www-data
program = myapp
command = ${buildout:bin-directory}/gunicorn -b unix:///tmp/myapp.socket myapp:app
directory = /tmpAuthorsCarsten Ehbrecht ehbrecht at dkrz.deChanges0.4.0 (2018-03-20)cleaned up buildout.cfg (#5).0.3.5 (2016-12-12)pep8.update MANIFEST.in: ignore temp files.0.3.4 (2016-07-26)fixed zc.recipe.egg import.0.3.3 (2016-07-05)sets env: USER, LOGNAME, HOME0.3.2 (2016-07-04)fixed bool_options.0.3.1 (2016-07-04)added skip-user option.0.3.0 (2016-06-30)updated buildout and doctests.enabled travis.replaced conda.makedirs by os.makedirs.using zc.recipe.deployment.using run-directory.0.2.8 (2015-12-22)fixed use-monitor option.0.2.7 (2015-12-22)cleaned up configuration files.added more supervisord options: host, port, username, password, use_monitor.0.2.6 (2015-12-07)remove supervisor config files after uninstall.0.2.5 (2015-09-21)added DAEMON_OPTS env variable to set additional parameters when starting supervisord.0.2.4 (2015-07-15)addedstopsignaloption.fixedstopasgroupoption.0.2.2 (2015-06-25)cleaned up templates.added user and chown option.0.2.1 (2015-05-18)added more options for program configuration.setting default logfile name for service.0.2.0 (2015-02-24)installing in conda enviromentbirdhouse.using$ANACONDA_HOMEenvironment variable.separation of anaconda-home and installation prefix.0.1.5 (2015-01-22)bugfix: var/log/supervisor directory is now created.0.1.4 (2014-12-06)Don’t update conda on buildout update.0.1.3 (2014-07-31)Updated documentation.0.1.2 (2014-07-24)Removed workaround “kill nginx”.0.1.1 (2014-07-22)Not using supervisor-host option.0.1.0 (2014-07-10)Initial Release.