-
Notifications
You must be signed in to change notification settings - Fork 19
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
confused by the ocaml5 images on Docker Hub #203
Comments
I can't remember how you get it from the command line, but the information in the Hub at https://hub.docker.com/layers/ocaml/opam/alpine-3.15-ocaml-5.0/images/sha256-c30eb992e95bced3e82ef1ec7e8fa46f9226f7628b848f98b0d485b688112578?context=explore reveals that image was written on Nov 26 last year, before the release of OCaml 5.0.0. The images track the See also #57 for tracking what we should do with old distributions. The metadata for keeping up with all this is in ocurrent/ocaml-version and ocurrent/ocaml-dockerfile which is what both the base image builder and ocaml-ci use to keep track both of what images should be available in the hub, and which versions of OCaml they'll contain. |
Do images ever get rebuilt after they are published for the first time, or is the intention that they remain frozen forever? I'm a bit nervous about the idea that it is so easy for users to use an image that does not correspond to an upstream release, without any clear signalling. Right now, a search for ocaml-5.0 suggests 97 possible images, 34 of which usee the actual 5.0 release, the other 63 have a weirdly outdated development versions. (In contrast, as of course you know, the opam repository uses +trunk for maintenance versions, with a "beta" constraint to hide not-released-yet versions by default.) In case it can help, here is the sort of organization that I would have expected -- as someone who knows very little about Docker, nothing about ocurrent etc. I am not saying that the docker images should move to this, but I don't understand the reasons for the current state and pointing out issues in my mockup alternative could be a way to explain the existing choices.
Users would use ocaml-${released-version} images to test against a given version (or just install several switches on top of a given image and use _opam caching), and ocaml-${version}+trunk in the rare situations (for most projects) where they want to check compatibility against an upcoming release. (I was going to say that this gives the property that the ocaml part of image names coincides with switch names, but in fact we don't have "5.0 switches that point to the latest 5.0.x release"; I would like to have them!) |
@gasche wrote:
This is the key missing name. If we had this, then all of your other points would be easier, since the images currently track the release branch and not the release (deliberately, as their prime purpose is CI, and a very specific release can be built from within the image if desired). |
Thanks for the feedback, I will consider opening an issue on opam-repository to discuss "last-patchset switches".
I don't understand why we are deliberately using moving-target switches for the purpose of CI. Can you explain? Maybe this is about distinguishing two types of CI:
Even for use-case (1), if the intention is to have CI images that track the development of the upstream branch to test compatibility / detect issues, then the CI images should be rebuilt regularly, which is not what is happening here I think? |
Sure, but my understanding was that those images are meant to save people the trouble and time of installing their own switches, the image comes with a switch pre-built. This seems to be how people use them in the wild. If the intent were to encourage people to build their switches, we should advertise an image with opam installed but no preinstalled switch, right? |
I created an upstream issue on opam-repository to discuss "latest patchset release" switch names. I originally thought that they should be named |
With Docker, if you want a particular reproducible hash, then you query the image tag for the sha256 id and use that, resulting in a pinned image that wont change. But if you just want to test with 'the latest 4.12', then the current tag gives you that and is resolved to a concrete sha256 hash at the point you pull it. |
On naming, I think a reasonable convention (which is currently used) is that Or to put it another way, it's good to map existing git branches and tag names to the corresponding image names. |
My problem with the current status is that I don't think users realize, when they see an image called "ocaml-5.0", that they may in fact be using some random in-development state coming from before the 5.0 release, in an unknown state of software quality. I find this mildly worrying. I guess I don't agree with this design choice. I think it should be hard for users to use an image that does not correspond to any OCaml release, they should be sure that this is what they want. I also don't know of a way to actually tell from the image which git commit this in-development state corresponds to.
At the time of writing there are 54 images with |
There is possibly a slight issue with encoding the “latest” in the version rather than the name. I’m on my phone, which makes checking the Debian version comparison function opam uses tricky, but I have a feeling that 5.0.latest is less than 5.0.1. Assuming I’ve remembered that correctly, another option could be to have an |
ocaml-5.0+latest could also work I guess. |
@gasche - what caused you to select alpine-3.15? alpine-ocaml-5.0 is always the latest version of alpine on the latest release of 5.0… you only landed on a development release through selecting on old alpine release? The way those tags are setup is specified on https://hub.docker.com/r/ocaml/opam? |
Actually someone else selected alpine-3.15-ocaml-5.0, but I recommended moving to alpine-ocaml-5.0 when I noticed the problem indeed. I don't know how alpine-3.15 was selected in the first place. Thanks for the pointer to the documentation, which I had somehow missed. I think that I only ever land on https://hub.docker.com/r/ocaml/opam/tags, possibly after googling for a particular image name and then trying to "go up" in the hub hierarchy. The documentation currently says:
This sounds very reasonable to me, but it is also different from what I observe in practice. |
With respect to older distributions and out of date tags, that needs to be fixed by pushing 'deprecated' containers to those tags: see ocaml/infrastructure#7 and #57. We shouldn't let the tail wag the dog and change our naming scheme (perfectly good) because of an incomplete image builder (easily fixed, if someone could get around to it). |
I just looked at a CI run for a CI script using alpine-3.15-ocaml-5.0, and I found it surprising.
This ocaml-5.0 image is not actually using a 5.0 release, but it seems to use the 5.0 maintenance branch. Relevant command:
I expected to get the 5.0.0 release instead (more precisely, from the name "5.0", the latest 5.0.x release, which currently is 5.0.0). In fact it looks like alpine-3.17-ocaml-5.0 uses 5.0.0, as well as alpine-ocaml-5.0 which I assume points to the latest alpine--ocaml-5.0 image.
Questions:
ocamlc --version
was5.0.0+dev10-2022-11-25
. This is not the result one would expect from a compiler using ocaml-5.0.0+trunk -- at least on the actual upstream repository the current version output is5.0.1+dev0-2022-12-15
). This makes sense if this image was produced a year ago and is not intended to be updated. But then: how can I tell which version of OCaml (ideally, for non-release configurations: which git commit) a specific CI image is doing? Is this information available elsewhere, or is the easiest way to download and load the image and somehow inspect it? (Bonus points if you know how to get the git commit from the installed switch data.)Is there some documentation somewhere of the expectations and best practices with using ocaml/opam CI images?
The text was updated successfully, but these errors were encountered: