ocaml-dune / binary-distribution

A web page for dune binary distribution
https://preview.dune.build/
ISC License
2 stars 5 forks source link

feat: support latest binary downloading #5

Closed maiste closed 1 month ago

maiste commented 1 month ago

This PR adds a /latest/<arch> URL to the Dune Binary Distribution system. Also, it provides a mechanism to update the binaries every time it is build with the latest version. It makes it easier for users to grab the dune version.

The website displays a Latest section at the top, which are just pointers to the latest built binaries.

This PR must be merged after #4 to make sure we have certificates available for the latest build.

Leonidas-from-XIV commented 1 month ago

I am still not a great fan of just having a latest URL which will return you a random dune. So how about an alternative idea:

The document which contains the preview links knows the URLs already, so instead of specifying

curl -o dune https://download.dune.ci.dev/latest/<arch>/dune

it could specify

$ curl -o dune https://download.dune.ci.dev/2024-08-26/x86_64-unknown-linux-musl/dune

for Linux on the 26th of August; likewise all the previews could instead of

$ curl https://download.dune.ci.dev/<yyyy-mm-dd>/<arch>/attestation.jsonl -o attestation.jsonl

have the actual URLs there. Then the whole verify section can be removed because for each preview day and arch the instructions would contain the correct URL and the correct command?

maiste commented 1 month ago

This is definitely something we could do to improve the readability on the website. The issue is that we miss the main use case for the latest feature. The goal is to have a URL where you don't have to think about and just pull the latest binary. It is not more random than having the binary from one day to another.

I understand the concern with the fact that running curl .../latest/dune would introduce an issue with tracking the origin of the binary (as it wouldn't be reproducible). However, if your proposal is great and allows the user to just copy and paste the result, it would still have the issue of the single download URL. Maybe this is something we can't do in the current configuration, and we need to check with the Infra team if we want to invest more time to have a finer control on the solution?

Leonidas-from-XIV commented 1 month ago

Ok but what is the problem we want to solve? The "latest" URL to be fixed is only a problem if we want e.g. tools to download the latest version, but for people I'd argue being able to copy-paste the actual command is more useful than to have a URL that always contains the most recent binary.

maiste commented 1 month ago

In our case, I would say yes, it is easier for the user to just have to run the copy and paste :smile: In the future, to have something more "opam" like (or other programming language like), we should definitely consider to have a better system to solve this (with your suggestion for the 303 redirect on latest). But it would be a problem for future us, so that's ok!

maiste commented 1 month ago

@Leonidas-from-XIV, I've updated following your recommendations. Users can now just copy and paste the daily build :+1: