-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
Testing create-wsl-image.yml #20
Comments
Testreport on commit 7d49318.The test was on a VM running Windows 10 Home. Again I was unable to paste the script into the Powershell terminal. This point worked better in my previous test last Saturday. But maybe this is a problem caused by the virtual machine. When this happens, the paste process is very slow, it seems to go line by line and at the end the code appears in reverse order in the terminal (see attached file paste.log). So I saved the code from the editor under a different name After rebooting the VM, I ran Before installation, the VM had 19.4 GB of used disk space, after installation it took up about 35 GB. I think there should be potential to reduce that. In your post on sage-devel (in the Using Sage on Windows thread), you said:
I guess you mean
Another suggestions: I think it would be worth considering user messages that make it clear that a reboot is required and the script needs to be called again afterwards. I did something similar regarding the installation of Docker Desktop (see section 2.1 of the documentation). |
Thanks for testing.
I used Windows 11 Pro for testing. WSL is WSL2. I have no machine Windows 10 with WSL enabled...
This is very strange. On my side, I had a different set of strange things happening. Then I learned that powershell works with UTF16 output encoding by default. Thus some of the strange things were cleared up after I set You can download the installer, and then right click it and "Run with PowerShell" to avoid copy and paste. |
Usually, people recommend to download the installer script and then execute it. This circumvents the issues with the slow pasting process. Eg. chocolatey recommends on https://chocolatey.org/install#individual:
|
I provided a .exe installer created by ps2exe from the .ps1 file. But because Windows falsely detects a virus from the .exe file and because I don't see a big merit of the .exe installer, I removed it. |
My host system is also Windows 11 Pro. For testing, I use Hyper-V Manager, for which I set up Windows 10 and 11 Home using ISO images. If you have worked with Virtual-Box before, this is very similar to handle. However, do not use Virtual-Box (neither on Linux nor on Windows)! This is not supposed to expose the CPU virtualization sufficiently to the guest sytem for WSL.
I'll do that later on (I don't carry a Windows machine with me). |
Does this change the registry? |
Installing the WSL image does not require a reboot. Installing WSL may need a reboot. Do you mean this? |
For me,
Anyway, this is striking to me. How can sagemath/sagemath be so small? |
The sage directories have similar sizes
The difference seems to be in system packages. |
Exactly! |
I guess you obtained this on Linux. On Linux Mint I get a similar result:
Yes, that's weird! I was wondering why the image size of
AFAIK the essential part for this in
But I'm not sure. Maybe, @saraedum knows it? |
I obtained that on Mac. It seems that the local size of a docker image may fluctuate in time since an image consists of layers, which may change(?) for some reasons. I less care about this. As I shown above, the sage-binder-env image has much larger |
Basically the installer assumes a functional WSL installation. (It runs |
I tested the installer on a virgin (no WSL install before :-) computer. Now I agree with you about the need to reboot. I added a relevant message to the installer. Thanks. |
Yes, that worked better! |
On another Windows machine where I also installed Docker using apt in WSL and Docker Desktop, the size is shown correctly at 3.45 GB (in both Bash and Powershell). So the incorrect size seems to be an issue on that particular machine. I'm sure I had Docker running in WSL before installing Docker Desktop on the machine which shows the correct sizes. Maybe it was the other way around on the other machine, so my guess at the moment is that this is the reason. |
OK. The official size of sagemath/sagemath is 3.45GB. The sage-binder-env image was using the ubuntu-focal-standard docker image, built in a workflow run like https://github.com/sagemath/sage/actions/runs/11304611125/job/31443198982 (the actual run log was removed) On the other hand, from its dockerfile, it seems that the sagemath/sagemath image is a custom build close to the ubuntu-jammy-minimal docker image. The "minimal" build minimizes install of system packages while "standard" build installs many system packages. I guess this made the size differences between the sage-binder-env image and the sagemath/sagemath image. I just uploaded a patch for sage-binder-env to use the ubuntu-jammy-minimal docker image. Hopefully this will reduce its size close to the sagemath/sagemath image. Let's see. |
Hmm. The current records:
|
I don't think so. Because of Concerning the docker size discussion: why do we use the binder image and not just the classical sagemath image? |
In this repo, that was a natural choice to me. If you will, you may duplicate the code into the sagemath/sage repo, using the sagemath image. |
Yes! Sorry I missed that! |
There is an archived repo sagemath/sage-windows for the old Cygwin installers. Should we create something similar for the both new installation methods (the one here with WSL import and the one I created with Docker Desktop)? We could rename the old one to The advantage of the approach here is that it leads more directly to a working Sage. But additional documentation of the installer with screenshots would be helpful in this case, too. I would keep such details out of the Sage repository and just reference them in the installation instructions. As developers, we are no longer aware of how difficulties with a small technical step can cause frustration and make people give up. In addition, we should make clear how the software changes the users system (where possible) and show the steps to uninstall it. The more transparency we provide, the more people will try it. As I said, the advantage of the Docker Desktop approach is the flexibility in deciding which Docker images to use. The choice of these images can easily be extended, for example to include images that provide certain optional packages, as already visible in the So I think both methods should be available for Windows users. |
That is a very good idea. I agree with all your points. I will ask sagemath-admins for a renewed sagemath/sage-windows repo. |
Meanwhile I got
However, we should use the smaller image for the renewed sagemath/sage-windows repo. |
How to completely remove:
and delete the desktop shortcuts. |
Now I got
and added uninstaller. |
Great! I'll take a look at it next week. I guess most of it is achieved by replacing
Don't you need that any more? |
Basically both images aim to be a minimal build of sage that is just runnable. The sagemath image achieves that by building sage first and minimizing it while the sage-binder-env does it by taking an already built image and minimizing it. Both use similar tactics for minimizing. I borrowed some tactics from docker/Dockerfile: removing artifacts like .c .cpp files produced by compiling .pyx files cut the last several hundred MBs; removing I think both images contain almost the same sage and the same base ubuntu image. A major difference is that the sage in the sagemath image is originally a non-editable install and the sage in the sage-binder-env is originally an editable install. Hence perhaps just some differences in organizing files at most. At the moment, I regard the "Run SageMath on WSL" in this repo as a release of the sage-binder-env image for local use on Windows. For sagemath/sage-windows repo, you may duplicate the code but based on the sagemath image. I think we may keep both (at least for some time). The sagemath/sage-windows repo and the sagemath image have an "official" flavor :-) I asked sagemath-admins to give the admin role of sagemath/sage-windows to you. I wonder who is the current admin/maintainer. |
Ah I forgot to mention that the sage-binder-env uses the system install of jupyterlab, and hence the latest. |
I don't have a strong opinion on this, but feeling wise I would favor it if the install instructions (including screenshots) are included in the main sage docs. Otherwise it looks like windows is a second-class citizen. Similarly, I think building the wsl image should be done on each release and thus is best included in the main repo as well. Maybe then the powershell script can also live there?
Totally agree!
I haven't looked at the scripts in detail, but can we merge both approaches? In the combined script, the user will first be asked if he wants to use WSL or Docker. I think it would also make sense to provide the option to install different WSL images in the future (the only requirement for this is of course that these images have to be made available somewhere first.) |
Release of sagemath/sage is a release of source code. The source code does not work on Windows. In that sense, Windows is a second-class citizen. We don't need to hide the reality. All downstream packagings of sage, even for linux and macOS, are done outside of sagemath/sage. For windows, sagemath/sage-windows would be an ideal place. Things would be simpler technically when we separate concerns. |
Which place do you suggest? At the moment we don't have Powershell scripts in the source tree:
|
Furthermore, there is no real dependency on the version of |
That's not quite true. Every release of sage publishes over 50 linux and macos images at https://github.com/orgs/sagemath/packages, so are many binary wheels.
I suggest to build the wsl tar image at https://github.com/sagemath/sage/blob/develop/.github/workflows/docker_hub.yml (or in a new workflow that is triggered by it). Not sure if there is a canonical place for the powershell script but it can just be in the root (or under docker). Or it goes in it's own repo as you have suggested. |
It seems that
The
There is one difference that I intended to address with my question "Don't you need that anymore?": In If I move the build tools from
the image size goes down to 3.18 GB |
You are right. Thanks. With the fix, the sage-binder-env image becomes 2.87 GB.
Right..
Actually I was not aware of the issue. I think the cython compilation functionality is a non-trivial feature of sage. To recover the functionality to the sage-binder-env image, I had to restore
Then the size of the image becomes 3.27 GB. For 400 MB, I would rather buy it :-) |
The sagemath/sage repo is a crowded place, containing too much information meaningful only to developers. The sagemath/sage-windows will be relatively tranquil. We may put screenshots right into the README of the repo, immediately visible to the visitors. |
This issue continues the discussion started in a sage-devel thread on Using Sage on Windows regarding the approach suggested by @tobiasdiez using a custom WSL distribution. An according implementation of this can be found here in .github/workflows/create-wsl-image.yml. Tests of it are documented in this issue.
The text was updated successfully, but these errors were encountered: