Giter VIP home page Giter VIP logo

python-buildpack's Introduction

Cloud Foundry Python Buildpack

CF Slack Join us on Slack

A Cloud Foundry buildpack for Python based apps.

This buildpack supports running Django and Flask apps.

Buildpack User Documentation

Official buildpack documentation can be found at python buildpack docs.

Building the Buildpack

To build this buildpack, run the following commands from the buildpack's directory:

  1. Source the .envrc file in the buildpack directory.

    source .envrc

    To simplify the process in the future, install direnv which will automatically source .envrc when you change directories.

  2. Install buildpack-packager

    go install github.com/cloudfoundry/libbuildpack/packager/buildpack-packager
  3. Build the buildpack

    buildpack-packager build [ --cached=(true|false) ]
  4. Use in Cloud Foundry

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

    cf create-buildpack [BUILDPACK_NAME] [BUILDPACK_ZIP_FILE_PATH] 1
    cf push my_app [-b BUILDPACK_NAME]

Testing

Buildpacks use the Cutlass framework for running integration tests.

To test this buildpack, run the following commands from the buildpack's directory:

  1. Source the .envrc file in the buildpack directory.

    source .envrc

    To simplify the process in the future, install direnv which will automatically source .envrc when you change directories.

  2. Run unit tests

    ./scripts/unit.sh
  3. Run integration tests

    Buildpacks use the Cutlass framework for running integration tests against Cloud Foundry. Before running the integration tests, you need to login to your Cloud Foundry using the cf cli:

    cf login -a https://api.your-cf.com -u [email protected] -p pa55woRD

    Note that your user requires permissions to run cf create-buildpack and cf update-buildpack. To run the integration tests, run the following command from the buildpack's directory:

    ./scripts/integration.sh
  4. Note: To run the network tests, you must have Docker installed.

Contributing

Find our guidelines here.

Help and Support

Join the #buildpacks channel in our Slack community if you need any further assistance.

Reporting Issues

Open a GitHub issue on this project here.

Active Development

The project backlog is on Pivotal Tracker.

python-buildpack's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

python-buildpack's Issues

The default version should be updated to Python 3.

./bin/compile:DEFAULT_PYTHON_VERSION="python-2.7.9"

From the Python website: "Python 2.x is legacy, Python 3.x is the present and future of the language"

Are there plans to change the default python version (when none is specified in requirements.txt) to python 3?

pip -e issue

This may be the problem raised upstream: heroku/heroku-buildpack-python#352

