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 cleanup functionality for container runner #678

Open
PGijsbers opened this issue Dec 14, 2024 · 1 comment
Open

Add cleanup functionality for container runner #678

PGijsbers opened this issue Dec 14, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@PGijsbers
Copy link
Collaborator

PGijsbers commented Dec 14, 2024

Moving TODOs from code to issue tracker (#172):

# TODO: remove generated script? anything else?

Clean up for runner may potentially also include the stopped container (not sure if that already happens), or the image (though would not do that by default).

@PGijsbers PGijsbers added the enhancement New feature or request label Dec 14, 2024
@PGijsbers
Copy link
Collaborator Author

Currently, cleanup is not implemented in any derived class, but is always called after a run.
I definitely would not want to remove the docker image after each run.
Perhaps the clean should only be called on --setup modes clean (#491) or force.
Then it could be something like:

    def cleanup(self):
        image = self._find_image()
        log.info(f"Cleaning up docker image {image}.")
        run_cmd(f"docker rmi -f {image}")
        log.info("Cleaning up Dockerfile")
        if os.path.exists(self._script):
            os.remove(self._script)

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

1 participant