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

Support cron scheduling via GCP Cloud Scheduler #107

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

MohamedBeydoun
Copy link

Summary

For: #20

Added GCP Cloud Scheduler support for cron job scheduling. I followed the linked issue and @ceritium's PR while also adding basic ActiveJob and OIDC support. Let me know what you think!

Testing

  1. Create a config file:
test_job:
  worker: "DummyWorker" # REQUIRED: class of the worker you're trying to schedule
  cron: "0 0 1 1 *" # REQUIRED: cron
  args: "foo" # OPTIONAL: the arguments that you want to pass to the worker
  queue: "default" #OPTIONAL:  queue name
  time_zone: "America/New_York" # OPTIONAL: the timezone that you want the job to be scheduled in (default: UTC)
  active_job: false # OPTIONAL: Whether your class represents a Cloudtasker Worker or an ActiveJob (default: false)
  1. After configuring your Cloudtasker (gcp_project_id, gcp_queue_prefix, processor_host, etc), you can start using the CloudScheduler::Manager as follows:
Cloudtasker::CloudScheduler::Manager.synchronize!("/path/to/your/config/file.yml")

Manager.synchronize! will sync your GCP project's Cloud Scheduler jobs with whatever you have in the config file. It will create any jobs that you add, update stale jobs, and delete any jobs that you remove.

I didn't add a rake task since I wanted to give the end users the freedom to use the manager however they see fit. Let me know if you want me to add it back.

Thanks!

@mspringsits
Copy link

I think this would be a great addition to the project. Any suggestions on when/if this will be merged?

@MohamedBeydoun
Copy link
Author

I think this would be a great addition to the project. Any suggestions on when/if this will be merged?

Not sure tbh 🤷 Waiting for @alachaum review 👀

@mspringsits
Copy link

I see. @alachaum Is there any help that we can provide to get this PR merged? 🤝

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

Successfully merging this pull request may close these issues.

None yet

2 participants