Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pq_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ jobs:
(github.event_name == 'schedule' && github.repository_owner == 'securefederatedai') ||
(github.event_name == 'workflow_dispatch')
name: TaskRunner Verifiable Dataset E2E
needs: task_runner_e2e
needs: task_runner_connectivity_e2e
uses: ./.github/workflows/tr_verifiable_dataset_e2e.yml
with:
commit_id: ${{ needs.set_commit_id_for_all_jobs.outputs.commit_id }}
Expand Down
61 changes: 30 additions & 31 deletions .github/workflows/task_runner_connectivity_e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,37 +52,36 @@ jobs:
with:
test_type: "TLS_Connectivity_gRPC"

# Uncomment once Rest API PR is merged
# test_rest_connectivity:
# name: Task Runner Rest connectivity (no-op, 3.11, rest)
# if: |
# (github.event_name == 'schedule' && github.repository_owner == 'securefederatedai') ||
# (github.event_name == 'workflow_dispatch') ||
# (github.event.pull_request.draft == false)
# runs-on: ubuntu-22.04
# timeout-minutes: 30
# env:
# MODEL_NAME: 'no-op'
# PYTHON_VERSION: '3.11'
# steps:
# - name: Checkout OpenFL repository
# id: checkout_openfl
# uses: actions/checkout@v4
# with:
# ref: ${{ env.COMMIT_ID }}
test_rest_connectivity:
name: Task Runner Rest connectivity (no-op, 3.11)
if: |
(github.event_name == 'schedule' && github.repository_owner == 'securefederatedai') ||
(github.event_name == 'workflow_dispatch') ||
(github.event.pull_request.draft == false)
runs-on: ubuntu-22.04
timeout-minutes: 30
env:
MODEL_NAME: 'no-op'
PYTHON_VERSION: '3.11'
steps:
- name: Checkout OpenFL repository
id: checkout_openfl
uses: actions/checkout@v4
with:
ref: ${{ env.COMMIT_ID }}

# - name: Pre test run
# uses: ./.github/actions/tr_pre_test_run
# if: ${{ always() }}
- name: Pre test run
uses: ./.github/actions/tr_pre_test_run
if: ${{ always() }}

# - name: Run Task Runner rest connectivity test
# id: run_tests
# run: |
# python -m pytest -s tests/end_to_end/test_suites/task_runner_tests.py -k test_federation_connectivity --model_name ${{ env.MODEL_NAME }} --tr_rest_api
# echo "Task runner end to end test run completed"
- name: Run Task Runner rest connectivity test
id: run_tests
run: |
python -m pytest -s tests/end_to_end/test_suites/task_runner_tests.py -k test_federation_connectivity --model_name ${{ env.MODEL_NAME }} --tr_rest_api
echo "Task runner end to end test run completed"
Comment thread
teoparvanov marked this conversation as resolved.

# - name: Post test run
# uses: ./.github/actions/tr_post_test_run
# if: ${{ always() }}
# with:
# test_type: "TLS_Connectivity_REST"
- name: Post test run
uses: ./.github/actions/tr_post_test_run
if: ${{ always() }}
with:
test_type: "TLS_Connectivity_REST"
16 changes: 8 additions & 8 deletions .github/workflows/task_runner_fedeval_e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ jobs:
with:
test_type: "FedEval_With_TLS"

test_without_tls:
name: Without TLS
test_without_tls_restapi:
name: Without TLS Rest API
if: | # Skip for PR pipeline
((github.event_name == 'schedule' && github.repository_owner == 'securefederatedai') ||
(github.event_name == 'workflow_dispatch')) && (github.workflow != 'OpenFL PR Pipeline')
Expand Down Expand Up @@ -115,17 +115,17 @@ jobs:
run: |
python -m pytest -s tests/end_to_end/test_suites/tr_with_fedeval_tests.py \
-m task_runner_basic --model_name ${{ env.MODEL_NAME }} \
--num_rounds ${{ env.NUM_ROUNDS }} --num_collaborators ${{ env.NUM_COLLABORATORS }} --disable_tls
--num_rounds ${{ env.NUM_ROUNDS }} --num_collaborators ${{ env.NUM_COLLABORATORS }} --disable_tls --tr_rest_api
echo "Task runner end to end test run completed"

