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
Max job retained pipelined runs #608
Merged
fruttasecca
merged 11 commits into
feat/delete-individual-job-pipeline-run
from
feat/max-job-retained-pipelined-runs
Dec 23, 2021
Merged
Max job retained pipelined runs #608
fruttasecca
merged 11 commits into
feat/delete-individual-job-pipeline-run
from
feat/max-job-retained-pipelined-runs
Dec 23, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Later used to retrieve job runs to delete when max_pipeline_runs retained has a valid value.
A job level property must be used to keep track of how many job pipeline runs have been scheduled because job pipeline runs can now be deleted, also the parameters of a (cron)job can be edited.
For some reason alembic did not like this migration (i.e. the previous verison) when creating database from scratch.
Nice job! LGTM |
Makes it so that the deletion of a job pipeline run directory is done by the celery worker rather than the orchest webserver. This allows to avoid a bidirectional relationship between the orchest-webserver and the orchest-api. The logic related to max_retained_pipeline_runs has been refactored into a 2PF, DeleteNonRetainedJobPipelineRuns.
yannickperrenet
approved these changes
Dec 23, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome! 💯
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds to the BE the functionality to automatically clean up the oldest job pipeline runs. This is done through a new field of the
Job
model,max_retained_pipeline_runs
. This can be specified both during the creation of a job (POST) or update (PUT). This will make it so that 1) when new pipeline runs are scheduled for the job 2) when a pipeline run of the job gets into an end state the logic will check for the oldest job pipeline runs to delete. A requirement for a pipeline run to be deleted is to be in an end state (SUCCESS
,FAILED
,ABORTED
).Some details:
orchest-api
does not control theuserdir
, but theorchest-webserver
does.pipeline_run_index
, this is used to find out what are the oldest job pipeline runs to delete, i.e.highest_index - max_retained_pipeline_runs
would be the threshold to be considered for deletionmax_retained_pipeline_runs = 0
is a valid value, i.e. every run will cleanup itself after reaching an end stateRelated to #550
@yannickperrenet The deletion of the directory of a job pipeline run could have been done in different manners, I went for preserving the constraint that the
orchest-api
does not touch theuserdir
, and for reusing the existingorchest-webserver
endpoint, so now theorchest-api
is actually getting in touch with the webserver and it's quite awkward since it will result in a call to theorchest-api
. Keen to know your opinion :).Checklist
./orchest status --ext
is not reporting failures when Orchest is running.models.py
I have performed the appropriate database migrations.