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
How Can I Use The Python Sdk To Access 2 Tasks That Live In Different Clearml Hosts? I Want To Do This In 1 Python Script. Currently I Can Set A Session To The Host Of The First Task, But The Environment Variables Are Caching Somewhere So I Cannot Access

How can I use the python SDK to access 2 tasks that live in different ClearML hosts? I want to do this in 1 python script. Currently I can set a session to the host of the first task, but the environment variables are caching somewhere so I cannot access the 2nd task. Example code in thread 🧵

  
  
Posted 20 days ago
Votes Newest

Answers 4


from clearml import Task

Task.set_credentials(
    api_host=api_host_1,
    web_host=web_host_1,
    files_host=file_host_1,
    key=key_1,
    secret=secret_1
)
# CAN get tasks from session 1
task_from_host_1 = Task.get_tasks(tags=["tag_1"], task_filter = {"status":["completed"]})


# below does not work, still tries to access session 1
Task.set_credentials(
    api_host=api_host_2,
    web_host=web_host_2,
    files_host=file_host_2,
    key=key_2,
    secret=secret_2
)

task_from_host_2 = Task.get_tasks(tags=["tag_2"], task_filter = {"status":["completed"]}) # still returns from session 1
  
  
Posted 20 days ago

Thanks @<1523701087100473344:profile|SuccessfulKoala55> , when calling this _set_default_session , I still get the error in the second call:

clearml.backend_api.session.session.LoginError: Failed getting token (error 401 from <server_1_path>): Unauthorized (invalid credentials) (failed to locate provided credentials)

This implies that there is still caching because the second call is still trying to access the first server path.

  
  
Posted 19 days ago

Hi @<1889122160853651456:profile|StoutArcticwolf12> , try adding this before the second set_credentials() :

from clearml.backend_interface.base import InterfaceBase
InterfaceBase._set_default_session(None)
  
  
Posted 20 days ago

@<1523701435869433856:profile|SmugDolphin23> This is what I mentioned today

  
  
Posted 14 days ago
138 Views
4 Answers
20 days ago
14 days ago
Tags