8000 Implement migration banner by edan-bainglass · Pull Request #251 · aiidalab/aiidalab-home · GitHub
[go: up one dir, main page]

Skip to content

Implement migration banner - #251

Merged
edan-bainglass merged 13 commits into
mainfrom
migration-banner
Oct 31, 2026
Merged

edan-bainglass merged 13 commits into
mainfrom
migration-banner

Conversation

@edan-bainglass
@edan-bainglass edan-bainglass commented Sep 26, 2026 •
Copy link
Copy Markdown
Member

This PR introduces MigrationWidget specifically for the purpose of migrating from Python 3.9 to 3.12.
A more general migration policy is deferred.

The banner displays based on a simple heuristic of checking if ~/.local/lib/python3.9 exists. If it does, the widget writes .FLAG_PENDING_MIGRATION to the user's home, which serves as another reason for the banner to display. The banner includes a button to confirm migration, blocked by a set of task checkboxes. Clicking the button removes the flag from disk and banner from the home page.

Based on a local branch representing a merge of the current control page PRs, for testing against its .local reset feature. Note that the danger zone panel of the control page is under discussion. See #257.


image

Comment thread home/start_page.py Resolved
@danielhollas
Copy link
Copy Markdown
Contributor

Can we determine accurately when every installed app has been reinstalled by checking the app against the new .local/lib/python3.12 environment?

That's an interesting idea! I think it's doable though somewhat non-trivial. Incidentally, some of the needed pieces are implemented in my PR for app package re-installation in aiidalab/aiidalab#515, which I aim to merge shortly. One would need to determine whether the AiiDAlab app has a corresponding python package (by checking whether setup.py or pyproject.toml are present, and then read the package name from setup.cfg).

@edan-bainglass
Copy link
Copy Markdown
Member Author

Can we determine accurately when every installed app has been reinstalled by checking the app against the new .local/lib/python3.12 environment?

That's an interesting idea! I think it's doable though somewhat non-trivial. Incidentally, some of the needed pieces are implemented in my PR for app package re-installation in aiidalab/aiidalab#515, which I aim to merge shortly. One would need to determine whether the AiiDAlab app has a corresponding python package (by checking whether setup.py or pyproject.toml are present, and then read the package name from setup.cfg).

Let's discuss Monday over a call if you have time 🙏 I'll try a few other things on my end in the meantime 🙂

@edan-bainglass
edan-bainglass marked this pull request as draft September 26, 2026 14:15
@edan-bainglass
edan-bainglass force-pushed the migration-banner branch 3 times, most recently from 0c00e11 to d195c7e Compare September 28, 2026 05:05
@edan-bainglass edan-bainglass changed the title Migration banner Implement migration banner Oct 12, 2026
@edan-bainglass
edan-bainglass force-pushed the migration-banner branch 3 times, most recently from 01d6d05 to 425bb56 Compare October 12, 2026 10:10
@edan-bainglass
edan-bainglass marked this pull request as ready for review October 13, 2026 07:19
@edan-bainglass
Copy link
Copy Markdown
Member Author

@danielhollas have a look, but also okay to wait until we resolve the danger zone discussion. Note that @yakutovicha is back tomorrow, AFAIK.

@danielhollas
danielhollas commented Oct 13, 2026 •
Copy link
Copy Markdown
Contributor

Thanks! Interesting idea with the checkboxes!

I am travelling today, will have a closer look once the danger zone is done.

Couple quick comments:

  1. Daemon restart checkbox shouldn't be needed because it should be restarted automatically when the app is reinstalled. (And if it is not I think it should be, not sure if we thought about it when implementing the reinstall button?)
  2. AWB doesn't have to be removed manually, it can be simply be uninstalled.

@edan-bainglass
Copy link
Copy Markdown
Member Author
  1. Daemon restart checkbox shouldn't be needed because it should be restarted automatically when the app is reinstalled. (And if it is not I think it should be, not sure if we thought about it when implementing the reinstall button?)

I think maybe they do, but wasn't sure. I'll check at some point as this advances and update accordingly.

  1. AWB doesn't have to be removed manually, it can be simply be uninstalled.

Right right, I wrote this point prior to considering a .local reset only option, so when I only had .local + apps reset as an option. But I think either case it results in what you say, they can simply uninstall it. Will update.

Comment thread home/control.py Resolved
@yakutovicha yakutovicha left a comment •
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, @edan-bainglass, I started the review, but I couldn't finish it because we need to make some decisions.

Let's check if you agree with my comments below. The most important one: shall we put the migration in its own module?

Comment thread home/widgets.py Resolved
Comment thread home/widgets.py Resolved
Comment thread home/start_page.py Resolved
@edan-bainglass
edan-bainglass commented Oct 30, 2026 •
Copy link
Copy Markdown
Member Author

Tested. Works nicely. A couple of comments:

  1. The reset feature from control removes everything from the home while a migration is scheduled. This includes the banner. It may be okay though. The user needs to restart! If they want to see the banner again, they can cancel and start the process again. I'm fine with this.
  2. I should update the banner text to state that one should first attempt an update, as it is likely they need to update an app to the latest version. Actually, this is not a "first" case. I don't think "reinstall" is ever a case, as they shouldn't have been on a 3.12-compatible version.

Update the text. @danielhollas @yakutovicha can you test on your end? Also, happy to iterate on the banner text if needed 🙂

@yakutovicha yakutovicha left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, @edan-bainglass. As discussed, I am going to do some manipulations with the tests, the other suggestions I leave as comments.

Comment thread home/package_migration.py Resolved
Comment thread home/package_migration.py Resolved
Comment thread home/package_migration.py Resolved
Comment thread home/package_migration.py Resolved
Comment thread home/package_migration.py Resolved
Comment thread home/package_migration.py Resolved
Comment thread home/package_migration.py Resolved
Comment thread home/package_migration.py Resolved
@edan-bainglass
Copy link
Copy Markdown
Member Author

@yakutovicha have another look. I applied your suggestions but also decided to encapsulate all migration matters within the widget. For example, has_pending_migration is now a classmethod.

@yakutovicha
Copy link
Copy Markdown
Member

Just dumping this here; very easy to test the migration with aiidalab-launch:

aiidalab-launch stop -p aiidalab-demo-312
aiidalab-launch reset -p aiidalab-demo-312 --yes
for v in home conda; do
  docker volume create aiidalab_aiidalab-demo-312_$v
  docker run --rm -v aiidalab_aiidalab-demo_$v:/from:ro -v aiidalab_aiidalab-demo-312_$v:/to alpine cp -a /from/. /to/
done
aiidalab-launch start -p aiidalab-demo-312

@yakutovicha yakutovicha left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Works perfectly!

@edan-bainglass
edan-bainglass merged commit 14e544b into main Oct 31, 2026
5 checks passed
981F
@edan-bainglass
edan-bainglass deleted the migration-banner branch October 31, 2026 06:17
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.

3 participants

0