Skip to content

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

MohamedBeydoun commented May 20, 2024

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's review 👀

@mspringsits
Copy link

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

@ruzia
Copy link

ruzia commented Dec 10, 2024

@alachaum
Could you take a look at this pull-req...? 🙏
I would like this feature very much. 😋

@OleMchls
Copy link

OleMchls commented Jan 9, 2025

@MohamedBeydoun great work. I would also love to see this merged 💖 We might improve our chances when you would also add some documentation to the, already very good, Readme of this project :)

@sohan
Copy link

sohan commented Feb 21, 2025

Would love to use this as well. @alachaum is there anything we can do to help get this 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.

5 participants