What version of Cloud Foundry and CF CLI are you using? (i.e. What is the output of running cf curl /v2/info && cf version?

  • API: 2.68.0
  • CLI: 6.23.1+a70deb3.2017-01-13

What version of the buildpack you are using?

1.5.14

If you were attempting to accomplish a task, what was it you were attempting to do?

Deploy an application with a -editable library in its requirements.txt.

What did you expect to happen?

For the application to include the editable library in its PYTHONPATH.

What was the actual behavior?

Editable library could not be found.

Please confirm where necessary:

  • I have included a log output
  • My log includes an error message
  • I have included steps for reproduction

Cleaned up logs:

$ ls
Procfile  requirements.txt  run.py
$ cat Procfile
web: python run.py
$ cat requirements.txt
-e git+https://github.com/eregs/[email protected]#egg=regcore

$ cat run.py
from regcore import settings
$ cf push fail
Updating app fail in org [SNIP] / space [SNIP] as [SNIP]...
OK

Uploading fail...
Uploading app files from: /tmp/fail
Uploading 494B, 3 files
Done uploading
OK

Starting app fail in org [SNIP] / space [SNIP] as [SNIP]...
Downloading binary_buildpack...
Downloading nodejs_buildpack...
Downloading go_buildpack...
Downloading python_buildpack...
Downloading ruby_buildpack...
Downloaded binary_buildpack
Downloading staticfile_buildpack...
Downloaded go_buildpack
Downloading java_buildpack...
Downloaded ruby_buildpack
Downloading php_buildpack...
Downloaded nodejs_buildpack
Downloading dotnet_core_buildpack...
Downloaded python_buildpack
Downloaded staticfile_buildpack
Downloaded php_buildpack
Downloaded java_buildpack
Downloaded dotnet_core_buildpack
Creating container
Successfully created container
Downloading app package...
Downloaded app package (581B)
Staging...
-------> Buildpack version 1.5.14
-----> Installing python-2.7.12
**WARNING** A newer version of python is available in this buildpack. Please adjust your app to use version 2.7.13 instead of version 2.7.12 as soon as possible. Old versions of python are only provided to assist in migrating to newer versions.
Downloaded [file:///tmp/buildpack/dependencies/https___buildpacks.cloudfoundry.org_dependencies_python_python-2.7.12-linux-x64.tgz]
     $ pip install -r requirements.txt
       Obtaining regcore from git+https://github.com/eregs/[email protected]#egg=regcore (from -r requirements.txt (line 1))
         Cloning https://github.com/eregs/regulations-core.git (to 2.0.0) to ./.heroku/src/regcore
       Collecting django<1.10,>=1.8 (from regcore->-r requirements.txt (line 1))
         Downloading Django-1.9.12-py2.py3-none-any.whl (6.6MB)
       Collecting django-mptt (from regcore->-r requirements.txt (line 1))
         Downloading django_mptt-0.8.7-py2.py3-none-any.whl (96kB)
       Collecting jsonschema (from regcore->-r requirements.txt (line 1))
         Downloading jsonschema-2.6.0-py2.py3-none-any.whl
       Collecting six (from regcore->-r requirements.txt (line 1))
         Downloading six-1.10.0-py2.py3-none-any.whl
       Collecting functools32; python_version == "2.7" (from jsonschema->regcore->-r requirements.txt (line 1))
         Downloading functools32-3.2.3-2.zip
       Installing collected packages: django, django-mptt, functools32, jsonschema, six, regcore
         Running setup.py install for functools32: started
           Running setup.py install for functools32: finished with status 'done'
         Running setup.py develop for regcore
       Successfully installed django-1.9.12 django-mptt-0.8.7 functools32-3.2.3.post2 jsonschema-2.6.0 regcore six-1.10.0
Exit status 0
Staging complete
Uploading droplet, build artifacts cache...
Uploading droplet...
Uploading build artifacts cache...
Uploaded build artifacts cache (34.8M)
Uploaded droplet (34.9M)
Uploading complete
Destroying container
Successfully destroyed container

0 of 1 instances running, 1 starting
0 of 1 instances running, 1 crashed
FAILED
Error restarting application: Start unsuccessful

TIP: use 'cf logs fail --recent' for more information
$ cf logs fail --recent
Connected, dumping recent logs for app fail in org [SNIP] / space [SNIP] as [SNIP]...

2017-02-09T16:03:59.54+0000 [API/0]      OUT Created app with guid 12e6ac12-e265-41ba-b958-efa89cb9af30
2017-02-09T16:04:03.19+0000 [API/1]      OUT Updated app with guid 12e6ac12-e265-41ba-b958-efa89cb9af30 ({"route"=>"dfac10db-0dd5-42cc-a4ba-e7c8b96b212c", :verb=>"add", :relation=>"routes", :related_guid=>"dfac10db-0dd5-42cc-a4ba-e7c8b96b212c"})
2017-02-09T16:06:09.59+0000 [API/0]      OUT Updated app with guid 12e6ac12-e265-41ba-b958-efa89cb9af30 ({"name"=>"fail"})
2017-02-09T16:06:22.76+0000 [API/0]      OUT Updated app with guid 12e6ac12-e265-41ba-b958-efa89cb9af30 ({"state"=>"STARTED"})
2017-02-09T16:06:22.78+0000 [STG/0]      OUT Downloading binary_buildpack...
2017-02-09T16:06:22.78+0000 [STG/0]      OUT Downloading nodejs_buildpack...
2017-02-09T16:06:22.78+0000 [STG/0]      OUT Downloading go_buildpack...
2017-02-09T16:06:22.78+0000 [STG/0]      OUT Downloading python_buildpack...
2017-02-09T16:06:22.78+0000 [STG/0]      OUT Downloading ruby_buildpack...
2017-02-09T16:06:22.79+0000 [STG/0]      OUT Downloaded binary_buildpack
2017-02-09T16:06:22.79+0000 [STG/0]      OUT Downloading staticfile_buildpack...
2017-02-09T16:06:22.79+0000 [STG/0]      OUT Downloaded go_buildpack
2017-02-09T16:06:22.79+0000 [STG/0]      OUT Downloading java_buildpack...
2017-02-09T16:06:22.80+0000 [STG/0]      OUT Downloaded ruby_buildpack
2017-02-09T16:06:22.80+0000 [STG/0]      OUT Downloading php_buildpack...
2017-02-09T16:06:22.80+0000 [STG/0]      OUT Downloaded nodejs_buildpack
2017-02-09T16:06:22.81+0000 [STG/0]      OUT Downloading dotnet_core_buildpack...
2017-02-09T16:06:22.81+0000 [STG/0]      OUT Downloaded python_buildpack
2017-02-09T16:06:22.81+0000 [STG/0]      OUT Downloaded staticfile_buildpack
2017-02-09T16:06:22.82+0000 [STG/0]      OUT Downloaded php_buildpack
2017-02-09T16:06:22.82+0000 [STG/0]      OUT Downloaded java_buildpack
2017-02-09T16:06:22.83+0000 [STG/0]      OUT Downloaded dotnet_core_buildpack
2017-02-09T16:06:22.83+0000 [STG/0]      OUT Creating container
2017-02-09T16:06:23.41+0000 [STG/0]      OUT Successfully created container
2017-02-09T16:06:23.41+0000 [STG/0]      OUT Downloading app package...
2017-02-09T16:06:23.45+0000 [STG/0]      OUT Downloaded app package (581B)
2017-02-09T16:06:23.45+0000 [STG/0]      OUT Staging...
2017-02-09T16:06:25.35+0000 [STG/0]      OUT -------> Buildpack version 1.5.14
2017-02-09T16:06:25.45+0000 [STG/0]      OUT -----> Installing python-2.7.12
2017-02-09T16:06:25.79+0000 [STG/0]      OUT **WARNING** A newer version of python is available in this buildpack. Please adjust your app to use version 2.7.13 instead of version 2.7.12 as soon as possible. Old versions of python are only provided to assist in migrating to newer versions.
2017-02-09T16:06:26.72+0000 [STG/0]      OUT Downloaded [file:///tmp/buildpack/dependencies/https___buildpacks.cloudfoundry.org_dependencies_python_python-2.7.12-linux-x64.tgz]
2017-02-09T16:06:33.11+0000 [STG/0]      OUT      $ pip install -r requirements.txt
2017-02-09T16:06:34.08+0000 [STG/0]      OUT        Obtaining regcore from git+https://github.com/eregs/[email protected]#egg=regcore (from -r requirements.txt (line 1))
2017-02-09T16:06:34.08+0000 [STG/0]      OUT          Cloning https://github.com/eregs/regulations-core.git (to 2.0.0) to ./.heroku/src/regcore
2017-02-09T16:06:38.08+0000 [STG/0]      OUT        Collecting django<1.10,>=1.8 (from regcore->-r requirements.txt (line 1))
2017-02-09T16:06:38.29+0000 [STG/0]      OUT          Downloading Django-1.9.12-py2.py3-none-any.whl (6.6MB)
2017-02-09T16:06:40.52+0000 [STG/0]      OUT        Collecting django-mptt (from regcore->-r requirements.txt (line 1))
2017-02-09T16:06:40.57+0000 [STG/0]      OUT          Downloading django_mptt-0.8.7-py2.py3-none-any.whl (96kB)
2017-02-09T16:06:40.70+0000 [STG/0]      OUT        Collecting jsonschema (from regcore->-r requirements.txt (line 1))
2017-02-09T16:06:40.75+0000 [STG/0]      OUT          Downloading jsonschema-2.6.0-py2.py3-none-any.whl
2017-02-09T16:06:40.87+0000 [STG/0]      OUT        Collecting six (from regcore->-r requirements.txt (line 1))
2017-02-09T16:06:40.92+0000 [STG/0]      OUT          Downloading six-1.10.0-py2.py3-none-any.whl
2017-02-09T16:06:41.11+0000 [STG/0]      OUT        Collecting functools32; python_version == "2.7" (from jsonschema->regcore->-r requirements.txt (line 1))
2017-02-09T16:06:41.15+0000 [STG/0]      OUT          Downloading functools32-3.2.3-2.zip
2017-02-09T16:06:41.53+0000 [STG/0]      OUT        Installing collected packages: django, django-mptt, functools32, jsonschema, six, regcore
2017-02-09T16:06:44.78+0000 [STG/0]      OUT          Running setup.py install for functools32: started
2017-02-09T16:06:45.23+0000 [STG/0]      OUT            Running setup.py install for functools32: finished with status 'done'
2017-02-09T16:06:45.30+0000 [STG/0]      OUT          Running setup.py develop for regcore
2017-02-09T16:06:45.78+0000 [STG/0]      OUT        Successfully installed django-1.9.12 django-mptt-0.8.7 functools32-3.2.3.post2 jsonschema-2.6.0 regcore six-1.10.0
2017-02-09T16:07:08.53+0000 [STG/0]      OUT Exit status 0
2017-02-09T16:07:08.53+0000 [STG/0]      OUT Staging complete
2017-02-09T16:07:08.53+0000 [STG/0]      OUT Uploading droplet, build artifacts cache...
2017-02-09T16:07:08.53+0000 [STG/0]      OUT Uploading droplet...
2017-02-09T16:07:08.53+0000 [STG/0]      OUT Uploading build artifacts cache...
2017-02-09T16:07:09.39+0000 [STG/0]      OUT Uploaded build artifacts cache (34.8M)
2017-02-09T16:07:13.46+0000 [STG/0]      OUT Uploaded droplet (34.9M)
2017-02-09T16:07:13.47+0000 [STG/0]      OUT Uploading complete
2017-02-09T16:07:13.50+0000 [STG/0]      OUT Destroying container
2017-02-09T16:07:13.92+0000 [CELL/0]     OUT Creating container
2017-02-09T16:07:14.33+0000 [CELL/0]     OUT Successfully created container
2017-02-09T16:07:17.06+0000 [STG/0]      OUT Successfully destroyed container
2017-02-09T16:07:17.27+0000 [CELL/0]     OUT Starting health monitoring of container
2017-02-09T16:07:17.40+0000 [APP/PROC/WEB/0]ERR Traceback (most recent call last):
2017-02-09T16:07:17.40+0000 [APP/PROC/WEB/0]ERR   File "run.py", line 1, in <module>
2017-02-09T16:07:17.40+0000 [APP/PROC/WEB/0]ERR     from regcore import settings
2017-02-09T16:07:17.40+0000 [APP/PROC/WEB/0]ERR ImportError: No module named regcore
2017-02-09T16:07:17.40+0000 [APP/PROC/WEB/0]OUT Exit status 1
2017-02-09T16:07:17.43+0000 [CELL/0]     OUT Exit status 0
2017-02-09T16:07:17.44+0000 [CELL/0]     OUT Destroying container
2017-02-09T16:07:17.46+0000 [CELL/0]     OUT Creating container
2017-02-09T16:07:17.51+0000 [API/1]      OUT Process has crashed with type: "web"
2017-02-09T16:07:17.52+0000 [API/1]      OUT App instance exited with guid 12e6ac12-e265-41ba-b958-efa89cb9af30 payload: {"instance"=>"", "index"=>0, "reason"=>"CRASHED", "exit_description"=>"2 error(s) occurred:\n\n* 2 error(s) occurred:\n\n* Exited with status 1\n* cancelled\n* cancelled", "crash_count"=>1, "crash_timestamp"=>1486656437383732812, "version"=>"c491202f-9e84-48c9-81ae-29f3c475eee0"}
2017-02-09T16:07:17.97+0000 [CELL/0]     OUT Successfully created container
2017-02-09T16:07:18.58+0000 [CELL/0]     OUT Successfully destroyed container
2017-02-09T16:07:20.93+0000 [CELL/0]     OUT Starting health monitoring of container
2017-02-09T16:07:21.03+0000 [APP/PROC/WEB/0]ERR Traceback (most recent call last):
2017-02-09T16:07:21.03+0000 [APP/PROC/WEB/0]ERR   File "run.py", line 1, in <module>
2017-02-09T16:07:21.03+0000 [APP/PROC/WEB/0]ERR     from regcore import settings
2017-02-09T16:07:21.03+0000 [APP/PROC/WEB/0]ERR ImportError: No module named regcore
2017-02-09T16:07:21.03+0000 [APP/PROC/WEB/0]OUT Exit status 1
2017-02-09T16:07:21.04+0000 [CELL/0]     OUT Exit status 0
2017-02-09T16:07:21.06+0000 [CELL/0]     OUT Destroying container
2017-02-09T16:07:21.07+0000 [API/0]      OUT Process has crashed with type: "web"
2017-02-09T16:07:21.09+0000 [CELL/0]     OUT Creating container
2017-02-09T16:07:21.09+0000 [API/0]      OUT App instance exited with guid 12e6ac12-e265-41ba-b958-efa89cb9af30 payload: {"instance"=>"", "index"=>0, "reason"=>"CRASHED", "exit_description"=>"2 error(s) occurred:\n\n* 2 error(s) occurred:\n\n* Exited with status 1\n* cancelled\n* cancelled", "crash_count"=>2, "crash_timestamp"=>1486656441006021356, "version"=>"c491202f-9e84-48c9-81ae-29f3c475eee0"}
2017-02-09T16:07:21.59+0000 [CELL/0]     OUT Successfully created container
2017-02-09T16:07:22.05+0000 [CELL/0]     OUT Successfully destroyed container
2017-02-09T16:07:24.48+0000 [CELL/0]     OUT Starting health monitoring of container
2017-02-09T16:07:24.60+0000 [API/0]      OUT Process has crashed with type: "web"
2017-02-09T16:07:24.61+0000 [API/0]      OUT App instance exited with guid 12e6ac12-e265-41ba-b958-efa89cb9af30 payload: {"instance"=>"", "index"=>0, "reason"=>"CRASHED", "exit_description"=>"2 error(s) occurred:\n\n* 2 error(s) occurred:\n\n* Exited with status 1\n* cancelled\n* cancelled", "crash_count"=>3, "crash_timestamp"=>1486656444595604386, "version"=>"c491202f-9e84-48c9-81ae-29f3c475eee0"}
2017-02-09T16:07:24.62+0000 [APP/PROC/WEB/0]ERR Traceback (most recent call last):
2017-02-09T16:07:24.62+0000 [APP/PROC/WEB/0]ERR   File "run.py", line 1, in <module>
2017-02-09T16:07:24.62+0000 [APP/PROC/WEB/0]ERR     from regcore import settings
2017-02-09T16:07:24.62+0000 [APP/PROC/WEB/0]ERR ImportError: No module named regcore
2017-02-09T16:07:24.62+0000 [APP/PROC/WEB/0]OUT Exit status 1
2017-02-09T16:07:24.64+0000 [CELL/0]     OUT Exit status 0
2017-02-09T16:07:24.64+0000 [CELL/0]     OUT Destroying container
2017-02-09T16:07:25.76+0000 [CELL/0]     OUT Successfully destroyed container
2017-02-09T16:08:17.95+0000 [CELL/0]     OUT Creating container
2017-02-09T16:08:18.42+0000 [CELL/0]     OUT Successfully created container
2017-02-09T16:08:21.64+0000 [CELL/0]     OUT Starting health monitoring of container
2017-02-09T16:08:21.78+0000 [APP/PROC/WEB/0]ERR Traceback (most recent call last):
2017-02-09T16:08:21.78+0000 [APP/PROC/WEB/0]ERR   File "run.py", line 1, in <module>
2017-02-09T16:08:21.78+0000 [APP/PROC/WEB/0]ERR     from regcore import settings
2017-02-09T16:08:21.78+0000 [APP/PROC/WEB/0]ERR ImportError: No module named regcore
2017-02-09T16:08:21.78+0000 [APP/PROC/WEB/0]OUT Exit status 1
2017-02-09T16:08:21.80+0000 [CELL/0]     OUT Exit status 0
2017-02-09T16:08:21.82+0000 [CELL/0]     OUT Destroying container
2017-02-09T16:08:21.82+0000 [API/0]      OUT Process has crashed with type: "web"
2017-02-09T16:08:21.84+0000 [API/0]      OUT App instance exited with guid 12e6ac12-e265-41ba-b958-efa89cb9af30 payload: {"instance"=>"", "index"=>0, "reason"=>"CRASHED", "exit_description"=>"2 error(s) occurred:\n\n* 2 error(s) occurred:\n\n* Exited with status 1\n* cancelled\n* cancelled", "crash_count"=>4, "crash_timestamp"=>1486656501761272238, "version"=>"c491202f-9e84-48c9-81ae-29f3c475eee0"}
2017-02-09T16:08:23.07+0000 [CELL/0]     OUT Successfully destroyed container

If I remove the -e from my requirements.txt, I don't get the import error anymore.

Regarding Adding extension file to buildpack for Appdynamics

Hi,

I am trying to add an extension file in the buildpack. The purpose of this file is to initialize Appdynamics agent specific environment variables by reading VCAP_APPLICATION and VCAP_SERVICES.
At what location in buildpack shall i add this file. Also any inputs on from where the call needs to be made to this extension file.

Unable to deploy CVXOPT with this Python Buildpack on Cloud Foundry

I am unable to deploy CVXOPT package into Linux environment. I am on Python 3.6.0. and using standard python buildpacks (1.5.15 from https://github.com/cloudfoundry/python-buildpack/releases) which I am trying to deploy on Clound Foundry for my IBM Bluemix app.

Are there any special buildpacks for this or CVXOPT cannot be working on Cloud Foundry? Thank you a lot!

This is the error output when deploying:

    2/14/2017 2:48:06 AM	OUT	STG	Running setup.py install for cvxopt: started

    2/14/2017 2:48:20 AM	OUT	STG	Running setup.py install for cvxopt: finished with status 'error'

    2/14/2017 2:48:20 AM	OUT	STG	Complete output from command /app/.heroku/python/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-pgi7qybb/cvxopt/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-6vk81aol-record/install-record.txt --single-version-externally-managed --compile:

    2/14/2017 2:48:20 AM	OUT	STG	running install

    2/14/2017 2:48:20 AM	OUT	STG	running build

    2/14/2017 2:48:20 AM	OUT	STG	creating build

    2/14/2017 2:48:20 AM	OUT	STG	creating build/lib.linux-x86_64-3.5/cvxopt

    2/14/2017 2:48:20 AM	OUT	STG	copying src/python/cvxprog.py -> build/lib.linux-x86_64-3.5/cvxopt

    2/14/2017 2:48:20 AM	OUT	STG	copying src/python/__init__.py -> build/lib.linux-x86_64-3.5/cvxopt

    2/14/2017 2:48:20 AM	OUT	STG	copying src/python/_version.py -> build/lib.linux-x86_64-3.5/cvxopt

    2/14/2017 2:48:20 AM	OUT	STG	copying src/python/printing.py -> build/lib.linux-x86_64-3.5/cvxopt

    2/14/2017 2:48:20 AM	OUT	STG	UPDATING build/lib.linux-x86_64-3.5/cvxopt/_version.py

    2/14/2017 2:48:20 AM	OUT	STG	set build/lib.linux-x86_64-3.5/cvxopt/_version.py to '1.1.9'

    2/14/2017 2:48:20 AM	OUT	STG	running build_ext

    2/14/2017 2:48:20 AM	OUT	STG	building 'base' extension

    2/14/2017 2:48:20 AM	OUT	STG	creating build/temp.linux-x86_64-3.5/src

    2/14/2017 2:48:20 AM	OUT	STG	gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/app/.heroku/python/include/python3.5m -c src/C/dense.c -o build/temp.linux-x86_64-3.5/src/C/dense.o

    2/14/2017 2:48:20 AM	OUT	STG	gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/app/.heroku/python/include/python3.5m -c src/C/sparse.c -o build/temp.linux-x86_64-3.5/src/C/sparse.o

    2/14/2017 2:48:20 AM	OUT	STG	src/C/sparse.c: In function โ€˜sparse_concatโ€™:

    2/14/2017 2:48:20 AM	OUT	STG	src/C/sparse.c:368:30: warning: variable โ€˜blk_ncolsโ€™ set but not used [-Wunused-but-set-variable]

    2/14/2017 2:48:20 AM	OUT	STG	int_t blk_nrows = 0, blk_ncols = 0;

    2/14/2017 2:48:20 AM	OUT	STG	gcc -pthread -shared build/temp.linux-x86_64-3.5/src/C/base.o build/temp.linux-x86_64-3.5/src/C/dense.o build/temp.linux-x86_64-3.5/src/C/sparse.o -L/usr/lib -L/app/.heroku/vendor/lib -lm -llapack -lblas -lpython3.5m -o build/lib.linux-x86_64-3.5/cvxopt/base.cpython-35m-x86_64-linux-gnu.so

    2/14/2017 2:48:20 AM	OUT	STG	gcc -pthread -shared build/temp.linux-x86_64-3.5/src/C/blas.o -L/usr/lib -L/app/.heroku/vendor/lib -lblas -lpython3.5m -o build/lib.linux-x86_64-3.5/cvxopt/blas.cpython-35m-x86_64-linux-gnu.so

    2/14/2017 2:48:20 AM	OUT	STG	gcc -pthread -shared build/temp.linux-x86_64-3.5/src/C/lapack.o -L/usr/lib -L/app/.heroku/vendor/lib -llapack -lblas -lpython3.5m -o build/lib.linux-x86_64-3.5/cvxopt/lapack.cpython-35m-x86_64-linux-gnu.so

    2/14/2017 2:48:20 AM	OUT	STG	src/C/umfpack.c:23:21: fatal error: umfpack.h: No such file or directory

    2/14/2017 2:48:20 AM	OUT	STG	#include "umfpack.h"

    2/14/2017 2:48:20 AM	OUT	STG	^

    2/14/2017 2:48:20 AM	OUT	STG	

    2/14/2017 2:48:20 AM	OUT	STG	----------------------------------------

    2/14/2017 2:48:21 AM	ERR	STG	Command "/app/.heroku/python/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-pgi7qybb/cvxopt/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-6vk81aol-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-pgi7qybb/cvxopt/

    2/14/2017 2:48:21 AM	ERR	STG	Failed to compile droplet

    2/14/2017 2:48:21 AM	ERR	STG	Staging failed: Exited with status 223

    2/14/2017 2:48:21 AM	OUT	STG	Destroying container

libpython incompatible to python binary?

The gist:
I'm looking at python_buildpack-cached-v1.5.1.zip, specifically dependencies/https___pivotal-buildpacks.s3.amazonaws.com_concourse-binaries_python_python-2.7.9-linux-x64.tgz

lib/libpython2.7.so.1.0 is built for 2-byte unicode characters (checked with nm libpython2.7.so.1.0 | grep Unicode), while bin/python2.7 is built for 4-byte unicode (checked with import sys; sys.maxunicode > 65535). I'm not an expert on C extensions or buildpacks, but doesn't this mean that C extensions using lipython won't work with the provided Python?

More context:
I was trying to push an app that's using PySide. The configuration of the machine it's wheel is built on should be similar to cflinuxfs2. I've put the wheel in vendor along with other dependencies, set LD_LIBRARY_PATH so that the code will see PySide's native libraries.

But then this happens:
ImportError: /app/.heroku/python/lib/python2.7/site-packages/PySide/QtCore.so: undefined symbol: PyUnicodeUCS4_FromWideChar

As I understand, this should be provided by libpython, but the current one has 2-byte unicode chars, so you have functions like this PyUnicodeUCS2_FromWideChar

Building with scikit-learn and scipy

I'm currently trying to deploy a Python application that has scikit-learn and scipy as dependencies. The flask server can deploy locally using python-2.7.6, however, when I do a cf push, it fails.

runtime.txt (Note: I have tried 2.7.6 as well)

python-2.7.9

requirements.txt

Flask==0.10.1
itsdangerous==0.24
Jinja2==2.7.3
MarkupSafe==0.23
nltk==3.0.2
numpy==1.9.2
pandas==0.16.1
python-dateutil==2.4.2
pytz==2015.4
scikit-learn==0.16.1
scipy==0.15.1
six==1.9.0
Werkzeug==0.10.4

manifest.yml

applications:
- name: scikit-test
  buildpack: https://github.com/cloudfoundry/python-buildpack
  instances: 1
  description: test
  memory: 512M
  command: python server.py
  host: scikit-test

Error from cf logs:

2015-05-28T00:52:10.35-0400 [STG/0]      ERR     Command "/app/.heroku/python/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-cb4oWN/scipy/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-H2efLy-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-cb4oWN/scipy
2015-05-28T00:52:10.43-0400 [STG/0]      OUT Staging failed: Buildpack compilation step failed
2015-05-28T00:52:10.77-0400 [API/2]      ERR encountered error: App staging failed in the buildpack compile phase

Is this a known issue? Are there any workarounds? Thanks.

pip tornado and missing certifi and backports.ssl_match_hostname deps

Seems the buildpack is not able to automatically install tornado deps as documented at https://pypi.python.org/pypi/tornado/4.1

2015-05-18T14:19:44.07+0200 [API/0]      OUT Updated app with guid 4b13c2dc-c7be-485e-bf7c-56f4335fb8f4 ({"name"=>"git-hook-services", "command"=>"PRIVATE DATA HIDDEN", "environment_json"=>"PRIVATE DATA HIDDEN"})
2015-05-18T14:19:49.47+0200 [API/0]      OUT Updated app with guid 4b13c2dc-c7be-485e-bf7c-56f4335fb8f4 ({"state"=>"STOPPED"})
2015-05-18T14:19:50.46+0200 [DEA/0]      OUT Got staging request for app with id 4b13c2dc-c7be-485e-bf7c-56f4335fb8f4
2015-05-18T14:19:51.59+0200 [API/0]      OUT Updated app with guid 4b13c2dc-c7be-485e-bf7c-56f4335fb8f4 ({"state"=>"STARTED"})
2015-05-18T14:19:51.73+0200 [STG/0]      OUT -----> Downloaded app package (328K)
2015-05-18T14:19:51.80+0200 [STG/0]      ERR Cloning into '/tmp/buildpacks/python-buildpack'...
2015-05-18T14:20:13.43+0200 [STG/0]      OUT Submodule 'compile-extensions' (https://github.com/cloudfoundry-incubator/compile-extensions.git) registered for path 'compile-extensions'
2015-05-18T14:20:13.48+0200 [STG/0]      ERR Cloning into 'compile-extensions'...
2015-05-18T14:20:16.86+0200 [STG/0]      OUT Submodule path 'compile-extensions': checked out '9f02e38433ca08c2e82cfec8844db9dd26acb336'
2015-05-18T14:20:16.97+0200 [STG/0]      OUT -------> Buildpack version 1.3.1
2015-05-18T14:20:17.01+0200 [STG/0]      OUT -----> Installing runtime (python-2.7.9)
2015-05-18T14:20:58.41+0200 [STG/0]      OUT -----> Installing dependencies with pip
2015-05-18T14:20:58.66+0200 [STG/0]      OUT        Ignoring indexes: https://pypi.python.org/simple
2015-05-18T14:20:59.18+0200 [STG/0]      OUT        Collecting tornado==4.1 (from -r requirements.txt (line 1))
2015-05-18T14:20:59.42+0200 [STG/0]      OUT        Collecting certifi (from tornado==4.1->-r requirements.txt (line 1))
2015-05-18T14:20:59.42+0200 [STG/0]      OUT          Could not find a version that satisfies the requirement certifi (from tornado==4.1->-r requirements.txt (line 1)) (from versions: )
2015-05-18T14:20:59.44+0200 [STG/0]      OUT          No matching distribution found for certifi (from tornado==4.1->-r requirements.txt (line 1))
2015-05-18T14:20:59.46+0200 [STG/0]      OUT Staging failed: Buildpack compilation step failed
2015-05-18T14:20:59.64+0200 [API/0]      ERR encountered error: App staging failed in the buildpack compile phase

requirements.txt

tornado==4.1

Upgrade pip

I see the following output in my deploys:

ERR You are using pip version 7.1.2, however version 8.1.1 is available.
2016-03-17T11:23:27.02-0700 [STG/0]      
ERR You should consider upgrading via the 'pip install --upgrade pip' command.

Could we upgrade the version of pip used by the buildpack?

gevent and multiple app instances

What version of Cloud Foundry are you using?
cf version 6.15.0+fa1bfe2-2016-01-13

What version of the buildpack you are using?
1.5.1

If you were attempting to accomplish a task, what was it you were attempting to do?
I'm running a flask socketio app with sticky session enabled. I'm running the app with gevent WSGIServer like so:

import gevent
import gevent.monkey
gevent.monkey.patch_all()
from gevent.wsgi import WSGIServer

gevent.spawn(users_consume)
interface = settings.get('sio_server_host')
port = settings.get('sio_server_port')
httpd = WSGIServer((interface, port), app)
print('Evented Service (longpolling) running on %s:%s', interface, port)
try:
    httpd.serve_forever()
except:
    print("Evented Service (longpolling): uncaught error during main loop")
    raise

What did you expect to happen?

What was the actual behavior?

2016-11-17T16:05:47.67+0200 [App/1]      OUT ('user_loader...', u'a2F5b2RlLm9kZXllbWlAZ3JlZW53b29kLm5nOjE0NzkzODc5MDguMDk6MzA=')
2016-11-17T16:06:12.70+0200 [App/0]      ERR Traceback (most recent call last):
2016-11-17T16:06:12.70+0200 [App/0]      ERR   File "gevent/_semaphore.py", line 101, in gevent._semaphore.Semaphore._notify_links (gevent/gevent._semaphore.c:2030)
2016-11-17T16:06:12.70+0200 [App/0]      ERR     link(self) # Must use Cython >= 0.23.4 on PyPy else this leaks memory
2016-11-17T16:06:12.70+0200 [App/0]      ERR error: cannot switch to a different thread
2016-11-17T16:06:12.70+0200 [App/0]      ERR (<built-in method switch of Greenlet object at 0x7fcd682f0af0>,
2016-11-17T16:06:12.70+0200 [App/0]      ERR  <gevent.thread.LockType object at 0x7fcd6821d2f0>) failed with error

Fails on the second instance of the app. seems it fails because of this gevent.spawn(users_consume)

Please confirm where necessary:

  • [x ] I have included a log output
  • [ x] My log includes an error message
  • I have included steps for reproduction

start up python app failed

hi,
dea got "instance.start.failed with error failed to accept connections within health check timeout" error while push app on cf cli ,but Enter the /home/vcap directory in container , can manually start the app๏ผŒThe related information is as follows๏ผš

The startup command in the Procfile file as follows๏ผšweb: python wsgi.py or web: python wsgi.py $PORT

Content of manifest.yml:

applications:
name: python-bottle-cl-14 
memory: 256M 
instances: 1

cf version :195

add debug log code in dea๏ผŒget content on start_script as follows๏ผš

umask 077
export VCAP_APPLICATION="{\"limits\":{\"mem\":256,\"disk\":1024,\"fds\":16384},\"application_version\":\"292e7c2d-67ea-4d06-8d6d-e4ffcf47c233\",\"application_name\":\"python-bottle-cl-14\",\"application_uris\":[\"python-bottle-cl-14.9.91.18.103.xip.io\"],\"version\":\"292e7c2d-67ea-4d06-8d6d-e4ffcf47c233\",\"name\":\"python-bottle-cl-14\",\"space_name\":\"dev\",\"space_id\":\"8cd2a4f8-8e1b-4774-ad5d-5647c01c3647\",\"uris\":[\"python-bottle-cl-14.9.91.18.103.xip.io\"],\"users\":null,\"application_id\":\"fb6edef0-6e1e-438f-80c3-eb8c19fe095a\",\"instance_id\":\"8f634400658f4970a2d33cfdfa3ff074\",\"instance_index\":0,\"host\":\"0.0.0.0\",\"port\":61015,\"started_at\":\"2015-03-13 10:55:25 +0000\",\"started_at_timestamp\":1426244125,\"start\":\"2015-03-13 10:55:25 +0000\",\"state_timestamp\":1426244125}";
export VCAP_SERVICES="{}";
export MEMORY_LIMIT="256m";
export HOME="$PWD/app";
export TMPDIR="$PWD/tmp";
export VCAP_APP_HOST="0.0.0.0";
export VCAP_APP_PORT="61015";
export PORT="$VCAP_APP_PORT";


unset GEM_PATH
if [ -d app/.profile.d ]; then
 for i in app/.profile.d/*.sh; do
 if [ -r $i ]; then
 . $i
 fi
 done
 unset i
fi

DROPLET_BASE_DIR=$PWD
cd app
echo $$ >> $DROPLET_BASE_DIR/run.pid
exec bash -c python wsgi.py

Below is the DEA log:

{"timestamp":1426244127.5314178,"message":"droplet.healthcheck.port","log_level":"debug","source":"Dea::Instance","data":{"attributes":{"prod":false,"executableFile":"deprecated","limits":{"mem":256,"disk":1024,"fds":16384},"cc_partition":"default","console":false,"debug":null,"start_command":null,"health_check_timeout":null,"vcap_application":{"limits":{"mem":256,"disk":1024,"fds":16384},"application_version":"292e7c2d-67ea-4d06-8d6d-e4ffcf47c233","application_name":"python-bottle-cl-14","application_uris":["python-bottle-cl-14.9.91.18.103.xip.io"],"version":"292e7c2d-67ea-4d06-8d6d-e4ffcf47c233","name":"python-bottle-cl-14","space_name":"dev","space_id":"8cd2a4f8-8e1b-4774-ad5d-5647c01c3647","uris":["python-bottle-cl-14.9.91.18.103.xip.io"],"users":null},"egress_network_rules":[{"destination":"0.0.0.0-9.255.255.255","protocol":"all"},{"destination":"11.0.0.0-169.253.255.255","protocol":"all"},{"destination":"169.255.0.0-172.15.255.255","protocol":"all"},{"destination":"172.32.0.0-192.167.255.255","protocol":"all"},{"destination":"192.169.0.0-255.255.255.255","protocol":"all"},{"destination":"0.0.0.0/0","ports":"53","protocol":"tcp"},{"destination":"0.0.0.0/0","ports":"53","protocol":"udp"}],"instance_index":0,"application_version":"292e7c2d-67ea-4d06-8d6d-e4ffcf47c233","application_name":"python-bottle-cl-14","application_uris":["python-bottle-cl-14.9.91.18.103.xip.io"],"application_id":"fb6edef0-6e1e-438f-80c3-eb8c19fe095a","droplet_sha1":"9acde13801743edcac14680076f7fd463488a5ce","instance_id":"8f634400658f4970a2d33cfdfa3ff074","private_instance_id":"b7adec50508b461392720f860df2fabfbe386dd47263413c87b7081f23f55669","state":"STARTING","state_timestamp":1426244125.2858455,"state_born_timestamp":1426244125.284365,"state_starting_timestamp":1426244125.2858508,"warden_handle":"18h54ud4o9o","warden_job_id":40},"host":"7.7.7.52","port":61015},"thread_id":9162860,"fiber_id":23163920,"process_id":25923,"file":"/var/vcap/packages/dea_next/lib/dea/starting/instance.rb","lineno":774,"method":"block in promise_port_open"}
{"timestamp":1426244127.5365767,"message":"droplet.warden.link.completed","log_level":"warn","source":"Dea::Instance","data":{"attributes":{"prod":false,"executableFile":"deprecated","limits":{"mem":256,"disk":1024,"fds":16384},"cc_partition":"default","console":false,"debug":null,"start_command":null,"health_check_timeout":null,"vcap_application":{"limits":{"mem":256,"disk":1024,"fds":16384},"application_version":"292e7c2d-67ea-4d06-8d6d-e4ffcf47c233","application_name":"python-bottle-cl-14","application_uris":["python-bottle-cl-14.9.91.18.103.xip.io"],"version":"292e7c2d-67ea-4d06-8d6d-e4ffcf47c233","name":"python-bottle-cl-14","space_name":"dev","space_id":"8cd2a4f8-8e1b-4774-ad5d-5647c01c3647","uris":["python-bottle-cl-14.9.91.18.103.xip.io"],"users":null},"egress_network_rules":[{"destination":"0.0.0.0-9.255.255.255","protocol":"all"},{"destination":"11.0.0.0-169.253.255.255","protocol":"all"},{"destination":"169.255.0.0-172.15.255.255","protocol":"all"},{"destination":"172.32.0.0-192.167.255.255","protocol":"all"},{"destination":"192.169.0.0-255.255.255.255","protocol":"all"},{"destination":"0.0.0.0/0","ports":"53","protocol":"tcp"},{"destination":"0.0.0.0/0","ports":"53","protocol":"udp"}],"instance_index":0,"application_version":"292e7c2d-67ea-4d06-8d6d-e4ffcf47c233","application_name":"python-bottle-cl-14","application_uris":["python-bottle-cl-14.9.91.18.103.xip.io"],"application_id":"fb6edef0-6e1e-438f-80c3-eb8c19fe095a","droplet_sha1":"9acde13801743edcac14680076f7fd463488a5ce","instance_id":"8f634400658f4970a2d33cfdfa3ff074","private_instance_id":"b7adec50508b461392720f860df2fabfbe386dd47263413c87b7081f23f55669","state":"STARTING","state_timestamp":1426244125.2858455,"state_born_timestamp":1426244125.284365,"state_starting_timestamp":1426244125.2858508,"warden_handle":"18h54ud4o9o","warden_job_id":40},"exit_status":1,"exit_description":"app instance exited"},"thread_id":9162860,"fiber_id":16470300,"process_id":25923,"file":"/var/vcap/packages/dea_next/lib/dea/starting/instance.rb","lineno":732,"method":"block in link"}
{"timestamp":1426244127.5372813,"message":"droplet.unhealthy","log_level":"warn","source":"Dea::Instance","data":{"attributes":{"prod":false,"executableFile":"deprecated","limits":{"mem":256,"disk":1024,"fds":16384},"cc_partition":"default","console":false,"debug":null,"start_command":null,"health_check_timeout":null,"vcap_application":{"limits":{"mem":256,"disk":1024,"fds":16384},"application_version":"292e7c2d-67ea-4d06-8d6d-e4ffcf47c233","application_name":"python-bottle-cl-14","application_uris":["python-bottle-cl-14.9.91.18.103.xip.io"],"version":"292e7c2d-67ea-4d06-8d6d-e4ffcf47c233","name":"python-bottle-cl-14","space_name":"dev","space_id":"8cd2a4f8-8e1b-4774-ad5d-5647c01c3647","uris":["python-bottle-cl-14.9.91.18.103.xip.io"],"users":null},"egress_network_rules":[{"destination":"0.0.0.0-9.255.255.255","protocol":"all"},{"destination":"11.0.0.0-169.253.255.255","protocol":"all"},{"destination":"169.255.0.0-172.15.255.255","protocol":"all"},{"destination":"172.32.0.0-192.167.255.255","protocol":"all"},{"destination":"192.169.0.0-255.255.255.255","protocol":"all"},{"destination":"0.0.0.0/0","ports":"53","protocol":"tcp"},{"destination":"0.0.0.0/0","ports":"53","protocol":"udp"}],"instance_index":0,"application_version":"292e7c2d-67ea-4d06-8d6d-e4ffcf47c233","application_name":"python-bottle-cl-14","application_uris":["python-bottle-cl-14.9.91.18.103.xip.io"],"application_id":"fb6edef0-6e1e-438f-80c3-eb8c19fe095a","droplet_sha1":"9acde13801743edcac14680076f7fd463488a5ce","instance_id":"8f634400658f4970a2d33cfdfa3ff074","private_instance_id":"b7adec50508b461392720f860df2fabfbe386dd47263413c87b7081f23f55669","state":"CRASHED","state_timestamp":1426244127.5368512,"state_born_timestamp":1426244125.284365,"state_starting_timestamp":1426244125.2858508,"warden_handle":"18h54ud4o9o","warden_job_id":40,"state_crashed_timestamp":1426244127.536857}},"thread_id":9162860,"fiber_id":17694660,"process_id":25923,"file":"/var/vcap/packages/dea_next/lib/dea/starting/instance.rb","lineno":550,"method":"block in start"}
{"timestamp":1426244127.5381448,"message":"instance.start.failed with error failed to accept connections within health check timeout","log_level":"warn","source":"Dea::Instance","data":{"attributes":{"prod":false,"executableFile":"deprecated","limits":{"mem":256,"disk":1024,"fds":16384},"cc_partition":"default","console":false,"debug":null,"start_command":null,"health_check_timeout":null,"vcap_application":{"limits":{"mem":256,"disk":1024,"fds":16384},"application_version":"292e7c2d-67ea-4d06-8d6d-e4ffcf47c233","application_name":"python-bottle-cl-14","application_uris":["python-bottle-cl-14.9.91.18.103.xip.io"],"version":"292e7c2d-67ea-4d06-8d6d-e4ffcf47c233","name":"python-bottle-cl-14","space_name":"dev","space_id":"8cd2a4f8-8e1b-4774-ad5d-5647c01c3647","uris":["python-bottle-cl-14.9.91.18.103.xip.io"],"users":null},"egress_network_rules":[{"destination":"0.0.0.0-9.255.255.255","protocol":"all"},{"destination":"11.0.0.0-169.253.255.255","protocol":"all"},{"destination":"169.255.0.0-172.15.255.255","protocol":"all"},{"destination":"172.32.0.0-192.167.255.255","protocol":"all"},{"destination":"192.169.0.0-255.255.255.255","protocol":"all"},{"destination":"0.0.0.0/0","ports":"53","protocol":"tcp"},{"destination":"0.0.0.0/0","ports":"53","protocol":"udp"}],"instance_index":0,"application_version":"292e7c2d-67ea-4d06-8d6d-e4ffcf47c233","application_name":"python-bottle-cl-14","application_uris":["python-bottle-cl-14.9.91.18.103.xip.io"],"application_id":"fb6edef0-6e1e-438f-80c3-eb8c19fe095a","droplet_sha1":"9acde13801743edcac14680076f7fd463488a5ce","instance_id":"8f634400658f4970a2d33cfdfa3ff074","private_instance_id":"b7adec50508b461392720f860df2fabfbe386dd47263413c87b7081f23f55669","state":"CRASHED","state_timestamp":1426244127.537521,"state_born_timestamp":1426244125.284365,"state_starting_timestamp":1426244125.2858508,"warden_handle":"18h54ud4o9o","warden_job_id":40,"state_crashed_timestamp":1426244127.5375252},"duration":2.251916435,"error":"failed to accept connections within health check timeout","backtrace":["/var/vcap/packages/dea_next/lib/dea/promise.rb:81:in resolve'","/var/vcap/packages/dea_next/lib/dea/promise.rb:14:inblock in resolve'"]},"thread_id":9162860,"fiber_id":17694860,"process_id":25923,"file":"/var/vcap/packages/dea_next/lib/dea/task.rb","lineno":104,"method":"block in resolve_and_log"}

but i push the app with diego๏ผŒstartup success

why๏ผŸ
thanks

No matching distribution found for python==3.5.0

I am trying to deploy a python application on IBM Bluemix cloud via clodfoundry. The buildpack compilation fails. logs

2016-04-08T09:23:04.732-0400[API/1]OUTUpdated app with guid 4823889e-5491-40a3-a8ce-35b8dd325441 ({"state"=>"STOPPED"})
2016-04-08T09:23:07.713-0400[DEA/4]OUTGot staging request for app with id 4823889e-5491-40a3-a8ce-35b8dd325441
2016-04-08T09:23:11.178-0400[API/0]OUTUpdated app with guid 4823889e-5491-40a3-a8ce-35b8dd325441 ({"state"=>"STARTED"})
2016-04-08T09:23:11.376-0400[STG/4]OUT-----> Downloaded app package (72K)
2016-04-08T09:23:12.762-0400[STG/4]OUT-----> Downloaded app buildpack cache (29M)
2016-04-08T09:23:12.901-0400[STG/0]ERRCloning into '/tmp/buildpacks/buildpack-python'...
2016-04-08T09:23:14.625-0400[STG/0]OUTSubmodule 'compile-extensions' (https://github.com/cloudfoundry/compile-extensions.git) registered for path 'compile-extensions'
2016-04-08T09:23:14.679-0400[STG/0]ERRCloning into 'compile-extensions'...
2016-04-08T09:23:15.534-0400[STG/0]OUTSubmodule path 'compile-extensions': checked out '9932bb1d352b88883d76df41e797a6fa556844f0'
2016-04-08T09:23:15.782-0400[STG/0]OUT-------> Buildpack version 1.5.5
2016-04-08T09:23:16.785-0400[STG/0]OUT-----> Found python-2.7.10, removing
2016-04-08T09:23:17.035-0400[STG/0]OUT-----> Installing python-3.5.0
2016-04-08T09:23:21.330-0400[STG/0]OUTDownloaded [https://pivotal-buildpacks.s3.amazonaws.com/concourse-binaries/python/python-3.5.0-linux-x64.tgz]
2016-04-08T09:23:27.161-0400[STG/0]OUT ! Please remove to ensure expected behavior.
2016-04-08T09:23:27.161-0400[STG/0]OUT ! The package setuptools/distribute is listed in requirements.txt.
2016-04-08T09:23:29.058-0400[STG/0]OUT $ pip install -r requirements.txt
2016-04-08T09:23:29.728-0400[STG/0]ERRDEPRECATION: --allow-all-external has been deprecated and will be removed in the future. Due to changes in the repository protocol, it no longer has any effect.
2016-04-08T09:23:29.757-0400[STG/0]OUT Collecting django==1.9.5 (from -r mysite/requirements.txt (line 1))
2016-04-08T09:23:30.078-0400[STG/0]OUT Downloading Django-1.9.5-py2.py3-none-any.whl (6.6MB)
2016-04-08T09:23:32.696-0400[STG/0]OUT Collecting docopt==0.6.2 (from -r mysite/requirements.txt (line 2))
2016-04-08T09:23:32.758-0400[STG/0]OUT Downloading docopt-0.6.2.tar.gz
2016-04-08T09:23:33.446-0400[STG/0]OUT Collecting elasticsearch==2.3.0 (from -r mysite/requirements.txt (line 3))
2016-04-08T09:23:33.525-0400[STG/0]OUT Downloading elasticsearch-2.3.0-py2.py3-none-any.whl (51kB)
2016-04-08T09:23:33.552-0400[STG/0]OUT Collecting hdfs==2.0.5 (from -r mysite/requirements.txt (line 4))
2016-04-08T09:23:33.631-0400[STG/0]OUT Downloading hdfs-2.0.5.tar.gz
2016-04-08T09:23:34.330-0400[STG/0]OUT Collecting python==3.5.0 (from -r mysite/requirements.txt (line 6))
2016-04-08T09:23:34.364-0400[STG/0]ERR Could not find a version that satisfies the requirement python==3.5.0 (from -r mysite/requirements.txt (line 6)) (from versions: )
2016-04-08T09:23:34.962-0400[STG/0]ERRNo matching distribution found for python==3.5.0 (from -r mysite/requirements.txt (line 6))
2016-04-08T09:23:35.249-0400[STG/0]OUTStaging failed: Buildpack compilation step failed
2016-04-08T09:23:35.468-0400[API/0]ERRencountered error: App staging failed in the buildpack compile phase

my requirements

django==1.9.5
docopt==0.6.2
elasticsearch==2.3.0
hdfs==2.0.5
pip==8.1.1
python==3.5.0
requests==2.9.1
setuptools==20.3
simplejson==3.8.2
six==1.10.0
urllib3==1.14
vs2015_runtime==14.00.23026.0
wheel==0.29.0

the command i ran

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

how should i deploy this?

Getting error when installing packages with conda

What version of Cloud Foundry are you using?

PCF 1.7

What version of the buildpack you are using?

Tried GitHub master and develop branch

If you were attempting to accomplish a task, what was it you were attempting to do?

Try to run the app I am currently working on (https://github.com/ronert/cf-predict)

What did you expect to happen?

I expected the buildpack to install all my dependencies specified in the environment.yml file.

What was the actual behavior?

PCF errored with

2016-06-20T15:57:19.40+0200 [STG/0]      OUT The following packages will be UPDATED:
2016-06-20T15:57:20.57+0200 [STG/0]      OUT Fetching package metadata .......
2016-06-20T15:57:20.89+0200 [STG/0]      OUT Solving package specifications: ..........
2016-06-20T15:57:21.83+0200 [STG/0]      OUT     package                    |            build
2016-06-20T15:57:21.83+0200 [STG/0]      OUT     pip-8.1.2                  |           py35_0         1.6 MB
2016-06-20T15:57:21.83+0200 [STG/0]      OUT Package plan for installation in environment /tmp/app/.conda:
2016-06-20T15:57:21.83+0200 [STG/0]      OUT The following packages will be downloaded:
2016-06-20T15:57:21.83+0200 [STG/0]      OUT     ---------------------------|-----------------
2016-06-20T15:57:21.83+0200 [STG/0]      OUT The following packages will be UPDATED:
2016-06-20T15:57:21.83+0200 [STG/0]      OUT     pip: 8.1.1-py35_1 --> 8.1.2-py35_0
2016-06-20T15:57:21.89+0200 [STG/0]      OUT -----> Installing conda environment from environment.yml...
2016-06-20T15:57:23.16+0200 [STG/0]      OUT Fetching package metadata .......
2016-06-20T15:57:24.22+0200 [STG/0]      OUT Solving package specifications: ..........
2016-06-20T15:58:07.31+0200 [STG/0]      OUT An unexpected error has occurred, please consider sending the
2016-06-20T15:58:07.31+0200 [STG/0]      OUT     https://github.com/conda/conda/issues
2016-06-20T15:58:07.31+0200 [STG/0]      OUT Include the output of the command 'conda info' in your report.
2016-06-20T15:58:07.31+0200 [STG/0]      ERR Traceback (most recent call last):
2016-06-20T15:58:07.31+0200 [STG/0]      ERR     sys.exit(conda_env.cli.main.main())
2016-06-20T15:58:07.31+0200 [STG/0]      ERR   File "/tmp/app/.conda/lib/python3.5/site-packages/conda_env/cli/main.py", line 68, in main
2016-06-20T15:58:07.31+0200 [STG/0]      ERR     return args_func(args, parser)
2016-06-20T15:58:07.31+0200 [STG/0]      ERR   File "/tmp/app/.conda/lib/python3.5/site-packages/conda/cli/main.py", line 127, in args_func
2016-06-20T15:58:07.31+0200 [STG/0]      ERR     args.func(args, p)
2016-06-20T15:58:07.31+0200 [STG/0]      ERR   File "/tmp/app/.conda/lib/python3.5/site-packages/conda_env/cli/main_update.py", line 118, in execute
2016-06-20T15:58:07.31+0200 [STG/0]      ERR TypeError: install() got an unexpected keyword argument 'prune'

Ian Huston's conda buildpack works fine with the same code. Maybe some miniconda behaviour changed?

ImportError: No module named 'encodings'

I am wondering if anyone else is seeing this same error...

On the lucid stack everything is working fine but if I switch to the new one cflinuxfs2 I get this error when using Python.

Moreover the only runtime that even compiles is 3.4.2 since everything less than that requires libssl.0.9.8.

Did anyone get something like this?

Python Buildpack Compilation Error

What version of Cloud Foundry are you using?
6.22.1+6b7af9c-2016-09-24

What version of the buildpack you are using?
1.5.5

If you were attempting to accomplish a task, what was it you were attempting to do?
cf push

What did you expect to happen?
Successfully push changes to my web app

What was the actual behavior?

Starting app MY-APP in org [email protected] / space test as [email protected]...
-----> Downloaded app package (13M)
-----> Downloaded app buildpack cache (30M)
-------> Buildpack version 1.5.5
-----> Found python-2.7.10, removing
-----> Installing python-3.5.2
DEPENDENCY MISSING IN MANIFEST: python 3.5.2
Unfortunately, that version of python is not supported by this build pack
- 3.5.1
- 3.5.0
- 3.4.4
- 2.7.11
- 2.7.10
It looks like you're trying to use python 3.5.2.
The versions of python supported in this build pack are
- 3.4.3
- 3.3.5
If you need further help, start by reading: http://github.com/cloudfoundry/python-buildpack/releases.
Staging failed: Buildpack compilation step failed


FAILED
Error restarting application: BuildpackCompileFailed




My requirements file: (Im using selenium and these packages also have dependencies which Im not sure if I should be putting in the requirements file.)

Flask==0.11.1
cloudant==2.2.0
Pyrebase==3.0.18

my runtime file:

`python-3.5.2`

my manifest file:

applications:

  • path: .
    memory: 128M
    instances: 1
    domain: mybluemix.net
    name: MY-APP
    host: MY-APP
    disk_quota: 1024M
    buildpack: python_buildpack

Support For Appdynamics

Hi,

I am working on Python Buildpack for Appdynamics.
While adding support It seems that we need to run command "pyagent run" with appdynamics controller details. But command is failing

Can you please provide details on how to go ahead with support for appdynamics.

App with scikit-learn error: ERR ImportError: libgfortran.so.1: cannot open shared object file: No such file or directory

What version of Cloud Foundry are you using?
API endpoint: https://api.local2.pcfdev.io (API version: 2.54.0)

What version of the buildpack you are using?
https://github.com/cloudfoundry/python-buildpack

If you were attempting to accomplish a task, what was it you were attempting to do?
Trying to push this app

What did you expect to happen?
It to work

What was the actual behavior?

2016-08-31T10:35:55.02-0400 [API/0] OUT App instance exited with guid 0caf2a47-245a-4a54-ad3b-e185081c2699 payload: {"instance"=>"bda29ec8-0ea7-443d-50c4-0a0a8ab9b77f", "index"=>0, "reason"=>"CRASHED", "exit_description"=>"2 error(s) occurred:\n\n* 2 error(s) occurred:\n\n* Exited with status 1\n* cancelled\n* cancelled", "crash_count"=>5, "crash_timestamp"=>1472654154980440286, "version"=>"334ec32f-bd9e-419e-ac7f-183af0a659e0"}

2016-08-31T10:35:54.90-0400 [APP/0] ERR /home/vcap/app/.conda/envs/dep_env/lib/python3.5/site-packages/sklearn/utils/fixes.py:64: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
2016-08-31T10:35:54.90-0400 [APP/0] ERR if 'order' in inspect.getargspec(np.copy)[0]:
2016-08-31T10:35:54.90-0400 [APP/0] ERR Traceback (most recent call last):
2016-08-31T10:35:54.90-0400 [APP/0] ERR File "app.py", line 7, in
2016-08-31T10:35:54.90-0400 [APP/0] ERR from sklearn.linear_model import LogisticRegression
2016-08-31T10:35:54.90-0400 [APP/0] ERR File "/home/vcap/app/.conda/envs/dep_env/lib/python3.5/site-packages/sklearn/linear_model/init.py", line 15, in
2016-08-31T10:35:54.90-0400 [APP/0] ERR from .least_angle import (Lars, LassoLars, lars_path, LarsCV, LassoLarsCV,
2016-08-31T10:35:54.90-0400 [APP/0] ERR File "/home/vcap/app/.conda/envs/dep_env/lib/python3.5/site-packages/sklearn/linear_model/least_angle.py", line 24, in
2016-08-31T10:35:54.90-0400 [APP/0] ERR from ..utils import arrayfuncs, as_float_array, check_X_y
2016-08-31T10:35:54.90-0400 [APP/0] ERR ImportError: libgfortran.so.1: cannot open shared object file: No such file or directory

Something to note: It's looking for python 3 even though I specified a Python2 app. FYI: I've seen this happen in the past.

Please confirm where necessary:

  • [x ] I have included a log output
  • [x ] My log includes an error message
  • [x ] I have included steps for reproduction

Pull request for APT-GET

What version of Cloud Foundry are you using?

  • Current PCF release

What version of the buildpack you are using?

  • Current 1.5.11

If you were attempting to accomplish a task, what was it you were attempting to do?

  • I am trying to put a functionality where we can do APT-GET install in the python buildpack. Basically, it is the code from heruko-apt-get buildpack. This allows us to install any linux binaries and the binaries and permission are set correct in the /app/ subfolders
  • Please check out the behaviour on my apt-python-buildpack
  • Essentially, if apt.install file are found, the installing of these binaries begins. Similar to conda's environment.yml

Building SciPy with the buildpack fails without a Fortran compiler

SciPy has a number of Fortran dependencies that require a compiler (such as gfortran) in order for compilation.

Example error when building:
2015-11-11T18:13:00.15-0500 [STG/0] OUT Could not locate executable pathf95 2015-11-11T18:13:00.15-0500 [STG/0] OUT don't know how to compile Fortran code on platform 'posix' 2015-11-11T18:13:00.15-0500 [STG/0] OUT building 'dfftpack' library 2015-11-11T18:13:00.15-0500 [STG/0] OUT error: library dfftpack has Fortran sources but no Fortran compiler found 2015-11-11T18:13:00.15-0500 [STG/0] OUT ---------------------------------------- 2015-11-11T18:13:00.16-0500 [STG/0] OUT Staging failed: Buildpack compilation step failed 2015-11-11T18:13:00.27-0500 [API/2] ERR encountered error: App staging failed in the buildpack compile phase

Copying into the container failed

I am relaying an issue I encountered and am providing the solution I am using.

What version of Cloud Foundry are you using?
API endpoint: https://api.local2.pcfdev.io (API version: 2.54.0)

What version of the buildpack you are using?
buildpack: https://github.com/cloudfoundry/python-buildpack.git

If you were attempting to accomplish a task, what was it you were attempting to do?
Pushing an app

https://github.com/crawles/text-analytics-service-example/tree/2bdc7a695459dc67877bf8ccd7f38ba238af32b5/flask_deployment

What did you expect to happen?
It to deploy

What was the actual behavior?
It failed due to:

2016-08-24T10:18:18.08-0400 [API/0] OUT App instance exited with guid 88003cf8-e493-4ece-a610-f36f3b2a0fce payload: {"instance"=>"7243f261-0f66-4db4-6fc8-eea5bfdc4a67", "index"=>0, "reason"=>"CRASHED", "exit_description"=>"Copying into the container failed", "crash_count"=>4, "crash_timestamp"=>1472048298064998585, "version"=>"ee271b31-6a2b-4b51-ae0c-589d06392855"}

This error is fixed when I changed the disk and memory from 512MB to 1 GB. The app is one python file and here is the environment.yml. I would desire the error message be more descriptive of why copying into the container failed. I guess there wasn't enough room? Had to figure out from googling and trial and error

Please confirm where necessary:

  • [ x] I have included a log output
  • [ x] My log includes an error message
  • [ x] I have included steps for reproduction

CF not recognizing package even though it's in environment.yml

What version of Cloud Foundry and CF CLI are you using? (i.e. What is the output of running cf curl /v2/info && cf version?

"name": "",
"build": "",
"support": "https://support.pivotal.io",
"version": 0,
"description": "",
"authorization_endpoint": "https://login.run.pez.pivotal.io",
"token_endpoint": "https://uaa.run.pez.pivotal.io",
"min_cli_version": "6.7.0",
"min_recommended_cli_version": "6.11.2",
"api_version": "2.65.0",
"app_ssh_endpoint": "ssh.run.pez.pivotal.io:2222",
"app_ssh_host_key_fingerprint": "9d:fb:3c:63:b5:fa:be:c2:50:cc:a6:a7:31:f4:a8:4b",
"app_ssh_oauth_client": "ssh-proxy",
"routing_endpoint": "https://api.run.pez.pivotal.io/routing",
"logging_endpoint": "wss://loggregator.run.pez.pivotal.io:443",
"doppler_logging_endpoint": "wss://doppler.run.pez.pivotal.io:443",
"user": "9bfb61cc-7859-445b-af24-2d5c49dafe75"
}

What version of the buildpack you are using?
newest from github

If you were attempting to accomplish a task, what was it you were attempting to do?
push an app

What did you expect to happen?
it to work

What was the actual behavior?
It says it can't import flask even though I put it in my environment.yml

2017-01-20T11:24:49.96-0500 [APP/PROC/WEB/0]ERR from flask import Flask, request, jsonify
2017-01-20T11:24:49.96-0500 [APP/PROC/WEB/0]ERR ImportError: No module named flask

I think install is stuck in the cache or something but it can't find it because at one point it says:
2017-01-20T11:22:39.45-0500 [STG/0] OUT Requirement already satisfied: flask in /tmp/app/.conda/envs/dep_env/lib/python2.7/site-packages

Please confirm where necessary:

  • I have included a log output
  • My log includes an error message
  • I have included steps for reproduction

2017-01-20T11:21:59.45-0500 [API/2] OUT Updated app with guid 008999e4-ea4c-495b-806f-5cf2ff3b7159 ({"name"=>"compute-tweet-stats", "command"=>"PRIVATE DATA HIDDEN", "instances"=>1, "memory"=>256, "disk_quota"=>1024, "buildpack"=>"https://github.com/cloudfoundry/python-buildpack.git", "environment_json"=>"PRIVATE DATA HIDDEN"})
2017-01-20T11:22:08.14-0500 [API/3] OUT Updated app with guid 008999e4-ea4c-495b-806f-5cf2ff3b7159 ({"state"=>"STOPPED"})
2017-01-20T11:22:09.58-0500 [API/6] OUT Updated app with guid 008999e4-ea4c-495b-806f-5cf2ff3b7159 ({"state"=>"STARTED"})
2017-01-20T11:22:09.67-0500 [STG/0] OUT Creating container
2017-01-20T11:22:10.02-0500 [STG/0] OUT Successfully created container
2017-01-20T11:22:10.02-0500 [STG/0] OUT Downloading app package...
2017-01-20T11:22:10.05-0500 [STG/0] OUT Downloaded app package (3.6K)
2017-01-20T11:22:10.05-0500 [STG/0] OUT Downloading build artifacts cache...
2017-01-20T11:22:20.14-0500 [STG/0] OUT Downloaded build artifacts cache (252.3M)
2017-01-20T11:22:20.14-0500 [STG/0] OUT Staging...
2017-01-20T11:22:27.08-0500 [STG/0] OUT ----------------- USING CONDA BUILDPACK -----------------
2017-01-20T11:22:27.08-0500 [STG/0] OUT -----> Starting compile step...
2017-01-20T11:22:27.09-0500 [STG/0] OUT -----> Preparing Python Environment...
2017-01-20T11:22:27.10-0500 [STG/0] OUT PREFIX=/tmp/app/.conda
2017-01-20T11:22:27.33-0500 [STG/0] OUT installing: python-2.7.12-1 ...
2017-01-20T11:22:29.40-0500 [STG/0] OUT installing: conda-env-2.6.0-0 ...
2017-01-20T11:22:29.41-0500 [STG/0] OUT installing: enum34-1.1.6-py27_0 ...
2017-01-20T11:22:29.42-0500 [STG/0] OUT installing: openssl-1.0.2j-0 ...
2017-01-20T11:22:29.90-0500 [STG/0] OUT installing: pycosat-0.6.1-py27_1 ...
2017-01-20T11:22:29.95-0500 [STG/0] OUT installing: readline-6.2-2 ...
2017-01-20T11:22:30.04-0500 [STG/0] OUT installing: requests-2.11.1-py27_0 ...
2017-01-20T11:22:30.14-0500 [STG/0] OUT installing: ruamel_yaml-0.11.14-py27_0 ...
2017-01-20T11:22:30.20-0500 [STG/0] OUT installing: sqlite-3.13.0-0 ...
2017-01-20T11:22:30.79-0500 [STG/0] OUT installing: tk-8.5.18-0 ...
2017-01-20T11:22:31.09-0500 [STG/0] OUT installing: yaml-0.1.6-0 ...
2017-01-20T11:22:31.13-0500 [STG/0] OUT installing: zlib-1.2.8-3 ...
2017-01-20T11:22:31.16-0500 [STG/0] OUT installing: conda-4.2.12-py27_0 ...
2017-01-20T11:22:31.25-0500 [STG/0] OUT installing: pycrypto-2.6.1-py27_4 ...
2017-01-20T11:22:31.36-0500 [STG/0] OUT installing: pip-8.1.2-py27_0 ...
2017-01-20T11:22:31.68-0500 [STG/0] OUT installing: wheel-0.29.0-py27_0 ...
2017-01-20T11:22:31.71-0500 [STG/0] OUT installing: setuptools-27.2.0-py27_0 ...
2017-01-20T11:22:31.77-0500 [STG/0] ERR Python 2.7.12 :: Continuum Analytics, Inc.
2017-01-20T11:22:31.77-0500 [STG/0] OUT creating default environment...
2017-01-20T11:22:32.38-0500 [STG/0] OUT installation finished.
2017-01-20T11:22:32.38-0500 [STG/0] OUT -----> Using dependency cache at /tmp/cache/envs
2017-01-20T11:22:33.54-0500 [STG/0] OUT -----> Installing Dependencies...
2017-01-20T11:22:33.54-0500 [STG/0] OUT -----> Installing conda environment from environment.yml...
2017-01-20T11:22:35.96-0500 [STG/0] OUT Fetching package metadata .......
2017-01-20T11:22:36.99-0500 [STG/0] OUT Solving package specifications: ..........
2017-01-20T11:22:39.45-0500 [STG/0] OUT Requirement already satisfied: flask in /tmp/app/.conda/envs/dep_env/lib/python2.7/site-packages
2017-01-20T11:22:39.47-0500 [STG/0] OUT Requirement already satisfied: gunicorn in /tmp/app/.conda/envs/dep_env/lib/python2.7/site-packages
2017-01-20T11:22:39.47-0500 [STG/0] OUT Requirement already satisfied: redis in /tmp/app/.conda/envs/dep_env/lib/python2.7/site-packages
2017-01-20T11:22:39.48-0500 [STG/0] OUT Requirement already satisfied: Werkzeug>=0.7 in /tmp/app/.conda/envs/dep_env/lib/python2.7/site-packages (from flask)
2017-01-20T11:22:39.49-0500 [STG/0] OUT Requirement already satisfied: Jinja2>=2.4 in /tmp/app/.conda/envs/dep_env/lib/python2.7/site-packages (from flask)
2017-01-20T11:22:39.50-0500 [STG/0] OUT Requirement already satisfied: itsdangerous>=0.21 in /tmp/app/.conda/envs/dep_env/lib/python2.7/site-packages (from flask)
2017-01-20T11:22:39.50-0500 [STG/0] OUT Requirement already satisfied: click>=2.0 in /tmp/app/.conda/envs/dep_env/lib/python2.7/site-packages (from flask)
2017-01-20T11:22:39.50-0500 [STG/0] OUT Requirement already satisfied: MarkupSafe in /tmp/app/.conda/envs/dep_env/lib/python2.7/site-packages (from Jinja2>=2.4->flask)
2017-01-20T11:22:39.54-0500 [STG/0] OUT #
2017-01-20T11:22:39.54-0500 [STG/0] OUT # To activate this environment, use:
2017-01-20T11:22:39.54-0500 [STG/0] OUT # > source activate dep_env
2017-01-20T11:22:39.54-0500 [STG/0] OUT #
2017-01-20T11:22:39.54-0500 [STG/0] OUT # To deactivate this environment, use:
2017-01-20T11:22:39.54-0500 [STG/0] OUT # > source deactivate dep_env
2017-01-20T11:22:39.54-0500 [STG/0] OUT #
2017-01-20T11:22:39.98-0500 [STG/0] OUT Cache location:
2017-01-20T11:22:39.98-0500 [STG/0] OUT There are no tarballs to remove
2017-01-20T11:22:39.98-0500 [STG/0] OUT Cache location: /tmp/app/.conda/pkgs
2017-01-20T11:22:39.98-0500 [STG/0] OUT Will remove the following packages:
2017-01-20T11:22:39.98-0500 [STG/0] OUT /tmp/app/.conda/pkgs
2017-01-20T11:22:39.98-0500 [STG/0] OUT --------------------
2017-01-20T11:22:39.98-0500 [STG/0] OUT setuptools-27.2.0-py27_0 529 KB
2017-01-20T11:22:39.98-0500 [STG/0] OUT pycosat-0.6.1-py27_1 600 KB
2017-01-20T11:22:39.98-0500 [STG/0] OUT conda-env-2.6.0-0 454 B
2017-01-20T11:22:39.98-0500 [STG/0] OUT ---------------------------------------------------
2017-01-20T11:22:39.98-0500 [STG/0] OUT Total: 1.1 MB
2017-01-20T11:22:39.98-0500 [STG/0] OUT Proceed ([y]/n)?
2017-01-20T11:22:39.98-0500 [STG/0] OUT removing setuptools-27.2.0-py27_0
2017-01-20T11:22:39.98-0500 [STG/0] OUT removing pycosat-0.6.1-py27_1
2017-01-20T11:22:39.98-0500 [STG/0] OUT removing conda-env-2.6.0-0
2017-01-20T11:22:40.00-0500 [STG/0] OUT -----> Caching dependencies to /tmp/cache/envs
2017-01-20T11:22:42.40-0500 [STG/0] OUT -----> Fixing paths...
2017-01-20T11:22:43.26-0500 [STG/0] OUT -----> Finished compile step
2017-01-20T11:22:44.06-0500 [STG/0] ERR No start command specified by buildpack or via Procfile.
2017-01-20T11:22:44.06-0500 [STG/0] ERR App will not start unless a command is provided at runtime.
2017-01-20T11:24:01.31-0500 [STG/0] OUT Exit status 0
2017-01-20T11:24:01.31-0500 [STG/0] OUT Staging complete
2017-01-20T11:24:01.31-0500 [STG/0] OUT Uploading droplet, build artifacts cache...
2017-01-20T11:24:01.31-0500 [STG/0] OUT Uploading build artifacts cache...
2017-01-20T11:24:01.31-0500 [STG/0] OUT Uploading droplet...
2017-01-20T11:24:07.53-0500 [STG/0] OUT Uploaded build artifacts cache (252.3M)
2017-01-20T11:24:16.44-0500 [STG/0] OUT Uploaded droplet (216.5M)
2017-01-20T11:24:16.48-0500 [STG/0] OUT Uploading complete
2017-01-20T11:24:16.50-0500 [STG/0] OUT Destroying container
2017-01-20T11:24:17.14-0500 [CELL/0] OUT Creating container
2017-01-20T11:24:17.41-0500 [STG/0] OUT Successfully destroyed container
2017-01-20T11:24:17.61-0500 [CELL/0] OUT Successfully created container
2017-01-20T11:24:33.71-0500 [CELL/0] OUT Starting health monitoring of container
2017-01-20T11:24:35.51-0500 [APP/PROC/WEB/0]ERR [2017-01-20 16:24:35 +0000] [14] [INFO] Starting gunicorn 19.6.0
2017-01-20T11:24:35.51-0500 [APP/PROC/WEB/0]ERR [2017-01-20 16:24:35 +0000] [14] [INFO] Listening at: http://0.0.0.0:8080 (14)
2017-01-20T11:24:35.51-0500 [APP/PROC/WEB/0]ERR [2017-01-20 16:24:35 +0000] [14] [INFO] Using worker: sync
2017-01-20T11:24:35.51-0500 [APP/PROC/WEB/0]ERR [2017-01-20 16:24:35 +0000] [64] [INFO] Booting worker with pid: 64
2017-01-20T11:24:35.53-0500 [APP/PROC/WEB/0]ERR [2017-01-20 16:24:35 +0000] [64] [ERROR] Exception in worker process
2017-01-20T11:24:35.53-0500 [APP/PROC/WEB/0]ERR Traceback (most recent call last):
2017-01-20T11:24:35.53-0500 [APP/PROC/WEB/0]ERR File "/home/vcap/app/.conda/envs/dep_env/lib/python2.7/site-packages/gunicorn/arbiter.py", line 557, in spawn_worker
2017-01-20T11:24:35.53-0500 [APP/PROC/WEB/0]ERR worker.init_process()
2017-01-20T11:24:35.53-0500 [APP/PROC/WEB/0]ERR File "/home/vcap/app/.conda/envs/dep_env/lib/python2.7/site-packages/gunicorn/workers/base.py", line 126, in init_process
2017-01-20T11:24:35.53-0500 [APP/PROC/WEB/0]ERR self.load_wsgi()
2017-01-20T11:24:35.53-0500 [APP/PROC/WEB/0]ERR File "/home/vcap/app/.conda/envs/dep_env/lib/python2.7/site-packages/gunicorn/workers/base.py", line 136, in load_wsgi
2017-01-20T11:24:35.53-0500 [APP/PROC/WEB/0]ERR self.wsgi = self.app.wsgi()
2017-01-20T11:24:35.53-0500 [APP/PROC/WEB/0]ERR File "/home/vcap/app/.conda/envs/dep_env/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
2017-01-20T11:24:35.53-0500 [APP/PROC/WEB/0]ERR self.callable = self.load()
2017-01-20T11:24:35.53-0500 [APP/PROC/WEB/0]ERR File "/home/vcap/app/.conda/envs/dep_env/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
2017-01-20T11:24:35.53-0500 [APP/PROC/WEB/0]ERR return self.load_wsgiapp()
2017-01-20T11:24:35.53-0500 [APP/PROC/WEB/0]ERR File "/home/vcap/app/.conda/envs/dep_env/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
2017-01-20T11:24:35.53-0500 [APP/PROC/WEB/0]ERR return util.import_app(self.app_uri)
2017-01-20T11:24:35.53-0500 [APP/PROC/WEB/0]ERR File "/home/vcap/app/.conda/envs/dep_env/lib/python2.7/site-packages/gunicorn/util.py", line 357, in import_app
2017-01-20T11:24:35.53-0500 [APP/PROC/WEB/0]ERR import(module)
2017-01-20T11:24:35.53-0500 [APP/PROC/WEB/0]ERR File "/home/vcap/app/tweet_rate.py", line 5, in
2017-01-20T11:24:35.53-0500 [APP/PROC/WEB/0]ERR from flask import Flask, request, jsonify
2017-01-20T11:24:35.53-0500 [APP/PROC/WEB/0]ERR ImportError: No module named flask
2017-01-20T11:24:35.53-0500 [APP/PROC/WEB/0]ERR [2017-01-20 16:24:35 +0000] [64] [INFO] Worker exiting (pid: 64)
2017-01-20T11:24:35.57-0500 [APP/PROC/WEB/0]ERR [2017-01-20 16:24:35 +0000] [14] [INFO] Shutting down: Master
2017-01-20T11:24:35.57-0500 [APP/PROC/WEB/0]ERR [2017-01-20 16:24:35 +0000] [14] [INFO] Reason: Worker failed to boot.
2017-01-20T11:24:35.59-0500 [APP/PROC/WEB/0]OUT Exit status 3

Also:

crawles$ cat compute-tweet-stats/environment.yml
name: tweet_rate_environment
dependencies:
  - pandas
  - python=2.7.11
  - pip:
      - flask
      - gunicorn
      - redis```

Failed compiling app with scipy requirement

I'm trying this right now (on Pivotal Web Services) and it's failing to compile:

$ cf push test-pandas -b python_buildpack -c 'python server.py' --random-route | tee /tmp/test-pandas-cf.log

Here's my requirements.txt (identical to #22):

Flask==0.10.1
itsdangerous==0.24
Jinja2==2.7.3
MarkupSafe==0.23
nltk==3.0.2
numpy==1.9.2
pandas==0.16.1
python-dateutil==2.4.2
pytz==2015.4
scikit-learn==0.16.1
scipy==0.15.1
six==1.9.0
Werkzeug==0.10.4

Here's my server.py (though it should be irrelevant for failed staging):

from flask import Flask
from sklearn.ensemble import RandomForestClassifier
import pandas as pd

app = Flask(__name__)

@app.route("/")
def hello():
    return "Hello World!"

if __name__ == "__main__":
    app.run()

Those are the only two files in my project's directory.

Here is the log output: https://gist.github.com/Amit-PivotalLabs/179dc16bc363893f4e79

The error message seems to be saying there's no Fortran compiler found. cflinuxfs2 indeed appears to have no Fortran compiler, just [libgfortran3](https://www.opencsw.org/package/libgfortran3/).

Ignoring server.py, my overall goal is to leverage the v3 CC API to parallelize a bunch of one-off tasks (ETL + some basic machine learning).

Can't access python-3.3.tar.gz

2014-11-21T15:43:39.34+0000 [DEA]     OUT Got staging request for app with id 07fa38ae-a9b4-440c-8aaa-bced16e62712
2014-11-21T15:43:40.27+0000 [API]     OUT Updated app with guid 07fa38ae-a9b4-440c-8aaa-bced16e62712 ({"state"=>"STARTED"})
2014-11-21T15:43:40.45+0000 [STG]     OUT -----> Downloaded app package (4.0K)
2014-11-21T15:43:55.09+0000 [STG]     OUT -------> Buildpack version 1.0.5
2014-11-21T15:43:55.09+0000 [STG]     OUT Use locally cached dependencies where possible
2014-11-21T15:43:55.12+0000 [STG]     OUT -----> Installing runtime (python-3.3)
2014-11-21T15:43:55.19+0000 [STG]     ERR Expected dependency to exist but could not find it: http://lang-python.s3.amazonaws.com/cedar/runtimes/python-3.3.tar.gz
2014-11-21T15:43:55.19+0000 [STG]     OUT  !     Requested runtime (python-3.3) is not available for this stack (cedar).
2014-11-21T15:43:55.19+0000 [STG]     OUT  !     Aborting.  More info: https://devcenter.heroku.com/articles/python-support
2014-11-21T15:43:55.21+0000 [STG]     OUT Staging failed: Buildpack compilation step failed
2014-11-21T15:43:55.37+0000 [API]     ERR Encountered error: App staging failed in the buildpack compile phase

Pre-staging hooks

What version of Cloud Foundry are you using?
cf version 6.15.0+fa1bfe2-2016-01-13

What version of the buildpack you are using?
v1.5.1

If you were attempting to accomplish a task, what was it you were attempting to do?
Trying to get Odoo to run on Cloud foundry. Need to have these deps installed: apt-get install -y libpq-dev libxml2-dev libxslt1-dev python-ldb-dev libldap2-dev libsasl2-dev

What did you expect to happen?

What was the actual behavior?

copying Lib/ldap/syncrepl.py -> build/lib.linux-x86_64-2.7/ldap
           file Lib/ldap.py (for module ldap) not found
           file Lib/ldap/controls.py (for module ldap.controls) not found           file Lib/ldap/extop.py (for module ldap.extop) not found           file Lib/ldap/schema.py (for module ldap.schema) not found
           running egg_info
           creating Lib/python_ldap.egg-info
           writing requirements to Lib/python_ldap.egg-info/requires.txt
           writing Lib/python_ldap.egg-info/PKG-INFO
           writing top-level names to Lib/python_ldap.egg-info/top_level.txt
           writing dependency_links to Lib/python_ldap.egg-info/dependency_links.txt
           writing manifest file 'Lib/python_ldap.egg-info/SOURCES.txt'
           warning: manifest_maker: standard file '-c' not found           file Lib/ldap.py (for module ldap) not found
           file Lib/ldap/controls.py (for module ldap.controls) not found
           file Lib/ldap/extop.py (for module ldap.extop) not found
           file Lib/ldap/schema.py (for module ldap.schema) not found
           reading manifest file 'Lib/python_ldap.egg-info/SOURCES.txt'
           reading manifest template 'MANIFEST.in'
           warning: no files found matching 'Makefile'
           warning: no files found matching 'Modules/LICENSE'
           writing manifest file 'Lib/python_ldap.egg-info/SOURCES.txt'
           running build_ext
           building '_ldap' extension
           creating build/temp.linux-x86_64-2.7
           creating build/temp.linux-x86_64-2.7/Modules
           gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DHAVE_SASL -DHAVE_TLS -DHAVE_LIBLDAP_R -DHAVE_LIBLDAP_R -DLDAPMODULE_VERSION=2.4.15 -IModules -I/opt/openldap-RE24/include -I/usr/include/sasl -I/usr/include -I/app/.heroku/python/include/python2.7 -c Modules/LDAPObject.c -o build/temp.linux-x86_64-2.7/Modules/LDAPObject.o
           Modules/LDAPObject.c:18:18: fatal error: sasl.h: No such file or directory
            #include <sasl.h>
                             ^
           compilation terminated.
           error: command 'gcc' failed with exit status 1

           ----------------------------------------
Command "/app/.heroku/python/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-pTbJ2u/python-ldap/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Ocwq2_-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-pTbJ2u/python-ldap 
Failed to compile droplet
Exit status 223
Staging failed: Exited with status 223

Please confirm where necessary:

  • I have included a log output
  • My log includes an error message
  • I have included steps for reproduction

bin/package gone

Hi,

Looks like this was removed by c8919dd but is still mentioned by Readme.md.

Is it possible to build an offline buildpack without this script? If so, how to do it?

Any help or advice appreciated!

Regards,
James

PIP Uninstall fails during Deployement

What version of Cloud Foundry are you using?

CLI: version 6.19.0+b29b4e0-2016-06-08
API: version: 2.43.0

What version of the buildpack you are using?

1.5.1

If you were attempting to accomplish a task, what was it you were attempting to do?

Deploy the application.

What did you expect to happen?

Application should get deployed.

What was the actual behavior?

Deployment fails due to PIP not being able to uninstall old versions of the applications dependencies.

Please confirm where necessary:

Deprecation warning: --allow-all-external

When pushing to cf, we see the following deprecation warning.

-------> Buildpack version 1.5.5
-----> Installing python-3.5.1
Downloaded [https://pivotal-buildpacks.s3.amazonaws.com/concourse-binaries/python/python-3.5.1-linux-x64.tgz]
     $ pip install -r requirements.txt
DEPRECATION: --allow-all-external has been deprecated and will be removed in the future. Due to changes in the repository protocol, it no longer has any effect.

NOTICE: Breaking change in the Python buildpack for all Python 2.7 compiled extension modules

Summary:

The next release of the Python buildpack after April 1, 2017 will switch the unicode mode of all currently included versions of Python 2.7 from UCS-2 to UCS-4. This will break any pre-compiled extensions modules for Python 2.7 that you may be vendoring with your app. If this affects you, continue reading to learn about a smooth migration strategy.

In the next release of the Python buildpack (1.5.16) we will provide a version of Python 2.7.13 called "2.7.13-ucs2" that maintains UCS-2 support. This version will be included in the buildpack ASAP (before the other versions of Python 2.7 are migrated to UCS-4), and it will be available until May 1, 2017. This means that if you switch to 2.7.13-ucs2 before April 1, you will have until May 1 to convert any compiled extension modules you may be using to UCS-4. Your app's Python version may be specified in the runtime.txt file at the app root.

Background:

Most Python 2.7 distributions on Linux, as well as the latest Python 2.7 versions distributed in the Heroku version of the buildpack, store unicode data in UCS-4. Most Python distributions for macOS and Windows still store data in UCS-2. As compiled Python modules must be compiled for Linux to work with the Python buildpack, we've decided to migrate to UCS-4.

Unfortunately, compiled extension modules must be compiled for either UCS-2 or UCS-4, and the mode your extensions are compiled with must match the mode that Python is compiled with.

Issues/questions about GDAL dependency

I'm trying to tweak the buildpack code so it will vendor GDAL along with libffi and libmemcache, but some things are kind of confusing to me:

  • When I try to download https://lang-python.s3.amazonaws.com/cflinuxfs2/libraries/vendor/gdal.tar.gz to get the checksum to add to manifest.yml, I get a 403.
  • What is the difference between bin/steps/gdal and builds/libraries/vendor/gdal? It seems like neither use vendored dependencies, which I'm trying to fix, but the libffi and libmemcache counterparts in builds/libraries/vendor also never used vendored dependencies. I cannot seem to figure out when the builds/libraries/vendor/* scripts are even called. Is this something I need to watch for?

ERR CF_STACK: unbound variable

ERR /tmp/buildpacks/python-buildpack/bin/compile: line 230: CF_STACK: unbound variable

v1.2.0 is not backward compatible. Changes in v1.2.0 are not compatible with CF deployments which don't set CF_STACK env.var. In bin/compile, there is no default value for CF_STACK as its done in compile-extensions https://github.com/cloudfoundry-incubator/compile-extensions/blob/master/lib/dependencies.rb#L67


cf push mypythonapp1056 -b https://github.com/cloudfoundry/python-buildpack#v1.2.0

2015-03-31T22:33:37.86-0400 [STG/0] ERR /tmp/buildpacks/python-buildpack/bin/compile: line 230: CF_STACK: unbound variable
2015-03-31T22:33:37.87-0400 [STG/0] OUT Staging failed: Buildpack compilation step failed
2015-03-31T22:33:38.07-0400 [API/0] ERR Encountered error: App staging failed in the buildpack compile phase

Are Flask apps supported?

Hi,

I'm trying to deploy a Flask app to Cloud Foundry, and I've tried doing it both ways (disconnected environment instructions and regular instructions), but it's failing with the same error. I've successfully deployed the same app to Heroku. Here is the app: https://github.com/18F/project-monitor

Here is the last part of the log:

015-03-13T16:29:54.17-0400 [STG/0]      OUT        Successfully installed Jinja2-2.7.3 Project-Monitor-0.0.0 Werkzeug-0.10.1 flask-0.10.1 future-0.14.3 gunicorn-19.3.0 httmock-1.2.3 itsdangerous-0.24 markupsafe-0.23 psycopg2-2.6 requests-2.2.1
2015-03-13T16:29:55.39-0400 [STG/0]      ERR /tmp/buildpacks/buildpack-python/bin/compile: line 230: CF_STACK: unbound variable
2015-03-13T16:29:55.39-0400 [STG/0]      OUT Staging failed: Buildpack compilation step failed

Thanks!

Not enough information about workers being killed by kernel OOM

What version of Cloud Foundry are you using?

v245

What version of the buildpack you are using?

python_buildpack-cached-v1.5.10.zip

If you were attempting to accomplish a task, what was it you were attempting to do?

When running an application that uses python gunicorn with very little memory, the gunicorn workers get killed by the kernel OOM. That is fine and expected.

But the gunicorn master is monitoring those workers and restarts them immediately, which is fine.

The problem is that this restart event is never logged properly, or detected by garden+rep, so you cannot easily visualise what is happening.

What was the actual behavior?

  • cf events does not reflect any change in the container, because the master gunicorn never gets restarted,
  • cf logs only shows the message ERR [2016-12-07 11:45:54 +0000] [31798] [INFO] Booting worker with pid: 31798 which does not give too much info of what is going on.
  • kernel logs includes a full message:

What did you expect to happen?

To get more information about what is actually happening. We could log that the worker has been killed and restarted, if possible explaining that was due a Out of Memory.

Maybe this can be implemented with hooks/signals http://docs.gunicorn.org/en/stable/signals.html

I also wonder:

  • Should gunicorn actually die if the worker dies and not restart it? This way CF/Diego would do its work and restart the instance.
  • Should garden somehow detect that the child of gunicorn died by OOM? is that possible to implement? this question might have to be escalated to garden+Diego.

Pip has a newer version '9.0.1'

What version of Cloud Foundry are you using?
CF v246

What version of the buildpack you are using?
python_buildpack-cached-v1.5.11.zip

If you were attempting to accomplish a task, what was it you were attempting to do?
cf push

What did you expect to happen?
Not receive pip warnings

What was the actual behavior?
Received pip warnings

Please confirm where necessary:

  • I have included a log output
  • My log includes an error message
  • I have included steps for reproduction

Steps to reproduce:

  • CF push an app with python buildpack

Can't deploy python application to offline buildpack

I'm trying to deploy a Python application using the latest 1.5.4 cached buildpack. I get the following error:

...
Creating container
Successfully created container
Downloading app package...
Downloaded app package (441.8K)
Downloading buildpacks (python-offline)...
Downloading python-offline...
Downloaded python-offline
Downloaded buildpacks
Staging...
/tmp/buildpacks/716b4c887fc391b63f824f71998ae460/bin/compile: line 22: /tmp/buildpacks/716b4c887fc391b63f824f71998ae460/compile-extensions/bin/check_stack_support: No such file or directory
Failed to compile droplet
Exit status 223
Staging failed: Exited with status 223

FAILED
BuildpackCompileFailed

The --recent logs show the same exception as above.

Broken geo-lib step in buildpack

The geo-libs step of the buildpack compile is currently broken because it refers to the Heroku binaries URL, and the dependencies are not actually listed in the manifest.yml.

The installation appears to succeed because the curl fetching has all errors sent to /dev/null and pipefail is not set.

To replicate

  1. Push a test python app
  2. cf set-env APPNAME BUILD_WITH_GEO_LIBRARIES 1
  3. cf restage APPNAME
  4. cf ssh APPNAME
  5. ls app/.heroku/vendor and observe that it is empty

In order to fix this

  1. The curl fetching needs to be refactored to use download_dependency
  2. The gdal, geos, and proj dependencies need to be built and uploaded to the buildpack dependency bucket
  3. manifest.yml needs to have the dependencies listed

Other notes

  • The bin/steps/gdal step is also broken in the same way, however given geo-lib installs gdal the best fix may be to remove that step entirely.

requirements.txt does not get updated after a push command

What version of Cloud Foundry and CF CLI are you using? (i.e. What is the output of running cf curl /v2/info && cf version?

cf version 6.21.1+6fd3c9f-2016-08-10

What version of the buildpack you are using?

Versions 1.5.9-15

If you were attempting to accomplish a task, what was it you were attempting to do?

Push updates to requirements.txt

What did you expect to happen?

The old version of requirements.txt contained an error (inline comment that it seems was not allowed in later version of pip). I removed the comment and tried to update the requirements file on the server.

What was the actual behavior?

The app failed to start, because pip kept complaining that the inline comment was still there.

Old version of requirements.txt contains:

mysql-python#==1.2.5

New version of requirements.txt contains:

mysql-python

Error log after pushing the new version:

-------> Buildpack version 1.5.10
 !     Warning: Your application is missing a Procfile. This file tells Cloud Foundry how to run your application.
 !     Learn more: https://docs.cloudfoundry.org/buildpacks/prod-server.html#procfile
Traceback (most recent call last):
  File "/tmp/buildpack/vendor/pip-pop/pip-diff", line 116, in <module>
    main()
  File "/tmp/buildpack/vendor/pip-pop/pip-diff", line 112, in main
    diff(**kwargs)
  File "/tmp/buildpack/vendor/pip-pop/pip-diff", line 84, in diff
    r1 = Requirements(r1)
  File "/tmp/buildpack/vendor/pip-pop/pip-diff", line 29, in __init__
    self.load(reqfile)
  File "/tmp/buildpack/vendor/pip-pop/pip-diff", line 39, in load
    for requirement in parse_requirements(reqfile, finder=finder, session=requests):
  File "/app/.heroku/python/lib/python2.7/site-packages/pip-8.1.2-py2.7.egg/pip/req/req_file.py", line 93, in parse_requirements
    for req in req_iter:
  File "/app/.heroku/python/lib/python2.7/site-packages/pip-8.1.2-py2.7.egg/pip/req/req_file.py", line 158, in process_line
    "Invalid requirement: '%s'\n%s" % (req, add_msg))
pip.exceptions.InstallationError: Invalid requirement: 'MySQL-python#==1.2.5'
    isolated=isolated, options=req_options, wheel_cache=wheel_cache
  File "/app/.heroku/python/lib/python2.7/site-packages/pip-8.1.2-py2.7.egg/pip/req/req_install.py", line 226, in from_line
    wheel_cache=wheel_cache, constraint=constraint)
  File "/app/.heroku/python/lib/python2.7/site-packages/pip-8.1.2-py2.7.egg/pip/req/req_install.py", line 87, in __init__
Traceback (most recent call last):
  File "/app/.heroku/python/lib/python2.7/site-packages/pip-8.1.2-py2.7.egg/pip/req/req_install.py", line 78, in __init__
    req = Requirement(req)
  File "/app/.heroku/python/lib/python2.7/site-packages/pip-8.1.2-py2.7.egg/pip/_vendor/packaging/requirements.py", line 96, in __init__
    requirement_string[e.loc:e.loc + 8]))
InvalidRequirement: Invalid requirement, parse error at "u'#==1.2.5'"
Staging failed: Buildpack compilation step failed

FAILED
Error restarting application: BuildpackCompileFailed

The same problem happens with manifest.yml - it does not get updated if the previous installation fails.

The build succeeded with the buildpack version 1.5.9, but failed with the same error for versions 1.5.10 and up. The bug was introduced in v1.5.10.

It seems that if an installation commands exit with an error, old requirements.txt (and manifest.yml) will be used in the next push.

Please confirm where necessary:

  • I have included a log output
  • My log includes an error message
  • I have included steps for reproduction

"reason"=>"CRASHED", "exit_description"=>"Copying into the container failed" when deploying app

I got a bit further than #32 trying to deploy a Python app to MicroPCF, but now I'm running into an issue with the application starting. This is a standard Python application that listens on $PORT.

The manifest.yml looks as follows:

applications:
- name: <app name>
  command: python app.py
  timeout: 180
  memory: 96M
  disk_quota: 128M
  buildpack: python-offline

I've tried deploying it with cf push -u none, but again, as the errors below indicate, it doesn't seem to be an issue with the application starting up. It seems to fail before it even has a chance to try and start up.

...
2016-01-13T15:03:46.55-0500 [STG/0]      OUT -------> Buildpack version 1.5.4
2016-01-13T15:03:46.57-0500 [STG/0]      OUT -----> Installing runtime (python-2.7.11)
2016-01-13T15:03:47.52-0500 [STG/0]      OUT Downloaded [file:///tmp/buildpacks/634c21ea0cde9c6fab146bf6e2193eb3/dependencies/https___pivotal-buildpacks.s3.amazonaws.com_concourse-binaries_python_python-2.7.11-linux-x64.tgz]
2016-01-13T15:03:50.74-0500 [STG/0]      OUT -----> Installing dependencies with pip
2016-01-13T15:03:50.94-0500 [STG/0]      ERR You must give at least one requirement to install (see "pip help install")
2016-01-13T15:04:01.04-0500 [STG/0]      OUT Exit status 0
2016-01-13T15:04:01.04-0500 [STG/0]      OUT Staging complete
2016-01-13T15:04:01.04-0500 [STG/0]      OUT Uploading droplet, build artifacts cache...
2016-01-13T15:04:01.04-0500 [STG/0]      OUT Uploading droplet...
2016-01-13T15:04:01.04-0500 [STG/0]      OUT Uploading build artifacts cache...
2016-01-13T15:04:01.85-0500 [STG/0]      OUT Uploaded build artifacts cache (28.3M)
2016-01-13T15:04:09.81-0500 [STG/0]      OUT Uploaded droplet (28.8M)
2016-01-13T15:04:09.82-0500 [STG/0]      OUT Uploading complete
2016-01-13T15:04:10.23-0500 [CELL/0]     OUT Creating container
2016-01-13T15:04:10.69-0500 [CELL/0]     OUT Successfully created container
2016-01-13T15:04:14.01-0500 [API/0]      OUT App instance exited with guid 493eef92-d118-479f-84ba-a9cc5f64ff30 payload: {"instance"=>"7b96489b-8ce9-41d2-663f-10ca7e4475f3", "index"=>0, "reason"=>"CRASHED", "exit_description"=>"Copying into the container failed", "crash_count"=>1, "crash_timestamp"=>1452715454006630364, "version"=>"55fdefe8-d61c-4f37-b57e-99a3b76a575d"}
2016-01-13T15:04:14.04-0500 [CELL/0]     OUT Creating container
2016-01-13T15:04:14.59-0500 [CELL/0]     OUT Successfully created container
2016-01-13T15:04:16.10-0500 [API/0]      OUT App instance exited with guid 493eef92-d118-479f-84ba-a9cc5f64ff30 payload: {"instance"=>"2d82d8d7-daff-4b35-6ed3-63992ce4b7d6", "index"=>0, "reason"=>"CRASHED", "exit_description"=>"Copying into the container failed", "crash_count"=>2, "crash_timestamp"=>1452715456095891488, "version"=>"55fdefe8-d61c-4f37-b57e-99a3b76a575d"}
2016-01-13T15:04:16.13-0500 [CELL/0]     OUT Creating container
2016-01-13T15:04:16.68-0500 [CELL/0]     OUT Successfully created container
2016-01-13T15:04:18.03-0500 [API/0]      OUT App instance exited with guid 493eef92-d118-479f-84ba-a9cc5f64ff30 payload: {"instance"=>"330b251f-9f58-4e50-784e-4c138816f024", "index"=>0, "reason"=>"CRASHED", "exit_description"=>"Copying into the container failed", "crash_count"=>3, "crash_timestamp"=>1452715458028848262, "version"=>"55fdefe8-d61c-4f37-b57e-99a3b76a575d"}
2016-01-13T15:04:55.77-0500 [CELL/0]     OUT Creating container
2016-01-13T15:04:56.06-0500 [CELL/0]     OUT Successfully created container
2016-01-13T15:04:56.72-0500 [API/0]      OUT App instance exited with guid 493eef92-d118-479f-84ba-a9cc5f64ff30 payload: {"instance"=>"71d95371-9f79-4492-7355-34160448ee4b", "index"=>0, "reason"=>"CRASHED", "exit_description"=>"Copying into the container failed", "crash_count"=>4, "crash_timestamp"=>1452715496713317715, "version"=>"55fdefe8-d61c-4f37-b57e-99a3b76a575d"}

Any help would be greatly appreciated. Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.