Reputation
Badges 1
13 × Eureka!Hey @<1523701205467926528:profile|AgitatedDove14> I need to access it programmatically. Just like we get the task id by Task.get_task().id
Hey @<1523701435869433856:profile|SmugDolphin23> ,
Thanks for your response !
Code : line 110 in None
ClearML version: I'm using app.clear.ml itself. And my agent version is clearml-agent 1.5.2
why aren't you coping the Pipeline ID from the UI? --> I have tried this and it works but let's say if I updated the pipeline code, then will have to rerun the pipeline code then manually get the id and update the task. But if there is way in which I can directly fetch the id using pipeline name, it'll allow me to get the latest pipeline to be scheduled without manual intervention. Please correct if my understanding is wrong.
task_to_schedule = Task.get_task(project_name='MyProject/.p...
Hi @<1523701205467926528:profile|AgitatedDove14> , It works if I dont specify the project name and just give the task name. So I modified the above code a bit and now I'm able to get the id of the latest pipeline run.
task_to_schedule: Task = Task.get_task(task_id='b0732c334115432f8dc0cec0dbfdbdcb')
print(task_to_schedule.get_project_name())
# Output: Project Team NASA/.pipelines/NASA Pipeline
print(task_to_schedule.name)
# Output: NASA Pipeline #11
# task: Task = Task.get_task(proje...
Thanks for your response @<1523701070390366208:profile|CostlyOstrich36> 🙂
I thought about doing the same but clearml setup is done using root privileges so even cache folder is generated with root privilege. So I was just wondering if clearml CLI exposes any API to refresh cache.
Hi @<1523701205467926528:profile|AgitatedDove14> , The code returns the project, but if I use the same project in get_task
it's throwing ValueError
task_to_schedule: Task = Task.get_task(task_id='b0732c334115432f8dc0cec0dbfdbdcb')
print(task_to_schedule.get_project_name())
# Output: Project Team NASA/.pipelines/NASA Pipeline
print(task_to_schedule.name)
# Output: NASA Pipeline #11
task: Task = Task.get_task(project_name=task_to_schedule.get_project_name(),
...
Thanks for your response @<1523701070390366208:profile|CostlyOstrich36> !
Please find the full log here: None
@<1523701087100473344:profile|SuccessfulKoala55> @<1523701205467926528:profile|AgitatedDove14> Same results, it's not able to find the Project
tasks = Task.get_tasks(project_name=task_to_schedule.get_project_name(),
task_name=task_to_schedule.name,
task_filter={"search_hidden": True})
print([task.name for task in tasks])
# Output:
# 2023-07-09 11:08:11,693 - clearml - WARNING - No projects were found with name(s): Project Team NA...
@<1523701070390366208:profile|CostlyOstrich36> I believe it is something to do with local cache, I changed the cache location to a different directory in clearml.conf and the issue is resolved.
Same error
task_to_schedule: Task = Task.get_task(task_id='b0732c334115432f8dc0cec0dbfdbdcb')
print(task_to_schedule.get_project_name())
# Output: Project Team NASA/.pipelines/NASA Pipeline
print(task_to_schedule.name)
# Output: NASA Pipeline #11
task: Task = Task.get_task(project_name=task_to_schedule.get_project_name(),
task_name=task_to_schedule.name,
task_filter={"search_hidden": True})
print(task.id)
# Error: ValueError: No pr...
But this is a different script for TaskScheduler
, something like below:
scheduler = TaskScheduler(...)
task_to_schedule = Task.get_task(project_name='MyProject',
task_name='MyTask')
scheduler.add_task(schedule_task_id=task_to_schedule.id, ...)
# Do we have something similar to this? Like below
# pipeline_to_schedule = Task.get_task(project_name='MyProject',
# task_name='MyPipeline')
# scheduler.add_task(schedule_...