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

Job scheduler implementation #1308

Merged
merged 8 commits into from
Nov 14, 2023
Merged

Job scheduler implementation #1308

merged 8 commits into from
Nov 14, 2023

Conversation

dungnmaster
Copy link
Collaborator

@dungnmaster dungnmaster commented Oct 20, 2023

This PR adds support for creating and dropping jobs in evadb based on this task.

  1. Jobs can be created using the create job query:

CREATE JOB {job_name} AS {
{job_queries; ...}
}
START {start_time}
END {end_time}
EVERY {repeat_period} {repeat_unit}

  1. Created jobs can be dropped using:

DROP JOB {job_name}

  1. The scheduled jobs will only be triggered if the job scheduler process is started explicitly using:

EvaDBConnection.start_jobs()

  1. The job scheduler process can be stopped using:

EvaDBConnection.stop_jobs()

@xzdandy
Copy link
Collaborator

xzdandy commented Oct 24, 2023

Hi @dungnmaster, thanks for looking into Job scheduler. What is the status of the PR? Could you summarize the design which helps us understanding the implementation. Thanks!

@dungnmaster dungnmaster changed the title Job scheduler changes Job scheduler implementation Oct 27, 2023
@jarulraj jarulraj requested a review from americast October 27, 2023 18:52
@dungnmaster dungnmaster force-pushed the jobs-scheduler branch 3 times, most recently from cbb87e7 to c110495 Compare November 3, 2023 07:06
@dungnmaster
Copy link
Collaborator Author

Hi @dungnmaster, thanks for looking into Job scheduler. What is the status of the PR? Could you summarize the design which helps us understanding the implementation. Thanks!

  • In the current implementation, the job scheduler process can be started using the start_jobs() method of the EvaDbConnection object and stopped using the stop_jobs() method.
  • The start_jobs() method, starts a new Python process that keeps polling for valid executable tasks in the catalog and also executes them in the same process. This will continue until the job scheduler is stopped or the calling python parent process terminates.

@dungnmaster dungnmaster marked this pull request as ready for review November 3, 2023 07:18
@xzdandy xzdandy linked an issue Nov 11, 2023 that may be closed by this pull request
2 tasks
@xzdandy xzdandy added High Effort 🏋 Difficult solution or problem to solve User Experience Feature Request ✨ New feature or request labels Nov 11, 2023
next_executable_job.row_id,
execution_time,
datetime.datetime.now(),
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can update the result of job in the catalog. so it is queryable. We can do this in later PRs. Maybe add a TODO.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. I'll add this as a followup change.

Copy link
Collaborator

@xzdandy xzdandy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! Very good quality. Could you also update the documentation https://evadb.readthedocs.io/en/stable/source/reference/evaql.html for the CREATE JOB query? Thanks!

@xzdandy xzdandy merged commit 1fbb74f into staging Nov 14, 2023
@xzdandy xzdandy deleted the jobs-scheduler branch November 14, 2023 17:25
@xzdandy xzdandy restored the jobs-scheduler branch November 14, 2023 17:39
xzdandy added a commit that referenced this pull request Nov 14, 2023
@xzdandy xzdandy added this to the v0.3.9 milestone Nov 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request ✨ New feature or request High Effort 🏋 Difficult solution or problem to solve User Experience
Projects
Development

Successfully merging this pull request may close these issues.

feat: Add support for scheduling Jobs
3 participants