-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Investigate reducing the dependencies to install vips #42
Comments
Instructions in the README for yum-based installation (to include AWS's default AMIs) would definitely help, thanks for the suggestion. How about a sample Dockerfile? That would help with an Elastic Beanstalk deployment. Not sure I'd want the maintenance overhead of including and compiling all dependencies from source! |
Instructions for yum (EC2 in particular) and a dockerfile would certainly be useful for production setups. I was chatting with a friend earlier today who didn't have brew installed and he found Sharp difficult to set up on Mavericks. I don't think it's reasonable for the Sharp project to precompile vips for major platforms but it would be nice for compilation to be easier. For example node-fibers is pretty easy to install on all major platforms and it ships with the source of its dependencies. So something similar where Sharp ships with the source of vips could be helpful, even if it's a longer term goal that might require help from the vips team. On Tue, May 27, 2014 at 11:31 PM, Lovell Fuller notifications@github.com
|
The libcoro dependency of node-fibers appears a lot simpler than libvips (which then has its own dependencies to worry about too). What I really like about the node-fibers repo is the provision of build.js, an idea sharp could borrow as a "bootstrap" to verify that dependencies are present, providing more useful feedback/help in the event things are not quite ready. Thanks for the inspiration! I'm also happy to provide installation instructions for other Mac OS package managers, e.g. Fink, if there's enough call for it. |
i would love if vips was included so i can deploy it to places like heroku without crazy images and stuff. however, it makes total sense not to as it's super complicated. it could also take forever to build |
@jonathanong There's a Heroku Buildpack at https://github.com/alex88/heroku-buildpack-vips which I've not tried but seems only slightly out of date with respect to required version numbers. Perhaps send a PR to upgrade to libvips 7.38.5 and liborc 0.4.19. |
NOTE: The test doesn't work yet, but it seems to be working fine when just getFilterInfosAndTargetContentTypeFromQueryString from an external app.
I've added a preinstall.sh shell script on the If everyone/anyone following this issue is able to test the instructions at https://github.com/lovell/sharp/tree/preinstall#prerequisites - especially on Mac OS as I've not been able to verify this - I would very much appreciate it. |
When everyone is happy that |
Here's my output on Yosemite. Seems to be working.
|
Great news, thanks @ide.
Is your friend available to help? What, if any, package/dependency management tool(s) do they use? |
That's me. I use vanilla ./configure with $PREFIX set to a subdirectory of my home directory, and make install things. I'm not a UNIX neckbeard, but it's a very reasonable expectation to expect to be able to make local, non-global installations of compiled software. Only being able to have a single active version of a dependency on an entire system is literally a singleton pattern and it makes a number of compromises to the system's integrity I'm not really willing to make, not the least of which is making a subdirectory of /usr/local user-owned-and-writable. Not to mention, new OS upgrades often break - sometimes subtly, sometimes blatantly - changes made by the package managers, and I prefer not to be dependent on upstream fixes to get a system up and running to where I'd like it to be. |
The preinstall script works fine on Ubuntu 14.04 here. This patch makes it work with Debian Wheezy as well: #111 |
@toulouse Thanks for your feedback - you're definitely not a "neckbeard"! What you say is pretty much why the separation of Linux Containers via tools such as Docker is attracting so much attention at the moment. Do you rely on pkg-config for dependency management? If so, are you manually modifying/setting the My current thinking is that the preinstall shell script will install libvips and dependencies globally only if run with root/sudo access, otherwise it will attempt to compile at least libvips from source into a relevant directory under @papandreou Thanks Andreas, I've merged your patch. |
Very much in favor of that approach. It needs to work when not sudoing Would it be possible to bundle the libvips source code à la https://github.com/bnoordhuis/node-iconv? |
The preinstall.sh script, which currently requires root/sudo access, is now in master. The Travis and Snap CI jobs both use this script for their test environments. I'll only make this part of @papandreou The upstream libvips library changes often so I'd rather have an install script fetch a specific version (one line change) than include it in the repo (1000+ file change). There's also the small matter of libvips' dependencies (libjpeg, libpng, libwebp etc.) to consider. How much can we assume is already present on a system? |
IMO, pkg-config is definitely an acceptable mechanism for locating libraries - it's well-known and mature tool that has worked well in my experience. As for including libvips in the repo, I think it would make a lot of sense to include it as a git subtree (for making tracking and merging changes pretty straightforward), and track the libvips branch versions. One major priority for running code in production is to have well-known combinations between libraries, so if there's a bug that only manifests in version X of libvips when combined with version Y of sharp, it's a lot easier to test for / verify / prevent. On the other hand, your point about libjpeg, libpng, libwebp, etc. is quite valid. |
@lovell Sure, it's a balance, and I understand why you would like to keep the size of the package itself down. However, on top of @toulouse's points about predictiblity it's also a big plus not to depend on downloading stuff from the Internet at install time. The source code of the mentioned libraries adds up to about 16MB, which is about the same size as libiconv, and node.js itself bundles about 80MB of dependencies. It's a lot, but it could be done. |
FYI: I just created a Dockerfile which installs libvips from source. It's the same installation procedure like in the install script. I created the dockerfile because I failed installing libvips using the provided script (some pkg-config problem). Here is the file https://registry.hub.docker.com/u/marcbachmann/dockerfile-libvips/dockerfile. I'm sorry for ignoring the comments in here. It's late 😪 |
Thanks for creating a Dockerfile @marcbachmann, I'll add a link to the prerequisite docs.
Feel free to open a new issue if you'd like more help with this specific problem. |
Many packages place OS dependant binaries in the local |
#186 provides the a rather compelling solution to this. |
@lovell Why my self share compiled libvips+sharp ZIP on AWS has 6MB and look branche is so big ? |
@vlapo See #292 (comment) |
I know about comment. I check it again.
This is my libvips compiled in vips and node_modules with sharp ~40MB And here is look branche without tests
hmm maybe, I have lite compilation or skip some libs ~17MB. :D |
@vlapo I'd expect shared libs to be a bit larger than static libs. Did you include libMagickCore? |
What about binaries for Mac OS X?
|
@mahnunchik The I am investigating the provision of pre-compiled Mac users are generally well-served by homebrew. The vast majority of installation-related questions raised here are Windows and Linux related. |
I'm going to find out how to update vips in the homebrew-science repo https://github.com/Homebrew/homebrew-science/issues/2977 Thank you for Linux version. I have tested it locally and inside the docker. It works like a charm! |
@mahnunchik Thanks for the brew update - I've been able to reproduce this now too. I know what the problem is so will fix and improve the OS X error messaging (e.g. "you need to install ... " vs "you need to upgrade ... ") over the weekend. |
The The Windows and Linux CI environments are both healthy. Windows support will be 64-bit only from v0.12.0. @vlapo The shared libs for Linux are now a mere 6MB when compressed, about 19MB when uncompressed. I'd forgotten to strip them of debug symbols. @mahnunchik This should now work with brew-installed vips again on OS X. |
Any more comments, suggestions or test results before the |
I've tested on:
$ brew install vips --with-webp --with-graphicsmagick --without-check And it works as expected. |
@mahnunchik Thanks for testing/confirming. If it makes you feel any better, I'm hearing about all sorts of problems with El Capitan upgrades breaking homebrew, xcode etc. |
On Debian Wheezy I get:
|
Oh, I should look at https://github.com/lovell/sharp/blob/look/docs/install.md instead, of course, and it does say Debian 8. Bummer. |
@papandreou Yes, sorry, I had to draw a line somewhere. Debian Wheezy's version of libc is over 4 years' old. Is this likely to be a problem? |
I'm stuck with Wheezy in my production environment for the time being, so for me personally, yes :( Do you have any idea how much work it'd be? |
@papandreou It might be as simple as changing the base OS in the Dockerfile used to generate the binaries. If you'd like to experiment, you can run |
I've managed to locally reproduce the heap corruption problem affecting Node v4 and v5 on the Windows CI environment. I think it's something to do with thread switching but I haven't figured it out yet. Here's the stacktrace should anyone else have any ideas:
|
Windows problems finally fixed with commit 3dbedf1 - there was a mismatched malloc/free - see https://ci.appveyor.com/project/lovell/sharp/build/269 |
The |
The forthcoming v0.12.0 release will provide pre-compiled binaries for 64-bit Windows and Linux. I've moved the work to investigate the best way to support OS X (and ARM) to #312. Thank you very much to everyone on this thread for all your suggestions, help and testing during the last year and a half! I'm closing+locking this issue now - please open a new issue if you're having any problems with the pre-compiled binaries or have further thoughts. |
v0.12.0 now available via npm - tell all your friends! |
One of the hardest parts about using Sharp is setting it up. Being able to just say "npm install sharp" would make it easier for a lot of people to try it out.
Currently libvips isn't very easy to set up on an Amazon Linux box, and on Mac OS X it requires brew (there are some instances in which one may wish not to install brew). So if there were an easier way to build vips and it were integrated with Sharp's installation that could help a lot.
The text was updated successfully, but these errors were encountered: