clearml Unexpected sending source code to demo server - Python

I started to check "trains", implemented sample with help of

from trains import Task

run it and found my sources code on public demo server. Also, I don't see a way to delete it.

Asked Oct 21 '21 02:10
avatar constructor-igor
constructor-igor

9 Answer:

Hi @pedropalb,

Just do:

from trains_agent import APIClient
client = APIClient()
tasks = client.tasks.get_all(system_tags=['archived'], only_fields=['id'])
for task in tasks:
  client.tasks.delete(task=task.id)

APIClient.tasks.get_all() provides several query parameters, you can see its docstring by typing help(client.tasks.get_all) in your python console (or client.tasks.get_all? if you're using IPython)

1
Answered Mar 31 '20 at 07:53
avatar  of bmartinn
bmartinn

Thanks @ainoam! maybe add it to the docs? anyway for future reference if someone sees this:

Task.set_credentials() and sits in task.py

1
Answered Jan 12 '21 at 18:28
avatar  of YairMen
YairMen

Hi @constructor-igor,

First of all, please know you can reset the experiment in the public demo server by right-clicking on your experiment in the experiments list and than edit the "Execution\Uncommitted Changes" section to delete any source code that was logged.

Trains is designed to run with a local server - we really tried to make it as simple as possible :) - see Configuring your own TRAINS server. Out of the box, trains will use the public demo server to allow you to quickly try it out before deciding to install your own server instance.

If you do have a local server installed and configured trains to use it, but still trains uses the public demo server, please let me know so we can investigate this issue.

As for the source code, trains is designed to help you track the source used for your experiment by storing the git repository reference along with the branch, tag or commit ID, as well as any locally modified source files in your git repository. If you're not using a git repository and simply run a python script file, trains will store this file as part of the experiment. This feature is an integral part of the trains and trains-agent ecosystem.

For this reason, we strongly recommend anyone using trains to run their own local server, especially when using you own training code and not just trying it out.

1
Answered Feb 04 '20 at 17:51
avatar  of bmartinn
bmartinn

First of all, please know you can reset the experiment in the public demo server by right-clicking on your experiment in the experiments list and than edit the "Execution\Uncommitted Changes" section to delete any source code that was logged.

please, could you provide menu command with name "delete". It will be more clear.

1
Answered Feb 05 '20 at 18:54
avatar  of constructor-igor
constructor-igor

Out of the box, trains will use the public demo server to allow you to quickly try it out before deciding to install your own server instance.

It's a good feature! But I have a problem to run copy paste command and find my code on public site. Probably, could you provide a initialization command with parameters like: nameofserver, sendingsourcecode, etc. It will allow me to understand all hidden options and define level of sending data. Now, "trains" sends data without any parameters. How can I be sure, if it will not send my data (even I use private server)? Pay attention, It can stop using of the service in real algorithms development.

suggested approach:

from trains import Task

Task.init(server="public_demo", sending_source=True)

where public_demo, seems, should be actual address.

1
Answered Feb 05 '20 at 19:00
avatar  of constructor-igor
constructor-igor

Hi @constructor-igor , thank you for the suggestion! Currently there is a way to setup Trains to connect to a specific trains-server from code, it is quite useful when you have no access to local filesystem (i.e. cannot edit ~/trains.conf), for example when using Jupyter Notebook on a remote machine. You can check the interface here

Regrading deleting your experiment, In the UI the easiest way to go about it is to right-click the experiment and archive it. Obviously there is a way to delete experiments, but we had the feeling it is safer to move them to "archive" instead of actually deleting them.

That said, you can of course delete an experiment from code. This is achieved with the help of the trains-agent package, for example deleting task id aabb112233:

from trains_agent import APIClient
client = APIClient()
client.tasks.delete(task='aabb112233')
1
Answered Feb 05 '20 at 21:55
avatar  of bmartinn
bmartinn

Hi @bmartinn! And what if I wanted to delete all archived tasks? Do I have to get their ids one by one? Is there a query interface for the entities? Something like client.tasks.query(**predicates). Thanks!

1
Answered Mar 31 '20 at 00:12
avatar  of pedropalb
pedropalb

sorry to hijack the post, @bmartinn, the link you provided to programatically setup clearml to use a specific clearml-server seems to be broken, mind re-sharing it? i've been looking for just that

1
Answered Jan 12 '21 at 15:25
avatar  of YairMen
YairMen

@YairMen Trick is to look at the version which correlates to the state of 'master' at the time the original message was written (link). @bmartinn referred to the Task.set_credentials interface (which is now here)

1
Answered Jan 12 '21 at 16:11
avatar  of ainoam
ainoam