ocaml-containers icon indicating copy to clipboard operation
ocaml-containers copied to clipboard

use custom image for CI

Open c-cube opened this issue 4 years ago • 6 comments

https://github.com/mjambon/ocaml-layer seems super nice to build a docker image with exactly what's needed on it (in our case: OCaml switches in {4.03, 4.08, 4.11} at least, with dune and the other dependencies) so that CI finishes in < 1 min. Sadly I'm not good with docker. Any help setting up CI with this would be appreciated.

c-cube avatar Nov 10 '20 18:11 c-cube

ocaml-layer doesn't have any non-linux OS's; how would we deal with those?

kwshi avatar Dec 16 '20 17:12 kwshi

That's a good point. I don't know. Build times on macOS are also a problem, however (13 minutes! :scream:), I just don't know how to improve that…

c-cube avatar Dec 16 '20 18:12 c-cube

Conceivably we could try to roll our own equivalent for macOS? It looks to me like ocaml-layer doesn't actually do anything particularly magical; it's just a set of convenience scripts to setup a Docker image with the right OCaml tools. As long as Docker images exist for macOS/Windows (server), then we should be able to make our own pre-loaded images to speed up CI.

kwshi avatar Dec 16 '20 18:12 kwshi

I don't think docker accommodates macOS or windows?

c-cube avatar Dec 16 '20 18:12 c-cube

Haha, oops, hmm. I thought I read somewhere that macOS/Windows containers were a thing, but guess I'm wrong...

Well, one problem at a time, I guess.

kwshi avatar Dec 16 '20 18:12 kwshi

I investigated using custom images for the same reason, but found it was much easier/faster to use my CI provider's cache facility to hold whatever switches I wanted to carry along from build to build. The approach was discussed here, and it seems that github actions offers an analogous caching facility:

https://discuss.ocaml.org/t/basic-gitlab-ci-configuration/3327/

cemerick avatar Dec 21 '20 21:12 cemerick