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
Unanswered
Hello, I Have Another, Hopefully Minor Question. What Is The Recommended Way Of Checking If A Code Segment Is Running As A Part Of A Task Or Not? I Tried Checking The Return Value Of


Hi AgitatedDove14 ,

Continuing from the previous question: Is it possible to detect remote Task execution before the remote Task.init(...) function call?

For example, when I run this:
print("Doing some computations that MUST be local") # I want to prevent this from running remotely task = Task.init("OMD", task_name="bla") task.set_base_docker("/home/rdekel/anaconda3/envs/P1") cloned_task = Task.clone(source_task=task, name="Clone") Task.enqueue(cloned_task.id, queue_name="ron_lambda_cpu_queue") task.close()The "computation" happens both locally and remotely, while I want it to only happen locally.

Although it is possibly, in principle, to use Task.current_task().running_locally(), I want to test for local vs. remote execution before the Task.init function call, so running_locally() is inaccessible.

Is there a simple, Task-independent way to tell apart local and remote execution? And if not, can I use the environment variables that clearml sets when a process is executing externally (I believe CLEARML_TASK_ID is one such option)?

I realize in the toy example above it appears trivial to replace the order of the print() and the Task.init(), but it would be difficult (and inelegant) in my actual use-case.

Thanks again for the help! :)
Ron

  
  
Posted 2 years ago
93 Views
0 Answers
2 years ago
one year ago