Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Streamlining PR pipeline #1378

Merged
merged 15 commits into from
Feb 14, 2025
Merged
36 changes: 0 additions & 36 deletions .github/workflows/double_ws_export.yml

This file was deleted.

20 changes: 4 additions & 16 deletions .github/workflows/pr_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ jobs:
name: Docker Bench for Security
uses: ./.github/workflows/docker-bench-security.yml

double_workspace_export:
name: Double workspace export
uses: ./.github/workflows/double_ws_export.yml

fr_301_watermark_nb_run:
name: Federated Runtime 301 MNIST Watermarking
uses: ./.github/workflows/federated_runtime.yml
Expand All @@ -47,14 +43,10 @@ jobs:
name: Pytest and code coverage
uses: ./.github/workflows/pytest_coverage.yml

straggler_handling:
name: Straggler Handling Test
uses: ./.github/workflows/straggler-handling.yml

task_runner:
name: TaskRunner
uses: ./.github/workflows/taskrunner.yml

windows:
name: Windows pytest coverage and workspace runs
uses: ./.github/workflows/windows.yml

task_runner_e2e:
name: TaskRunner E2E
uses: ./.github/workflows/task_runner_basic_e2e.yml
Expand All @@ -63,10 +55,6 @@ jobs:
name: TaskRunner E2E Resiliency
uses: ./.github/workflows/task_runner_e2e_resiliency.yml

taskrunner_eden_compression:
name: TaskRunner (Eden Compression)
uses: ./.github/workflows/taskrunner_eden_pipeline.yml

tr_docker_gramine_direct:
name: TaskRunner (docker/gramine-direct)
uses: ./.github/workflows/tr_docker_gramine_direct.yml
Expand Down
74 changes: 73 additions & 1 deletion .github/workflows/task_runner_basic_e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
if: |
(github.event_name == 'schedule' && github.repository_owner == 'securefederatedai') ||
(github.event_name == 'workflow_dispatch') ||
(github.event.pull_request.draft == false && contains(github.event.pull_request.labels.*.name, 'task_runner_e2e'))
(github.event.pull_request.draft == false)
name: Input value selection
runs-on: ubuntu-22.04
outputs:
Expand Down Expand Up @@ -326,3 +326,75 @@ jobs:
if: ${{ always() }}
with:
test_type: "With_Memory_Logs"

test_straggler_check:
name: Straggler Handling
runs-on: ubuntu-22.04
timeout-minutes: 30
if: |
(github.event_name == 'schedule' && github.repository_owner == 'securefederatedai') ||
(github.event_name == 'workflow_dispatch') ||
(github.event.pull_request.draft == false)

env:
MODEL_NAME: "torch/mnist_straggler_check"
PYTHON_VERSION: "3.10"

steps:
- name: Checkout OpenFL repository
id: checkout_openfl
uses: actions/checkout@v4

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

- name: Run Straggler Handling Interface Test
id: run_tests
run: |
python -m pytest -s tests/end_to_end/test_suites/task_runner_tests.py \
-m task_runner_basic --model_name ${{ env.MODEL_NAME }} \
--num_rounds ${{ env.NUM_ROUNDS }} --num_collaborators ${{ env.NUM_COLLABORATORS }}
echo "Straggler handling test run completed"

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

test_eden_compression:
name: Eden Compression
runs-on: ubuntu-22.04
timeout-minutes: 30
if: |
(github.event_name == 'schedule' && github.repository_owner == 'securefederatedai') ||
(github.event_name == 'workflow_dispatch') ||
(github.event.pull_request.draft == false && contains(github.event.pull_request.labels.*.name, 'eden_compression'))

env:
MODEL_NAME: "torch/mnist_eden_compression"
PYTHON_VERSION: "3.10"

steps:
- name: Checkout OpenFL repository
id: checkout_openfl
uses: actions/checkout@v4

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

- name: Run Eden Compression Test
id: run_tests
run: |
python -m pytest -s tests/end_to_end/test_suites/task_runner_tests.py \
-m task_runner_basic --model_name ${{ env.MODEL_NAME }} \
--num_rounds ${{ env.NUM_ROUNDS }} --num_collaborators ${{ env.NUM_COLLABORATORS }}
echo "Eden compression test run completed"

