Closed muratmaga closed 1 month ago
User will be presented with a popup like the following:
To show the dialog from the self-hosted runner using SSH:
instance_ip=X.X.X.X
ssh \
-o StrictHostKeyChecking=no \
-o UserKnownHostsFile=/dev/null \
-o LogLevel=ERROR \
exouser@$instance_ip \
'export DISPLAY=:1 && zenity --question --timeout=60 --title="Automatic Instance Shelving" --text="Instance will be shelved in ~30 minutes.\n\nWould you like to keep the instance running for an additinal 4 hours?" --ok-label="Yes" --cancel-label="No"'
To show the dialog directly from the instance:
export DISPLAY=:1 && \
zenity \
--question \
--timeout=60 \
--title="Automatic Instance Shelving" \
--text="Instance will be shelved in ~30 minutes.\n\nWould you like to keep the instance running for an additinal 4 hours?" --ok-label="Yes" --cancel-label="No"
any updates on this?
I have a working protoype and will integrate shortly.
Existing instance will also be gracefully handled (current mechanism will apply), the question will be asked only in the context of newly created instance.
This feature improves the user experience by allowing active users to extend their session by 4 hours. It has been implemented and deployed across multiple projects:
exosphere
MorphoCloudWorkflow
MorphoCloudInstances
exosphere
feat(Slicer role): Add support to check for instance shelving extension Beta
).check-instance-shelve.sh
, which manages automatic shelving, providing users the option to extend the runtime by 4 hours. The script can also display the elapsed time since the last session extension or reset the timer.check-instance-shelve.sh
.@reboot
entry to handle unshelving.MorphoCloudWorkflow
fix(cloud-config): Update to use exosphere changes
) and a29ea08 (feat(automatic shelving): Add support to check for instance shelving extension
).
.github/workflows/automatic-instance-shelving.yml
to remotely run check-instance-shelve.sh -d
and check the timestamp of the tracker file (/home/exouser/shelving_instance_tracker
).MorphoCloudInstances
The user notification is triggered by the following cron job:
# Ansible: Ask user for instance shelving extension
*/5 * * * * /home/exouser/dist/check-instance-shelve.sh -a
The cron job runs the script every 5 minutes, prompting active users to extend their session before automatic shelving occurs. Below is a preview of the notification:
I am sure this is working, but displaying the message is only for 5 minutes is not going to work well. I missed it yesterday while stepped out for a thing... Can you display until a response is received or the for 30 minutes (whichever is sooner)?
To follow up on @muratmaga comment shared by email:
And also I am still not seeing it pop up. So that 5 minutes is very restrictive. I might just have gone to have coffee and miss it.
It turns out there was an issue with the script, the fix (https://github.com/MorphoCloud/exosphere/commit/620f82fdf19ff4a42ac324b4710d72039d1e6331) is currently being tested in jcfr/MorphoCloudPortal
and will deployed later to MorphoCloudInstances
To follow up on @muratmaga comment shared by email:
I suggest making this file hidden and maybe put it under ~exouser/.local/ If they delete it for one reason or another, it will break things.
Ditto. As a first step, I will improve the script to simply create the file if doesn't exist.
As a second step, we should then address:
To follow-up on @muratmaga comment shared by email:
Is there any reason you can keep it until a response is recorder, or it times out?
After integrating the fix referenced in https://github.com/MorphoCloud/MorphoCloudWorkflow/issues/35#issuecomment-2435769518, the popup will keep being displayed until the user either click "Yes" or the instance is shelved. So this should not be an issue.
The fix ensuring the script check-instance-shelve.sh
works has been deployed to the MorphoCloudInstances
project through https://github.com/MorphoCloud/MorphoCloudInstances/commit/445198ffe212396dd3993df2302ddb8c52828112
This seems to work well now, thank you.
Going forward, would it be possible to implement this as little widget that sits on the top menu bar like countdown, from which they can renew the session whenever they want.
If you think it is feasible (i.e., won't require extensive development time), I will open a separate issue to track.
Allow people to continue working with the instance, and skip the auto-shelving at 4h.