Skip to content

Setup initial github-based CI infrastructure #1818

Closed

Description

@benvanik

Currently under the benvanik-ci branch, finishing off the initial work here to get something building (even if suboptimal) will allow us to iterate on it.

The current major blocking requirements to getting things fully end-to-end:

If we can get these both working such that on a local machine it's possible to build and install LLVM/MLIR to reuse for IREE compiler builds,and to use prebuilt IREE compiler tools when building runtime bits then getting the CI doing the same is mostly sketched out.

After that, the remaining initial CI work:

  • cache the install directories for LLVM/MLIR/IREE host tools
  • build commands for each of the above in the right scripts
  • runtime configurations for at least android to ensure we can do the cross-compilation

WIP actions config: https://github.com/google/iree/blob/benvanik-ci/.github/workflows/ci-core-hosted.yml
WIP scripts: https://github.com/google/iree/tree/benvanik-ci/.github/workflows/ci

Activity

  1. added
    infrastructure
    on May 6, 2020
  2. added this to the milestone on May 6, 2020
  3. self-assigned this
    on May 6, 2020
  4. removed this from the milestone on Jun 17, 2020
  5. added
    quality of life 😊
    on Nov 23, 2020
  6. GMNGeoffrey commented on Jan 19, 2021

    @GMNGeoffrey
    Member

    The issues described here seem quite old. In practice I found GitHub actions to be inadequate for regular CI work and extremely slow to debug. I would much prefer we use BuildKite and either way I think we should have more structured discussion about this direction. I'm a bit worried about our proliferation of various infra solutions

  7. benvanik commented on Jan 19, 2021

    @benvanik
    CollaboratorAuthor

    It's important to be able to bucket things into what is needed for maintenance of the project itself vs what is needed for users of the project (and what are the different types of users). What is inadequate for doing tensorflow builds for pip releases is not always the same as what is useful for someone who just wants to use their own build of LLVM or produce a .jar of the runtime they can use on Android. As is our current problem there is also usability: buildkite means nothing if it doesn't run on forked repos without someone becoming effectively an IREE build engineer (and kokoro is of course the worst because then you have to become a googler). If anything, I'd say that github actions should be the first place we make work for anything a user of IREE or a casual contributor may want to do themselves and only then optimize for our own purposes by using other infra - if that is a burden it means we built things wrong. I've said it many many times, but this should be our goal: it's the commands a user would issue to build, and if we can't "maintain" those files in working order in our repo then we have some major problems.

    As a concrete example, someone should be able to use IREE, find a bug in the compiler or runtime, fork IREE, make a change, and see if it passes on their fork without needing to send a PR to do so (and maybe just have the fork with their workaround in perpetuity). Anything less than that is not open source. That doesn't mean rebuilding tensorflow, though, or publishing a package to the pip repository, etc.

  8. GMNGeoffrey commented on Jan 19, 2021

    @GMNGeoffrey
    Member

    But what you're talking about is all the stuff for building all the parts that a user could then download and install. A user of IREE can do what you describe and run the build locally on their machine. We should definitely have the installable artifacts such that they only need to rebuild the part that they've changed. But it seem you're claiming that unless we also provide a hosting solution that requires zero additional configuration, it's not open source? Since GitHub actions are only a few years old, that would sort of imply that nothing was open source prior to 2018.

  9. benvanik commented on Jan 19, 2021

    @benvanik
    CollaboratorAuthor

    Not saying that: saying that if our configuration for a user cannot be distilled to something on the scale of "build and run" then we are not an effective open source project (like, say, tensorflow isn't) as no one can use us, and that in response to your "inadequate" statement and worry over multiple pieces of infra that the cost of supporting github actions should be effectively free. If we can't do that we can't expect users to build our project or integrate it into their own CI (regardless of which it is). Remember that the IREE runtime is not a binary artifact but source (or effectively source, like a static library) that is to be linked in to existing projects that have their own existing CIs. We can't tell users to go change their CI or use our docker images instead of their own to build IREE. So again, if we can't get github actions working then we can't expect users to use our project and I'd much rather be able to have github actions like this (or something on that order of complexity) be the thing we use both to ensure we work for user scenarios and a place to point users to for how to configure for their target environments than this or this or this - none of those help us or users ensure the project is actually usable or buildable outside of our own infra. They do help solve other goals (automated releases, automated benchmarking, documentation deployment, etc) but that's a very different set of scenarios and not indicative of how users (both strict consumers or people performing light modifications) interact with IREE.

    I was mostly responding to your comment - for this particular issue (which is out of date, but not invalid), we can say things now like we don't need to build integrations and can instead just install the pip binaries for things like iree-import-tf. We can also separate the compiler and runtime components: it'd be acceptable (though not great) for the compiler to come through pip releases and just have the setup for the runtime (the part most people will be directly building, vs. the compiler where only people modifying LLVM/etc will need to change it).

    If we can't get the flow down to "pip install the compiler tools and then cmake configure & build to get the runtime" then we have issues - hopefully you can agree with that :)

  10. stellaraccident commented on Jan 20, 2021

    @stellaraccident
    Collaborator

    I'd be open to having this discussion in a more structured way. In addition to the points made above, there are practical considerations with respect to Actions and BuildKite that it would be good to talk through.

    My opinion is largely that release pipelines for deployment to the big-3 (Linux, MacOS, Windows), GitHub Actions is the right tool for the job due to its standardization and availability of runners that anyone can use. You can fork the repo, click to generate a release and eventually get a built and tested set of artifacts.

    For pre-submits, though, it can be (a lot) more trouble for a project such as ours. It is difficult to scale GitHub Actions to have sufficient resources for effective/timely presubmits that need to build anything but a small project, and GitHub themselves recommends against public projects using custom runners to overcome this for (good) security reasons. Based on my experience with npcomp, we can get a working presubmit flow that lives in the confines of GitHub Actions with (very) creative uses of caching, but it will still suffer from cache-invalidation-costs-an-hour problems. It isn't great. For presubmits, I don't love Kokoro, but a big part of me is inclined to acknowledge that what we have works and we use it for the next 6 months, then checkpoint and see if any of the cloud CI options have better custom runner options for repos such as ours.

    I can go either way on release pipelines for oddball platforms. I suspect the right answer for now on that end is to build and publish release artifacts on GitHub Actions and then trigger tests on BuildKite (or whatever is the easiest/most portable for running such agents).

    In any case, there is a middle road where most of the CI pipeline is just scripts and docker images, can be run locally, or can be (relatively) easily ported to alternatives without being too tied down. Probably should do that regardless.

  11. GMNGeoffrey commented on Jan 20, 2021

    @GMNGeoffrey
    Member

    +1 Stella. My two high-level comments about this issue are: it seems over-prescribed to be about GitHub actions vs "make building IREE easy" (which I am 100% behind) and I think we should talk about our goals here a bit more, and that my experience with trying to get GitHub actions working for presubmits was that it was a huge pain because of the resource constraints. I've been wanting to rip up our CI system and rewrite it, but have been fighting that urge because of the "we have something that mostly works" point 😁 If we are going to do so, I want to make sure we have a longer conversation first about where the best direction to go in is.

    In the meantime, anything to make building IREE easier (like #4323) seem like the more generic "this helps no matter which direction we go".

  12. ScottTodd commented on Sep 7, 2021

    @ScottTodd
    Member

    We're reopening the topic of moving our primary build+test CI from Kokoro to somewhere (likely Buildkite). What shall we do with this issue?

  13. GMNGeoffrey commented on Sep 7, 2021

    @GMNGeoffrey
    Member

    Well I've been not touching it until I write an issue for the other thing and then I was going to close this one 😛

  14. ScottTodd commented on Mar 8, 2022

    @ScottTodd
    Member

    @GMNGeoffrey / @benvanik . Want to open a new issue for setting up Buildkite infra and close this now?

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

Metadata

Metadata

Assignees

Labels

infrastructurequality of life 😊

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions