Hi! Is the repo where you’re seeing these results public? If so I’d be curious to check it out. In my repo I’m not able to have runs with cache-hit be as fast as you report in your second message.
To the question of whether it is normal for ocaml/setup-ocaml I think, to my current understanding (and I keep an open mind that perhaps I am not using it correctly) but I think, with the way it is currently setup, the response is Yes, this is within spec and expectations.
At some point I have tried toying with a rust repo and I was blown away by the performance of the CI. Their strategy must be really good (this was super fast). Not to mention node based CIs, as I am guessing these are probably built-in by GitHub, you can’t compete there.
I am vaguely aware that some folks are using strategies that are different from that of setup-ocaml. For example GitHub - mjambon/ocaml-layer: Make your own OCaml base image for fast CI jobs. Also, GitHub - ocurrent/ocaml-ci: A CI for OCaml projects must be quite good as often I’ve seen results there available in the order of less than a minute.
I think people are working on this, as some implementation of this requires a relocatable compiler. I don’t know much about this, please someone knowledgeable feel free to chim in!
I’d like to ask these questions:
- Would that be reasonable and worth it to have a mainstream and shared GitHub actions that would be really performant to build ocaml cis? (I would want to say that it would be)
- Is it required to stack that behind the
relocatable work? (if so, only CI involving higher ocaml versions would be able to benefits this work unfortunately).
See also:
Personally, I’m also curious about some implications of the current performance. At one point I was reading The First ziglang.org Outage ⚡ Zig Programming Language and somewhere in there they talk about how Zig wanted to minimize their reliance on GitHub, and they addressed some suggestions from the community to make Zig’s distribution of packages/compiler more robust to such outage in the following fashion:
In summary, we believe that preventing this kind of event from surfacing is the wrong approach because nobody’s resources (be ones we pay for or not) should be silently wasted on poorly coded bots (or poorly cached CI jobs, for that matter).
This made me wonder, for the ocaml-ci using setup-ocaml, who is currently “paying the bill?”, and what are those bills exactly? Again I may be using it wrong, but I think this is doing too much work on every build (even with dune-cache: true).
That all being said, I also want to share that I don’t feel particularly comfortable sounding negative about setup-ocaml. I am super thankful that such free tool exists, and I am a big user of it. So posting about its potential shortcoming is definitely outside of my personal comfort zone. But I think we ought to do better and that this is important work, to make it easier for ocaml users to do the right thing without requiring to be a Docker or ocaml-compiler expert.