clingen-data-model / cgwi-php-helm

Helm chart for ClinGen Workflow Infrastructure php apps
0 stars 0 forks source link

explore moving scheduler jobs to k8s CronJobs #1

Open bpow opened 8 months ago

bpow commented 8 months ago

The scheduler container sits there idle most of the time, probably better to let those be handled by CronJobs.

bpow commented 1 month ago

So... I had done this, but artisan schedule:run does not work the way I thought it would. It does not keep track of jobs that hadn't yet been run since the last time they were scheduled, but only if the job is scheduled to run during the same minute that schedule:run is active.

So that means that the timing of running these cronjobs has to match the timing of the jobs scheduled by the php scheduler. And even then, if the k8s job gets delayed in scheduling, it may not start until the next minute and a job could be missed.

The other option could be running the k8s cronjob every minute, but that's a lot of container churn.

So might eventually abandon the php scheduler entirely (on k8s) and just use the k8s cj functionality to run jobs, but that requires more coordination between code and deployment.