Skip to content

Commit

Permalink
Fix summary helper
Browse files Browse the repository at this point in the history
Signed-off-by: Chaurasiya, Payal <[email protected]>
  • Loading branch information
payalcha committed Feb 24, 2025
1 parent e3e9226 commit 9a2a1da
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/federated_runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ permissions:

jobs:
test_federated_runtime_301_watermarking_notebook:
name: Watermarking Without TLS (torch/mnist, 3.10)
name: WF Watermarking Without TLS (torch/mnist, 3.10)
if: |
(github.event_name == 'schedule' && github.repository_owner == 'securefederatedai') ||
(github.event_name == 'workflow_dispatch') ||
Expand Down Expand Up @@ -50,7 +50,7 @@ jobs:
if: ${{ always() }}
run: |
export PYTHONPATH="$PYTHONPATH:."
python tests/end_to_end/utils/summary_helper.py --func_name "print_federated_runtime_score"
python tests/end_to_end/utils/summary_helper.py --func_name "print_federated_runtime_score" --folder_name "wf_watermarking"
echo "Test summary printed"
- name: Tar files
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wf_functional_e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ env:
jobs:
test_wf_functional_local_runtime:
if: github.event.pull_request.draft == false
name: wf_functional_local_runtime
name: WF Functional Without TLS
runs-on: ubuntu-22.04
timeout-minutes: 15
strategy:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ permissions:

jobs:
test_secure_agg_notebook:
name: SecAgg Without TLS (torch/mnist, 3.10)
name: WF SecAgg Without TLS (torch/mnist, 3.10)
if: |
(github.event_name == 'schedule' && github.repository_owner == 'securefederatedai') ||
(github.event_name == 'workflow_dispatch') ||
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
if: ${{ always() }}
run: |
export PYTHONPATH="$PYTHONPATH:."
python tests/end_to_end/utils/summary_helper.py --func_name "print_federated_runtime_score"
python tests/end_to_end/utils/summary_helper.py --func_name "print_federated_runtime_score" --folder_name "wf_secagg"
echo "Test summary printed"
- name: Tar files
Expand Down
4 changes: 2 additions & 2 deletions tests/end_to_end/test_suites/wf_federated_runtime_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def test_federated_runtime_301_watermarking(request):

# Create result log files for the director and envoys
result_path, participant_res_files = fh.create_federated_runtime_participant_res_files(
request.config.results_dir, envoys
request.config.results_dir, envoys, model_name="wf_watermarking"
)

# Start the director
Expand Down Expand Up @@ -94,7 +94,7 @@ def test_federated_runtime_secure_aggregation(request):

# Create result log files for the director and envoys
result_path, participant_res_files = fh.create_federated_runtime_participant_res_files(
request.config.results_dir, envoys, model_name="secure_aggregation_workflow"
request.config.results_dir, envoys, model_name="wf_secagg"
)
# Start the director
fh.start_director(workspace_path, participant_res_files["director"])
Expand Down
2 changes: 1 addition & 1 deletion tests/end_to_end/utils/federation_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ def start_envoy(envoy_name, workspace_path, res_file):
return True


def create_federated_runtime_participant_res_files(results_dir, envoys, model_name="301_mnist_watermarking"):
def create_federated_runtime_participant_res_files(results_dir, envoys, model_name):
"""
Create result log files for the director and envoys.
Args:
Expand Down
13 changes: 10 additions & 3 deletions tests/end_to_end/utils/summary_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def print_task_runner_score():
)


def print_federated_runtime_score():
def print_federated_runtime_score(folder_name):
"""
Function to get the federated runtime score from the director log file
And write the results to GitHub step summary
Expand All @@ -183,7 +183,7 @@ def print_federated_runtime_score():
# Assumption - result directory is present in the home directory
dir_res_file = os.path.join(
result_path,
"301_mnist_watermarking",
folder_name,
"director.log",
)

Expand Down Expand Up @@ -243,6 +243,10 @@ def fetch_args():
parser.add_argument(
"--func_name", required=True, default="", type=str, help="Name of function to be called"
)
# This argument is needed for workflow api and it value is set in the workflow during create_federated_runtime_participant_res_files as model_name
parser.add_argument(
"--folder_name", required=False, default="", type=str, help="Name of output folder"
)
args = parser.parse_args()
return args

Expand All @@ -255,4 +259,7 @@ def fetch_args():
if func_name in ["print_task_runner_score", "print_local_runtime_score"]:
print_task_runner_score()
elif func_name == "print_federated_runtime_score":
print_federated_runtime_score()
folder_name = args.folder_name
if not folder_name:
raise ValueError("folder_name argument is required for print_federated_runtime_score function")
print_federated_runtime_score(folder_name)

0 comments on commit 9a2a1da

Please sign in to comment.