Skip to content

Commit f213744

Browse files
authored
Merge pull request #584 from FedML-AI/test/v0.7.0
Test/v0.7.0
2 parents faef960 + d3c0ee6 commit f213744

File tree

13 files changed

+114
-66
lines changed

13 files changed

+114
-66
lines changed

python/app/fedcv/object_detection/config/bootstrap.bat

100644100755
File mode changed.

python/app/fedcv/object_detection/config/bootstrap.sh

100644100755
File mode changed.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/usr/bin/env bash
22
RUN_ID=$1
3-
python3 torch_server.py --cf config/krum/fedml_config.yaml --rank 0 --role server --run_id $RUN_ID
3+
python3 torch_server.py --cf config/foolsgold/fedml_config.yaml --rank 0 --role server --run_id $RUN_ID
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
:: ### don't modify this part ###
2+
:: ##############################
3+
4+
5+
:: ### please customize your script in this region ####
6+
set DATA_PATH=%userprofile%\fedml_data
7+
mkdir %DATA_PATH%
8+
9+
10+
:: ### don't modify this part ###
11+
echo [FedML]Bootstrap Finished
12+
:: ##############################

python/examples/cross_silo/mqtt_s3_fedavg_mnist_lr_example/custom_data_and_model/config/bootstrap.sh

100644100755
File mode changed.

python/fedml/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
_global_training_type = None
2424
_global_comm_backend = None
2525

26-
__version__ = "0.7.321"
26+
__version__ = "0.7.326"
2727

2828

2929
def init(args=None):

