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

Created Install Script for Debian #3041

Open
wants to merge 23 commits into
base: testnet3
Choose a base branch
from

Conversation

fabrinasr
Copy link

@fabrinasr fabrinasr commented Jan 28, 2024

Motivation

I looked at the Ubuntu script created by Howard and I made one main modification to make it work for Debian. In the Debian repos the LLVM and Clang packages are old. To solve this issue I grabbed the LLVM and Clang packages directly from the LLVM repo. For the reviewer checking this... the original source for the LLVM part of the script is below.

Source: https://apt.llvm.org/llvm.sh

I made some minor modifications to the above script and Howard's Ubuntu Script to create a working Install Script for Debian.

I also added Debian Install instructions to the Docs and I added a Beta tag next to the Debian instructions in the Docs for clarity.

Test Plan

I have tested the script multiple times in Debian with no errors. I purged all installed packages and re-ran the script multiple times and got almost exactly the same output that you get when you run the Ubuntu Script in an Ubuntu OS.

Related PRs

(Link any related PRs here)

Signed-off-by: fabrinasr <157924858+fabrinasr@users.noreply.github.com>
Signed-off-by: fabrinasr <157924858+fabrinasr@users.noreply.github.com>
Signed-off-by: fabrinasr <157924858+fabrinasr@users.noreply.github.com>
Signed-off-by: fabrinasr <157924858+fabrinasr@users.noreply.github.com>
@howardwu howardwu requested review from joske and ljedrz February 9, 2024 21:49
@joske
Copy link
Contributor

joske commented Feb 11, 2024

Hi, thx for taking the time to make this. However, this is based on an older version of the ubuntu script. It's better form to only require root for the actions that need it (installing packages, firewall rules), and not for the build. This was updated a few days ago for the ubuntu script. Note that the ufw commands were removed, and it's left up to the user to make sure these ports are open.

As a general comment, I feel this script tries to do too much. I understand you need to fetch the LLVM packages as debian repos are always hopelessly outdated, but does this script really need to support all kinds of ubuntu and debian variants?

So please rebase your branch to bring it in line with the current script. I'll also add some comments on specific lines.

build_debian.sh Outdated Show resolved Hide resolved
build_debian.sh Outdated Show resolved Hide resolved
build_debian.sh Outdated Show resolved Hide resolved
build_debian.sh Outdated Show resolved Hide resolved
build_debian.sh Outdated Show resolved Hide resolved
build_debian.sh Outdated Show resolved Hide resolved
Signed-off-by: fabrinasr <157924858+fabrinasr@users.noreply.github.com>
Signed-off-by: fabrinasr <157924858+fabrinasr@users.noreply.github.com>
Signed-off-by: fabrinasr <157924858+fabrinasr@users.noreply.github.com>
Signed-off-by: fabrinasr <157924858+fabrinasr@users.noreply.github.com>
source: https://apt.llvm.org/llvm.sh

Signed-off-by: fabrinasr <157924858+fabrinasr@users.noreply.github.com>
Signed-off-by: fabrinasr <157924858+fabrinasr@users.noreply.github.com>
@fabrinasr
Copy link
Author

fabrinasr commented Feb 20, 2024

I found a better solution for the best way to integrate Debian.

I think it is a mistake to create one script for Debian like we have for Ubuntu.

We should instead have a two step install process

Step 1) run the official script provided by the LLVM organisation to install updated version of Clang and LLVM for Debian

Step 2) run the SnarkOS Install script for Debian

The SnarkOS install script for Debian will be almost identical to the updated install script for Ubuntu,
The only difference will be that "apt-get clang" and "apt-get llvm" will be removed to avoid the installation of the outdated
versions of these packages in Debian.

This is in my opinion the best solution for three reasons:

  1. we use the official install script provided by the LLVM organisation for Debian, this has already been
    tested by them, I believe there is no need to make changes to this. It is already working and stable.

  2. we can avoid running the SnarkOS install script as root which is ideal.

  3. In future, if we want to edit the Debian SnarkOS install script we will have a simple and clean file to edit,
    it makes life easier for devs. The Ubuntu and Debian install scripts will look almost identical.

I have made the following changes

  1. Grabbed the official install script from LLVM for Debian and added to SnarkOS repo (Source: https://apt.llvm.org/llvm.sh)
  2. Modified Ubuntu Install script for use in Debian
  3. Edited readme to include install instructions for Debian

@joske
Copy link
Contributor

joske commented Feb 20, 2024

Yes this seems like a better approach. I'm not sure we should bundle llvm.sh with snarkOS though.

Signed-off-by: fabrinasr <157924858+fabrinasr@users.noreply.github.com>
Signed-off-by: fabrinasr <157924858+fabrinasr@users.noreply.github.com>
@fabrinasr
Copy link
Author

fabrinasr commented Feb 21, 2024

Yes, including a link to the llvm script in the readme is a better approach than bundling it. I removed the llvm script file.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
fabrinasr and others added 4 commits February 21, 2024 14:41
Signed-off-by: fabrinasr <157924858+fabrinasr@users.noreply.github.com>
Co-authored-by: ljedrz <ljedrz@users.noreply.github.com>
Signed-off-by: fabrinasr <157924858+fabrinasr@users.noreply.github.com>
Co-authored-by: ljedrz <ljedrz@users.noreply.github.com>
Signed-off-by: fabrinasr <157924858+fabrinasr@users.noreply.github.com>
Co-authored-by: ljedrz <ljedrz@users.noreply.github.com>
Signed-off-by: fabrinasr <157924858+fabrinasr@users.noreply.github.com>
README.md Outdated Show resolved Hide resolved
Signed-off-by: fabrinasr <157924858+fabrinasr@users.noreply.github.com>
ljedrz
ljedrz previously approved these changes Feb 22, 2024
Copy link
Collaborator

@ljedrz ljedrz left a comment

Choose a reason for hiding this comment

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

LGTM, with the caveat that I don't currently have a Debian environment to test it in.

@joske
Copy link
Contributor

joske commented Feb 22, 2024

The file build_debian.sh should be committed with 755 permissions.

build_debian.sh Show resolved Hide resolved
added sudo package to installation script

Signed-off-by: fabrinasr <157924858+fabrinasr@users.noreply.github.com>
added sudo package to installation script

Signed-off-by: fabrinasr <157924858+fabrinasr@users.noreply.github.com>
@fabrinasr fabrinasr requested a review from joske February 22, 2024 22:01
Copy link
Contributor

@joske joske left a comment

Choose a reason for hiding this comment

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

LGTM now

@joske
Copy link
Contributor

joske commented Feb 23, 2024 via email

@fabrinasr
Copy link
Author

fabrinasr commented Feb 23, 2024

I understand. I was thinking about it from the point of view of the people running Aleo Provers. I think Debian would be a better option for them. In my experience it is more stable than Ubuntu. This PR also made some minor improvements to the Ubuntu script. But I understand there might be bigger priorities right now for @howardwu

@fabrinasr fabrinasr mentioned this pull request Feb 27, 2024
Signed-off-by: fabrinasr <157924858+fabrinasr@users.noreply.github.com>
@fabrinasr
Copy link
Author

fabrinasr commented Mar 3, 2024

@ljedrz

I re-added the instructions "cargo install --locked --path...." to the readme. It was originally removed here.

It is still needed, see here from @howardwu

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