- name: Post test run
uses: ./.github/actions/tr_post_test_run
if: ${{ always() }}
with:
test_type: "FedEval_Without_TLS"
test_type: "FedEval_Without_TLS_REST"

test_without_client_auth:
name: Without Client Auth
test_without_client_auth_restapi:
name: Without Client Auth Rest API
if: | # Skip for PR pipeline
((github.event_name == 'schedule' && github.repository_owner == 'securefederatedai') ||
(github.event_name == 'workflow_dispatch')) && (github.workflow != 'OpenFL PR Pipeline')
Expand Down Expand Up @@ -159,11 +159,11 @@ jobs:
run: |
python -m pytest -s tests/end_to_end/test_suites/tr_with_fedeval_tests.py \
-m task_runner_basic --model_name ${{ env.MODEL_NAME }} \
--num_rounds ${{ env.NUM_ROUNDS }} --num_collaborators ${{ env.NUM_COLLABORATORS }} --disable_client_auth
--num_rounds ${{ env.NUM_ROUNDS }} --num_collaborators ${{ env.NUM_COLLABORATORS }} --disable_client_auth --tr_rest_api
echo "Task runner end to end test run completed"

- name: Post test run
uses: ./.github/actions/tr_post_test_run
if: ${{ always() }}
with:
test_type: "FedEval_Without_Client_Auth"
test_type: "FedEval_Without_Client_Auth_REST"
76 changes: 35 additions & 41 deletions .github/workflows/task_runner_resiliency_e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,50 +53,46 @@ env:
COMMIT_ID: ${{ inputs.commit_id || github.sha }} # use commit_id from the calling workflow

jobs:
input_selection:
if: |
(github.event_name == 'schedule' && github.repository_owner == 'securefederatedai') ||
(github.event_name == 'workflow_dispatch') ||
(github.event.pull_request.draft == false)
name: Input value selection
resiliency_in_native_grpc:
name: Resiliency in gRPC (torch/mnist, 3.10)
runs-on: ubuntu-22.04
outputs:
# Output all the variables related to models and python versions to be used in the matrix strategy
# for different jobs, however their usage depends on the selected job.
selected_models_for_tls: ${{ steps.input_selection.outputs.models_for_tls }}
selected_python_for_tls: ${{ steps.input_selection.outputs.python_for_tls }}
timeout-minutes: 30
env:
MODEL_NAME: ${{ inputs.model_name || 'torch/mnist' }}
PYTHON_VERSION: ${{ inputs.python_version || '3.10' }}

steps:
- name: Job to select input values
id: input_selection
- name: Checkout OpenFL repository
id: checkout_openfl
uses: actions/checkout@v4
with:
ref: ${{ env.COMMIT_ID }}

- name: Pre test run
uses: ./.github/actions/tr_pre_test_run
if: ${{ always() }}

- name: Run Task Runner E2E tests with TLS
id: run_tests
run: |
if [ "${{ env.MODEL_NAME }}" == "all" ]; then
echo "models_for_tls=[\"torch/mnist\", \"keras/mnist\"]" >> "$GITHUB_OUTPUT"
else
echo "models_for_tls=[\"${{env.MODEL_NAME}}\"]" >> "$GITHUB_OUTPUT"
fi
if [ "${{ env.PYTHON_VERSION }}" == "all" ]; then
echo "python_for_tls=[\"3.10\", \"3.11\"]" >> "$GITHUB_OUTPUT"
else
echo "python_for_tls=[\"${{env.PYTHON_VERSION}}\"]" >> "$GITHUB_OUTPUT"
fi
python -m pytest -s tests/end_to_end/test_suites/tr_resiliency_tests.py \
-m task_runner_basic --model_name ${{ env.MODEL_NAME }} \
--num_collaborators ${{ env.NUM_COLLABORATORS }} --num_rounds ${{ env.NUM_ROUNDS }}
echo "Task runner end to end test run completed"

