Files
heroku-buildpack-python/builds
Ed Morley e621ff4d5e Improve the workflow for generating binaries for Heroku-16 (#387)
* Updates bob-builder to a version that clears out the previous
  build directory, which prevents the stale files seen in #379.
* Adds a `buildenv-heroku-16` Make command to simplify the
  building and use of the Heroku-16 binary build environment.
* Sets `S3_BUCKET` and `S3_PREFIX` in the Docker image, to save
  having to do so manually each time.
* Removes the duplication of the bob-builder dependency between
  `Dockerfile` and `requirements.txt`.
* Disables the pip version check during Docker build, to avoid the
  noisy stderr warning about Ubuntu 16.04 pip being older (v8.1.1).
* Adds a `.dockerignore` to speed up the Docker build, by reducing
  the build context transferred to the daemon from 60MB to 2MB.
* Applies some Dockerfile best practices like disabling/removing
  cached files (since layer invalidation makes caching pointless).
2017-05-25 11:55:57 -07:00
..
2017-02-23 11:15:39 -05:00
2017-05-25 10:55:01 -07:00

Python Buildpack Binaries

For Cedar-14 stack

To get started with it, create an app on Heroku inside a clone of this repository, and set your S3 config vars:

$ heroku create --buildpack https://github.com/heroku/heroku-buildpack-python#not-heroku
$ heroku config:set WORKSPACE_DIR=builds
$ heroku config:set AWS_ACCESS_KEY_ID=<your_aws_key>
$ heroku config:set AWS_SECRET_ACCESS_KEY=<your_aws_secret>
$ heroku config:set S3_BUCKET=<your_s3_bucket_name>

Then, shell into an instance and run a build by giving the name of the formula inside builds:

$ heroku run bash
Running `bash` attached to terminal... up, run.6880
~ $ bob build runtimes/python-2.7.6

Fetching dependencies... found 2:
  - libraries/sqlite

Building formula runtimes/python-2.7.6:
    === Building Python 2.7.6
    Fetching Python v2.7.6 source...
    Compiling...

If this works, run bob deploy instead of bob build to have the result uploaded to S3 for you.

To speed things up drastically, it'll usually be a good idea to heroku run bash --size PX instead.

For Heroku-16 stack

  1. Ensure GNU Make and Docker are installed.
  2. From the root of the buildpack repository, run: make buildenv-heroku-16
  3. Follow the instructions displayed!

Enjoy :)