Skip to content

Commit

Permalink
update testing scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
hasan7n committed Jul 30, 2024
1 parent e749925 commit fe4bd92
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 73 deletions.
135 changes: 64 additions & 71 deletions cli/cli_tests_training.sh
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,58 @@ checkFailed "submit plan failed"

echo "\n"

##########################################################
echo "====================================="
echo "start event"
echo "====================================="
echo "[email protected]: [email protected]" >>./testcols.yaml
echo "[email protected]: [email protected]" >>./testcols.yaml
print_eval medperf training start_event -n event1 -t $TRAINING_UID -p ./testcols.yaml -y
checkFailed "start event failed"
rm ./testcols.yaml

##########################################################

echo "\n"

##########################################################
echo "====================================="
echo "Activate aggowner profile"
echo "====================================="
print_eval medperf profile activate testagg
checkFailed "testagg profile activation failed"
##########################################################

echo "\n"

##########################################################
echo "====================================="
echo "Get aggregator cert"
echo "====================================="
print_eval medperf certificate get_server_certificate -t $TRAINING_UID
checkFailed "Get aggregator cert failed"
##########################################################

echo "\n"

##########################################################
echo "====================================="
echo "Starting aggregator"
echo "====================================="
print_eval medperf aggregator start -t $TRAINING_UID -p $HOSTNAME_ </dev/null >agg.log 2>&1 &
AGG_PID=$!

# sleep so that the mlcube is run before we change profiles
sleep 7

# Check if the command is still running.
if [ ! -d "/proc/$AGG_PID" ]; then
checkFailed "agg doesn't seem to be running" 1
fi
##########################################################

echo "\n"

##########################################################
echo "====================================="
echo "Activate dataowner profile"
Expand Down Expand Up @@ -351,77 +403,6 @@ fi

echo "\n"

##########################################################
echo "====================================="
echo "Activate modelowner profile"
echo "====================================="
print_eval medperf profile activate testmodel
checkFailed "testmodel profile activation failed"
##########################################################

echo "\n"

##########################################################
echo "====================================="
echo "Approve data1 association"
echo "====================================="
print_eval medperf association approve -t $TRAINING_UID -d $DSET_1_UID
checkFailed "data1 association approval failed"
##########################################################

echo "\n"

##########################################################
echo "====================================="
echo "Approve data2 association"
echo "====================================="
print_eval medperf association approve -t $TRAINING_UID -d $DSET_2_UID
checkFailed "data2 association approval failed"
##########################################################

echo "\n"

##########################################################
echo "====================================="
echo "start event"
echo "====================================="
print_eval medperf training start_event -n event1 -t $TRAINING_UID -y
checkFailed "start event failed"

##########################################################

echo "\n"

##########################################################
echo "====================================="
echo "Activate aggowner profile"
echo "====================================="
print_eval medperf profile activate testagg
checkFailed "testagg profile activation failed"
##########################################################

echo "\n"

##########################################################
echo "====================================="
echo "Get aggregator cert"
echo "====================================="
print_eval medperf certificate get_server_certificate -t $TRAINING_UID
checkFailed "Get aggregator cert failed"
##########################################################

echo "\n"

##########################################################
echo "====================================="
echo "Starting aggregator"
echo "====================================="
print_eval medperf aggregator start -t $TRAINING_UID -p $HOSTNAME_
checkFailed "agg didn't exit successfully"
##########################################################

echo "\n"

##########################################################
echo "====================================="
echo "Waiting for other prcocesses to exit successfully"
Expand All @@ -436,6 +417,18 @@ wait $COL1_PID
checkFailed "data1 training didn't exit successfully"
wait $COL2_PID
checkFailed "data2 training didn't exit successfully"
wait $AGG_PID
checkFailed "agg didn't exit successfully"
##########################################################

echo "\n"

##########################################################
echo "====================================="
echo "Activate aggowner profile"
echo "====================================="
print_eval medperf profile activate testagg
checkFailed "testagg profile activation failed"
##########################################################

echo "\n"
Expand Down
3 changes: 2 additions & 1 deletion cli/medperf/commands/training/submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ def get_fl_mlcube(self):

def get_fl_admin_mlcube(self):
mlcube_id = self.training_exp.fl_admin_mlcube
Cube.get(mlcube_id)
if mlcube_id:
Cube.get(mlcube_id)

def submit(self):
updated_body = self.training_exp.upload()
Expand Down
2 changes: 1 addition & 1 deletion cli/medperf/commands/training/training.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def submit(
..., "--fl-mlcube", "-m", help="Reference Model MLCube UID"
),
fl_admin_mlcube: int = typer.Option(
..., "--fl-mlcube", "-a", help="FL admin interface MLCube"
None, "--fl-mlcube", "-a", help="FL admin interface MLCube"
),
operational: bool = typer.Option(
False,
Expand Down

0 comments on commit fe4bd92

Please sign in to comment.