Skip to content
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

Split up Cabal's Travis buildjobs into stages #4556

Closed
hvr opened this issue Jun 7, 2017 · 10 comments
Closed

Split up Cabal's Travis buildjobs into stages #4556

hvr opened this issue Jun 7, 2017 · 10 comments

Comments

@hvr
Copy link
Member

hvr commented Jun 7, 2017

#4529 shows a problem we're starting to run into with cabal's heavy Travis jobs:

If a travis job gets killed due to timeout, it misses the opprotunity to write anything to the Travis cache.

However, there's a recently introduced staged jobs feature which should allow us to build & cache dependencies in an early stage, so that if a later stage runs into a timeout, we'd still have at least not lost the cached work, which could then be reused by a restarted job.

Moreover, this could allow us to split work into smaller logical workunits which travis could then schedule accordingly (as our current jobs seem rather unevenly distributed in terms of work-length).

@phadej
Copy link
Collaborator

phadej commented Jun 7, 2017

Seems a bit difficult: travis-ci/beta-features#11 (comment)

@23Skidoo
Copy link
Member

23Skidoo commented Jun 9, 2017

The announcement says that "build stages work as expected when combined with build matrix expansion".

23Skidoo added a commit to 23Skidoo/cabal that referenced this issue Jun 9, 2017
23Skidoo added a commit to 23Skidoo/cabal that referenced this issue Jun 9, 2017
23Skidoo added a commit to 23Skidoo/cabal that referenced this issue Jun 9, 2017
23Skidoo added a commit to 23Skidoo/cabal that referenced this issue Jun 9, 2017
23Skidoo added a commit to 23Skidoo/cabal that referenced this issue Jun 9, 2017
23Skidoo added a commit to 23Skidoo/cabal that referenced this issue Jun 9, 2017
23Skidoo added a commit to 23Skidoo/cabal that referenced this issue Jun 9, 2017
23Skidoo added a commit to 23Skidoo/cabal that referenced this issue Jun 9, 2017
23Skidoo added a commit to 23Skidoo/cabal that referenced this issue Jun 9, 2017
23Skidoo added a commit to 23Skidoo/cabal that referenced this issue Jun 9, 2017
23Skidoo added a commit to 23Skidoo/cabal that referenced this issue Jun 9, 2017
@23Skidoo
Copy link
Member

23Skidoo commented Jun 9, 2017

The announcement says that "build stages work as expected when combined with build matrix expansion".

But see travis-ci/beta-features#11 (comment).

23Skidoo added a commit to 23Skidoo/cabal that referenced this issue Jun 10, 2017
23Skidoo added a commit to 23Skidoo/cabal that referenced this issue Jun 10, 2017
23Skidoo added a commit to 23Skidoo/cabal that referenced this issue Jun 10, 2017
23Skidoo added a commit to 23Skidoo/cabal that referenced this issue Jun 10, 2017
23Skidoo added a commit to 23Skidoo/cabal that referenced this issue Jun 10, 2017
23Skidoo added a commit to 23Skidoo/cabal that referenced this issue Jun 10, 2017
@23Skidoo
Copy link
Member

23Skidoo commented Jun 10, 2017

So I sort of got this to work in #4560 (with help from @BanzaiMan), but there are following problems:

  1. Travis build stages are a bit coarse-grained for our purposes. In principle, each "test" job depends only on one "precache" job, but with build stages all "precache" jobs must finish before we get to the "test" stage. Ideally we'd want a more expressive way to describe job graphs that'd allow to expose more parallelism.
  2. new-build --only-dependencies builds more than is needed by "precache". We don't want to build the Cabal lib and hackage-security in the "precache" stage, since they will not be cached in the store (Cabal is a local package, and hackage-security depends on it), but --only-dependencies can't remove reverse dependencies of a target from the install plan:
$ cabal new-build --only-dependencies --enable-tests cabal-install cabal-tests Cabal --dry-run
cabal: Cannot select only the dependencies (as requested by the
'--only-dependencies' flag), the package Cabal-2.1.0.0 is required by a
dependency of one of the other targets.

@hvr
Copy link
Member Author

hvr commented Jun 10, 2017

new-build --only-dependencies builds more than is needed by "precache".

Btw, I've wanted to have a way to better control what is built (in this case you'd want only non-local deps built). In the case of matrix builder I would need the granularity of adressing to be able to select the build goal(s) by specifying the nix-hash (which I lookup in the plan.json file).

@BardurArantsson
Copy link
Collaborator

BardurArantsson commented Jun 10, 2017

Could we do away with this nonsense with a bit of sponsorship for a real CI solution? The amount of time wasted on the "free tier" of Travis-CI is absurd. (Not that I expect paid Travis-CI to be much better. Their issue tracker tells quite a tale.)

(FWIW, if it helps the community, I'm willing to donate a bit of money[1] towards it... but I think the Haskell.org might also be willing to donate a bit for a project as critical as Cabal?)

[1] Actually, also time, if need be. If there are existing servers which could be recruited for CI, I'd be quite happy to help sysadmin them.

@23Skidoo
Copy link
Member

@BardurArantsson We talked with @gbaz about setting up a build farm for core projects like Cabal using haskell.org machines. Servers seem to be available, what's missing is developer/sysadmin time to make it happen.

@BardurArantsson
Copy link
Collaborator

BardurArantsson commented Jun 13, 2017

@gbaz Is there some wiki page or something which describes the current infrastructure? I'd like to get an idea of whether it's similar enough to what I'm used to to see if I could meaningfully contribute...

EDIT: E.g. is it running docker containers, etc. etc?

@23Skidoo
Copy link
Member

@BardurArantsson I've sent you an e-mail.

@23Skidoo
Copy link
Member

Closing the ticket, since enabling build stages doesn't seem to be worth it currently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants