From e4a992e07e5398e5ab201d57557dfb2bc57cf7cd Mon Sep 17 00:00:00 2001 From: "Chaurasiya, Payal" Date: Thu, 21 Nov 2024 06:19:12 -0800 Subject: [PATCH 1/9] Change the input params Signed-off-by: Chaurasiya, Payal --- tests/end_to_end/models/participants.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/end_to_end/models/participants.py b/tests/end_to_end/models/participants.py index 6eb455aaa8..e3c6437632 100644 --- a/tests/end_to_end/models/participants.py +++ b/tests/end_to_end/models/participants.py @@ -139,8 +139,8 @@ def modify_plan(self, new_rounds=None, num_collaborators=None, disable_client_au data["collaborator"]["settings"]["log_memory_usage"] = self.log_memory_usage data["data_loader"]["settings"]["collaborator_count"] = int(self.num_collaborators) - data["network"]["settings"]["disable_client_auth"] = disable_client_auth - data["network"]["settings"]["tls"] = not disable_tls + data["network"]["settings"]["require_client_auth"] = not disable_client_auth + data["network"]["settings"]["use_tls"] = not disable_tls with open(self.plan_path, "w+") as write_file: yaml.dump(data, write_file) From 33943fde8c7f478844ff654fa8045ffa392934aa Mon Sep 17 00:00:00 2001 From: "Chaurasiya, Payal" Date: Thu, 21 Nov 2024 23:48:57 -0800 Subject: [PATCH 2/9] use_tls and require_client_auth Signed-off-by: Chaurasiya, Payal --- .github/workflows/task_runner_e2e.yml | 2 +- tests/end_to_end/README.md | 6 +- tests/end_to_end/conftest.py | 67 +++++-------------- tests/end_to_end/models/participants.py | 10 +-- .../test_suites/task_runner_tests.py | 6 +- tests/end_to_end/utils/conftest_helper.py | 11 +-- 6 files changed, 35 insertions(+), 67 deletions(-) diff --git a/.github/workflows/task_runner_e2e.yml b/.github/workflows/task_runner_e2e.yml index 98ffde8433..b9a01c630f 100644 --- a/.github/workflows/task_runner_e2e.yml +++ b/.github/workflows/task_runner_e2e.yml @@ -140,7 +140,7 @@ jobs: run: | python -m pytest -s tests/end_to_end/test_suites/task_runner_tests.py \ -m ${{ env.MODEL_NAME }} --model_name ${{ env.MODEL_NAME }} \ - --num_rounds $NUM_ROUNDS --num_collaborators $NUM_COLLABORATORS --disable_tls + --num_rounds $NUM_ROUNDS --num_collaborators $NUM_COLLABORATORS --use_tls "false" echo "Task runner end to end test run completed" - name: Print test summary diff --git a/tests/end_to_end/README.md b/tests/end_to_end/README.md index ae725a170f..41086fc449 100644 --- a/tests/end_to_end/README.md +++ b/tests/end_to_end/README.md @@ -46,13 +46,13 @@ Below parameters are available for modification: 1. --num_collaborators - to modify the number of collaborators 2. --num_rounds - to modify the number of rounds to train 3. --model_name - to use a specific model -4. --disable_tls - to disable TLS communication (by default it is enabled) -5. --disable_client_auth - to disable the client authentication (by default it is enabled) +4. --use_tls - to enable TLS communication (by default it is enabled) +5. --require_client_auth - to enable the client authentication (by default it is enabled) For example, to run Task runner with - torch_cnn_mnist model, 3 collaborators, 5 rounds and non-TLS scenario: ```sh -python -m pytest -s tests/end_to_end/test_suites/task_runner_tests.py --num_rounds 5 --num_collaborators 3 --model_name torch_cnn_mnist --disable_tls +python -m pytest -s tests/end_to_end/test_suites/task_runner_tests.py --num_rounds 5 --num_collaborators 3 --model_name torch_cnn_mnist --use_tls "true" ``` ### Output Structure diff --git a/tests/end_to_end/conftest.py b/tests/end_to_end/conftest.py index 85d7db4d58..77011c45fa 100644 --- a/tests/end_to_end/conftest.py +++ b/tests/end_to_end/conftest.py @@ -17,10 +17,9 @@ # Define a named tuple to store the objects for model owner, aggregator, and collaborators federation_fixture = collections.namedtuple( "federation_fixture", - "model_owner, aggregator, collaborators, model_name, disable_client_auth, disable_tls, workspace_path, results_dir, num_rounds", + "model_owner, aggregator, collaborators, model_name, require_client_auth, use_tls, workspace_path, results_dir, num_rounds", ) - def pytest_addoption(parser): """ Add custom command line options to the pytest parser. @@ -29,44 +28,12 @@ def pytest_addoption(parser): """ parser.addini("results_dir", "Directory to store test results", default="results") parser.addini("log_level", "Logging level", default="DEBUG") - parser.addoption( - "--results_dir", action="store", type=str, default="results", help="Results directory" - ) - parser.addoption( - "--num_collaborators", - action="store", - type=int, - default=constants.NUM_COLLABORATORS, - help="Number of collaborators", - ) - parser.addoption( - "--num_rounds", - action="store", - type=int, - default=constants.NUM_ROUNDS, - help="Number of rounds to train", - ) - parser.addoption( - "--model_name", - action="store", - type=str, - help="Model name", - ) - parser.addoption( - "--disable_client_auth", - action="store_true", - help="Disable client authentication", - ) - parser.addoption( - "--disable_tls", - action="store_true", - help="Disable TLS for communication", - ) - parser.addoption( - "--log_memory_usage", - action="store_true", - help="Enable memory log in collaborators and aggregator", - ) + parser.addoption("--num_collaborators") + parser.addoption("--num_rounds") + parser.addoption("--model_name") + parser.addoption("--require_client_auth") + parser.addoption("--use_tls") + parser.addoption("--log_memory_usage") @pytest.fixture(scope="session", autouse=True) @@ -234,11 +201,11 @@ def fx_federation(request, pytestconfig): args = parse_arguments() # Use the model name from the test case name if not provided as a command line argument model_name = args.model_name if args.model_name else request.node.name.split("test_")[1] - results_dir = args.results_dir or pytestconfig.getini("results_dir") + results_dir = pytestconfig.getini("results_dir") num_collaborators = args.num_collaborators num_rounds = args.num_rounds - disable_client_auth = args.disable_client_auth - disable_tls = args.disable_tls + require_client_auth = True if ( args.require_client_auth.lower() == "true" ) else False + use_tls = True if ( args.use_tls.lower() == "true" ) else False log_memory_usage = args.log_memory_usage log.info( @@ -246,8 +213,8 @@ def fx_federation(request, pytestconfig): f"\tNumber of collaborators: {num_collaborators}\n" f"\tNumber of rounds: {num_rounds}\n" f"\tModel name: {model_name}\n" - f"\tClient authentication: {not disable_client_auth}\n" - f"\tTLS: {not disable_tls}\n" + f"\tClient authentication: {require_client_auth}\n" + f"\tTLS: {use_tls}\n" f"\tMemory Logs: {log_memory_usage}" ) @@ -270,8 +237,8 @@ def fx_federation(request, pytestconfig): model_owner.modify_plan( new_rounds=num_rounds, num_collaborators=num_collaborators, - disable_client_auth=disable_client_auth, - disable_tls=disable_tls, + require_client_auth=require_client_auth, + use_tls=use_tls, ) except Exception as e: log.error(f"Failed to modify the plan: {e}") @@ -279,7 +246,7 @@ def fx_federation(request, pytestconfig): # For TLS enabled (default) scenario: when the workspace is certified, the collaborators are registered as well # For TLS disabled scenario: collaborators need to be registered explicitly - if args.disable_tls: + if args.use_tls: log.info("Disabling TLS for communication") try: model_owner.register_collaborators(num_collaborators) @@ -321,8 +288,8 @@ def fx_federation(request, pytestconfig): aggregator=aggregator, collaborators=collaborators, model_name=model_name, - disable_client_auth=disable_client_auth, - disable_tls=disable_tls, + require_client_auth=require_client_auth, + use_tls=use_tls, workspace_path=workspace_path, results_dir=results_dir, num_rounds=num_rounds, diff --git a/tests/end_to_end/models/participants.py b/tests/end_to_end/models/participants.py index e3c6437632..ae0aca5168 100644 --- a/tests/end_to_end/models/participants.py +++ b/tests/end_to_end/models/participants.py @@ -114,14 +114,14 @@ def certify_collaborator(self, collaborator_name): raise e return True - def modify_plan(self, new_rounds=None, num_collaborators=None, disable_client_auth=False, disable_tls=False): + def modify_plan(self, new_rounds=None, num_collaborators=None, require_client_auth=False, use_tls=False): """ Modify the plan to train the model Args: new_rounds (int): Number of rounds to train num_collaborators (int): Number of collaborators - disable_client_auth (bool): Disable client authentication - disable_tls (bool): Disable TLS communication + require_client_auth (bool): Disable client authentication + use_tls (bool): Disable TLS communication Returns: bool: True if successful, else False """ @@ -139,8 +139,8 @@ def modify_plan(self, new_rounds=None, num_collaborators=None, disable_client_au data["collaborator"]["settings"]["log_memory_usage"] = self.log_memory_usage data["data_loader"]["settings"]["collaborator_count"] = int(self.num_collaborators) - data["network"]["settings"]["require_client_auth"] = not disable_client_auth - data["network"]["settings"]["use_tls"] = not disable_tls + data["network"]["settings"]["require_client_auth"] = not require_client_auth + data["network"]["settings"]["use_tls"] = not use_tls with open(self.plan_path, "w+") as write_file: yaml.dump(data, write_file) diff --git a/tests/end_to_end/test_suites/task_runner_tests.py b/tests/end_to_end/test_suites/task_runner_tests.py index 371fee8f08..43946d61fb 100644 --- a/tests/end_to_end/test_suites/task_runner_tests.py +++ b/tests/end_to_end/test_suites/task_runner_tests.py @@ -17,7 +17,7 @@ def test_torch_cnn_mnist(fx_federation): log.info("Testing torch_cnn_mnist model") # Setup PKI for trusted communication within the federation - if not fx_federation.disable_tls: + if fx_federation.use_tls: assert fed_helper.setup_pki(fx_federation), "Failed to setup PKI for trusted communication" # Start the federation @@ -32,7 +32,7 @@ def test_keras_cnn_mnist(fx_federation): log.info("Testing keras_cnn_mnist model") # Setup PKI for trusted communication within the federation - if not fx_federation.disable_tls: + if fx_federation.use_tls: assert fed_helper.setup_pki(fx_federation), "Failed to setup PKI for trusted communication" # Start the federation @@ -50,7 +50,7 @@ def test_torch_cnn_histology(fx_federation): log.info("Testing torch_cnn_histology model") # Setup PKI for trusted communication within the federation - if not fx_federation.disable_tls: + if fx_federation.use_tls: assert fed_helper.setup_pki(fx_federation), "Failed to setup PKI for trusted communication" # Start the federation diff --git a/tests/end_to_end/utils/conftest_helper.py b/tests/end_to_end/utils/conftest_helper.py index 35c6986ea8..2b8ce817e9 100644 --- a/tests/end_to_end/utils/conftest_helper.py +++ b/tests/end_to_end/utils/conftest_helper.py @@ -18,8 +18,8 @@ def parse_arguments(): - num_collaborators (int, default=2): Number of collaborators - num_rounds (int, default=5): Number of rounds to train - model_name (str, default="torch_cnn_mnist"): Model name - - disable_client_auth (bool): Disable client authentication - - disable_tls (bool): Disable TLS for communication + - require_client_auth (bool): Disable client authentication + - use_tls (bool): Disable TLS for communication - log_memory_usage (bool): Enable Memory leak logs Raises: @@ -27,13 +27,14 @@ def parse_arguments(): """ try: parser = argparse.ArgumentParser(description="Provide the required arguments to run the tests") - parser.add_argument("--results_dir", type=str, required=False, default="results", help="Directory to store the results") + # parser.add_argument("--results_dir", type=str, required=False, default="results", help="Directory to store the results") parser.add_argument("--num_collaborators", type=int, default=2, help="Number of collaborators") parser.add_argument("--num_rounds", type=int, default=5, help="Number of rounds to train") parser.add_argument("--model_name", type=str, help="Model name") - parser.add_argument("--disable_client_auth", action="store_true", help="Disable client authentication") - parser.add_argument("--disable_tls", action="store_true", help="Disable TLS for communication") + parser.add_argument("--require_client_auth", type=str, default="True", help="Enable client authentication") + parser.add_argument("--use_tls", type=str, default="True", help="Enable TLS for communication") parser.add_argument("--log_memory_usage", action="store_true", help="Enable Memory leak logs") + # parser.add_argument("--junitxml" , type=str, default="report.xml", help="Path to store the JUnit XML report") args = parser.parse_known_args()[0] return args From d85bc9f52609d739dd6376a8a46adaa594eda0de Mon Sep 17 00:00:00 2001 From: "Chaurasiya, Payal" Date: Fri, 22 Nov 2024 00:05:01 -0800 Subject: [PATCH 3/9] remove not Signed-off-by: Chaurasiya, Payal --- tests/end_to_end/models/participants.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/end_to_end/models/participants.py b/tests/end_to_end/models/participants.py index ae0aca5168..8f288ea2d9 100644 --- a/tests/end_to_end/models/participants.py +++ b/tests/end_to_end/models/participants.py @@ -139,8 +139,8 @@ def modify_plan(self, new_rounds=None, num_collaborators=None, require_client_au data["collaborator"]["settings"]["log_memory_usage"] = self.log_memory_usage data["data_loader"]["settings"]["collaborator_count"] = int(self.num_collaborators) - data["network"]["settings"]["require_client_auth"] = not require_client_auth - data["network"]["settings"]["use_tls"] = not use_tls + data["network"]["settings"]["require_client_auth"] = require_client_auth + data["network"]["settings"]["use_tls"] = use_tls with open(self.plan_path, "w+") as write_file: yaml.dump(data, write_file) From 1e215df2b52fab23a1a54aaa3bad244a4bd8f244 Mon Sep 17 00:00:00 2001 From: "Chaurasiya, Payal" Date: Fri, 22 Nov 2024 01:43:59 -0800 Subject: [PATCH 4/9] Small change in use-tls Signed-off-by: Chaurasiya, Payal --- .github/workflows/task_runner_e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/task_runner_e2e.yml b/.github/workflows/task_runner_e2e.yml index b3f22e8daa..d62605e6ea 100644 --- a/.github/workflows/task_runner_e2e.yml +++ b/.github/workflows/task_runner_e2e.yml @@ -140,7 +140,7 @@ jobs: run: | python -m pytest -s tests/end_to_end/test_suites/task_runner_tests.py \ -m ${{ env.MODEL_NAME }} --model_name ${{ env.MODEL_NAME }} \ - --num_rounds ${{ env.NUM_ROUNDS }} --num_collaborators ${{ env.NUM_COLLABORATORS }} --use_tls "false" + --num_rounds ${{ env.NUM_ROUNDS }} --num_collaborators ${{ env.NUM_COLLABORATORS }} --use_tls False echo "Task runner end to end test run completed" - name: Print test summary From 6fba6ee30535b79ccce2b2e58bff15e40ed7a500 Mon Sep 17 00:00:00 2001 From: "Chaurasiya, Payal" Date: Wed, 27 Nov 2024 06:56:19 -0800 Subject: [PATCH 5/9] Review comments Signed-off-by: Chaurasiya, Payal --- .github/workflows/task_runner_e2e.yml | 69 ++++++++++++++++++++++- tests/end_to_end/README.md | 4 +- tests/end_to_end/conftest.py | 8 +-- tests/end_to_end/models/participants.py | 7 ++- tests/end_to_end/utils/conftest_helper.py | 10 ++-- 5 files changed, 82 insertions(+), 16 deletions(-) diff --git a/.github/workflows/task_runner_e2e.yml b/.github/workflows/task_runner_e2e.yml index d62605e6ea..a4d854d17f 100644 --- a/.github/workflows/task_runner_e2e.yml +++ b/.github/workflows/task_runner_e2e.yml @@ -140,7 +140,74 @@ jobs: run: | python -m pytest -s tests/end_to_end/test_suites/task_runner_tests.py \ -m ${{ env.MODEL_NAME }} --model_name ${{ env.MODEL_NAME }} \ - --num_rounds ${{ env.NUM_ROUNDS }} --num_collaborators ${{ env.NUM_COLLABORATORS }} --use_tls False + --num_rounds ${{ env.NUM_ROUNDS }} --num_collaborators ${{ env.NUM_COLLABORATORS }} --disable_tls + echo "Task runner end to end test run completed" + + - name: Print test summary + id: print_test_summary + if: ${{ always() }} + run: | + export PYTHONPATH="$PYTHONPATH:." + python tests/end_to_end/utils/summary_helper.py + echo "Test summary printed" + + - name: Tar files + id: tar_files + if: ${{ always() }} + run: tar -cvf result.tar results + + - name: Upload Artifacts + id: upload_artifacts + uses: actions/upload-artifact@v4 + if: ${{ always() }} + with: + name: tr_non_tls_${{ env.MODEL_NAME }}_python${{ env.PYTHON_VERSION }}_${{ github.run_id }} + path: result.tar + + test_with_no_client_auth: + name: tr_no_client_auth + runs-on: ubuntu-22.04 + timeout-minutes: 120 # 2 hours + strategy: + matrix: + # Testing non TLS scenario only for torch_cnn_mnist model and python 3.10 + # If required, this can be extended to other models and python versions + model_name: ["keras_cnn_mnist"] + python_version: ["3.10"] + fail-fast: false # do not immediately fail if one of the combinations fail + + env: + MODEL_NAME: ${{ matrix.model_name }} + PYTHON_VERSION: ${{ matrix.python_version }} + + steps: + - name: Checkout OpenFL repository + id: checkout_openfl + uses: actions/checkout@v4.1.1 + with: + fetch-depth: 2 # needed for detecting changes + submodules: "true" + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up Python + id: setup_python + uses: actions/setup-python@v3 + with: + python-version: ${{ env.PYTHON_VERSION }} + + - name: Install dependencies + id: install_dependencies + run: | + python -m pip install --upgrade pip + pip install . + pip install -r test-requirements.txt + + - name: Run Task Runner E2E tests without TLS + id: run_tests + run: | + python -m pytest -s tests/end_to_end/test_suites/task_runner_tests.py \ + -m ${{ env.MODEL_NAME }} --model_name ${{ env.MODEL_NAME }} \ + --num_rounds ${{ env.NUM_ROUNDS }} --num_collaborators ${{ env.NUM_COLLABORATORS }} --disable_client_auth echo "Task runner end to end test run completed" - name: Print test summary diff --git a/tests/end_to_end/README.md b/tests/end_to_end/README.md index 41086fc449..28c6124e6e 100644 --- a/tests/end_to_end/README.md +++ b/tests/end_to_end/README.md @@ -46,8 +46,8 @@ Below parameters are available for modification: 1. --num_collaborators - to modify the number of collaborators 2. --num_rounds - to modify the number of rounds to train 3. --model_name - to use a specific model -4. --use_tls - to enable TLS communication (by default it is enabled) -5. --require_client_auth - to enable the client authentication (by default it is enabled) +4. --disable_tls - to disable TLS communication (by default it is enabled) +5. --disable_client_auth - to disable the client authentication (by default it is enabled) For example, to run Task runner with - torch_cnn_mnist model, 3 collaborators, 5 rounds and non-TLS scenario: diff --git a/tests/end_to_end/conftest.py b/tests/end_to_end/conftest.py index 77011c45fa..a75c0a718d 100644 --- a/tests/end_to_end/conftest.py +++ b/tests/end_to_end/conftest.py @@ -31,8 +31,8 @@ def pytest_addoption(parser): parser.addoption("--num_collaborators") parser.addoption("--num_rounds") parser.addoption("--model_name") - parser.addoption("--require_client_auth") - parser.addoption("--use_tls") + parser.addoption("--disable_client_auth") + parser.addoption("--disable_tls") parser.addoption("--log_memory_usage") @@ -204,8 +204,8 @@ def fx_federation(request, pytestconfig): results_dir = pytestconfig.getini("results_dir") num_collaborators = args.num_collaborators num_rounds = args.num_rounds - require_client_auth = True if ( args.require_client_auth.lower() == "true" ) else False - use_tls = True if ( args.use_tls.lower() == "true" ) else False + require_client_auth = not args.disable_client_auth + use_tls = not args.disable_tls log_memory_usage = args.log_memory_usage log.info( diff --git a/tests/end_to_end/models/participants.py b/tests/end_to_end/models/participants.py index 8f288ea2d9..ca33cdc32a 100644 --- a/tests/end_to_end/models/participants.py +++ b/tests/end_to_end/models/participants.py @@ -114,14 +114,14 @@ def certify_collaborator(self, collaborator_name): raise e return True - def modify_plan(self, new_rounds=None, num_collaborators=None, require_client_auth=False, use_tls=False): + def modify_plan(self, new_rounds=None, num_collaborators=None, require_client_auth=True, use_tls=True): """ Modify the plan to train the model Args: new_rounds (int): Number of rounds to train num_collaborators (int): Number of collaborators - require_client_auth (bool): Disable client authentication - use_tls (bool): Disable TLS communication + require_client_auth (bool): Enable client authentication + use_tls (bool): Enable TLS communication Returns: bool: True if successful, else False """ @@ -142,6 +142,7 @@ def modify_plan(self, new_rounds=None, num_collaborators=None, require_client_au data["network"]["settings"]["require_client_auth"] = require_client_auth data["network"]["settings"]["use_tls"] = use_tls + with open(self.plan_path, "w+") as write_file: yaml.dump(data, write_file) diff --git a/tests/end_to_end/utils/conftest_helper.py b/tests/end_to_end/utils/conftest_helper.py index 2b8ce817e9..d623c21201 100644 --- a/tests/end_to_end/utils/conftest_helper.py +++ b/tests/end_to_end/utils/conftest_helper.py @@ -18,8 +18,8 @@ def parse_arguments(): - num_collaborators (int, default=2): Number of collaborators - num_rounds (int, default=5): Number of rounds to train - model_name (str, default="torch_cnn_mnist"): Model name - - require_client_auth (bool): Disable client authentication - - use_tls (bool): Disable TLS for communication + - disable_client_auth (bool): Disable client authentication + - disable_tls (bool): Disable TLS for communication - log_memory_usage (bool): Enable Memory leak logs Raises: @@ -27,14 +27,12 @@ def parse_arguments(): """ try: parser = argparse.ArgumentParser(description="Provide the required arguments to run the tests") - # parser.add_argument("--results_dir", type=str, required=False, default="results", help="Directory to store the results") parser.add_argument("--num_collaborators", type=int, default=2, help="Number of collaborators") parser.add_argument("--num_rounds", type=int, default=5, help="Number of rounds to train") parser.add_argument("--model_name", type=str, help="Model name") - parser.add_argument("--require_client_auth", type=str, default="True", help="Enable client authentication") - parser.add_argument("--use_tls", type=str, default="True", help="Enable TLS for communication") + parser.add_argument("--disable_client_auth", action="store_true", help="Disable client authentication") + parser.add_argument("--disable_tls", action="store_true", help="Disable TLS for communication") parser.add_argument("--log_memory_usage", action="store_true", help="Enable Memory leak logs") - # parser.add_argument("--junitxml" , type=str, default="report.xml", help="Path to store the JUnit XML report") args = parser.parse_known_args()[0] return args From aa862e22f3f6c6c70a5d124cd87c032ede958d5e Mon Sep 17 00:00:00 2001 From: "Chaurasiya, Payal" Date: Wed, 27 Nov 2024 18:42:23 -0800 Subject: [PATCH 6/9] action needed for boolean Signed-off-by: Chaurasiya, Payal --- tests/end_to_end/conftest.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/end_to_end/conftest.py b/tests/end_to_end/conftest.py index a75c0a718d..08938467a2 100644 --- a/tests/end_to_end/conftest.py +++ b/tests/end_to_end/conftest.py @@ -31,9 +31,9 @@ def pytest_addoption(parser): parser.addoption("--num_collaborators") parser.addoption("--num_rounds") parser.addoption("--model_name") - parser.addoption("--disable_client_auth") - parser.addoption("--disable_tls") - parser.addoption("--log_memory_usage") + parser.addoption("--disable_client_auth", action="store_true") + parser.addoption("--disable_tls", action="store_true") + parser.addoption("--log_memory_usage", action="store_true") @pytest.fixture(scope="session", autouse=True) @@ -246,7 +246,7 @@ def fx_federation(request, pytestconfig): # For TLS enabled (default) scenario: when the workspace is certified, the collaborators are registered as well # For TLS disabled scenario: collaborators need to be registered explicitly - if args.use_tls: + if use_tls: log.info("Disabling TLS for communication") try: model_owner.register_collaborators(num_collaborators) From 66f27f9b9eab1b5c27143754f837808d4a0f10d5 Mon Sep 17 00:00:00 2001 From: "Chaurasiya, Payal" Date: Wed, 27 Nov 2024 18:47:31 -0800 Subject: [PATCH 7/9] Small fix Signed-off-by: Chaurasiya, Payal --- tests/end_to_end/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/end_to_end/conftest.py b/tests/end_to_end/conftest.py index 08938467a2..7496bd2abe 100644 --- a/tests/end_to_end/conftest.py +++ b/tests/end_to_end/conftest.py @@ -246,7 +246,7 @@ def fx_federation(request, pytestconfig): # For TLS enabled (default) scenario: when the workspace is certified, the collaborators are registered as well # For TLS disabled scenario: collaborators need to be registered explicitly - if use_tls: + if not use_tls: log.info("Disabling TLS for communication") try: model_owner.register_collaborators(num_collaborators) From cc5e3382b176c1bdff494207adcb8d1c9e6799eb Mon Sep 17 00:00:00 2001 From: "Chaurasiya, Payal" Date: Wed, 27 Nov 2024 19:34:49 -0800 Subject: [PATCH 8/9] Small fix Signed-off-by: Chaurasiya, Payal --- tests/end_to_end/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/end_to_end/README.md b/tests/end_to_end/README.md index 28c6124e6e..ae725a170f 100644 --- a/tests/end_to_end/README.md +++ b/tests/end_to_end/README.md @@ -52,7 +52,7 @@ Below parameters are available for modification: For example, to run Task runner with - torch_cnn_mnist model, 3 collaborators, 5 rounds and non-TLS scenario: ```sh -python -m pytest -s tests/end_to_end/test_suites/task_runner_tests.py --num_rounds 5 --num_collaborators 3 --model_name torch_cnn_mnist --use_tls "true" +python -m pytest -s tests/end_to_end/test_suites/task_runner_tests.py --num_rounds 5 --num_collaborators 3 --model_name torch_cnn_mnist --disable_tls ``` ### Output Structure From de6c6ee06981e4f898f7b8d6b66aecf47a15f25b Mon Sep 17 00:00:00 2001 From: "Chaurasiya, Payal" Date: Thu, 28 Nov 2024 00:00:01 -0800 Subject: [PATCH 9/9] Review comments Signed-off-by: Chaurasiya, Payal --- .github/workflows/task_runner_e2e.yml | 2 +- tests/end_to_end/conftest.py | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/task_runner_e2e.yml b/.github/workflows/task_runner_e2e.yml index a4d854d17f..b4b8dff280 100644 --- a/.github/workflows/task_runner_e2e.yml +++ b/.github/workflows/task_runner_e2e.yml @@ -228,5 +228,5 @@ jobs: uses: actions/upload-artifact@v4 if: ${{ always() }} with: - name: tr_non_tls_${{ env.MODEL_NAME }}_python${{ env.PYTHON_VERSION }}_${{ github.run_id }} + name: tr_no_client_auth_${{ env.MODEL_NAME }}_python${{ env.PYTHON_VERSION }}_${{ github.run_id }} path: result.tar diff --git a/tests/end_to_end/conftest.py b/tests/end_to_end/conftest.py index 7496bd2abe..22eed9d101 100644 --- a/tests/end_to_end/conftest.py +++ b/tests/end_to_end/conftest.py @@ -244,8 +244,6 @@ def fx_federation(request, pytestconfig): log.error(f"Failed to modify the plan: {e}") raise e - # For TLS enabled (default) scenario: when the workspace is certified, the collaborators are registered as well - # For TLS disabled scenario: collaborators need to be registered explicitly if not use_tls: log.info("Disabling TLS for communication") try: