Hi PompousParrot44 , you mean delete experiment?
yes delete experiments which are old or for some other reason are not required to keep around
You can loop over the tasks you want to delete, Based on the cleanup service:
` import logging
from trains.backend_api.session.client import APIClient
client = APIClient()
you can get the tasks you want to delete with client.tasks.get_all, in this example we will get you all the tasks in a project, but you have other filters too
tasks = client.tasks.get_all(project=[<your project id>])
for task in tasks:
try:
# try delete a task from system
client.tasks.delete(task=task.id) # you also have a force param, you can add force=True if you like
except Exception as ex:
logging.warning(
"Could not delete Task ID={}, {}".format(
task.id, ex.message if hasattr(ex, "message") else ex
)
) `This will delete all the tasks in a project for example
TimelyPenguin76 is there any way to do this using UI directly or as a schedule... otherwise i think i will run the cleanup_service as given in docs...
that seems like a bit of extra thing a user needs to bother about.. better deployment model should be that its part of api-server deployment and configurable from UI itself.. may be i am asking too much 😛
Unfortunately, it is not possible to delete an experiment using the UI. You can run the script as a service like in the example or run it with job scheduler (crontab for example in linux) to execute it.
Can this do the trick?
i think for now it should do the trick... was just thinking about the roadmap part
PompousParrot44 obviously you can just archive a task and run the cleanup service, it will actually delete archived tasks older than X days.
https://github.com/allegroai/trains/blob/master/examples/services/cleanup/cleanup_service.py