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

Implement an install script for newcomers #33765

Open
soehms opened this issue Apr 28, 2022 · 11 comments
Open

Implement an install script for newcomers #33765

soehms opened this issue Apr 28, 2022 · 11 comments

Comments

@soehms
Copy link
Member

soehms commented Apr 28, 2022

As suggested in this sage-devel-thread we need to simplify the installation for newcomers who are not familiar with complicated install procedures. Since there is a satisfactory solution for Mac users and Windows users are advised to use WSL we may assume that most of them will try to install Sage on Ubuntu or Debian systems. The aim is that the user can install Sage copying one line into a bash terminal, say

curl -I -O https://github.com/sagemath/sage-prod/tree/develop/src/bin/easy_install_sage.sh && easy_install_sage.sh

Suggestion: The script should do the following:

  1. Check if we are on an Ubuntu / Debian system. If not goto 7.
  2. Check if Conda / Mamba is present on the system. If yes, do the according installation and exit.
  3. Obtain the Sage version which would be installed by apt from https://repology.org/api/v1/projects/sagemath. If this is the current version, ask the user if he has root access. If yes, do the installation using apt and exit.
  4. If the version number obtained in 2. is less than 9.2, show a warning.
  5. Ask the user if he agrees to install Mamba on his system. If yes then ask if Mamba should be removed / deactivated after installation and install Sage accordingly and exit.
  6. Ask the user if he has root access. If yes, do the installation using apt and exit.
  7. Show a message that other installation methods can be found in our installation guide and print out its URL.

Now and again this script could be extended to other, more exotic Linux distributions, as well. I would not include the installation from source here, since that should be done by poeple who know what they do.

Depends on #33740

Component: scripts

Issue created by migration from https://trac.sagemath.org/ticket/33765

@soehms soehms added this to the sage-9.7 milestone Apr 28, 2022
@mkoeppe
Copy link
Contributor

mkoeppe commented Apr 28, 2022

comment:1

I think what is described is already too complex. Just a script that does the conda installation would be good enough, I think.

@mkoeppe
Copy link
Contributor

mkoeppe commented Apr 28, 2022

comment:2

And it should definitely not be called easy_install... because this term is associated with ancient python technology

@soehms
Copy link
Member Author

soehms commented Apr 29, 2022

comment:3

Replying to @mkoeppe:

I think what is described is already too complex.

My intention was to have the intervention on the users system as minimally invasive as possible. I don't know how much conda changes the behavior of the system but at least it changes it visually (prompt) what might be a matter of irritation to the user.

Just a script that does the conda installation would be good enough, I think.

Agreed! At least that would make things much easier for a start. If users will accept it then it's fine!

And it should definitely not be called easy_install... because this term is associated with ancient python technology

I see! What would you suggest? Maybe install_sage_conda.sh according to the reduction of the functionality?

@tobiasdiez
Copy link
Contributor

Dependencies: #33740

@mkoeppe mkoeppe modified the milestones: sage-9.7, sage-9.8 Sep 19, 2022
@mkoeppe mkoeppe removed this from the sage-9.8 milestone Jan 29, 2023
@saraedum
Copy link
Member

saraedum commented Sep 18, 2024

I created installers for the sage-flatsurf project. They install SageMath with a JupyterLab setup from conda-forge + the sage-flatsurf package.
I tried them out on a small range of systems, but they seem to work fine on the Linux machines I tried, both M1 and intel macOS and Windows 10 Home & Pro and Windows 11 Home & Pro.

The installers can be found on the release page of sage-flatsurf and I would appreciate feedback: https://github.com/flatsurf/sage-flatsurf/releases/tag/0.5.2

Turning these into SageMath installers (without sage-flatsurf) is of course a trivial change if you think that would be a useful addition.

@saraedum
Copy link
Member

saraedum commented Sep 18, 2024

@soehms this is different from what you describe in the issue. There is no need to install conda/mamba and make actual changes to the system on the Unixes anymore now. On Windows, some system changes are necessary to make WSL functional.

