Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

RSS

opsworks_python (3) Versions 0.0.1

Deploys and configures python based applications with supervisor

Berkshelf/Librarian
Policyfile
Knife
cookbook 'opsworks_python', '= 0.0.1'
cookbook 'opsworks_python', '= 0.0.1', :supermarket
knife cookbook site install opsworks_python
knife cookbook site download opsworks_python
README
Dependencies
Changelog
Quality

opsworks_python Cookbook

This cookbook is designed to be able to describe and deploy python applications on AWS OpsWorks with supervisor.

Requirements

Chef 0.10.0 or higher required (for Chef environment use).

The following Opscode cookbooks are dependencies:

  • python
  • supervisor

Additionally, the AWS OpsWorks following cookbooks are required:

  • deploy
  • scm_helper

Stack/Layer configuration

Stack configuration

In your stack, update enable your custom json:

{
 "deploy": {
    "my_python_app": {
        "custom_type": "python", // Required otherwise the recipe will skip
  // List of package to install (optional)
  "packages": { 
    "pip_package_name": "latest",
  },
  // OS packages  (optional)
  "os_packages": { 
    "package_name": "lasest"
  },
  "opsworks_python": {
    "supervisor": {
        // supervisor options
    }
  }
}

Recipes

python

The python deploy recipe creates a virtualenv and installs specified OS and python packages. This is the default recipe. These attributes can be set on the deploy configuration (node[:deploy][application_name]) or globally (node["opsworks_python"]).

Attribute Parameters

  • packages: a list of python packages to be installed in the virtualenv
  • os_packages: a list of OS packages to be installed on the instance
  • venv_options: a string with command line options for virtualenv creation (defaults to --no-site-packages)
  • python_major_version: the major version of python to use (only allowable in the deploy configuration, not globally), allows you to use python 2.4, 2.5 or 2.6 as needed.
  • python-undeploy: removes the virtual env and stops supervisor for the app

supervisor

by default supervisor looks for application.py into your app folder. If your entrypoint is different set:

["opsworks_python"]["supervisor"]["script"] = 'myscript.py' 

If you want supervisor to use a specific command: ["opsworks_python"]["supervisor"]["command"] = 'mycommand' 

Other supervisor options for the service are described here

Disable supervisor

set node["opsworks_python"]["supervisor"]["disabled"] = true and supervisor will be disabled.

Bugfix for R3 Instances

OpsWorks currently has a bug that affects r3 class instances, where the ephemeral instance storage is not formatted or mounted on initial load. This causes reboots to fail, since the volume is listed in fstab, and also results in reduced space available on /mnt.

To workaround this issue, this package contains a custom recipe that formats and mounts the default ephemeral volume on r3 instances. To enable the recipe, add the opsworks_deploy_python::r3-mount-patch recipe to the start of the setup section of any layers that might run on an r3 instance.

More info here.

License & Authors

With thanks to Jazkarta, Inc. and KCRW Radio ```text Copyright 2014, Alec Mitchell

Licensed under the BSD License. ```

Dependent cookbooks

supervisor >= 0.0.0
python >= 0.0.0
opsworks_initial_setup >= 0.0.0
scm_helper >= 0.0.0
deploy >= 0.0.0

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

application_buildout Cookbok CHANGELOG

Foodcritic Metric
            

0.0.1 failed this metric

FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/7dc3637a53839f3b7bc5f66f/opsworks_python/attributes/supervisor.rb:1
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/7dc3637a53839f3b7bc5f66f/opsworks_python/attributes/supervisor.rb:10
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/7dc3637a53839f3b7bc5f66f/opsworks_python/attributes/supervisor.rb:11
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/7dc3637a53839f3b7bc5f66f/opsworks_python/definitions/python_base_setup.rb:85
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/7dc3637a53839f3b7bc5f66f/opsworks_python/definitions/python_dependencies.rb:7
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/7dc3637a53839f3b7bc5f66f/opsworks_python/recipes/deploy.rb:7
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/7dc3637a53839f3b7bc5f66f/opsworks_python/recipes/r3-mount-patch.rb:5
FC002: Avoid string interpolation where not required: /tmp/cook/7dc3637a53839f3b7bc5f66f/opsworks_python/recipes/deploy.rb:14
FC015: Consider converting definition to a LWRP: /tmp/cook/7dc3637a53839f3b7bc5f66f/opsworks_python/definitions/python_base_setup.rb:1
FC015: Consider converting definition to a LWRP: /tmp/cook/7dc3637a53839f3b7bc5f66f/opsworks_python/definitions/python_dependencies.rb:1
FC015: Consider converting definition to a LWRP: /tmp/cook/7dc3637a53839f3b7bc5f66f/opsworks_python/definitions/supervisor_deploy.rb:1
FC019: Access node attributes in a consistent manner: /tmp/cook/7dc3637a53839f3b7bc5f66f/opsworks_python/definitions/python_base_setup.rb:62
FC023: Prefer conditional attributes: /tmp/cook/7dc3637a53839f3b7bc5f66f/opsworks_python/definitions/python_base_setup.rb:76
FC023: Prefer conditional attributes: /tmp/cook/7dc3637a53839f3b7bc5f66f/opsworks_python/recipes/r3-mount-patch.rb:20