resiliency_in_native:
name: With TLS
needs: input_selection
- name: Post test run
uses: ./.github/actions/tr_post_test_run
if: ${{ always() }}
with:
test_type: "Resiliency_Native_Grpc"
Comment thread
payalcha marked this conversation as resolved.
Outdated

resiliency_in_native_rest:
Comment thread
payalcha marked this conversation as resolved.
Outdated
name: Resiliency in REST (keras/tensorflow/mnist, 3.11)
runs-on: ubuntu-22.04
timeout-minutes: 30
strategy:
matrix:
model_name: ${{ fromJson(needs.input_selection.outputs.selected_models_for_tls) }}
python_version: ${{ fromJson(needs.input_selection.outputs.selected_python_for_tls) }}
exclude: # Keras does not support Python 3.12
- model_name: "keras/mnist"
python_version: "3.12"
fail-fast: false # do not immediately fail if one of the combinations fail

env:
MODEL_NAME: ${{ matrix.model_name }}
PYTHON_VERSION: ${{ matrix.python_version }}
MODEL_NAME: ${{ inputs.model_name || 'keras/tensorflow/mnist' }}
PYTHON_VERSION: ${{ inputs.python_version || '3.11' }}

steps:
- name: Checkout OpenFL repository
Expand All @@ -114,13 +110,11 @@ jobs:
run: |
python -m pytest -s tests/end_to_end/test_suites/tr_resiliency_tests.py \
-m task_runner_basic --model_name ${{ env.MODEL_NAME }} \
--num_collaborators ${{ env.NUM_COLLABORATORS }} --num_rounds ${{ env.NUM_ROUNDS }}
--num_collaborators ${{ env.NUM_COLLABORATORS }} --num_rounds ${{ env.NUM_ROUNDS }} --tr_rest_api
echo "Task runner end to end test run completed"

- name: Post test run
uses: ./.github/actions/tr_post_test_run
if: ${{ always() }}
with:
test_type: "Resiliency_Native"

# TODO - Add dockerized approach as well once we have GitHub runners with higher configurations.
test_type: "Resiliency_Native_Rest"
Comment thread
payalcha marked this conversation as resolved.
Outdated
8 changes: 4 additions & 4 deletions .github/workflows/task_runner_straggler_e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ jobs:
test_type: "With_TLS_Percentage"

test_straggler_cutoff:
name: Cutoff Policy (torch/mnist_straggler_check, 3.10)
name: Cutoff Policy Rest API (torch/mnist_straggler_check, 3.11)
if: |
(github.event_name == 'schedule' && github.repository_owner == 'securefederatedai') ||
(github.event_name == 'workflow_dispatch')
runs-on: ubuntu-22.04
timeout-minutes: 30
env:
MODEL_NAME: 'torch/mnist_straggler_check'
PYTHON_VERSION: '3.10'
PYTHON_VERSION: '3.11'
steps:
- name: Checkout OpenFL repository
id: checkout_openfl
Expand All @@ -75,11 +75,11 @@ jobs:
- name: Run Task Runner cutofftime straggler tests
id: run_tests
run: |
python -m pytest -s tests/end_to_end/test_suites/tr_resiliency_tests.py -k test_straggler_cutoff
python -m pytest -s tests/end_to_end/test_suites/tr_resiliency_tests.py -k test_straggler_cutoff --tr_rest_api
echo "Task runner end to end test run completed"

