@@ -84,11 +84,13 @@ def get_json(filename, run_id=None, artifact=False):
84
84
return data
85
85
86
86
87
- def sender () -> str :
87
+ def sender (
88
+ server_url : typing .Optional [str ] = None , server_token : typing .Optional [str ] = None
89
+ ) -> str :
88
90
"""
89
91
Asynchronous upload of runs to Simvue server
90
92
"""
91
- directory = SimvueConfiguration .fetch ().offline .cache
93
+ directory = SimvueConfiguration .fetch (mode = "offline" ).offline .cache
92
94
93
95
# Clean up old runs after waiting 5 mins
94
96
runs = glob .glob (f"{ directory } /*/sent" )
@@ -116,13 +118,17 @@ def sender() -> str:
116
118
logger .info ("Lauching %d workers" , NUM_PARALLEL_WORKERS )
117
119
with ThreadPoolExecutor (NUM_PARALLEL_WORKERS ) as executor :
118
120
for run in runs :
119
- executor .submit (process (run ))
121
+ executor .submit (
122
+ process (run , server_token = server_token , server_url = server_url )
123
+ )
120
124
return [executor .result () for _ in runs ]
121
125
else :
122
126
return [process (run ) for run in runs ]
123
127
124
128
125
- def process (run ) -> typing .Optional [str ]:
129
+ def process (
130
+ run , server_url : typing .Optional [str ], server_token : typing .Optional [str ]
131
+ ) -> typing .Optional [str ]:
126
132
"""
127
133
Handle updates for the specified run
128
134
"""
@@ -173,7 +179,9 @@ def process(run) -> typing.Optional[str]:
173
179
# Create run if it hasn't previously been created
174
180
created_file = f"{ current } /init"
175
181
name = None
176
- config = SimvueConfiguration .fetch ()
182
+ config = SimvueConfiguration .fetch (
183
+ mode = "online" , server_token = server_token , server_url = server_url
184
+ )
177
185
if not os .path .isfile (created_file ):
178
186
remote = Remote (
179
187
name = run_init ["name" ], uniq_id = id , config = config , suppress_errors = False
0 commit comments