i set like this: for init Task Scheduler
task_scheduler = TaskScheduler(
sync_frequency_minutes=5,
force_create_task_name='controller_feedback',
force_create_task_project='Automation/Controller',
)
i running this on 2.35 am, but the job not launching after 2.40 am
Hi @<1523701260895653888:profile|QuaintJellyfish58>
Based on the docs
None
I think this should have worked, are you running the actual task_scheduler
on yout machine? on the services queue ? what's the console output you see there ?
Hi @<1523701205467926528:profile|AgitatedDove14> , Thanks for rresponse!
this my simple code to test scheduler
import datetime
from clearml.automation import TaskScheduler
def test_make():
print('test running', datetime.datetime.now())
if __name__ == '__main__':
task_scheduler = TaskScheduler(
sync_frequency_minutes=30,
force_create_task_name='controller_feedback',
force_create_task_project='Automation/Controller',
)
print('\n[utc_timestamp]:',datetime.datetime.utcnow())
print()
task_scheduler.add_task(
target_project='Automation/testing',
name='fetch feedback',
schedule_function=test_make,
minute=35, hour=4, day=1,
recurring=True,
)
print(task_scheduler.get_scheduled_tasks())
task_scheduler.start()
and the console output like this after pass the 4.35 utc time, there is no job running.
ClearML Task: created new task id=e9369778f9084929bee918f163f940a7
ClearML results page:
[utc_timestamp]: 2023-02-26 04:29:48.147570
[ScheduleJob(name='fetch feedback', base_task_id='', base_function=<function test_make at 0x7f91fd123d90>, queue=None, target_project='Automation/testing', single_instance=False, task_parameters=None, task_overrides=None, clone_task=True, _executed_instances=None, execution_limit_hours=None, recurring=True, starting_time=datetime.datetime(2023, 2, 26, 4, 29, 48, 148192), minute=35, hour=4, day=1, weekdays=None, month=None, year=None, _next_run=None, _execution_timeout=None, _last_executed=None)]
Syncing scheduler
Waiting for next run, sleeping for 30.00 minutes, until next sync.
clearml=1.9.1
I found the issue, the first run it jumps over the first day (let me check if we can quickly fix that)
Thanks! i just prove it can run in next day, but not for the same day. i hope can run in same day too.
Syncing scheduler
Waiting for next run, sleeping for 5.13 minutes, until next sync.
Launching job: ScheduleJob(name='fetch feedback', base_task_id='', base_function=<function test_make at 0x7f91fd123d90>, queue=None, target_project='Automation/testing', single_instance=False, task_parameters={}, task_overrides={}, clone_task=True, _executed_instances=None, execution_limit_hours=None, recurring=True, starting_time=datetime.datetime(2023, 2, 26, 4, 29, 48, 148192), minute=35, hour=4, day=1, weekdays=None, month=None, year=None, _next_run=datetime.datetime(2023, 2, 27, 4, 35), _execution_timeout=None, _last_executed=None)
Scheduling Job 'fetch feedback', Task '<function test_make at 0x7f91fd123d90>' on background thread
test running 2023-02-27 12:35:00.098939 (Malaysia Time)
i hope can run in same day too.
Fix should be in the next RC 🙂