ryandotsmith / nginx-buildpack

Run NGINX in front of your app server on Heroku
457 stars 248 forks source link

Support "cedar-14" #35

Closed tt closed 10 years ago

tt commented 10 years ago

This adds support for Heroku's new stack: nginx needs to link different library versions, so a binary is vendored per stack.

ryandotsmith commented 10 years ago

Rad! Thanks for the PR.

ryandotsmith commented 10 years ago

Did you build NGINX using this script?

tt commented 10 years ago

I did. Not exactly as advertised, although that shouldn't matter; got a one-off dyno and uploaded it from there so I didn't have to deal with setting up another web server that would serve it.

ryandotsmith commented 10 years ago

I see. Is that a better approach? Should we change the script? Did you notice that the script started a python web server?

ryandotsmith commented 10 years ago

https://github.com/ryandotsmith/nginx-buildpack/blob/master/scripts/build_nginx.sh#L25

tt commented 10 years ago

No, I think the current approach is better. I just misread it and thought I had to wrap it. Using the null buildpack and downloading directly is definitely less work.

tt commented 10 years ago

Just for reference, this is the ldd output from a "cedar-14" dyno:

$ ldd bin/nginx-cedar
        linux-vdso.so.1 =>  (0x00007fff6bb58000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f589b614000)
        libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007f589b3db000)
        libcrypto.so.0.9.8 => not found
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f589b1c1000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f589adfb000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f589b83c000)

$ ldd bin/nginx-cedar-14
        linux-vdso.so.1 =>  (0x00007fff98ef9000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007ff2a6069000)
        libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007ff2a5e30000)
        libcrypto.so.1.0.0 => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007ff2a5a55000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007ff2a583c000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff2a5476000)
        /lib64/ld-linux-x86-64.so.2 (0x00007ff2a6291000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ff2a5271000)
tt commented 10 years ago

Anything you need, @ryandotsmith?

ryandotsmith commented 10 years ago

OK. Last questions.... I think.

Is the $STACK variable documented somewhere? I did a quick google search and was unable to find anything useful.

tt commented 10 years ago

A STACK environment variable is available to the compile script. The value of the STACK variable is the stack of the app that the slug is being built for, i.e. cedar or cedar-14 (Bamboo apps don't use buildpacks). Buildpacks should use the STACK variable to selectively pull binaries and other dependencies appropriate for that stack. Builds are always done inside a dyno running on the same stack as the app that the build is running for.

Source: https://devcenter.heroku.com/articles/buildpack-api

ryandotsmith commented 10 years ago

thanks!