Hi GloriousPenguin2 , have you tried the method you mentioned in the previous thread?
Like fetching the task of the scheduler and then changing the configuration json?
CostlyOstrich36 yes i tried, it does nothing
namely, changing this value does nothing, doesn't even affect the running tasktask = Task.get_task(task_id="...") # valid task task._data.configuration['schedule'].value # the value of config that contains schedule
2. tried to make schedule modifiable via Task.connect
+ TaskScheduler.add_task
, no resultscheduler_clearml_dict = {"config connected": [1, 2]} task.connect(scheduler_clearml_dict) # <- this config is later modified at runtime to
[1, 2, 3]`
%%
scheduler.start()
def simple_function():
print("This code is executed in a background thread, " "on the same machine as the TaskScheduler process")
# add some logic here
print("done")
iter_list = task.get_parameter("General/config connected")
for i in iter_list:
scheduler.add_task(
name=f"scheduled task {i}",
schedule_function=simple_function,
queue="debug-1",
day=1,
recurring=True,
single_instance=True,
execute_immediately=True,
)
scheduler.start() 3. tried to modify
BaseScheduler sources to make it instantiate from
Task.get_task ` output, https://github.com/allegroai/clearml/blob/8cb4ac2acb3a314f7ecb3017903d0cccf9f745de/clearml/automation/scheduler.py#L292-L300
no result either - the supposedly fetched TaskScheduler
doesn't contain any state
So i found no way to properly modify TaskScheduler
's schedule at runtime