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

Transactional python requirements installation for live reload #228

Open
pankajroark opened this issue Feb 20, 2023 · 0 comments
Open

Transactional python requirements installation for live reload #228

pankajroark opened this issue Feb 20, 2023 · 0 comments
Assignees
Milestone

Comments

@pankajroark
Copy link
Collaborator

Currently, if multiple python packages are added via live-reload, there's a possibility that some python requirements get installed while others fail. In such a case, since the truss container cannot be allowed to be in an inconsistent state, a full redeploy/rebuild is triggered. This rebuild itself will fail due to the bad python requirement. Overall, this is not a great experience. It will be great to install the packages in a transactional manner, such that if any package installation fails, then the original python requirements can be restored.

There are a few ways to achieve this. One way would be keep the python requirements in a virtual environment, create a copy of the virtual environment for installation via live-reload, and only swap it for the used virtual environment if all installations succeed. This is a clean approach but requires creating a copy of the entire virtual environment, which could be slow and run into disk space issues.
Perhaps an easier option would be to record the pip state and try to restore that state in case of failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

3 participants