@soehms
Copy link
Member Author

soehms commented Sep 22, 2024

I created installers for the sage-flatsurf project. They install SageMath with a JupyterLab setup from conda-forge + the sage-flatsurf package. I tried them out on a small range of systems, but they seem to work fine on the Linux machines I tried, both M1 and intel macOS and Windows 10 Home & Pro and Windows 11 Home & Pro.

Thanks for the info! That's good news.

The installers can be found on the release page of sage-flatsurf and I would appreciate feedback: https://github.com/flatsurf/sage-flatsurf/releases/tag/0.5.2

I tried your Windows installer on an old Sony VAIO with a 2nd generation i5, on which I recently installed Windows 11 Pro (after replacing the HDD with an SSD). Here are my observations:

On this machine I had already enabled WSL 2 and installed Ubuntu 22.04.3 LTS, so I was a bit surprised when I was prompted to update WSL. Unfortunately, I didn't notice that my WiFi extender was unplugged. Probably this caused the installation to run very slowly. A couple of times the Powershell terminal where the installer was running suddenly closed (possibly also due to bad WiFi). But after restarting the installation, it continued correctly from where it stopped. After the installation was complete, all three icons were fully functional. Disk space consumption was about 9 GB. Is this to be expected?

wsl@SonyVAIO:~$ du --max-depth=1
96      ./.sage
5521216 ./sage-flatsurf-0.5.2
20      ./.local
20      ./.config
1383880 ./.cache
16      ./.jupyter
4       ./.ipython
6905360 .

More than 1 GB of it is stored under .cache. Is this a leftover from the installation or is it required for flatsurf?

I then tried to uninstall it, first using the Windows software uninstaller. A message appeared (unfortunately I couldn't take a screenshot of it) telling me to uninstall the virtual machine first to avoid leaving data on the disk. However, there was no way to cancel the uninstall. So after that sage-flatsurf-0.5.2 was no longer functional, but 9 GB of disk space was still occupied. So I had to run wsl --unregister sage-flatsurf-0.5.2 to free up that disk space.

Turning these into SageMath installers (without sage-flatsurf) is of course a trivial change if you think that would be a useful addition.

I think anything that makes installing Sage more convenient is a useful addition!

@soehms
Copy link
Member Author

soehms commented Sep 22, 2024

@soehms this is different from what you describe in the issue. There is no need to install conda/mamba and make actual changes to the system on the Unixes anymore now. On Windows, some system changes are necessary to make WSL functional.

I haven't worked on what I described in the header of this issue, but I have started working on a tool to make accessing our Docker images more convenient for Windows users. I think it will take me a few more weeks to get a preliminary version ready. As soon as it's ready, I'll post it here.

@soehms
Copy link
Member Author

soehms commented Oct 16, 2024

As soon as it's ready, I'll post it here.

I have now published this in a separate repository.

@saraedum
Copy link
Member

Disk space consumption was about 9 GB. Is this to be expected?

Yes, that's roughly what I would expect.

More than 1 GB of it is stored under .cache. Is this a leftover from the installation or is it required for flatsurf?

I believe that this is hard or symlinked to other places. It probably does not save any space to delete .cache.

I then tried to uninstall it, first using the Windows software uninstaller. A message appeared (unfortunately I couldn't take a screenshot of it) telling me to uninstall the virtual machine first to avoid leaving data on the disk. However, there was no way to cancel the uninstall.

Oh, that's very unfortunate. Windows installers are quite a bit of black magic.

Turning these into SageMath installers (without sage-flatsurf) is of course a trivial change if you think that would be a useful addition.

I think anything that makes installing Sage more convenient is a useful addition!

Great. I'll try to get to that soonish.

@soehms
Copy link
Member Author

soehms commented Oct 22, 2024

Great. I'll try to get to that soonish.

@saraedum Did you notice this sage-devel thread about this subject?

Maybe the approach that @kwankyu is trying is similar to yours.

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

No branches or pull requests

4 participants