python/fedml/cli/edge_deployment/client_constants.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
import os
3+
import platform
34
import shutil
45
import signal
56
import subprocess
@@ -217,9 +218,15 @@ def exit_process(process):
217218
@staticmethod
218219
def exec_console_with_script(script_path, should_capture_stdout_err=False):
219220
if should_capture_stdout_err:
220-
script_process = subprocess.Popen(['sh', '-c', script_path], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
221+
if platform.system() == 'Windows':
222+
script_process = subprocess.Popen(script_path, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
223+
else:
224+
script_process = subprocess.Popen(['sh', '-c', script_path], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
221225
else:
222-
script_process = subprocess.Popen(['sh', '-c', script_path], stdout=sys.stdout, stderr=subprocess.PIPE)
226+
if platform.system() == 'Windows':
227+
script_process = subprocess.Popen(script_path, stdout=sys.stdout, stderr=subprocess.PIPE)
228+
else:
229+
script_process = subprocess.Popen(['sh', '-c', script_path], stdout=sys.stdout, stderr=subprocess.PIPE)
223230
return script_process
224231

225232
@staticmethod

python/fedml/cli/edge_deployment/client_runner.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,20 +252,27 @@ def build_dynamic_args(self, run_config, package_conf_object, base_dir):
252252
if bootstrap_script_path is not None:
253253
if os.path.exists(bootstrap_script_path):
254254
bootstrap_stat = os.stat(bootstrap_script_path)
255-
os.chmod(bootstrap_script_path, bootstrap_stat.st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
256-
bootstrap_scripts = "cd {}; ./{}".format(bootstrap_script_dir, os.path.basename(bootstrap_script_file))
255+
if platform.system() == 'Windows':
256+
os.chmod(bootstrap_script_path, bootstrap_stat.st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
257+
bootstrap_scripts = "{}".format(bootstrap_script_path)
258+
else:
259+
os.chmod(bootstrap_script_path, bootstrap_stat.st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
260+
bootstrap_scripts = "cd {}; ./{}".format(bootstrap_script_dir, os.path.basename(bootstrap_script_file))
261+
bootstrap_scripts = str(bootstrap_scripts).replace('\\', os.sep).replace('/', os.sep)
257262
logging.info("Bootstrap scripts are being executed...")
258263
process = ClientConstants.exec_console_with_script(bootstrap_scripts, should_capture_stdout_err=True)
259264
ret_code, out, err = ClientConstants.get_console_pipe_out_err_results(process)
260265
if out is not None:
261266
out_str = out.decode(encoding="utf-8")
262-
if str(out_str).find(FedMLClientRunner.FEDML_BOOTSTRAP_RUN_OK) == -1:
267+
if str(out_str).find(FedMLClientRunner.FEDML_BOOTSTRAP_RUN_OK) == -1 \
268+
and str(out_str).lstrip(' ').rstrip(' ') != '':
263269
logging.error("{}".format(out_str))
264270
else:
265271
logging.info("{}".format(out_str))
266272
if err is not None:
267273
err_str = err.decode(encoding="utf-8")
268-
if str(err_str).find(FedMLClientRunner.FEDML_BOOTSTRAP_RUN_OK) == -1:
274+
if str(err_str).find(FedMLClientRunner.FEDML_BOOTSTRAP_RUN_OK) == -1 \
275+
and str(err_str).lstrip(' ').rstrip(' ') != '':
269276
logging.error("{}".format(err_str))
270277
else:
271278
logging.info("{}".format(err_str))

python/fedml/cli/server_deployment/server_constants.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
import json
33
import os
4+
import platform
45
import signal
56
import subprocess
67
import sys
@@ -193,9 +194,15 @@ def exit_process(process):
193194
@staticmethod
194195
def exec_console_with_script(script_path, should_capture_stdout_err=False):
195196
if should_capture_stdout_err:
196-
script_process = subprocess.Popen(['sh', '-c', script_path], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
197+
if platform.system() == 'Windows':
198+
script_process = subprocess.Popen(script_path, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
199+
else:
200+
script_process = subprocess.Popen(['sh', '-c', script_path], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
197201
else:
198-
script_process = subprocess.Popen(['sh', '-c', script_path], stdout=sys.stdout, stderr=subprocess.PIPE)
202+
if platform.system() == 'Windows':
203+
script_process = subprocess.Popen(script_path, stdout=sys.stdout, stderr=subprocess.PIPE)
204+
else:
205+
script_process = subprocess.Popen(['sh', '-c', script_path], stdout=sys.stdout, stderr=subprocess.PIPE)
199206
return script_process
200207

201208
@staticmethod

python/fedml/cli/server_deployment/server_runner.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -273,22 +273,28 @@ def build_dynamic_args(self, run_config, package_conf_object, base_dir):
273273
if bootstrap_script_path is not None:
274274
if os.path.exists(bootstrap_script_path):
275275
bootstrap_stat = os.stat(bootstrap_script_path)
276-
os.chmod(bootstrap_script_path, bootstrap_stat.st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
277-
bootstrap_scripts = "cd {}; ./{}".format(bootstrap_script_dir,
278-
os.path.basename(bootstrap_script_file))
276+
if platform.system() == 'Windows':
277+
os.chmod(bootstrap_script_path, bootstrap_stat.st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
278+
bootstrap_scripts = "{}".format(bootstrap_script_path)
279+
else:
280+
os.chmod(bootstrap_script_path, bootstrap_stat.st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
281+
bootstrap_scripts = "cd {}; ./{}".format(bootstrap_script_dir, os.path.basename(bootstrap_script_file))
282+
bootstrap_scripts = str(bootstrap_scripts).replace('\\', os.sep).replace('/', os.sep)
279283
logging.info("Bootstrap scripts are being executed...")
280284
process = ServerConstants.exec_console_with_script(bootstrap_scripts,
281285
should_capture_stdout_err=True)
282286
ret_code, out, err = ServerConstants.get_console_pipe_out_err_results(process)
283287
if out is not None:
284288
out_str = out.decode(encoding="utf-8")
285-
if str(out_str).find(FedMLServerRunner.FEDML_BOOTSTRAP_RUN_OK) == -1:
289+
if str(out_str).find(FedMLServerRunner.FEDML_BOOTSTRAP_RUN_OK) == -1 \
290+
and str(out_str).lstrip(' ').rstrip(' ') != '':
286291
logging.error("{}".format(out_str))
287292
else:
288293
logging.info("{}".format(out_str))
289294
if err is not None:
290295
err_str = err.decode(encoding="utf-8")
291-
if str(err_str).find(FedMLServerRunner.FEDML_BOOTSTRAP_RUN_OK) == -1:
296+
if str(err_str).find(FedMLServerRunner.FEDML_BOOTSTRAP_RUN_OK) == -1 \
297+
and str(err_str).lstrip(' ').rstrip(' ') != '':
292298
logging.error("{}".format(err_str))
293299
else:
294300
logging.info("{}".format(err_str))

0 commit comments

Comments
 (0)