A Cloud Foundry buildpack for Python based apps.
This is based on the [Heroku buildpack] (https://github.com/heroku/heroku-buildpack-python).
Additional information can be found at CloudFoundry.org.
This buildpack will be used if there is a requirements.txt
or setup.py
file in the root directory of your project. Since we are using this to deploy to Bluemix you must specify a more recent ubuntu stack than the default one (bluemix runtimes default to Lucid64).
cf push -b https://github.com/innovateonline/python-buildpack.git -s cflinuxfs2
Note that in our workflow my_app is always specified in the manifest.yml
. Only production environments require app name overrides (with cf push prod_app_name
)
To use this buildpack on Cloud Foundry, where the Cloud Foundry instance limits some or all internet activity, please read the Disconnected Environments documentation.
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/
.
The buildpack only supports the two most stable patches for each dependency in the manifest.yml.
- Make sure you have fetched submodules
git submodule update --init
- Get latest buildpack dependencies
BUNDLE_GEMFILE=cf.Gemfile bundle
- Build the buildpack
BUNDLE_GEMFILE=cf.Gemfile bundle exec buildpack-packager [ uncached | cached ]
-
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
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
.
Find our guidelines here.
Open a GitHub issue on this project at https://github.com/cloudfoundry/python-buildpack/issues/new
The project backlog is on Pivotal Tracker