ChainMovers / suibase

Sui development environment and cookbook.
https://suibase.io
Apache License 2.0
35 stars 6 forks source link

Remove pre-requesites installation #101

Open mario4tier opened 2 weeks ago

mario4tier commented 2 weeks ago

Update 6/20/24: Goal changed to eliminate the Sui pre-requesites.

Goals

(1) Should detect the Sui prerequesites missing and automatically (or offer) to the user to install them. Suibase CLI should automatically download, install and upgrade suibase-daemon binaries without user intervention.

(2) The installation of the VSCode extension should have the consequence of installing Suibase CLI and the Sui pre-requesites automatically. Ideally, that means to be fully up and running only by installing the extension!

Related code VSCode extension for now just do diagnostic... not automated installation:

image Excerpt from https://github.com/ChainMovers/suibase/blob/main/typescript/vscode-extension/src/BackendSync.ts

The CLI look for pre-requesites when attempting to build something:

image Excerpt from https://github.com/ChainMovers/suibase/blob/main/scripts/common/__globals.sh

kkomelin commented 2 weeks ago

Hey @mario4tier ,

As I mentioned during our chat discussion, some of my users (kkomelin/sui-dapp-starter) complained about the complexity of the Sui prerequisites installation.

My suggestion was to develop OS-specific shell scripts to install everything in one line like so:

# Windows
iwr https://get.pnpm.io/install.ps1 -useb | iex
# Linux
wget -qO- https://get.pnpm.io/install.sh | sh -

ref https://pnpm.io/installation

And I thought about suggesting adding them to the main Sui docs/repo because I think it's a higher level problem.

I like the checks which Suibase has. It may be enough. What is the best place to add the scrips from your point of view?

kkomelin commented 2 weeks ago

Currently Sui docs offer one-liners already:

brew install sui
# or 
choco install sui

But I don't know a person who would have brew or choco installed on Linux/Ubuntu. Native package managers here are apt and snap. Maybe it's easier to suggest Sui adding a Snap package for Linux/Ubuntu and that would eliminate the need of manual dependency install.

mario4tier commented 2 weeks ago

I see.

Keep in mind that brew/choco install only the binaries, not the dependencies.

Seems their latest doc favor binaries installations, therefore eliminating the need for pre-requesites for most users (>99% ?).

IMHO, it is now more urgent to also eliminate Suibase dependency on these Sui pre-requesites (currently always needed for building the Rust suibase-daemon).

===

For suibase, the binary installation should remain to be done with downloading "assets". Not brew/choco etc... the reasons are:

Summary

I agree that brew/choco etc... are out-of-scope for Suibase and are better to be discuss with Mysten Labs directly.

kkomelin commented 2 weeks ago

Thank you @mario4tier ,

Agree, let's leave streamlining Sui cli prerequisites installation to the Sui guys. Can suggest this improvement to them later with lower priority.

As for Suibase, it looks like if we could implement building suibase-daemon in the cloud for all OSs automatically, we would not need to ask users to install Sui prerequisites at all, which would be ideal from my point of view because it would allow to simplify Suibase and VSCode Plugin checks significantly. Shall we consider this option?

mario4tier commented 1 week ago

As for Suibase, it looks like if we could implement building suibase-daemon in the cloud for all OSs automatically, we would not need to ask users to install Sui prerequisites at all, which would be ideal from my point of view because it would allow to simplify Suibase and VSCode Plugin checks significantly. Shall we consider this option?

@kkomelin

Yes. I fully agree.

I will try to complete this by end of August (will be done with github actions, which already build the suibase-daemon for automated tests).

The Suibase assets will match the way Mysten Labs release their assets, that way we can re-use most of the already done bash script.

kkomelin commented 1 week ago

@mario4tier That's a good plan! Good luck with that! I have Lunux/Ubuntu if you need some alfa/beta testers. Can also setup Windows through VirtualBox.