Skip to content

Commit

Permalink
Merge branch 'securefederatedai:develop' into compression/model-save
Browse files Browse the repository at this point in the history
  • Loading branch information
kta-intel authored Nov 15, 2024
2 parents f0371eb + 1d7c9bf commit 1637b41
Show file tree
Hide file tree
Showing 318 changed files with 2,096 additions and 125 deletions.
6 changes: 0 additions & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,3 @@ updates:
interval: "daily"
ignore:
- dependency-name: "*"
- package-ecosystem: pip
directory: /openfl-tutorials/interactive_api
schedule:
interval: "daily"
ignore:
- dependency-name: "*"
2 changes: 2 additions & 0 deletions .github/workflows/docker-bench-security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ name: Docker Bench for Security
on:
pull_request:
branches: [ develop ]
types: [opened, synchronize, reopened, ready_for_review]

permissions:
contents: read

jobs:
build:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
timeout-minutes: 10

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/double_ws_export.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ name: Double workspace export
on:
pull_request:
branches: [ develop ]
types: [opened, synchronize, reopened, ready_for_review]

permissions:
contents: read
Expand All @@ -16,6 +17,7 @@ env:

jobs:
build:
if: github.event.pull_request.draft == false
runs-on: 'ubuntu-latest'

steps:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/experimental_workflow_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ on:
branches: [ develop ]
pull_request:
branches: [ develop ]
types: [opened, synchronize, reopened, ready_for_review]

permissions:
contents: read

jobs:
build:
if: contains(github.event.pull_request.labels.*.name, 'workflow_interface')
if: (github.event.pull_request.draft == false && contains(github.event.pull_request.labels.*.name, 'workflow_interface'))
runs-on: ubuntu-latest

steps:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/gandlf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ name: GaNDLF TaskRunner
on:
pull_request:
branches: [ develop ]
types: [opened, synchronize, reopened, ready_for_review]

permissions:
contents: read
Expand All @@ -16,7 +17,7 @@ env:

jobs:
build:

if: github.event.pull_request.draft == false
runs-on: ubuntu-latest

steps:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/hadolint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ name: Hadolint Security Scan
on:
pull_request:
branches: [ develop ]
types: [opened, synchronize, reopened, ready_for_review]

permissions:
contents: read

jobs:
build:

if: github.event.pull_request.draft == false
runs-on: ubuntu-latest

steps:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/interactive-kvasir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ name: Interactive API - Pytorch Kvasir UNet
on:
pull_request:
branches: [ develop ]
types: [opened, synchronize, reopened, ready_for_review]

permissions:
contents: read

jobs:
build:

if: github.event.pull_request.draft == false
strategy:
matrix:
os: ['ubuntu-latest', 'windows-latest']
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/interactive-tensorflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ name: Interactive API - Tensorflow MNIST
on:
pull_request:
branches: [ develop ]
types: [opened, synchronize, reopened, ready_for_review]

permissions:
contents: read

jobs:
build:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest # Add Windows support after https://github.com/keras-team/keras/issues/16308 is merged

steps:
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ name: Check code format
on:
pull_request:
branches: [ develop ]
types: [opened, synchronize, reopened, ready_for_review]

permissions:
contents: read

jobs:
build:
if: github.event.pull_request.draft == false

runs-on: ubuntu-latest

Expand All @@ -25,5 +27,5 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -r linters-requirements.txt
- name: Lint using built-in script
run: bash shell/lint.sh
- name: Lint with OpenFL-specific rules
run: bash shell/lint.sh
3 changes: 2 additions & 1 deletion .github/workflows/pki.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ name: Private Key Infrastructure
on:
pull_request:
branches: [ develop ]
types: [opened, synchronize, reopened, ready_for_review]

permissions:
contents: read
Expand All @@ -16,7 +17,7 @@ env:

jobs:
test_insecure_client:

if: github.event.pull_request.draft == false
runs-on: ubuntu-latest

steps:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/pytest_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ name: Pytest and code coverage
on:
pull_request:
branches: [ develop ]
types: [opened, synchronize, reopened, ready_for_review]
workflow_dispatch:

permissions:
Expand All @@ -17,7 +18,7 @@ env:

jobs:
build:

if: github.event.pull_request.draft == false
runs-on: ubuntu-latest

steps:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/straggler-handling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ name: Straggler Handling Test
on:
pull_request:
branches: [ develop ]
types: [opened, synchronize, reopened, ready_for_review]

permissions:
contents: read
Expand All @@ -16,6 +17,7 @@ env:

