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 an MSS updater #984

Merged
merged 21 commits into from
Jun 1, 2021
Merged

Add an MSS updater #984

merged 21 commits into from
Jun 1, 2021

Conversation

Marilyth
Copy link
Collaborator

@Marilyth Marilyth commented May 21, 2021

fixes #899

  • 1. Check if version is a lower number than conda search mss
  • 2. Check if a simple mamba/conda install mss={newest} python is sufficient

I have decided against the functionality to create and replace the current environment. It is an absolute nightmare especially on Windows and its permission system. Random crashes can ruin the environment etc.

Also it seems coverage does not capture QThreads, which is a bummer since the majority of the updater is running in the background.

@Marilyth Marilyth changed the title Adds an MSS updater Add an MSS updater May 21, 2021
@ReimarBauer
Copy link
Member

on windows we used

mamba install mss python=3.9 

this was used by me recently also on linux.

probably we could verify first which python version is available and not request a minor one.

@Marilyth
Copy link
Collaborator Author

Marilyth commented May 25, 2021

Your command works only if there is no mss preinstalled I think. Otherwise mamba will keep the old mss version and be happy with it.
This worked for me on all my cases, be it a fresh environment or as a mss update

mamba install mss={version} python

where {version} is the latest one. Is there a reason to specify 3.9 instead of just telling mamba to match it to the newest mss @ReimarBauer ?
I have once managed to completely destroy my environment in which case that command didn't work. Which is why the environment replacement exists, but it is very dangerous if interrupted.

@ReimarBauer
Copy link
Member

Your command works only if there is no mss preinstalled I think. Otherwise mamba will keep the old mss version and be happy with it.
This worked for me on all my cases, be it a fresh environment or as a mss update

mamba install mss={version} python

where {version} is the latest one. Is there a reason to specify 3.9 instead of just telling mamba to match it to the newest mss @ReimarBauer ?
I have once managed to completely destroy my environment in which case that command didn't work. Which is why the environment replacement exists, but it is very dangerous if interrupted.

The previous python=3.9 was some time ago a solution for a few windows installations.

@ReimarBauer
Copy link
Member

the replacement of an existing env is something which should be explained to the user. And I'm still not sure if we should do this automated.

I'm also not sure if this scales, when a user has own plugins, libs additional installed in an mssenv.

An other option is to guide the user through these steps for a backupped new installation. So it is half automated and we could also verify that it probably will be successful.

@Marilyth
Copy link
Collaborator Author

Marilyth commented May 31, 2021

the replacement of an existing env is something which should be explained to the user. And I'm still not sure if we should do this automated.

I'm also not sure if this scales, when a user has own plugins, libs additional installed in an mssenv.

An other option is to guide the user through these steps for a backupped new installation. So it is half automated and we could also verify that it probably will be successful.

I fully agree. I pursued the ability to create and replace the environment in case an update does not work, but I had to give up.
It did work, sometimes, sometimes not. Random segfaults occured, crashes to the updater, permission issues on Windows, hacks for going out of the current environment. Ugh. This is not worth it.
In case it is ever considered again, the commits here document how I did it.

@Marilyth Marilyth marked this pull request as ready for review May 31, 2021 15:35
@Marilyth Marilyth requested a review from ReimarBauer May 31, 2021 15:36
@Marilyth Marilyth requested a review from joernu76 May 31, 2021 15:36
Copy link
Member

@ReimarBauer ReimarBauer left a comment

Choose a reason for hiding this comment

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

@Marilyth I do later a deeper review. I've seen already that it is centric to the UI user which is a good choice.

I would also like to have a command line feature, at least for the servers. That must not do everything like the gui but it should log or output on a command option that the version is outdated. If that is too much now we can postpone that.

mslib/msui/updater.py Outdated Show resolved Hide resolved
@Marilyth
Copy link
Collaborator Author

Sure, I will detach the functions from the UI and bring the updater to the servers also.

@ReimarBauer
Copy link
Member

played a little with it, with some fake versions. Works pretty well :)
unfortunately have the current versions not that feature ;)

@Marilyth Marilyth requested a review from ReimarBauer June 1, 2021 09:25
Copy link
Member

@ReimarBauer ReimarBauer left a comment

Choose a reason for hiding this comment

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

very well done

@ReimarBauer ReimarBauer merged commit 8bc0675 into Open-MSS:develop Jun 1, 2021
@Marilyth Marilyth deleted the i899 branch June 2, 2021 06:01
Marilyth added a commit to Marilyth/MSS that referenced this pull request Jun 17, 2021
* Updater Step 1

* Better workflow

* Finish updater

* Add tests

* Add backups, use environment only as last resort

* Mock Worker, test environment code

* Make process more transparent and safe

* Backup only at replacement, warn user on replacement

* Warn the user even more in case of environment replacement

* More tests

* Remove environment replacement

* Make restarter work on windows

* Move updater to utils

* Add command line update arguments

Co-authored-by: ReimarBauer <rb.proj@gmail.com>
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.

request update of mss
2 participants