Hi AgitatedDove14 thanks for the answer.
I'm using python doit: https://pydoit.org/ to schedule multiple steps. Basically, it does subprocess.Popen for each step. In each step (=subprocess) I get the task using
t0: doit -> parent proc creates new Task t1: |_ child proc: current_task() and do smth t2: |_ child proc: current_task() and do smth
My question is what happens if I launch in parallel multiple doit commands that create new Tasks. I would like to confirm that current_task will get the correct task instead of some other task...
would like to understand the limitations of
Basically this will always get you an instance of the current Task. This will work from sub-processes as well as the main process. Is there a specific scenario you have in mind, or a challenge with the use case ?
current task fetches the good Task
Assuming you fork the process than the gloabl instance" is passed to the subprocess. Assuming the sub-process was spawned (e.g. POpen) then an environement variable with the Task's unique ID is passed. then when you call the "Task.current_task" it "knows" the Task was already created and it will fetch the state from the clearml-server and create a new Task object for you to work with.
BTW: please use the latest RC (we fixed an issue with exactly this use case)
pip install clearml==1.0.4rc0