- name: Post test run
uses: ./.github/actions/tr_post_test_run
if: ${{ always() }}
with:
test_type: "Eden_Compression"
12 changes: 6 additions & 6 deletions .github/workflows/task_runner_e2e_resiliency.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:
num_rounds:
description: "Number of rounds to train"
required: false
default: "50"
default: "30"
type: string
num_collaborators:
description: "Number of collaborators"
Expand All @@ -25,12 +25,12 @@ on:
model_name:
description: "Model name"
required: false
default: "all"
default: "torch/mnist"
type: choice
options:
- all
- torch/mnist
- keras/mnist
- all
python_version:
description: "Python version"
required: false
Expand All @@ -47,17 +47,17 @@ permissions:
# Environment variables common for all the jobs
# DO NOT use double quotes for the values of the environment variables
env:
NUM_ROUNDS: ${{ inputs.num_rounds || 50 }}
NUM_ROUNDS: ${{ inputs.num_rounds || 30 }}
NUM_COLLABORATORS: ${{ inputs.num_collaborators || 2 }}
MODEL_NAME: ${{ inputs.model_name || 'all' }}
MODEL_NAME: ${{ inputs.model_name || 'torch/mnist' }}
PYTHON_VERSION: ${{ inputs.python_version || '3.10' }}

jobs:
input_selection:
if: |
(github.event_name == 'schedule' && github.repository_owner == 'securefederatedai') ||
(github.event_name == 'workflow_dispatch') ||
(github.event.pull_request.draft == false && contains(github.event.pull_request.labels.*.name, 'task_runner_e2e'))
(github.event.pull_request.draft == false)
name: Input value selection
runs-on: ubuntu-22.04
outputs:
Expand Down
34 changes: 0 additions & 34 deletions .github/workflows/taskrunner_eden_pipeline.yml

This file was deleted.

5 changes: 5 additions & 0 deletions .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up apt-get
run: |
sudo apt-get update -y
sudo apt-get upgrade -y

- name: Build an image from Dockerfile
run: |
docker build --pull -t docker.io/securefederatedai/openfl:${{ github.sha }} -f openfl-docker/Dockerfile.base .
Expand Down
56 changes: 0 additions & 56 deletions .github/workflows/ubuntu.yml

This file was deleted.

44 changes: 41 additions & 3 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Windows (latest)

on:
workflow_call:
schedule:
- cron: '0 0 * * *'

Expand Down Expand Up @@ -36,8 +37,7 @@ jobs:
coverage run -m pytest -rA
coverage report

cli: # from taskrunner.yml
needs: [pytest-coverage]
keras_mnist: # from taskrunner.yml - keras/mnist
runs-on: windows-latest
timeout-minutes: 15
steps:
Expand All @@ -52,4 +52,42 @@ jobs:
pip install .
- name: Test TaskRunner API
run: |
python -m tests.github.test_hello_federation --template keras/mnist --fed_workspace aggregator --col1 col1 --col2 col2 --rounds-to-train 3 --save-model output_model
python -m tests.github.test_hello_federation --template keras/mnist --fed_workspace aggregator --col1 col1 --col2 col2 --rounds-to-train 3 --save-model output_model

torch_mnist_eden_compression: # from taskrunner_eden_pipeline.yml - torch/mnist_eden_compression
runs-on: windows-latest
timeout-minutes: 15
if: |
(github.event_name == 'schedule' && github.repository_owner == 'securefederatedai') ||
(github.event_name == 'workflow_dispatch') ||
(github.event.pull_request.draft == false && contains(github.event.pull_request.labels.*.name, 'eden_compression'))
steps:
- uses: actions/checkout@v4
- name: Set up Python 3
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .
- name: Test TaskRunner API with Eden Compression
run: |
python -m tests.github.test_hello_federation --template torch/mnist_eden_compression --fed_workspace aggregator --col1 col1 --col2 col2 --rounds-to-train 3

torch_mnist_straggler_check: # from straggler-handling.yml - torch/mnist_straggler_check
runs-on: windows-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Set up Python 3
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .
- name: Test Straggler Handling Interface
run: |
python -m tests.github.test_hello_federation --template torch/mnist_straggler_check --fed_workspace aggregator --col1 col1 --col2 col2 --rounds-to-train 3
1 change: 1 addition & 0 deletions .trivyignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Accept the risk
CVE-2025-0395
CVE-2024-3596
9 changes: 6 additions & 3 deletions tests/end_to_end/utils/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@ class ModelName(Enum):
"""
# IMP - The model name must be same (and in uppercase) as the model value.
# This is used to identify the model in the tests.
TORCH_MNIST = "torch/mnist"
KERAS_JAX_MNIST = "keras/jax/mnist"
KERAS_MNIST = "keras/mnist"
KERAS_TORCH_MNIST = "keras/torch/mnist"
TORCH_HISTOLOGY = "torch/histology"
TORCH_MNIST = "torch/mnist"
TORCH_MNIST_EDEN_COMPRESSION = "torch/mnist_eden_compression"
TORCH_MNIST_STRAGGLER_CHECK = "torch/mnist_straggler_check"
XGB_HIGGS = "xgb_higgs"
KERAS_TORCH_MNIST = "keras/torch/mnist"
KERAS_JAX_MNIST = "keras/jax/mnist"


NUM_COLLABORATORS = 2
NUM_ROUNDS = 5
Expand Down
Loading