Thanks @<1523704157695905792:profile|VivaciousBadger56> ! great work on the docstring, I also really like the extended example. Let me make sure someone merges it
In the documentation it warns about
.close()
"Only call Task.close if you are certain the Task is not needed."
Maybe this is not clear enough, this means you do not need to automatically Add/Log/Track things into the Task in the current process.
This does Not mean you cannot access the Task or its artifacts
Mark closed means to externally (i..e not from the process that crated the Task, maybe even from a different machine) close and mark the task as completed (this will also means the process running the Task will be closed by the clearml SDK).
does that make sense ?
Ok, I checked: A is terminated. This is not what I thought would happen and not what I intended with my documentation. I should clarify that.
@<1523701205467926528:profile|AgitatedDove14> : Wait, so, if a task is initialized in process A and I call mark_completed
in a process B, which process is terminated? A or B?
Is
mark_completed
used to complete a task from a different process and
close
from the same process - is that the idea?
Yes
However, when I tried them out,
mark_completed
terminated the process that called
mark_completed
.
Yes if you are changing the state of the Task externally or internally the SDK will kill the process. If you are calling task.close()
from the process that created the Task it will gracefully close the Task (but not the process)
@<1523701205467926528:profile|AgitatedDove14>
@<1523701205467926528:profile|AgitatedDove14> In the documentation it warns about .close()
"Only call Task.close if you are certain the Task is not needed."
What does the documentation refer to? My understanding would be that if close the task within a program, I am not able to use the task object anymore as before and I need to retrieve it via query_tasks
to get it again. Is that correct?
@<1523701205467926528:profile|AgitatedDove14> : "does that make sense ?" Not really.
"you do not need to automatically Add/Log/Track things into the Task in the current process." - I do not need to automatically do [...]? You mean I can do it automatically, but alternatively I can do it manually? Do you mean I use close
within a process to prevent automatic logging/adding/tracking? But, as far as I know, after I used close
I am not able to log etc. manually either. So...
"Mark closed" - do you mean close
or mark_completed
?
Is mark_completed
used to complete a task from a different process and close
from the same process - is that the idea? However, when I tried them out, mark_completed
terminated the process that called mark_completed
. In fact, I wrote that into the docstring of mark_completed
and made a pull request, which got accepted. See None
Similarly I updated None
Please check if that was done correctly and update the docstrings accordingly.
Hi @<1523704157695905792:profile|VivaciousBadger56>
You should replace
task.mark_completed()
with:
task.close()
To your point
parameters = task.connect(parameters)
Will be retrieved with:
task.get_parameters()
fyi:
connect_configuration -> get_configuration_objects
Secondly, I do not understand this:
None says
Manually mark a Task as completed. This will close the running process and will change the Task’s status to Completed (Use this function to close and change status of remotely executed tasks). To simply change the Task’s status to completed, use task.close()
None says
Closes the current Task and changes its status to completed. Enables you to manually shutdown the task.
danger: Only call Task.close if you are certain the Task is not needed.
What is the difference? My understanding is, that mark_completed additionally (in contrast to close), kills the current Python process on my local machine. Is that right?