clearml icon indicating copy to clipboard operation
clearml copied to clipboard

Delete example tasks, projects, and models from ClearML server

Open fjean opened this issue 2 years ago • 4 comments

Trying to remove the example tasks, projects, and models from ClearML server (Docker image), but it cannot be done from the UI, so I tried to do it using the API:

from clearml.backend_api.session.client import APIClient
client = APIClient()
print(client.tasks.get_all())

# Select one of the shown task IDs
client.tasks.delete("e8e09741583b4a0499baf588eb3f8bdb", force=True)

But I get this error:

APIError: APIError: code 403/21: Forbidden (modification not allowed) (cannot modify public task(s), ids=('e8e09741583b4a0499baf588eb3f8bdb',))

Is there something else I need to do for removing all those examples?

fjean avatar Sep 07 '22 16:09 fjean

Hi @fjean, In which way are these examples getting in your way? Is this about conserving resources or de-cluttering the UI?

ainoam avatar Sep 07 '22 16:09 ainoam

@ainoam Yeah it's more about de-cluttering the UI, I don't think they consume that much resources

fjean avatar Sep 07 '22 16:09 fjean

@fjean Gotcha. Indeed there's currently no easy way to remove these examples. Have you noticed that as you create more projects, the examples get pushed away out of view?

ainoam avatar Sep 07 '22 16:09 ainoam

@ainoam Yes indeed, so they should appear at the bottom of the list, eventually.

That would still be a good feature to add to the server, to be able to remove these examples (maybe by just making them normal projects/tasks/models that can be dealt with like any other user-generated items)

fjean avatar Sep 07 '22 16:09 fjean

I agree, it would be great to be able to delete them to declutter the UI. I want to go to my project without having to look for the right folder. They actually don't provide any value if you know how clear ml works.

maria8899 avatar Nov 09 '22 20:11 maria8899

Thanks for chiming in @maria8899.

I think we'll add a "hide examples" control to the UI Settings page in one of the coming versions - Does that makes sense? @fjean ?

ainoam avatar Nov 10 '22 14:11 ainoam

@ainoam That would make sense to have that option in the UI.

fjean avatar Nov 10 '22 15:11 fjean

@maria8899 @fjean One of the coming UI releases will have a user option to choose whether or not to show these built-in examples. Makes sense?

ainoam avatar Nov 17 '22 13:11 ainoam

Yes! Thank you!

maria8899 avatar Nov 18 '22 16:11 maria8899

Hey @fjean! clearml-server v1.9.0 is now out with a user option to not show example content in the UI

pollfly avatar Jan 23 '23 08:01 pollfly

@pollfly thanks!

fjean avatar Jan 25 '23 23:01 fjean

Hi there @ainoam @pollfly, I am using version 1.9.2, I've checked the user option "dont show examples", but now it also shows this new "DevOps Services" project example that is not my work!

Ok this one I can delete it so I guess it's fine!

maria8899 avatar Mar 07 '23 19:03 maria8899

Here is what I did:

  1. Expose Mongo DB port in docker-compose file by adding
    ports:
     - "27017:27017"
    
  2. Connect with any DB Tool or with mongo cli
  3. Get your company id from the user collection of the backend db
  4. Add this company id to all tasks, models and projects in the task, project and model collections
  5. Change the status for all tasks in the task collection to created
  6. Archive and delete all experiments, models and reports in the Web GUI
  7. There are two datasets remaining which I can not find in the Web GUI. Find their ids in the task collection in the db and change their status to draft.
  8. Delete them by using clearml-data delete --id DATASET_ID

That way I got a nice and clean setup. Don't forget to remove the exposed mongo port from the compose file.

DominikMa avatar May 08 '24 11:05 DominikMa

Closing this as this is not expected to be supported and a community suggestion is provided above

jkhenning avatar May 08 '24 12:05 jkhenning