jobs:
build:
if: github.event.pull_request.draft == false
strategy:
matrix:
os: ['ubuntu-latest', 'windows-latest']
Expand Down
161 changes: 161 additions & 0 deletions .github/workflows/task_runner_e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
---
#---------------------------------------------------------------------------
# Workflow to run Task Runner end to end tests
# Authors - Noopur, Payal Chaurasiya
#---------------------------------------------------------------------------
name: Task Runner E2E

on:
schedule:
- cron: "0 0 * * *" # Run every day at midnight
workflow_dispatch:
inputs:
num_rounds:
description: "Number of rounds to train"
required: false
default: "5"
type: string
num_collaborators:
description: "Number of collaborators"
required: false
default: "2"
type: string

permissions:
contents: read

# Environment variables common for all the jobs
env:
NUM_ROUNDS: ${{ inputs.num_rounds || '5' }}
NUM_COLLABORATORS: ${{ inputs.num_collaborators || '2' }}

jobs:
test:
name: tr_tls
runs-on: ubuntu-22.04
timeout-minutes: 120 # 2 hours
strategy:
matrix:
# There are open issues for some of the models, so excluding them for now:
# model_name: [ "torch_cnn_mnist", "keras_cnn_mnist", "torch_cnn_histology" ]
model_name: ["torch_cnn_mnist", "keras_cnn_mnist"]
python_version: ["3.8", "3.9", "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/[email protected]
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 with TLS
id: run_tests
run: |
python -m pytest -s tests/end_to_end/test_suites/task_runner_tests.py -m ${{ env.MODEL_NAME }} --num_rounds $NUM_ROUNDS --num_collaborators $NUM_COLLABORATORS --model_name ${{ env.MODEL_NAME }}
echo "Task runner end to end test run completed"
- name: Print test summary # Print the test summary only if the tests were run
id: print_test_summary
if: steps.run_tests.outcome == 'success' || steps.run_tests.outcome == 'failure'
run: |
export PYTHONPATH="$PYTHONPATH:."
python tests/end_to_end/utils/summary_helper.py
echo "Test summary printed"
- name: Tar files # Tar the test results only if the tests were run
id: tar_files
if: steps.run_tests.outcome == 'success' || steps.run_tests.outcome == 'failure'
run: tar -cvf result.tar results

- name: Upload Artifacts # Upload the test results only if the tar was created
id: upload_artifacts
uses: actions/upload-artifact@v4
if: steps.tar_files.outcome == 'success'
with:
name: task_runner_tls_${{ env.MODEL_NAME }}_python${{ env.PYTHON_VERSION }}_${{ github.run_id }}
path: result.tar

test_with_non_tls:
name: tr_non_tls
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: ["torch_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/[email protected]
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 }} --num_rounds $NUM_ROUNDS --num_collaborators $NUM_COLLABORATORS --disable_tls
echo "Task runner end to end test run completed"
- name: Print test summary # Print the test summary only if the tests were run
id: print_test_summary
if: steps.run_tests.outcome == 'success' || steps.run_tests.outcome == 'failure'
run: |
export PYTHONPATH="$PYTHONPATH:."
python tests/end_to_end/utils/summary_helper.py
echo "Test summary printed"
- name: Tar files # Tar the test results only if the tests were run
id: tar_files
if: steps.run_tests.outcome == 'success' || steps.run_tests.outcome == 'failure'
run: tar -cvf result.tar results

- name: Upload Artifacts # Upload the test results only if the tar was created
id: upload_artifacts
uses: actions/upload-artifact@v4
if: steps.tar_files.outcome == 'success'
with:
name: task_runner_non_tls_${{ env.MODEL_NAME }}_python${{ env.PYTHON_VERSION }}_${{ github.run_id }}
path: result.tar
2 changes: 2 additions & 0 deletions .github/workflows/taskrunner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ name: TaskRunner
on:
pull_request:
branches: [ develop ]
types: [opened, synchronize, reopened, ready_for_review]

permissions:
contents: read
Expand All @@ -16,6 +17,7 @@ env:

jobs:
build:
if: github.event.pull_request.draft == false
strategy:
matrix:
os: ['ubuntu-latest', 'windows-latest']
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/taskrunner_eden_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ name: TaskRunner (Eden Compression)

on:
pull_request:
branches: [ develop ]
branches: [ develop ]
types: [opened, synchronize, reopened, ready_for_review]

permissions:
contents: read

jobs:
build:
if: contains(github.event.pull_request.labels.*.name, 'eden_compression')
if: (github.event.pull_request.draft == false && contains(github.event.pull_request.labels.*.name, 'eden_compression'))
strategy:
matrix:
os: ['ubuntu-latest', 'windows-latest']
Expand Down
Loading

0 comments on commit 1637b41

Please sign in to comment.