Skip to content

davidhadas/python-buildpack

 
 

Cloud Foundry buildpack: Python

A Cloud Foundry buildpack for Python based apps.

This buildpack extends the Cloud Foundry buildpack which is based on the [Heroku buildpack] (https://github.com/heroku/heroku-buildpack-python).

The buildpack was adapted to allow support for extending the python application with diversified C/C++ shared libraries. The shared libraries can be pushed as part of the application by placing them in the SharedLib/ library.

Additional information can be found at CloudFoundry.org.

Usage

This buildpack will be used if there is a requirements.txt or setup.py file in the root directory of your project.

cf push my_app -b https://github.com/cloudfoundry/buildpack-python.git

Disconnected environments

To use this buildpack on Cloud Foundry, where the Cloud Foundry instance limits some or all internet activity, please read the Disconnected Environments documentation.

Vendoring app dependencies

As stated in the Disconnected Environments documentation, your application must 'vendor' it's dependencies.

For the Python buildpack, use pip:

cd <your app dir>
mkdir -p vendor

# vendors all the pip *.tar.gz into vendor/
pip install --download vendor -r requirements.txt

cf push uploads your vendored dependencies. The buildpack will install them directly from the vendor/.

Building

The buildpack only supports the two most stable patches for each dependency in the manifest.yml.

  1. Make sure you have fetched submodules
git submodule update --init
  1. Get latest buildpack dependencies
BUNDLE_GEMFILE=cf.Gemfile bundle
  1. Build the buildpack
BUNDLE_GEMFILE=cf.Gemfile bundle exec buildpack-packager [ uncached | cached ]
  1. Use in Cloud Foundry

    Upload the buildpack to your Cloud Foundry and optionally specify it by name

    cf create-buildpack custom_python_buildpack python_buildpack-cached-custom.zip 1
    cf push my_app -b custom_python_buildpack

Deprecated Versions

If you would like to build the buildpack with previously supported dependency versions, provide the --use-custom-manifest=manifest-including-unsupported.yml option to buildpack-packager.

Contributing

Find our guidelines here.

Reporting Issues

Open an issue on this project

Active Development

The project backlog is on Pivotal Tracker

About

Extending Cloud Foundry buildpack for the Python

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 87.0%
  • Ruby 9.9%
  • Python 2.8%
  • Makefile 0.3%