generated from jaspersnel/v6-boilerplate-py
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.py
37 lines (30 loc) · 921 Bytes
/
run.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
from vantage6.client import Client
from pathlib import Path
import time
print("Attempt login to Vantage6 API")
client = Client("http://localhost", 5000, "/api")
client.authenticate("node1-user", "node1-password")
client.setup_encryption(None)
input_ = {
"master": "true",
"method":"master",
"args": [],
"kwargs": {}
}
print("Requesting to execute colnames algorithm")
task = client.post_task(
name="testing",
image="jaspersnel/v6-colnames-py",
collaboration_id=client.collaboration.list()[0]['id'],
input_= input_,
organization_ids=[client.collaboration.list()[0]['organizations'][0]['id']]
)
print("Wait and fetch results")
res = client.result.get(id_=task.get("results")[0]['id'])
attempts=1
while((res["result"] == None) and attempts < 7):
print("waiting...")
time.sleep(5)
res = client.result.get(id_=task.get("results")[0]['id'])
attempts += 1
print(res)