juliaup icon indicating copy to clipboard operation
juliaup copied to clipboard

Support pr channels

Open LilithHafner opened this issue 1 year ago • 9 comments

It would be lovely to have julia +pr54152 download and run the binaries built from the pull request # 54152 (if binaries are available). If the build failed or the PR is old enough that the binaries have been discarded or my system is not compatible with any of the CI systems then I wouldn't expect this to be possible, but in most cases I care about none of those are the case. It would make interactive testing of a PR much nicer to e.g. verify that purported performance improvements are real.

I recall hearing on slack that with the new nightly support this shouldn't be too hard, but I can't find that conversation now.

LilithHafner avatar Apr 19 '24 19:04 LilithHafner

All we need is a stable URL scheme where these can be downloaded, which is something that needs to happen on the Julia CI side of things. Once we have something like https://julialangnightlies-s3.julialang.org/bin/macos/x86_64/pr/pr12345/julia-pr12345-latest-macos-x86_64.tar.gz it would be almost trivial to add support for this to Juliaup.

davidanthoff avatar Jun 13 '24 16:06 davidanthoff

@staticfloat Is this possible?

StefanKarpinski avatar Jun 19 '24 02:06 StefanKarpinski

https://github.com/JuliaCI/julia-buildkite/pull/362

staticfloat avatar Jun 19 '24 03:06 staticfloat

What happens on a push/force-push? I assume the binary on AWS gets replaced, but Julia up probably needs to be able to quickly check it the local binary is now out of date.

vchuravy avatar Jun 19 '24 12:06 vchuravy

As long as the etag header on the URL for the PR changes when a new build is pushed, it should all work and Juliaup should be able to detect new versions. Its the same mechanism used for the nightly channel.

davidanthoff avatar Jun 19 '24 12:06 davidanthoff

Do you need .exe or .dmg files for Windows or macOS? Or is it sufficient for me to just upload tarballs everywhere?

staticfloat avatar Jun 19 '24 20:06 staticfloat

We only ever download the tarballs, no need for anything else.

davidanthoff avatar Jun 19 '24 22:06 davidanthoff

Okay, here's some example PR URLs:

  • https://julialangnightlies-s3.julialang.org/bin/windows/x86_64/julia-pr54876-windows-x86_64.tar.gz
  • https://julialangnightlies-s3.julialang.org/bin/macos/aarch64/julia-pr54876-macos-aarch64.tar.gz
  • https://julialangnightlies-s3.julialang.org/bin/macos/x86_64/julia-pr54876-macos-x86_64.tar.gz
  • https://julialangnightlies-s3.julialang.org/bin/linux/x86_64/julia-pr54876-linux-x86_64.tar.gz
  • https://julialangnightlies-s3.julialang.org/bin/linux/aarch64/julia-pr54876-linux-aarch64.tar.gz

staticfloat avatar Jun 21 '24 18:06 staticfloat

Awesome!

I think this actually makes a great issue for someone else to implement and familiarize themselves with the code :) Here are some pointers on what needs to be done:

  1. Use regex to check for channels names of the form pr12345~platform (where ~platform of course is optional) right around https://github.com/JuliaLang/juliaup/blob/7c7e9c0cac86f3b35e190cfd248421a72ac83676/src/command_add.rs#L10 and then add another branch for pr installs.
  2. Create a add_pr that is simlar to https://github.com/JuliaLang/juliaup/blob/7c7e9c0cac86f3b35e190cfd248421a72ac83676/src/command_add.rs#L74. That function essentially just needs to map from the high level channel name to the correct URL based on platforms etc. I think one should be able to mostly just replicate what is there for nightly already and make sure that all the same cases are covered.
  3. Eventually this will lead to a call to install_from_url. Once that is called, everything else should "just work", i.e. all the update logic, management of the version etc should all be done already.

So really this is just an exercise of constructing the correct URL and mimic the nightly code for that. It might also be feasible to actually unify the code for nightly and the pr version that constructs these urls a bit more.

If anyone wants to tackle that, feel free to ask for help, either here or over on the juliaup-dev channel on slack.

davidanthoff avatar Jun 25 '24 09:06 davidanthoff