juliaup
juliaup copied to clipboard
Support pr channels
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.
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.
@staticfloat Is this possible?
https://github.com/JuliaCI/julia-buildkite/pull/362
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.
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.
Do you need .exe or .dmg files for Windows or macOS? Or is it sufficient for me to just upload tarballs everywhere?
We only ever download the tarballs, no need for anything else.
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
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:
- Use regex to check for channels names of the form
pr12345~platform(where~platformof 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. - Create a
add_prthat 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 fornightlyalready and make sure that all the same cases are covered. - 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.