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

com.aws.greengrass.lifecyclemanager: New Lifecycle stage "Uninstall" #814

Open
2 tasks
kris-sum opened this issue Jan 13, 2021 · 6 comments
Open
2 tasks
Labels
enhancement New feature or request

Comments

@kris-sum
Copy link

Feature Description
We already have 'install', 'run', 'shutdown' etc as Lifecycle stages where we can configure scripts, but how about about an 'Uninstall' stage where we can perform any cleanup operations when a component is upgraded or removed.

Use Case
If my component puts temporary data in the CWD, or needs to notify another component that it's being removed, it would be good to use this 'uninstall' stage which operates like the inverse of 'install', allowing us to call scripts when the current artifact is removed.

My particular use-case was to cleanup the filesystem after an install script installs dependencies - my dependencies ended up in /home/ggc_user/.local/share/virtualenvs/{instance_id}, and weren't removed when the component artifacts were removed. I'm aware that this isn't "The Right Way" to do things, but nonetheless I feel an Uninstall licecycle stage would be useful to others.

Note: Shutdown !== Uninstall, as components can be stopped/started without being uninstalled.

Proposed Solution
Uninstall scripts should be executed before any artifact cleanup is performed.
Uninstall scripts should have a default timeout value, so that uninstalls don't hang the system indefinitely.

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change
@kris-sum kris-sum added the needs-triage Needs eyeballs label Jan 13, 2021
@MikeDombo MikeDombo added enhancement New feature or request and removed needs-triage Needs eyeballs labels Jan 13, 2021
@MikeDombo
Copy link
Member

Thanks for the feedback Kris. We'll discuss this internally to determine a priority for our roadmap.

@plafer
Copy link

plafer commented Jun 8, 2021

I second this. We really need this feature. Currently, we're hacking it by making the RUN script sleep forever once done, and we put the cleanup in the shutdown script.

@breboulet
Copy link

I second this. We really need this feature. Currently, we're hacking it by making the RUN script sleep forever once done, and we put the cleanup in the shutdown script.

Same here. Not having a clean uninstall stage is unfortunately making it a hard sell for a production environment :(

@cgddrd-gardin
Copy link

I'd also +1 this (I've thumbed up as well), it would be very very useful to have the ability to run a cleanup script when a component gets uninstalled.

@sambonator1
Copy link

I opened a feature request through AWS Enterprise Support for this, not knowing this feature request existed here.
+1 for this feature please. Without it I cannot do a proper cleanup when components are removed.

@chaithuprsnl
Copy link

My use case is to install & uninstall an .exe file on a windows device using Greengrass component deployment. It would be great if this uninstall life cycle stage addresses this use case as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants