Skip to content
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

Add rzup installation script #1774

Merged
merged 22 commits into from
May 3, 2024
Merged

Add rzup installation script #1774

merged 22 commits into from
May 3, 2024

Conversation

hmrtn
Copy link
Member

@hmrtn hmrtn commented May 2, 2024

This introduces two shell scripts for easy installation and version management of the r0 toolchain with rzup.

To install rzup, download and execute the install script with this one-liner:

curl -L https://risc0-artifacts.s3.us-west-2.amazonaws.com/rzup/install | bash

This automates the installation by downloading the rzup and adding it to the user's PATH.

Once installed, use rzup:

rzup

Running rzup automates the installation of cargo-binstall, cargo-risczero, and the toolchain, making it very easy for users get started.

We should consider setting up a redirect to a more user-friendly URL, such as:

curl -L r0.xyz/install | bash

Prior to merging, we should edit the url paths to main, rather than the installer branch.
https://github.com/risc0/risc0/blob/hmrtn/rzup-installer/rzup/install#L14
https://github.com/risc0/risc0/blob/hmrtn/rzup-installer/rzup/README.md?plain=1#L9

I have tested this on MacOS and Linux. It would be great to have a windows user test it.

Copy link

vercel bot commented May 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
docs-website ✅ Ready (Inspect) Visit Preview May 3, 2024 5:08am
reports-and-benchmarks ✅ Ready (Inspect) Visit Preview May 3, 2024 5:08am

}

install_cargo_binstall() {
execute_with_feedback "cargo install cargo-binstall --quiet" "Installing cargo-binstall"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small note that this will build cargo-binstall from scratch if you have an older version, but this shouldn't be necessary to have the most up to date version. Feel free to ignore this comment, just figure I'd mention!

@flaub
Copy link
Member

flaub commented May 2, 2024

Would it be possible to test this in CI?

@flaub
Copy link
Member

flaub commented May 2, 2024

I should note that windows isn't a supported platform right now (unless you consider WSL/WSL2, but that's not really windows).

rzup/install Outdated Show resolved Hide resolved
rzup/rzup Outdated Show resolved Hide resolved
rzup/README.md Outdated Show resolved Hide resolved
@hmrtn
Copy link
Member Author

hmrtn commented May 2, 2024

Would it be possible to test this in CI?

I am not very familiar with our CI workflow, but messing around locally with a new job in similar fashion to the others, I think it is possible.

My local workflow testing with the act tool fails, but something like this is probably what we want:

diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index ebdc9e20..988984dd 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml

@@ -38,6 +38,7 @@ jobs:
       examples: ${{ steps.filter.outputs.examples }}
       test: ${{ steps.filter.outputs.test }}
       web: ${{ steps.filter.outputs.web }}
+      rzup: ${{ steps.filter.outputs.rzup }}
     steps:
       - uses: actions/checkout@v4
       - uses: risc0/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36
@@ -83,6 +84,9 @@ jobs:
               - examples/browser-verify/**
               - risc0/**
               - xtask/**
+            rzup:
+              - *base
+              - rzup/**

   # see: https://github.com/orgs/community/discussions/26822
   main-status-check:
@@ -431,3 +435,28 @@ jobs:
         env:
           RISC0_USE_DOCKER: "1"
       - run: sccache --show-stats
+
+  rzup:
+    if: needs.changes.outputs.rzup == 'true'
+    needs: changes
+    runs-on: [self-hosted, prod, "${{ matrix.os }}", cpu]
+    strategy:
+      fail-fast: false
+      matrix:
+        os: [Linux, macOS]
+    steps:
+      - uses: actions/checkout@v4
+      - uses: ./.github/actions/rustup
+      - uses: ./.github/actions/sccache
+        with:
+          key: ${{ matrix.os }}-default
+      - name: Install rzup
+        run: |
+          chmod +x rzup/install
+          rzup/install
+          source ~/.bashrc
+      - name: Run rzup
+        run: |
+          chmod +x rzup/rzup
+          rzup/rzup --verbose
+      - run: sccache --show-stats

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants