Skip to content

Improve build performance on Travis #100

Closed

Description

@ioquatix

I've implemented https://travis-ci.org/ioquatix/vips-thumbnail which includes travis tests.

The build time on travis is pretty horrendous. Is there something we can do to improve this? Precompiled binaries? Also, is it possible to install without sudo? That also improves performance a bit.

Activity

  1. jcupitt commented on Mar 22, 2017

    @jcupitt
    Member

    I think you need to cache the vips build, so just build the vips lib once, then reuse that binary for all your rvm tests.

    https://docs.travis-ci.com/user/migrating-from-legacy/#How-Do-I-Cache-Dependencies-and-Directories%3F

    I'll see if I can get the main ruby-vips repo to do this.

  2. ioquatix commented on Mar 22, 2017

    @ioquatix
    MemberAuthor

    Have you done this for ruby-vips?

  3. jcupitt commented on Mar 22, 2017

    @jcupitt
    Member

    No, but it should be simple.

    (edit: stupid kb, posted too soon)

  4. jcupitt commented on Mar 22, 2017

    @jcupitt
    Member

    It seems to be working, it's reusing the vips binary now:

    https://travis-ci.org/jcupitt/ruby-vips/jobs/213787127

    https://github.com/jcupitt/ruby-vips/tree/use-travis-containers

    What do you think?

  5. jcupitt commented on Mar 22, 2017

    @jcupitt
    Member

    I've merged to master, and got php-vips doing this as well.

  6. jcupitt commented on Mar 22, 2017

    @jcupitt
    Member

    Also, I like your thumbnailer. You're right, it should get quicker with vips_thumbnail(), when 8.5 is done.

  7. ioquatix commented on Mar 22, 2017

    @ioquatix
    MemberAuthor

    I like what you did, and I think I improved it a bit. I put all vips specific environment in install file.

    https://github.com/ioquatix/vips-thumbnail/blob/master/install-vips.sh

    Invoked using

    before_script:
      - source install-vips.sh
  8. jcupitt commented on Mar 23, 2017

    @jcupitt
    Member

    I'm not sure that will work, will it? The gem will need GI_TYPELIB_PATH to run, for example, and it'll need PKG_CONFIG_PATH to build, so they'll need to be in the global env table.

    My idea was to share install-vips.sh with php-vips, so I wanted to have all the config in the .travis.yml file. If you have the config there it's easy to add things like test against various vips versions too.

  9. ioquatix commented on Mar 23, 2017

    @ioquatix
    MemberAuthor

    It works.

    That's why it use source. It works in the current "shell instance" as it were rather than executing a separate shell.

    As much as possible should be in install-vips.sh, otherwise it's cumbersome to manage .travis.yml IMHO.

  10. jcupitt commented on Mar 23, 2017

    @jcupitt
    Member

    Ah OK, I hadn't noticed the source, duh.

    I like having all the config stuff at the top so it's easy to see. And global env vars should be defined in env: global: (imo), it's easy to miss them if they are set elsewhere.

    I moved some other stuff into install-vips.sh, does that look a bit cleaner?

  11. ioquatix commented on Mar 23, 2017

    @ioquatix
    MemberAuthor

    The only thing I'd be inclined to put in .travis.yml would be things which I'd want to vary on the build matrix, so perhaps:

    - VIPS_VERSION_MAJOR=8
    - VIPS_VERSION_MINOR=4
    - VIPS_VERSION_MICRO=5
    

    Everything else should go in install-vips.sh. Keeping .travis.yml as light as possible makes the most sense to me. Think about if you moved to a different CI platform - you'd want to reuse as much as possible. But, in any case, it's up to you.

  12. ioquatix commented on Mar 23, 2017

    @ioquatix
    MemberAuthor

    I thin w.r.t. versions, it would be even better to just write VIPS_VERSION=8.4.5 as that approach is more common IMHO.

  13. ioquatix commented on Mar 25, 2017

    @ioquatix
    MemberAuthor

    I realised something: every single thing that depends on vips, needs to use this script. It's really heavy for travis, and it's really heavy for things which depend on vips.

    Specifically, each project needs to:

    • Declare all the appropriate packages/addons (may change which would have a significant maintenance burden).
    • Include the install-vips.sh script and maintain it.
    • The build process is so long that each project needs to have a cache.

    What we should do is try to get a decent version of vips added to travis whitelist.

    @BanzaiMan just wondering if you are able to provide some advice here. I'll try to kick off the whitelist process. @jcupitt is there a debian/ubuntu package for libvips? Is it up to date?

  14. ioquatix commented on Mar 25, 2017

    @ioquatix
    MemberAuthor

    Is this the current package for trusty ubuntu? http://packages.ubuntu.com/trusty/libvips-dev - It seems a bit old.

    We need to follow the procedure here: https://github.com/travis-ci/apt-package-whitelist

    I take it the package we want is libvips-dev?

  15. ioquatix commented on Mar 25, 2017

    @ioquatix
    MemberAuthor

    There is a more recent package here: https://launchpad.net/ubuntu/+source/vips/8.4.5-1 perhaps we can use a PPA to get the latest versions of the packages available on Travis?

  16. jcupitt commented on Mar 25, 2017

    @jcupitt
    Member

    Hi, sure, a PPA would be great.

    There have been quite a few attempts to get vips whitelisted for travis, I guess you've seen. For example:

    travis-ci/apt-source-safelist#68

    And many others.

  17. ioquatix commented on Mar 25, 2017

    @ioquatix
    MemberAuthor

    That's odd, when I searched for it I didn't get any results. It's almost like there are too many open issues.

    There is a PR here: travis-ci/apt-source-safelist#137 but it's a bit out of date now.

  18. felixbuenemann commented on Jul 17, 2017

    @felixbuenemann
    Contributor

    You could also pupload travis compatible linux binaries to an S3 bucket and use that for builds. The build could either be a tarball unpacked to a local directory with all the dependencies or a deb-package that still requires the dependencies like libpng to be installed in the system.

  19. changed the title [-]Built performance on Travis[/-] [+]Improve build performance on Travis[/+] on Aug 22, 2017
  20. locked and limited conversation to collaborators on Jan 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions