heroku-geo-buildpack
heroku-geo-buildpack copied to clipboard
Build sometimes working, sometimes not
I have a cedar-14 app using this buildpack - it apparently builds fine every time, but sometimes the libraries are not present in /app/.heroku/vendors/lib
This seems to happen if I see these lines in the build log.
remote: -----> Fetching and vendoring geos
remote: -----> Fetching and vendoring gdal
remote: -----> Fetching and vendoring proj
A re-deploy fixes the issue.. I don't see those lines above, but the libraries are placed in the lib directory..
I'm also seeing this.
Just reviewed all the code, and everything looks relatively sane. Going to dig deeper.
I have tried explicitly making an /app/.heroku/vendors dir instead of using the shell script variables but no joy. My workaround after a cache purge is now to push an empty Python + Geo app up THEN re push my actual app. (My actual app has a bin/post_compile script that dies if the libs aren't where they should be so the build fails and no cache is created)
Somehow the official Python build pack manages to create the vendors dir every time. Here's hoping! On Mon, 8 Feb 2016 at 23:47, Kenneth Reitz [email protected] wrote:
Just reviewed all the code, and everything looks relatively sane. Going to dig deeper.
— Reply to this email directly or view it on GitHub https://github.com/cyberdelia/heroku-geo-buildpack/issues/33#issuecomment-181606293 .
I find the exact same thing as @guybowden - pushing an empty Python Django app that doesn't require the geo libraries to get new clean image set up, then pushing the actual app after that and everything works. Subsequent pushes work without a problem, using the cache.
This line may be to blame
https://github.com/heroku/heroku-buildpack-python/blob/master/bin/steps/python#L18
Interesting. If that's true, then is the python buildpack not playing nicely with other buildpacks that put libraries into .heroku/vendor, or is the python buildpack allowed to do that? If so, should this buildpack put its libraries somewhere other than .heroku/vendor?
The real problem here is the first push triggers this behavior, a "stack change". That is likely a bug.
What sets the default STACK variable in Dokku? According to this https://github.com/heroku/heroku-buildpack-python/blob/master/bin/compile#L148 the $CACHED_PYTHON_STACK
gets set to $DEFAULT_PYTHON_STACK
which is cedar
. Perhaps that should be $CACHED_PYTHON_STACK=$STACK
oh, cedar-11
builds are permanently disabled now, so this appears to easily fixable. But there will be another stack in the future, so this will just come into play once more. Will need to evaluate carefully.
Okay, I believe I have now fixed this.
@longhotsummer your suggestion was correct :)
So, the Python buildpack will no longer wipe the contents of .heroku/vendor
on the first push of an application. I believe that was the cause of this bug.
It will still do so whenever the stack changes. This almost never happens (once every 2-3 years?).
Great stuff - thanks for sorting
Brilliant, thanks @kennethreitz