Skip to content

Commit

Permalink
Removed docker based tests and workflow
Browse files Browse the repository at this point in the history
Signed-off-by: noopur <[email protected]>
  • Loading branch information
noopurintel committed Dec 18, 2024
1 parent 84e028b commit 5d79356
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 275 deletions.
158 changes: 0 additions & 158 deletions .github/workflows/task_runner_docker_e2e.yml

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/task_runner_dockerized_ws_e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
- name: Run Task Runner E2E tests with TLS
id: run_tests
run: |
python -m pytest -s tests/end_to_end/test_suites/task_runner_dockerized_ws_tests.py \
python -m pytest -s tests/end_to_end/test_suites/task_runner_tests.py \
-m task_runner_dockerized_ws --model_name ${{ env.MODEL_NAME }} \
--num_rounds ${{ env.NUM_ROUNDS }} --num_collaborators ${{ env.NUM_COLLABORATORS }}
echo "Task runner end to end test run completed"
Expand Down Expand Up @@ -99,7 +99,7 @@ jobs:
- name: Run Task Runner E2E tests without TLS
id: run_tests
run: |
python -m pytest -s tests/end_to_end/test_suites/task_runner_dockerized_ws_tests.py \
python -m pytest -s tests/end_to_end/test_suites/task_runner_tests.py \
-m task_runner_dockerized_ws --model_name ${{ env.MODEL_NAME }} \
--num_rounds ${{ env.NUM_ROUNDS }} --num_collaborators ${{ env.NUM_COLLABORATORS }} --disable_tls
echo "Task runner end to end test run completed"
Expand Down Expand Up @@ -140,7 +140,7 @@ jobs:
- name: Run Task Runner E2E tests without TLS
id: run_tests
run: |
python -m pytest -s tests/end_to_end/test_suites/task_runner_dockerized_ws_tests.py \
python -m pytest -s tests/end_to_end/test_suites/task_runner_tests.py \
-m task_runner_dockerized_ws --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"
Expand Down
6 changes: 3 additions & 3 deletions tests/end_to_end/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ For example, to run Task runner (bare metal approach) with - torch_cnn_mnist mod
python -m pytest -s tests/end_to_end/test_suites/task_runner_tests.py -m task_runner_basic --num_rounds 5 --num_collaborators 3 --model_name torch_cnn_mnist --disable_tls
```

And, to run Task runner (via docker) with keras_cnn_mnist, 2 collaborators, 5 rounds:
And, to run Task runner (via dockerized workspace) with keras_cnn_mnist, 2 collaborators, 3 rounds:

```sh
python -m pytest -s tests/end_to_end/test_suites/task_runner_tests.py -m task_runner_docker --num_rounds 5 --num_collaborators 2 --model_name keras_cnn_mnist
python -m pytest -s tests/end_to_end/test_suites/task_runner_tests.py -m task_runner_dockerized_ws --num_rounds 3 --num_collaborators 2 --model_name keras_cnn_mnist
```

### Fixture and marker mapping:

- `fx_federation_tr` - for task_runner_basic and task_runner_docker
- `fx_federation_tr` - for task_runner_basic
- `fx_federation_tr_dws` - for task_runner_dockerized_ws


Expand Down
3 changes: 1 addition & 2 deletions tests/end_to_end/models/model_owner.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ def create_workspace(self):
log.info(f"Creating workspace for model {self.model_name} at the path: {self.workspace_path}")
error_msg = "Failed to create the workspace"

# Docker environment requires the path to be relative
ws_path = self.workspace_path.lstrip('/') if os.getenv("TEST_ENV") == "task_runner_docker" else self.workspace_path
ws_path = self.workspace_path

return_code, output, error = fh.run_command(
f"fx workspace create --prefix {ws_path} --template {self.model_name}",
Expand Down
3 changes: 1 addition & 2 deletions tests/end_to_end/pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ log_level = INFO
markers =
log_memory_usage: mark a test as a log memory usage test.
task_runner_basic: mark a test as a task runner basic test.
task_runner_docker: mark a test as a task runner docker test.
task_runner_dockerized_ws: mark a test as a task runner dockerized ws test.
task_runner_dockerized_ws: mark a test as a task runner dockerized workspace test.
asyncio_mode=auto
asyncio_default_fixture_loop_scope="function"
16 changes: 0 additions & 16 deletions tests/end_to_end/test_suites/sample_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,6 @@ def test_federation_basic(request, fx_federation_tr):
), "Federation completion failed"


@pytest.mark.task_runner_docker
def test_federation_via_docker(request, fx_federation_tr):
"""
Add a proper docstring here.
"""
log.info(f"Running sample model test {fx_federation_tr}")

# Start the federation
results = fed_helper.run_federation(fx_federation_tr)

# Verify the completion of the federation run
assert fed_helper.verify_federation_run_completion(
fx_federation_tr, results, num_rounds=request.config.num_rounds
), "Federation completion failed"


@pytest.mark.task_runner_dockerized_ws
def test_federation_via_dockerized_workspace(request, fx_federation_tr_dws):
"""
Expand Down
28 changes: 0 additions & 28 deletions tests/end_to_end/test_suites/task_runner_dockerized_ws_tests.py

This file was deleted.

21 changes: 10 additions & 11 deletions tests/end_to_end/test_suites/task_runner_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,19 @@
import pytest
import logging

from tests.end_to_end.utils.common_fixtures import fx_federation_tr
from tests.end_to_end.utils.common_fixtures import fx_federation_tr, fx_federation_tr_dws
from tests.end_to_end.utils import federation_helper as fed_helper

log = logging.getLogger(__name__)


# NOTE: This test file contains the test cases for the task runner federation using bare metal and docker approaches.

@pytest.mark.task_runner_basic
def test_federation_via_native(request, fx_federation_tr):
"""
Test federation via native task runner.
Args:
request (Fixture): Pytest fixture
fx_federation_tr (Fixture): Pytest fixture for native task runner
"""
# Start the federation
results = fed_helper.run_federation(fx_federation_tr)
Expand All @@ -26,18 +27,16 @@ def test_federation_via_native(request, fx_federation_tr):
), "Federation completion failed"


@pytest.mark.task_runner_docker
def test_federation_via_docker(request, fx_federation_tr):
@pytest.mark.task_runner_dockerized_ws
def test_federation_via_dockerized_workspace(request, fx_federation_tr_dws):
"""
Test federation via docker.
Test federation via dockerized workspace.
Args:
request (Fixture): Pytest fixture
fx_federation_tr (Fixture): Pytest fixture
fx_federation_tr_dws (Fixture): Pytest fixture for dockerized workspace
"""
# Start the federation
results = fed_helper.run_federation(fx_federation_tr)
results = fed_helper.run_federation_for_dws(fx_federation_tr_dws, use_tls=request.config.use_tls)

# Verify the completion of the federation run
assert fed_helper.verify_federation_run_completion(
fx_federation_tr, results, request.config.num_rounds
), "Federation completion failed"
assert fed_helper.verify_federation_run_completion(fx_federation_tr_dws, results, request.config.num_rounds), "Federation completion failed"
13 changes: 2 additions & 11 deletions tests/end_to_end/utils/common_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ def fx_federation_tr(request):
"""
test_env = fh.get_test_env_from_markers(request)

if test_env not in ["task_runner_docker", "task_runner_basic"]:
if test_env != "task_runner_basic":
raise ValueError(
"Fixture fx_federation_tr is only supported for task_runner_basic and task_runner_docker markers"
"Fixture fx_federation_tr is only supported for task_runner_basic marker"
)

collaborators = []
Expand All @@ -74,15 +74,6 @@ def fx_federation_tr(request):
# Create workspace for given model name
fh.create_persistent_store(model_owner.name, local_bind_path)

# Start the docker container for aggregator in case of docker environment
if test_env == "task_runner_docker":
container = dh.start_docker_container(
container_name="aggregator",
workspace_path=workspace_path,
local_bind_path=local_bind_path,
)
model_owner.container_id = container.id

model_owner.create_workspace()
fh.add_local_workspace_permission(local_bind_path)

Expand Down
Loading

0 comments on commit 5d79356

Please sign in to comment.