- name: Post test run
uses: ./.github/actions/tr_post_test_run
if: ${{ always() }}
with:
test_type: "With_TLS_Cutoff"
test_type: "With_TLS_Cutoff_Rest"
4 changes: 3 additions & 1 deletion tests/end_to_end/models/aggregator.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,22 @@ class Aggregator():
2. Starting the aggregator
"""

def __init__(self, agg_domain_name, workspace_path, eval_scope=False, container_id=None):
def __init__(self, agg_domain_name, workspace_path, eval_scope=False, container_id=None, transport_protocol="grpc"):
"""
Initialize the Aggregator class
Args:
agg_domain_name (str): Aggregator domain name
workspace_path (str): Workspace path
container_id (str): Container ID
eval_scope (bool, optional): Scope of aggregator is evaluation. Default is False.
transport_protocol (str): Transport protocol (default: "grpc")
"""
self.name = "aggregator"
self.agg_domain_name = agg_domain_name
self.workspace_path = workspace_path
self.eval_scope = eval_scope
self.container_id = container_id
self.transport_protocol = transport_protocol
self.tensor_db_file = os.path.join(self.workspace_path, "local_state", "tensor.db")
self.res_file = None # Result file to track the logs
self.start_process = None # Process associated with the aggregator start command
Expand Down
4 changes: 3 additions & 1 deletion tests/end_to_end/models/collaborator.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,22 @@ class Collaborator():
4. Starting the collaborator
"""

def __init__(self, collaborator_name=None, data_directory_path=None, workspace_path=None, container_id=None):
def __init__(self, collaborator_name=None, data_directory_path=None, workspace_path=None, container_id=None, transport_protocol="grpc"):
"""
Initialize the Collaborator class
Args:
collaborator_name (str): Collaborator name
data_directory_path (str): Data directory path
workspace_path (str): Workspace path
container_id (str): Container ID
transport_protocol (str): Transport protocol (default: "grpc")
"""
self.name = collaborator_name
self.collaborator_name = collaborator_name
self.data_directory_path = data_directory_path
self.workspace_path = workspace_path
self.container_id = container_id
self.transport_protocol = transport_protocol
self.res_file = None # Result file to track the logs
self.start_process = None # Process associated with the aggregator start command

Expand Down
13 changes: 12 additions & 1 deletion tests/end_to_end/utils/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ class ModelName(Enum):
TORCH_MNIST = "torch/mnist"
TORCH_MNIST_EDEN_COMPRESSION = "torch/mnist_eden_compression"
TORCH_MNIST_STRAGGLER_CHECK = "torch/mnist_straggler_check"
KERAS_TENSORFLOW_MNIST = "keras/tensorflow/mnist"
XGB_HIGGS = "xgb_higgs"
GANDLF_SEG_TEST = "gandlf_seg_test"
FLOWER_APP_PYTORCH = "flower-app-pytorch"
NO_OP = "no-op"
KERAS_TENSORFLOW_MNIST = "keras/tensorflow/mnist"
FEDERATED_ANALYTICS_HISTOGRAM = "federated_analytics/histogram"
FEDERATED_ANALYTICS_SMOKERS_HEALTH = "federated_analytics/smokers_health"

Expand Down Expand Up @@ -65,6 +65,17 @@ class ModelName(Enum):
AGG_METRIC_MODEL_ACCURACY_KEY = "aggregator/aggregated_model_validation/accuracy"
COL_TLS_END_MSG = "TLS connection established."


class TransportProtocol(Enum):
"""
Enum class to define the transport protocol.
"""
GRPC = "grpc"
REST = "rest"

AGGREGATOR_REST_CLIENT = "Starting Aggregator REST Server"
AGGREGATOR_GRPC_CLIENT = "Starting Aggregator gRPC Server"

# For S3 and MinIO
MINIO_ROOT_USER = "minioadmin"
MINIO_ROOT_PASSWORD = "minioadmin"
Expand Down
Loading
Loading