Thanks for response.
from clearml import Task
from clearml.automation import TaskScheduler
from datetime import timedelta, datetime
def my_task():
task = Task.init(...)
# do somthinge
print("do something")
# sleep 10
condition = True
if condition:
# i want to trigger run another task by
# set some config in task, but execute tomorrow/sometime
# not directly run at the time.
# here i use
task_id = task.id
task.close()
task_clone:Task = Task.get_task(task_id=task_id)
# schedule running a task for tomorrow
now = datetime.utcnow()
schedule_time = now + timedelta(days=1, minutes=30)
hour = schedule_time.hour
minute = schedule_time.minute
scheduler = TaskScheduler(
sync_frequency_minutes=60,
force_create_task_name='Scheduler Task',
force_create_task_project='Automation/Controller',
)
# here i run my task
scheduler.add_task(
target_project=task_clone.project,
queue='cpu-nomad-preprod',
name=task_clone.name,
schedule_task_id=task_clone.id,
minute=minute,
hour=hour,
day=1,
recurring=False,
task_parameters ={
"params/limit_per_day": params["limit_per_day"], # limit perday, before 15k
"params/csv_url": params["csv_url"],
"params/zoom_level": params["zoom_level"],
"params/pond_type": params["pond_type"],
},
single_instance=True
)
pass
print("task end")
i tried do that, but it seems cannot do. do you have another solutions?
Hi @<1523701260895653888:profile|QuaintJellyfish58> , if the first task ended, how would you be able to start another task from that code? This sounds like a pipeline 🙂
I would suggest talking a look at pipelines: None
sorry, but can clearml pipeline do this scenario?
You can pass results to the reporting task, and simply decide not to do anything there on a condition (no need for intermediate logic)