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
Can Anybody Give A Code Example Of How To Do Runtime Changes To Taskscheduler?

Can anybody give a code example of how to do runtime changes to TaskScheduler?

https://clear.ml/docs/latest/docs/references/sdk/scheduler/#class-automationtaskscheduler

i've already asked this before, see: https://clearml.slack.com/archives/CTK20V944/p1671326416374569

  
  
Posted one year ago
Votes Newest

Answers 2


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 result
scheduler_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

  
  
Posted one year ago

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?

  
  
Posted one year ago
533 Views
2 Answers
one year ago
one year ago
Tags