Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escaping: Escape characters +-&|!(){}[]^"~*?:\ with \, e.g. \+
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Answered
Hi, I Am Try To Use Taskscheduler As Cronjob, I Want My Task Running Every 2.40 Am Utc Everyday,

Hi,
i am try to use TaskScheduler as cronjob, i want my task running every 2.40 am UTC everyday,

    task_scheduler.add_task(
        target_project='Automation/feedback_jobs',
        queue='cpu-ssd',
        name='fetch feedback',
        schedule_task_id='96f0f3051720448f9ab9b5d4d9a013cc',
        minute=40, hour=2, day=1,
        recurring=True,
        # execute_immediately= True,
        task_overrides={'script.branch':'main', 'script.commit':'latest'},
        starting_time= datetime.datetime(year=2023,month=1, day=1, hour=0,minute=0, second=0),

    )

but it seems not working, am i do wrong?

  
  
Posted one year ago
Votes Newest

Answers 7


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',

    )
  
  
Posted one year ago

i running this on 2.35 am, but the job not launching after 2.40 am

  
  
Posted one year ago

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 ?

  
  
Posted one year ago

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

  
  
Posted one year ago

I found the issue, the first run it jumps over the first day (let me check if we can quickly fix that)

  
  
Posted one year ago

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)
  
  
Posted one year ago

i hope can run in same day too.

Fix should be in the next RC 🙂

  
  
Posted one year ago
1K Views
7 Answers
one year ago
one year ago
Tags