diff --git a/.github/workflows/build_wheels_and_releases.yml b/.github/workflows/build_wheels_and_releases.yml
new file mode 100644
index 0000000000..b6801e26d8
--- /dev/null
+++ b/.github/workflows/build_wheels_and_releases.yml
@@ -0,0 +1,187 @@
+name: Build-Wheels-PyPi
+# https://github.com/pypa/cibuildwheel
+# Controls when the workflow will run
+on:
+ pull_request:
+ branches: [ master ]
+
+ # Allows you to run this workflow manually from the Actions tab
+ workflow_dispatch:
+
+jobs:
+ # Build the wheels for Linux, Windows and macOS for Python 3.8 and newer
+ build_wheels:
+ name: Build wheel for cp${{ matrix.python }}-${{ matrix.platform_id }}-${{ matrix.manylinux_image }}
+ runs-on: ${{ matrix.os }}
+ defaults:
+ run:
+ shell: bash
+ working-directory: python
+
+ strategy:
+ # Ensure that a wheel builder finishes even if another fails
+ fail-fast: false
+ matrix:
+ include:
+ # Window 64 bit
+ - os: windows-2019
+ python: 38
+ bitness: 64
+ platform_id: win_amd64
+ - os: windows-latest
+ python: 39
+ bitness: 64
+ platform_id: win_amd64
+ - os: windows-latest
+ python: 310
+ bitness: 64
+ platform_id: win_amd64
+
+ # Window 32 bit
+ - os: windows-latest
+ python: 38
+ bitness: 32
+ platform_id: win32
+ - os: windows-latest
+ python: 39
+ bitness: 32
+ platform_id: win32
+
+ # Linux 64 bit manylinux2014
+ - os: ubuntu-latest
+ python: 38
+ bitness: 64
+ platform_id: manylinux_x86_64
+ manylinux_image: manylinux2014
+ - os: ubuntu-latest
+ python: 39
+ bitness: 64
+ platform_id: manylinux_x86_64
+ manylinux_image: manylinux2014
+
+ # NumPy on Python 3.10 only supports 64bit and is only available with manylinux2014
+ - os: ubuntu-latest
+ python: 310
+ bitness: 64
+ platform_id: manylinux_x86_64
+ manylinux_image: manylinux2014
+
+ # MacOS x86_64
+ - os: macos-latest
+ bitness: 64
+ python: 38
+ platform_id: macosx_x86_64
+ - os: macos-latest
+ bitness: 64
+ python: 39
+ platform_id: macosx_x86_64
+ - os: macos-latest
+ bitness: 64
+ python: 310
+ platform_id: macosx_x86_64
+
+ # MacOS arm64
+ - os: macos-latest
+ bitness: 64
+ python: 38
+ platform_id: macosx_arm64
+ - os: macos-latest
+ bitness: 64
+ python: 39
+ platform_id: macosx_arm64
+ - os: macos-latest
+ bitness: 64
+ python: 310
+ platform_id: macosx_arm64
+
+ steps:
+ - name: Checkout fedml
+ uses: actions/checkout@v3
+
+ - name: Setup Python
+ uses: actions/setup-python@v4
+ #with:
+ # python-version: '3.9'
+
+ - name: Build and test wheels
+ env:
+ CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }}
+ CIBW_ARCHS: all
+ CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux_image }}
+ CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.manylinux_image }}
+ CIBW_TEST_SKIP: "*-macosx_arm64"
+ CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: bash build_tools/github/repair_windows_wheels.sh {wheel} {dest_dir} ${{ matrix.bitness }}
+ CIBW_BEFORE_TEST_WINDOWS: bash build_tools/github/build_minimal_windows_image.sh ${{ matrix.python }} ${{ matrix.bitness }}
+ CIBW_TEST_COMMAND: bash {project}/build_tools/github/test_wheels.sh
+ CIBW_TEST_COMMAND_WINDOWS: bash {project}/build_tools/github/test_windows_wheels.sh ${{ matrix.python }} ${{ matrix.bitness }}
+ CIBW_BUILD_VERBOSITY: 1
+
+ #run: bash build_tools/github/build_wheels.sh
+ run: |
+ python -m pip install -U wheel setuptools
+ python setup.py sdist bdist_wheel
+ ls dist/*.whl
+
+ - name: Store artifacts
+ uses: actions/upload-artifact@v3
+ with:
+ path: python/dist/*.whl
+
+ # Build the source distribution under Linux
+ build_sdist:
+ name: Source distribution
+ needs: [ build_wheels ]
+ runs-on: ubuntu-latest
+ defaults:
+ run:
+ shell: bash
+ working-directory: python
+
+ steps:
+ - name: Checkout fedml
+ uses: actions/checkout@v3
+
+ - name: Setup Python
+ uses: actions/setup-python@v4
+ with:
+ python-version: '3.9' # update once build dependencies are available
+
+ - name: Build source distribution
+ run: bash build_tools/github/build_source.sh
+
+ - name: Test source distribution
+ run: bash build_tools/github/test_source.sh
+ env:
+ OMP_NUM_THREADS: 2
+ OPENBLAS_NUM_THREADS: 2
+
+ - name: Store artifacts
+ uses: actions/upload-artifact@v3
+ with:
+ path: python/dist/*.tar.gz
+
+ upload_pypi:
+ name: Upload pypi
+ needs: [ build_sdist ]
+ runs-on: ubuntu-latest
+ defaults:
+ run:
+ shell: bash
+ working-directory: python
+ # upload to PyPI on every tag starting with 'v'
+ # if: github.event_name == 'push' && contains(github.event.comment, 'release v')
+ # alternatively, to publish when a GitHub Release is created, use the following rule:
+ # if: github.event_name == 'release' && github.event.action == 'published'
+ steps:
+ - uses: actions/download-artifact@v3
+ with:
+ name: artifact
+ path: python/dist
+
+ - uses: pypa/gh-action-pypi-publish@v1.4.2
+ with:
+ skip_existing: true
+ packages_dir: python/dist
+ user: ${{ secrets.PYPI_USER_NAME }}
+ password: ${{ secrets.PYPI_PASSWORD }}
+ # To test: repository_url: https://test.pypi.org/legacy/
\ No newline at end of file
diff --git a/.github/workflows/build_wheels_and_releases.yml-backup b/.github/workflows/build_wheels_and_releases.yml-backup
new file mode 100644
index 0000000000..2a27b44e65
--- /dev/null
+++ b/.github/workflows/build_wheels_and_releases.yml-backup
@@ -0,0 +1,250 @@
+#name: Build_Wheels_and_Release
+## https://github.com/pypa/cibuildwheel
+## Controls when the workflow will run
+#on:
+# # Triggers the workflow on push or pull request events but only for the master branch
+# schedule:
+# # Nightly build at 12:12 A.M.
+# - cron: "12 12 */1 * *"
+## push:
+## branches: [ master, test/v0.7.0 ]
+## pull_request:
+## branches: [ master, test/v0.7.0 ]
+#
+# # Allows you to run this workflow manually from the Actions tab
+# workflow_dispatch:
+#
+#jobs:
+# build_wheels:
+# runs-on: [self-hosted, devops]
+# defaults:
+# run:
+# shell: bash
+# working-directory: python
+# strategy:
+# # Ensure that a wheel builder finishes even if another fails
+# fail-fast: false
+# matrix:
+# # Github Actions doesn't support pairing matrix values together, let's improvise
+# # https://github.com/github/feedback/discussions/7835#discussioncomment-1769026
+# buildplat:
+# - [ubuntu-20.04, manylinux_x86_64]
+# - [macos-10.15, macosx_*]
+# - [windows-2019, win_amd64]
+# - [windows-2019, win32]
+# # TODO: uncomment PyPy 3.9 builds once PyPy
+# # re-releases a new minor version
+# # NOTE: This needs a bump of cibuildwheel version, also, once that happens.
+# python: ["cp38", "cp39", "cp310", "pp38"] #, "pp39"]
+# exclude:
+# # Don't build PyPy 32-bit windows
+# - buildplat: [windows-2019, win32]
+# python: "pp38"
+# - buildplat: [windows-2019, win32]
+# python: "pp39"
+# env:
+# IS_32_BIT: ${{ matrix.buildplat[1] == 'win32' }}
+# IS_PUSH: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
+# IS_SCHEDULE_DISPATCH: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
+# steps:
+# - name: Checkout numpy
+# - uses: actions/checkout@v3
+#
+# # Used to push the built wheels
+# - uses: actions/setup-python@v3
+# with:
+# python-version: '3.x'
+#
+# - name: Configure mingw for 32-bit builds
+# run: |
+# # Force 32-bit mingw
+# choco uninstall mingw
+# choco install -y mingw --forcex86 --force --version=7.3.0
+# echo "C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw32\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
+# refreshenv
+# if: ${{ env.IS_32_BIT == 'true' }}
+#
+#
+# - name: Install cibuildwheel
+# run: |
+# pip install --upgrade setuptools
+# python3 -m pip install pipx
+# python3 -m pipx ensurepath
+# export PATH="${PATH}:$(python3 -c 'import site; print(site.USER_BASE)')/bin"
+## python3 -m pipx ensurepath --force
+#
+# - name: Build wheels
+# uses: pypa/cibuildwheel@v2.7.0
+# env:
+# CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}
+#
+# - uses: actions/upload-artifact@v3
+# with:
+# name: ${{ matrix.python }}-${{ startsWith(matrix.buildplat[1], 'macosx') && 'macosx' || matrix.buildplat[1] }}
+# path: ./wheelhouse/*.whl
+
+# - name: Upload wheels
+# if: success()
+# shell: bash
+# env:
+# NUMPY_STAGING_UPLOAD_TOKEN: ${{ secrets.NUMPY_STAGING_UPLOAD_TOKEN }}
+# NUMPY_NIGHTLY_UPLOAD_TOKEN: ${{ secrets.NUMPY_NIGHTLY_UPLOAD_TOKEN }}
+# run: |
+# source tools/wheels/upload_wheels.sh
+# set_upload_vars
+# # trigger an upload to
+# # https://anaconda.org/scipy-wheels-nightly/numpy
+# # for cron jobs or "Run workflow" (restricted to main branch).
+# # Tags will upload to
+# # https://anaconda.org/multibuild-wheels-staging/numpy
+# # The tokens were originally generated at anaconda.org
+# upload_wheels
+# strategy:
+# fail-fast: false
+# matrix:
+# os: [ ubuntu-20.04, windows-2019, macOS-10.15 ]
+# arch: [X86, X64, ARM, ARM64]
+# python-version: ['3.6', '3.7', '3.8', '3.9']
+# exclude:
+# - os: macos-latest
+# python-version: '3.8'
+# - os: windows-latest
+# python-version: '3.6'
+# strategy:
+# # Ensure that a wheel builder finishes even if another fails
+# fail-fast: false
+# matrix:
+# include:
+# # from mpi4py import MPI
+# # ImportError: DLL load failed while importing MPI: The specified module could not be found.
+# - os: windows-2019-py38-amd64
+# python: 38
+# bitness: 64
+# platform_id: win_amd64
+# # from mpi4py import MPI
+# # ImportError: DLL load failed while importing MPI: The specified module could not be found.
+# - os: windows-latest-py39-amd64
+# python: 39
+# bitness: 64
+# platform_id: win_amd64
+# # ERROR: No matching distribution found for MNN==1.1.6
+# - os: windows-latest-py310-amd64
+# python: 310
+# bitness: 64
+# platform_id: win_amd64
+# # #RROR: No matching distribution found for torch==1.11.0
+# - os: windows-latest-py38-win32
+# python: 38
+# bitness: 32
+# platform_id: win32
+# # ERROR: No matching distribution found for torch==1.11.0
+# - os: windows-latest-py39-win32
+# python: 39
+# bitness: 32
+# platform_id: win32
+#
+# # auditwheel.main_repair:This does not look like a platform wheel
+# - os: ubuntu-latest-py38-x86
+# python: 38
+# bitness: 64
+# platform_id: manylinux_x86_64
+# manylinux_image: manylinux2014
+# # auditwheel.main_repair:This does not look like a platform wheel
+# - os: ubuntu-latest-py39-x86
+# python: 39
+# bitness: 64
+# platform_id: manylinux_x86_64
+# manylinux_image: manylinux2014
+# # auditwheel.main_repair:This does not look like a platform wheel
+# - os: ubuntu-latest-py310-x86
+# python: 310
+# bitness: 64
+# platform_id: manylinux_x86_64
+# manylinux_image: manylinux2014
+#
+# # _configtest.c:2:10: fatal error: 'mpi.h' file not found
+# - os: macos-latest-py38-x86
+# bitness: 64
+# python: 38
+# platform_id: macosx_x86_64
+# # _configtest.c:2:10: fatal error: 'mpi.h' file not found
+# - os: macos-latest-py39-x86
+# bitness: 64
+# python: 39
+# platform_id: macosx_x86_64
+# # _configtest.c:2:10: fatal error: 'mpi.h' file not found
+# - os: macos-latest-py310-x86
+# bitness: 64
+# python: 310
+# platform_id: macosx_x86_64
+#
+# # MacOS arm64
+# - os: macos-latest-py38-arm64
+# bitness: 64
+# python: 38
+# platform_id: macosx_arm64
+# - os: macos-latest-py39-arm64
+# bitness: 64
+# python: 39
+# platform_id: macosx_arm64
+# - os: macos-latest-py310-arm64
+# bitness: 64
+# python: 310
+# platform_id: macosx_arm64
+
+# steps:
+# - uses: actions/checkout@v3
+#
+# # Used to host cibuildwheel
+# - uses: actions/setup-python@v3
+#
+## - name: Install cibuildwheel
+## run: python -m pip install cibuildwheel==2.7.0
+#
+# - name: Build wheels
+# working-directory: ./python
+# env:
+# CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }}
+# CIBW_ARCHS: all
+# CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: bash {project}/python/build_tools/github/repair_windows_wheels.sh {wheel} {dest_dir} ${{ matrix.bitness }}
+# CIBW_BEFORE_TEST_WINDOWS: bash {project}/python/build_tools/github/build_minimal_windows_image.sh ${{ matrix.python }} ${{ matrix.bitness }}
+# CIBW_TEST_COMMAND: bash {project}/python/build_tools/github/test_wheels.sh
+# CIBW_TEST_COMMAND_WINDOWS: bash {project}/python/build_tools/github/test_windows_wheels.sh ${{ matrix.python }} ${{ matrix.bitness }}
+# CIBW_BUILD_VERBOSITY: 1
+# run: |
+# python -m pip install -U wheel setuptools
+# python setup.py sdist bdist_wheel
+# run: python -m cibuildwheel --output-dir dist
+## run: cd {project}/python && python -m cibuildwheel --output-dir wheelhouse
+# # to supply options, put them in 'env', like (test)
+# # env:
+# # CIBW_SOME_OPTION: value
+#
+# - name: Upload source zip file
+# uses: actions/upload-artifact@v2
+# with:
+# path: python/dist/*.tar.gz
+# - name: Upload Wheels
+# uses: actions/upload-artifact@v2
+# with:
+# path: ./python/dist/*.whl
+
+# upload_pypi:
+# needs: [build_wheels]
+# runs-on: [self-hosted]
+# # upload to PyPI on every tag starting with 'v'
+## if: github.event_name == 'push' && contains(github.event.comment, 'release v')
+# # alternatively, to publish when a GitHub Release is created, use the following rule:
+# # if: github.event_name == 'release' && github.event.action == 'published'
+# steps:
+# - uses: actions/download-artifact@v2
+# with:
+# name: artifact
+# path: dist
+#
+# - uses: pypa/gh-action-pypi-publish@v1.4.2
+# with:
+# skip_existing: true
+# user: chaoyanghe
+# password: ${{ secrets.pypi_password }}
+# # To test: repository_url: https://test.pypi.org/legacy/
\ No newline at end of file
diff --git a/.github/workflows/full_e2e_test.yml-bakcup b/.github/workflows/full_e2e_test.yml-bakcup
new file mode 100644
index 0000000000..4dd408fbd8
--- /dev/null
+++ b/.github/workflows/full_e2e_test.yml-bakcup
@@ -0,0 +1,104 @@
+# This is a basic workflow to help you get started with Actions
+
+name: Full End-to-end Test
+
+# Controls when the workflow will run
+on:
+ # Triggers the workflow on push or pull request events but only for the master branch
+ push:
+ branches: [ master, test/v0.7.0 ]
+ pull_request:
+ branches: [ master, test/v0.7.0 ]
+
+ # Allows you to run this workflow manually from the Actions tab
+ workflow_dispatch:
+
+# A workflow run is made up of one or more jobs that can run sequentially or in parallel
+jobs:
+ # This workflow contains a single job called "mlops-cli-test"
+ mlops-cli-test:
+ strategy:
+ matrix:
+ os: [ ubuntu-latest, windows-latest, macos-latest ]
+ arch: [X64, ARM64]
+ python-version: ['3.8']
+ # The type of runner that the job will run on
+ runs-on: [self-hosted, devops]
+ defaults:
+ run:
+ shell: bash
+ working-directory: python
+
+ # Steps represent a sequence of tasks that will be executed as part of the job
+ steps:
+ # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
+ - uses: actions/checkout@v3
+ - uses: actions/setup-python@v4
+ with:
+ python-version: ${{ matrix.python-version }}
+ # - name: pip install -e ./
+ # run: |
+ # echo "install pip"
+ # sudo apt-get install python3-pip << eof
+ #
+ # y
+ #
+ # eof
+ #
+ # echo "pip install -e ./"
+ # pip install -e ./
+
+ - name: test sp_fedavg_mnist_lr_example
+ run: |
+ echo "this is for test sp_fedavg_mnist_lr_example"
+ cd examples/simulation/sp_fedavg_mnist_lr_example
+
+ python torch_fedavg_mnist_lr_step_by_step_example.py --cf fedml_config.yaml
+
+ - name: test sp_fedopt_mnist_lr_example
+ run: |
+ echo "this is for test sp_fedopt_mnist_lr_example"
+ cd examples/simulation/sp_fedopt_mnist_lr_example
+
+ python torch_fedopt_mnist_lr_step_by_step_example.py --cf fedml_config.yaml
+
+ - name: test sp_fednova_mnist_lr_example
+ run: |
+ echo "this is for test sp_fednova_mnist_lr_example"
+ cd examples/simulation/sp_fednova_mnist_lr_example
+
+ python torch_fednova_mnist_lr_step_by_step_example.py --cf fedml_config.yaml
+
+ - name: test sp_turboaggregate_mnist_lr_example
+ run: |
+ echo "this is for test sp_turboaggregate_mnist_lr_example"
+ cd examples/simulation/sp_turboaggregate_mnist_lr_example
+
+ python torch_turboaggregate_mnist_lr_step_by_step_example.py --cf fedml_config.yaml
+
+ - name: test sp_hierarchicalfl_mnist_lr_example
+ run: |
+ echo "this is for test sp_hierarchicalfl_mnist_lr_example"
+ cd examples/simulation/sp_hierarchicalfl_mnist_lr_example
+
+ python torch_hierarchicalfl_mnist_lr_step_by_step_example.py --cf fedml_config.yaml
+
+ - name: test sp_vertical_mnist_lr_example
+ run: |
+ echo "this is for test sp_vertical_mnist_lr_example"
+ cd examples/simulation/sp_vertical_mnist_lr_example
+
+ python torch_vertical_mnist_lr_step_by_step_example.py --cf fedml_config.yaml
+
+ - name: test sp_fedsgd_cifar10_resnet20_example
+ run: |
+ echo "this is for test sp_fedsgd_cifar10_resnet20_example"
+
+ cd examples/simulation/sp_fedsgd_cifar10_resnet20_example
+
+ python sp_fedsgd_cifar10_resnet20_example.py --cf eftopk_config.yaml
+
+ - name: test example B
+ run: |
+ echo "this is for test example B"
+ echo "second line of the script"
\ No newline at end of file
diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml
index a4f4bf6f58..ae7fc77858 100644
--- a/.github/workflows/pylint.yml
+++ b/.github/workflows/pylint.yml
@@ -1,15 +1,34 @@
-name: Pylint
+name: Pylint - FedML
-on: [push]
+on:
+ push:
+ branches: [ master, test/v0.7.0, dev/v0.7.0 ]
+
+ pull_request:
+ branches: [ master, test/v0.7.0, dev/0.7.0 ]
+
+ # Allows you to run this workflow manually from the Actions tab
+ workflow_dispatch:
jobs:
build:
- runs-on: ubuntu-latest
+ defaults:
+ run:
+ shell: bash
+ working-directory: python
+ runs-on: [self-hosted, runner-linux, devops-mpi]
strategy:
matrix:
- python-version: ["3.7", "3.8", "3.9", "3.10"]
+ python-version: ["3.8"]
+ mpi: [mpich]
+# include:
+# - os: ubuntu-latest
+# mpi: mpich
+# install-mpi: sudo apt install -y mpich libmpich-dev
steps:
- uses: actions/checkout@v3
+# - name: Install MPI
+# run: ${{ matrix.install-mpi }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
@@ -20,4 +39,13 @@ jobs:
pip install pylint
- name: Analysing the code with pylint
run: |
- pylint $(git ls-files '*.py')
+ python -m pip install mpi4py
+ pip install "fedml[gRPC]"
+ pip install "fedml[tensorflow]"
+ pip install "fedml[jax]"
+ pip install "fedml[mxnet]"
+ pip install tensorflow_federated
+ pip install mxnet
+ pip install jax
+ pip install ptflops
+ pylint --rcfile=build_tools/lint/.pylintrc --disable=C,R,W,I ./
diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml
deleted file mode 100644
index ec703542be..0000000000
--- a/.github/workflows/python-publish.yml
+++ /dev/null
@@ -1,39 +0,0 @@
-# This workflow will upload a Python Package using Twine when a release is created
-# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
-
-# This workflow uses actions that are not certified by GitHub.
-# They are provided by a third-party and are governed by
-# separate terms of service, privacy policy, and support
-# documentation.
-
-name: Upload Python Package
-
-on:
- release:
- types: [published]
-
-permissions:
- contents: read
-
-jobs:
- deploy:
-
- runs-on: ubuntu-latest
-
- steps:
- - uses: actions/checkout@v3
- - name: Set up Python
- uses: actions/setup-python@v3
- with:
- python-version: '3.x'
- - name: Install dependencies
- run: |
- python -m pip install --upgrade pip
- pip install build
- - name: Build package
- run: python -m build
- - name: Publish package
- uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
- with:
- user: __token__
- password: ${{ secrets.PYPI_API_TOKEN }}
diff --git a/.github/workflows/runner.md b/.github/workflows/runner.md
new file mode 100644
index 0000000000..40b5462a4d
--- /dev/null
+++ b/.github/workflows/runner.md
@@ -0,0 +1,37 @@
+# Install GitHub runner with your own computer:
+ssh -i amir-github-actions-key.cer ubuntu@54.183.200.162
+ssh -i amir-github-actions-key.cer ubuntu@52.53.164.162
+ssh -i github_actions.cer ubuntu@54.153.18.24
+
+sudo rpm -Uvh https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm
+sudo apt-get update && sudo apt-get install -y dotnet6
+dotnet --version
+#install runner based on the following url: https://github.com/FedML-AI/FedML/settings/actions/runners/new?arch=x64&os=linux
+sudo ./svc.sh install
+sudo ./svc.sh start
+sudo ./svc.sh status
+
+# Install GitHub runner in Ubuntu from AWS:
+ssh -i "fedml-github-action.pem" ubuntu@ec2-54-176-61-229.us-west-1.compute.amazonaws.com
+ssh -i "fedml-github-action.pem" ubuntu@ec2-54-219-186-81.us-west-1.compute.amazonaws.com
+ssh -i "fedml-github-action.pem" ubuntu@ec2-54-219-187-134.us-west-1.compute.amazonaws.com
+
+sudo rpm -Uvh https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm
+sudo apt-get update && sudo apt-get install -y dotnet6
+dotnet --version
+#install runner based on the following url: https://github.com/FedML-AI/FedML/settings/actions/runners/new?arch=x64&os=linux
+
+sudo ./svc.sh install
+sudo ./svc.sh start
+sudo ./svc.sh status
+
+
+# Install GitHub runner in Windows from AWS:
+1. You may connect to AWS Windows server by RDP client from MAC AppStore based on the url: https://docs.microsoft.com/en-us/windows-server/remote/remote-desktop-services/clients/remote-desktop-mac
+
+host: ec2-184-169-242-201.us-west-1.compute.amazonaws.com
+
+2. Enabling Windows Long Path on Windows based on the following url:
+ https://www.microfocus.com/documentation/filr/filr-4/filr-desktop/t47bx2ogpfz7.html
+
+3. install runner based on the following url: https://github.com/FedML-AI/FedML/settings/actions/runners/new?arch=x64&os=win
diff --git a/.github/workflows/smoke_test_cross_device_mnn_server_linux.yml b/.github/workflows/smoke_test_cross_device_mnn_server_linux.yml
new file mode 100644
index 0000000000..b2fea66602
--- /dev/null
+++ b/.github/workflows/smoke_test_cross_device_mnn_server_linux.yml
@@ -0,0 +1,51 @@
+# This is a basic workflow to help you get started with Actions
+
+name: CROSS-DEVICE-MNN-Linux
+
+# Controls when the workflow will run
+on:
+ # Triggers the workflow on push or pull request events but only for the master branch
+ schedule:
+ # Nightly build at 12:12 A.M.
+ - cron: "12 12 */1 * *"
+
+ pull_request:
+ branches: [ master, test/v0.7.0, dev/0.7.0 ]
+
+ # Allows you to run this workflow manually from the Actions tab
+ workflow_dispatch:
+
+# A workflow run is made up of one or more jobs that can run sequentially or in parallel
+jobs:
+ cross-device-mnn-server:
+ defaults:
+ run:
+ shell: bash
+ working-directory: python
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [ ubuntu-latest ]
+ arch: [X64]
+ python-version: ['3.8']
+# exclude:
+# - os: macos-latest
+# python-version: '3.8'
+# - os: windows-latest
+# python-version: '3.6'
+ runs-on: [self-hosted, runner-linux, devops]
+ timeout-minutes: 15
+ steps:
+ - uses: actions/setup-python@v4
+ with:
+ python-version: ${{ matrix.python-version }}
+ - uses: actions/checkout@v3
+ - name: pip install -e ./
+ run: |
+ pip install -e ./
+
+ - name: test server of cross-device
+ run: |
+ cd quick_start/beehive
+ timeout 60 bash run_server.sh || code=$?; if [[ $code -ne 124 && $code -ne 0 ]]; then exit $code; fi
+
diff --git a/.github/workflows/smoke_test_cross_silo_fedavg_attack_linux.yml b/.github/workflows/smoke_test_cross_silo_fedavg_attack_linux.yml
new file mode 100644
index 0000000000..aa6cdf4b8d
--- /dev/null
+++ b/.github/workflows/smoke_test_cross_silo_fedavg_attack_linux.yml
@@ -0,0 +1,85 @@
+# This is a basic workflow to help you get started with Actions
+
+name: Attacker-Linux
+
+# Controls when the workflow will run
+on:
+ # Triggers the workflow on push or pull request events but only for the master branch
+ schedule:
+ # Nightly build at 12:12 A.M.
+ - cron: "12 12 */1 * *"
+ pull_request:
+ branches: [ master, test/v0.7.0, dev/0.7.0 ]
+
+ # Allows you to run this workflow manually from the Actions tab
+ workflow_dispatch:
+
+# A workflow run is made up of one or more jobs that can run sequentially or in parallel
+jobs:
+ cross-silo-attack-test:
+ defaults:
+ run:
+ shell: bash
+ working-directory: python
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [ ubuntu-latest]
+ arch: [X64]
+ python-version: ['3.8']
+ client-index: ['0', '1', '2', '3', '4']
+# exclude:
+# - os: macos-latest
+# python-version: '3.8'
+# - os: windows-latest
+# python-version: '3.6'
+ runs-on: [self-hosted, runner-linux, devops]
+ timeout-minutes: 15
+ steps:
+ - uses: actions/setup-python@v4
+ with:
+ python-version: ${{ matrix.python-version }}
+ - uses: actions/checkout@v3
+ - name: pip install -e ./
+ run: |
+ pip install -e ./
+
+ - name: server - cross-silo - attack
+ run: |
+ cd examples/cross_silo/mqtt_s3_fedavg_attack_mnist_lr_example
+ run_id=cross-silo-attack-${{ format('{0}{1}{2}{3}', github.run_id, matrix.os, matrix.arch, matrix.python-version) }}
+ echo ${run_id}
+ bash run_server.sh $run_id
+ if: ${{ matrix.client-index == '0' }}
+
+ - name: client 1 - cross-silo - attack
+ run: |
+ cd examples/cross_silo/mqtt_s3_fedavg_attack_mnist_lr_example
+ run_id=cross-silo-attack-${{ format('{0}{1}{2}{3}', github.run_id, matrix.os, matrix.arch, matrix.python-version) }}
+ echo ${run_id}
+ bash run_client.sh 1 $run_id
+ if: ${{ matrix.client-index == '1' }}
+
+ - name: client 2 - cross-silo - attack
+ run: |
+ cd examples/cross_silo/mqtt_s3_fedavg_attack_mnist_lr_example
+ run_id=cross-silo-attack-${{ format('{0}{1}{2}{3}', github.run_id, matrix.os, matrix.arch, matrix.python-version) }}
+ echo ${run_id}
+ bash run_client.sh 2 $run_id
+ if: ${{ matrix.client-index == '2' }}
+
+ - name: client 3 - cross-silo - attack
+ run: |
+ cd examples/cross_silo/mqtt_s3_fedavg_attack_mnist_lr_example
+ run_id=cross-silo-attack-${{ format('{0}{1}{2}{3}', github.run_id, matrix.os, matrix.arch, matrix.python-version) }}
+ echo ${run_id}
+ bash run_client.sh 3 $run_id
+ if: ${{ matrix.client-index == '3' }}
+
+ - name: client 4 - cross-silo - attack
+ run: |
+ cd examples/cross_silo/mqtt_s3_fedavg_attack_mnist_lr_example
+ run_id=cross-silo-attack-${{ format('{0}{1}{2}{3}', github.run_id, matrix.os, matrix.arch, matrix.python-version) }}
+ echo ${run_id}
+ bash run_client.sh 4 $run_id
+ if: ${{ matrix.client-index == '4' }}
\ No newline at end of file
diff --git a/.github/workflows/smoke_test_cross_silo_fedavg_cdp_linux.yml b/.github/workflows/smoke_test_cross_silo_fedavg_cdp_linux.yml
new file mode 100644
index 0000000000..2272285811
--- /dev/null
+++ b/.github/workflows/smoke_test_cross_silo_fedavg_cdp_linux.yml
@@ -0,0 +1,69 @@
+# This is a basic workflow to help you get started with Actions
+
+name: CDP-Linux
+
+# Controls when the workflow will run
+on:
+ # Triggers the workflow on push or pull request events but only for the master branch
+ schedule:
+ # Nightly build at 12:12 A.M.
+ - cron: "12 12 */1 * *"
+ pull_request:
+ branches: [ master, test/v0.7.0, dev/0.7.0 ]
+
+ # Allows you to run this workflow manually from the Actions tab
+ workflow_dispatch:
+
+# A workflow run is made up of one or more jobs that can run sequentially or in parallel
+jobs:
+ cross-silo-cdp-test:
+ defaults:
+ run:
+ shell: bash
+ working-directory: python
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [ ubuntu-latest]
+ arch: [X64]
+ python-version: ['3.8']
+ client-index: ['0', '1', '2']
+# exclude:
+# - os: macos-latest
+# python-version: '3.8'
+# - os: windows-latest
+# python-version: '3.6'
+ runs-on: [self-hosted, runner-linux, devops]
+ timeout-minutes: 15
+ steps:
+ - uses: actions/setup-python@v4
+ with:
+ python-version: ${{ matrix.python-version }}
+ - uses: actions/checkout@v3
+ - name: pip install -e ./
+ run: |
+ pip install -e ./
+
+ - name: server - cross-silo - cdp
+ run: |
+ cd examples/cross_silo/mqtt_s3_fedavg_cdp_mnist_lr_example
+ run_id=cross-silo-ho-${{ format('{0}{1}{2}{3}', github.run_id, matrix.os, matrix.arch, matrix.python-version) }}
+ echo ${run_id}
+ bash run_server.sh $run_id
+ if: ${{ matrix.client-index == '0' }}
+
+ - name: client 1 - cross-silo - cdp
+ run: |
+ cd examples/cross_silo/mqtt_s3_fedavg_cdp_mnist_lr_example
+ run_id=cross-silo-ho-${{ format('{0}{1}{2}{3}', github.run_id, matrix.os, matrix.arch, matrix.python-version) }}
+ echo ${run_id}
+ bash run_client.sh 1 $run_id
+ if: ${{ matrix.client-index == '1' }}
+
+ - name: client 2 - cross-silo - cdp
+ run: |
+ cd examples/cross_silo/mqtt_s3_fedavg_cdp_mnist_lr_example
+ run_id=cross-silo-ho-${{ format('{0}{1}{2}{3}', github.run_id, matrix.os, matrix.arch, matrix.python-version) }}
+ echo ${run_id}
+ bash run_client.sh 2 $run_id
+ if: ${{ matrix.client-index == '2' }}
\ No newline at end of file
diff --git a/.github/workflows/smoke_test_cross_silo_fedavg_defense_linux.yml b/.github/workflows/smoke_test_cross_silo_fedavg_defense_linux.yml
new file mode 100644
index 0000000000..e009288ff5
--- /dev/null
+++ b/.github/workflows/smoke_test_cross_silo_fedavg_defense_linux.yml
@@ -0,0 +1,85 @@
+# This is a basic workflow to help you get started with Actions
+
+name: Defender-Linux
+
+# Controls when the workflow will run
+on:
+ # Triggers the workflow on push or pull request events but only for the master branch
+ schedule:
+ # Nightly build at 12:12 A.M.
+ - cron: "12 12 */1 * *"
+ pull_request:
+ branches: [ master, test/v0.7.0, dev/0.7.0 ]
+
+ # Allows you to run this workflow manually from the Actions tab
+ workflow_dispatch:
+
+# A workflow run is made up of one or more jobs that can run sequentially or in parallel
+jobs:
+ cross-silo-defense-test:
+ defaults:
+ run:
+ shell: bash
+ working-directory: python
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [ ubuntu-latest]
+ arch: [X64]
+ python-version: ['3.8']
+ client-index: ['0', '1', '2', '3', '4']
+# exclude:
+# - os: macos-latest
+# python-version: '3.8'
+# - os: windows-latest
+# python-version: '3.6'
+ runs-on: [self-hosted, runner-linux, devops]
+ timeout-minutes: 15
+ steps:
+ - uses: actions/setup-python@v4
+ with:
+ python-version: ${{ matrix.python-version }}
+ - uses: actions/checkout@v3
+ - name: pip install -e ./
+ run: |
+ pip install -e ./
+
+ - name: server - cross-silo - defense
+ run: |
+ cd examples/cross_silo/mqtt_s3_fedavg_defense_mnist_lr_example
+ run_id=cross-silo-defense-${{ format('{0}{1}{2}{3}', github.run_id, matrix.os, matrix.arch, matrix.python-version) }}
+ echo ${run_id}
+ bash run_server.sh $run_id
+ if: ${{ matrix.client-index == '0' }}
+
+ - name: client 1 - cross-silo - defense
+ run: |
+ cd examples/cross_silo/mqtt_s3_fedavg_defense_mnist_lr_example
+ run_id=cross-silo-defense-${{ format('{0}{1}{2}{3}', github.run_id, matrix.os, matrix.arch, matrix.python-version) }}
+ echo ${run_id}
+ bash run_client.sh 1 $run_id
+ if: ${{ matrix.client-index == '1' }}
+
+ - name: client 2 - cross-silo - defense
+ run: |
+ cd examples/cross_silo/mqtt_s3_fedavg_defense_mnist_lr_example
+ run_id=cross-silo-defense-${{ format('{0}{1}{2}{3}', github.run_id, matrix.os, matrix.arch, matrix.python-version) }}
+ echo ${run_id}
+ bash run_client.sh 2 $run_id
+ if: ${{ matrix.client-index == '2' }}
+
+ - name: client 3 - cross-silo - defense
+ run: |
+ cd examples/cross_silo/mqtt_s3_fedavg_defense_mnist_lr_example
+ run_id=cross-silo-defense-${{ format('{0}{1}{2}{3}', github.run_id, matrix.os, matrix.arch, matrix.python-version) }}
+ echo ${run_id}
+ bash run_client.sh 3 $run_id
+ if: ${{ matrix.client-index == '3' }}
+
+ - name: client 4 - cross-silo - defense
+ run: |
+ cd examples/cross_silo/mqtt_s3_fedavg_defense_mnist_lr_example
+ run_id=cross-silo-defense-${{ format('{0}{1}{2}{3}', github.run_id, matrix.os, matrix.arch, matrix.python-version) }}
+ echo ${run_id}
+ bash run_client.sh 4 $run_id
+ if: ${{ matrix.client-index == '4' }}
diff --git a/.github/workflows/smoke_test_cross_silo_fedavg_ldp_linux.yml b/.github/workflows/smoke_test_cross_silo_fedavg_ldp_linux.yml
new file mode 100644
index 0000000000..9fb43f6bfb
--- /dev/null
+++ b/.github/workflows/smoke_test_cross_silo_fedavg_ldp_linux.yml
@@ -0,0 +1,69 @@
+# This is a basic workflow to help you get started with Actions
+
+name: LDP-Linux
+
+# Controls when the workflow will run
+on:
+ # Triggers the workflow on push or pull request events but only for the master branch
+ schedule:
+ # Nightly build at 12:12 A.M.
+ - cron: "12 12 */1 * *"
+ pull_request:
+ branches: [ master, test/v0.7.0, dev/0.7.0 ]
+
+ # Allows you to run this workflow manually from the Actions tab
+ workflow_dispatch:
+
+# A workflow run is made up of one or more jobs that can run sequentially or in parallel
+jobs:
+ cross-silo-ldp-test:
+ defaults:
+ run:
+ shell: bash
+ working-directory: python
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [ ubuntu-latest]
+ arch: [X64]
+ python-version: ['3.8']
+ client-index: ['0', '1', '2']
+# exclude:
+# - os: macos-latest
+# python-version: '3.8'
+# - os: windows-latest
+# python-version: '3.6'
+ runs-on: [self-hosted, runner-linux, devops]
+ timeout-minutes: 15
+ steps:
+ - uses: actions/setup-python@v4
+ with:
+ python-version: ${{ matrix.python-version }}
+ - uses: actions/checkout@v3
+ - name: pip install -e ./
+ run: |
+ pip install -e ./
+
+ - name: server - cross-silo - ldp
+ run: |
+ cd examples/cross_silo/mqtt_s3_fedavg_ldp_mnist_lr_example
+ run_id=cross-silo-ho-${{ format('{0}{1}{2}{3}', github.run_id, matrix.os, matrix.arch, matrix.python-version) }}
+ echo ${run_id}
+ bash run_server.sh $run_id
+ if: ${{ matrix.client-index == '0' }}
+
+ - name: client 1 - cross-silo - ldp
+ run: |
+ cd examples/cross_silo/mqtt_s3_fedavg_ldp_mnist_lr_example
+ run_id=cross-silo-ho-${{ format('{0}{1}{2}{3}', github.run_id, matrix.os, matrix.arch, matrix.python-version) }}
+ echo ${run_id}
+ bash run_client.sh 1 $run_id
+ if: ${{ matrix.client-index == '1' }}
+
+ - name: client 2 - cross-silo - ldp
+ run: |
+ cd examples/cross_silo/mqtt_s3_fedavg_ldp_mnist_lr_example
+ run_id=cross-silo-ho-${{ format('{0}{1}{2}{3}', github.run_id, matrix.os, matrix.arch, matrix.python-version) }}
+ echo ${run_id}
+ bash run_client.sh 2 $run_id
+ if: ${{ matrix.client-index == '2' }}
\ No newline at end of file
diff --git a/.github/workflows/smoke_test_cross_silo_ho_linux.yml b/.github/workflows/smoke_test_cross_silo_ho_linux.yml
new file mode 100644
index 0000000000..09497f830c
--- /dev/null
+++ b/.github/workflows/smoke_test_cross_silo_ho_linux.yml
@@ -0,0 +1,69 @@
+# This is a basic workflow to help you get started with Actions
+
+name: CROSS-SILO-HO-Linux
+
+# Controls when the workflow will run
+on:
+ # Triggers the workflow on push or pull request events but only for the master branch
+ schedule:
+ # Nightly build at 12:12 A.M.
+ - cron: "12 12 */1 * *"
+ pull_request:
+ branches: [ master, test/v0.7.0, dev/0.7.0 ]
+
+ # Allows you to run this workflow manually from the Actions tab
+ workflow_dispatch:
+
+# A workflow run is made up of one or more jobs that can run sequentially or in parallel
+jobs:
+ cross-silo-horizontal-test:
+ defaults:
+ run:
+ shell: bash
+ working-directory: python
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [ ubuntu-latest]
+ arch: [X64]
+ python-version: ['3.8']
+ client-index: ['0', '1', '2']
+# exclude:
+# - os: macos-latest
+# python-version: '3.8'
+# - os: windows-latest
+# python-version: '3.6'
+ runs-on: [self-hosted, runner-linux, devops]
+ timeout-minutes: 15
+ steps:
+ - uses: actions/setup-python@v4
+ with:
+ python-version: ${{ matrix.python-version }}
+ - uses: actions/checkout@v3
+ - name: pip install -e ./
+ run: |
+ pip install -e ./
+
+ - name: server - cross-silo - ho
+ run: |
+ cd quick_start/octopus
+ run_id=cross-silo-ho-${{ format('{0}{1}{2}{3}', github.run_id, matrix.os, matrix.arch, matrix.python-version) }}
+ echo ${run_id}
+ bash run_server.sh $run_id
+ if: ${{ matrix.client-index == '0' }}
+
+ - name: client 1 - cross-silo - ho
+ run: |
+ cd quick_start/octopus
+ run_id=cross-silo-ho-${{ format('{0}{1}{2}{3}', github.run_id, matrix.os, matrix.arch, matrix.python-version) }}
+ echo ${run_id}
+ bash run_client.sh 1 $run_id
+ if: ${{ matrix.client-index == '1' }}
+
+ - name: client 2 - cross-silo - ho
+ run: |
+ cd quick_start/octopus
+ run_id=cross-silo-ho-${{ format('{0}{1}{2}{3}', github.run_id, matrix.os, matrix.arch, matrix.python-version) }}
+ echo ${run_id}
+ bash run_client.sh 2 $run_id
+ if: ${{ matrix.client-index == '2' }}
\ No newline at end of file
diff --git a/.github/workflows/smoke_test_cross_silo_ho_win.yml b/.github/workflows/smoke_test_cross_silo_ho_win.yml
new file mode 100644
index 0000000000..a1b57d7bd2
--- /dev/null
+++ b/.github/workflows/smoke_test_cross_silo_ho_win.yml
@@ -0,0 +1,70 @@
+# This is a basic workflow to help you get started with Actions
+
+name: CROSS-SILO-HO-Win
+
+# Controls when the workflow will run
+on:
+ # Triggers the workflow on push or pull request events but only for the master branch
+ schedule:
+ # Nightly build at 12:12 A.M.
+ - cron: "12 12 */1 * *"
+ pull_request:
+ branches: [ master, test/v0.7.0, dev/0.7.0 ]
+
+ # Allows you to run this workflow manually from the Actions tab
+ workflow_dispatch:
+
+# A workflow run is made up of one or more jobs that can run sequentially or in parallel
+jobs:
+ cross-silo-horizontal-test:
+ defaults:
+ run:
+ shell: powershell
+ working-directory: fedml-devops\python
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [ windows-2019 ]
+ arch: [X64]
+ python-version: ['3.8']
+ client-index: ['0', '1', '2']
+# exclude:
+# - os: macos-latest
+# python-version: '3.8'
+# - os: windows-latest
+# python-version: '3.6'
+ runs-on: [self-hosted, runner-windows, devops]
+ timeout-minutes: 15
+ steps:
+ - name: cleanup running processes
+ continue-on-error: true
+ run: |
+ wmic.exe /interactive:off process where "name='python.exe'" call terminate
+ - uses: actions/setup-python@v4
+ with:
+ python-version: ${{ matrix.python-version }}
+ - uses: actions/checkout@v3
+ with:
+ path: fedml-devops
+ clean: true
+ - name: pip install -e ./
+ run: |
+ pip install -e ./
+
+ - name: server - cross-silo - ho
+ run: |
+ cd quick_start/octopus
+ .\run_server.bat ${{ format('{0}{1}{2}{3}', github.run_id, matrix.os, matrix.arch, matrix.python-version) }}
+ if: ${{ matrix.client-index == '0' }}
+
+ - name: client 1 - cross-silo - ho
+ run: |
+ cd quick_start/octopus
+ .\run_client.bat 1 ${{ format('{0}{1}{2}{3}', github.run_id, matrix.os, matrix.arch, matrix.python-version) }}
+ if: ${{ matrix.client-index == '1' }}
+
+ - name: client 2 - cross-silo - ho
+ run: |
+ cd quick_start/octopus
+ .\run_client.bat 2 ${{ format('{0}{1}{2}{3}', github.run_id, matrix.os, matrix.arch, matrix.python-version) }}
+ if: ${{ matrix.client-index == '2' }}
\ No newline at end of file
diff --git a/.github/workflows/smoke_test_cross_silo_lightsecagg_linux.yml b/.github/workflows/smoke_test_cross_silo_lightsecagg_linux.yml
new file mode 100644
index 0000000000..f408760742
--- /dev/null
+++ b/.github/workflows/smoke_test_cross_silo_lightsecagg_linux.yml
@@ -0,0 +1,69 @@
+# This is a basic workflow to help you get started with Actions
+
+name: LightSecAgg-Linux
+
+# Controls when the workflow will run
+on:
+ # Triggers the workflow on push or pull request events but only for the master branch
+ schedule:
+ # Nightly build at 12:12 A.M.
+ - cron: "12 12 */1 * *"
+ pull_request:
+ branches: [ master, test/v0.7.0, dev/0.7.0 ]
+
+ # Allows you to run this workflow manually from the Actions tab
+ workflow_dispatch:
+
+# A workflow run is made up of one or more jobs that can run sequentially or in parallel
+jobs:
+ cross-silo-horizontal-test:
+ defaults:
+ run:
+ shell: bash
+ working-directory: python
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [ ubuntu-latest]
+ arch: [X64]
+ python-version: ['3.8']
+ client-index: ['0', '1', '2']
+# exclude:
+# - os: macos-latest
+# python-version: '3.8'
+# - os: windows-latest
+# python-version: '3.6'
+ runs-on: [self-hosted, runner-linux, devops]
+ timeout-minutes: 15
+ steps:
+ - uses: actions/setup-python@v4
+ with:
+ python-version: ${{ matrix.python-version }}
+ - uses: actions/checkout@v3
+ - name: pip install -e ./
+ run: |
+ pip install -e ./
+
+ - name: server - cross-silo - lightsecagg
+ run: |
+ cd examples/cross_silo/light_sec_agg_example
+ run_id=cross-silo-lightsecagg-${{ format('{0}{1}{2}{3}', github.run_id, matrix.os, matrix.arch, matrix.python-version) }}
+ echo ${run_id}
+ bash run_server.sh $run_id
+ if: ${{ matrix.client-index == '0' }}
+
+ - name: client 1 - cross-silo - lightsecagg
+ run: |
+ cd examples/cross_silo/light_sec_agg_example
+ run_id=cross-silo-lightsecagg-${{ format('{0}{1}{2}{3}', github.run_id, matrix.os, matrix.arch, matrix.python-version) }}
+ echo ${run_id}
+ bash run_client.sh 1 $run_id
+ if: ${{ matrix.client-index == '1' }}
+
+ - name: client 2 - cross-silo - lightsecagg
+ run: |
+ cd examples/cross_silo/light_sec_agg_example
+ run_id=cross-silo-lightsecagg-${{ format('{0}{1}{2}{3}', github.run_id, matrix.os, matrix.arch, matrix.python-version) }}
+ echo ${run_id}
+ bash run_client.sh 2 $run_id
+ if: ${{ matrix.client-index == '2' }}
\ No newline at end of file
diff --git a/.github/workflows/smoke_test_cross_silo_lightsecagg_win.yml b/.github/workflows/smoke_test_cross_silo_lightsecagg_win.yml
new file mode 100644
index 0000000000..825c67f2b4
--- /dev/null
+++ b/.github/workflows/smoke_test_cross_silo_lightsecagg_win.yml
@@ -0,0 +1,70 @@
+# This is a basic workflow to help you get started with Actions
+
+name: LightSecAgg-Windows
+
+# Controls when the workflow will run
+on:
+ # Triggers the workflow on push or pull request events but only for the master branch
+ schedule:
+ # Nightly build at 12:12 A.M.
+ - cron: "12 12 */1 * *"
+ pull_request:
+ branches: [ master, test/v0.7.0, dev/0.7.0 ]
+
+ # Allows you to run this workflow manually from the Actions tab
+ workflow_dispatch:
+
+# A workflow run is made up of one or more jobs that can run sequentially or in parallel
+jobs:
+ cross-silo-horizontal-test:
+ defaults:
+ run:
+ shell: powershell
+ working-directory: fedml-devops\python
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [ windows-2019 ]
+ arch: [X64]
+ python-version: ['3.8']
+ client-index: ['0', '1', '2']
+# exclude:
+# - os: macos-latest
+# python-version: '3.8'
+# - os: windows-latest
+# python-version: '3.6'
+ runs-on: [self-hosted, runner-windows, devops]
+ timeout-minutes: 15
+ steps:
+ - name: cleanup running processes
+ continue-on-error: true
+ run: |
+ wmic.exe /interactive:off process where "name='python.exe'" call terminate
+ - uses: actions/setup-python@v4
+ with:
+ python-version: ${{ matrix.python-version }}
+ - uses: actions/checkout@v3
+ with:
+ path: fedml-devops
+ clean: true
+ - name: pip install -e ./
+ run: |
+ pip install -e ./
+
+ - name: server - cross-silo - ho
+ run: |
+ cd examples/cross_silo/light_sec_agg_example
+ .\run_server.bat cross-silo-lightsecagg-${{ format('{0}{1}{2}{3}', github.run_id, matrix.os, matrix.arch, matrix.python-version) }}
+ if: ${{ matrix.client-index == '0' }}
+
+ - name: client 1 - cross-silo - ho
+ run: |
+ cd examples/cross_silo/light_sec_agg_example
+ .\run_client.bat 1 cross-silo-lightsecagg-${{ format('{0}{1}{2}{3}', github.run_id, matrix.os, matrix.arch, matrix.python-version) }}
+ if: ${{ matrix.client-index == '1' }}
+
+ - name: client 2 - cross-silo - lightsecagg
+ run: |
+ cd examples/cross_silo/light_sec_agg_example
+ .\run_client.bat 2 cross-silo-lightsecagg-${{ format('{0}{1}{2}{3}', github.run_id, matrix.os, matrix.arch, matrix.python-version) }}
+ if: ${{ matrix.client-index == '2' }}
\ No newline at end of file
diff --git a/.github/workflows/smoke_test_flow_linux.yml b/.github/workflows/smoke_test_flow_linux.yml
new file mode 100644
index 0000000000..6a1b2a3ed5
--- /dev/null
+++ b/.github/workflows/smoke_test_flow_linux.yml
@@ -0,0 +1,69 @@
+# This is a basic workflow to help you get started with Actions
+
+name: Flow-Linux
+
+# Controls when the workflow will run
+on:
+ # Triggers the workflow on push or pull request events but only for the master branch
+ schedule:
+ # Nightly build at 12:12 A.M.
+ - cron: "12 12 */1 * *"
+ pull_request:
+ branches: [ master, test/v0.7.0, dev/0.7.0 ]
+
+ # Allows you to run this workflow manually from the Actions tab
+ workflow_dispatch:
+
+# A workflow run is made up of one or more jobs that can run sequentially or in parallel
+jobs:
+ Flow-test:
+ defaults:
+ run:
+ shell: bash
+ working-directory: python
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [ ubuntu-latest]
+ arch: [X64]
+ python-version: ['3.8']
+ client-index: ['0', '1', '2']
+# exclude:
+# - os: macos-latest
+# python-version: '3.8'
+# - os: windows-latest
+# python-version: '3.6'
+ runs-on: [self-hosted, runner-linux, devops]
+ timeout-minutes: 15
+ steps:
+ - uses: actions/setup-python@v4
+ with:
+ python-version: ${{ matrix.python-version }}
+ - uses: actions/checkout@v3
+ - name: pip install -e ./
+ run: |
+ pip install -e ./
+
+ - name: server - Flow
+ run: |
+ cd fedml/core/distributed/flow
+ run_id=cross-silo-ho-${{ format('{0}{1}{2}{3}', github.run_id, matrix.os, matrix.arch, matrix.python-version) }}
+ echo ${run_id}
+ bash test_run_server.sh $run_id
+ if: ${{ matrix.client-index == '0' }}
+
+ - name: client 1 - Flow
+ run: |
+ cd fedml/core/distributed/flow
+ run_id=cross-silo-ho-${{ format('{0}{1}{2}{3}', github.run_id, matrix.os, matrix.arch, matrix.python-version) }}
+ echo ${run_id}
+ bash test_run_client.sh 1 $run_id
+ if: ${{ matrix.client-index == '1' }}
+
+ - name: client 2 - Flow
+ run: |
+ cd fedml/core/distributed/flow
+ run_id=cross-silo-ho-${{ format('{0}{1}{2}{3}', github.run_id, matrix.os, matrix.arch, matrix.python-version) }}
+ echo ${run_id}
+ bash test_run_client.sh 2 $run_id
+ if: ${{ matrix.client-index == '2' }}
\ No newline at end of file
diff --git a/.github/workflows/smoke_test_ml_engines_linux.yml b/.github/workflows/smoke_test_ml_engines_linux.yml
new file mode 100644
index 0000000000..e90c438739
--- /dev/null
+++ b/.github/workflows/smoke_test_ml_engines_linux.yml
@@ -0,0 +1,176 @@
+# This is a basic workflow to help you get started with Actions
+
+name: ML-Engines-Linux
+
+# Controls when the workflow will run
+on:
+ # Triggers the workflow on push or pull request events but only for the master branch
+ schedule:
+ # Nightly build at 12:12 A.M.
+ - cron: "12 12 */1 * *"
+ pull_request:
+ branches: [ master, test/v0.7.0, dev/0.7.0 ]
+
+ # Allows you to run this workflow manually from the Actions tab
+ workflow_dispatch:
+
+# A workflow run is made up of one or more jobs that can run sequentially or in parallel
+jobs:
+ tf-ml-engines-test:
+ defaults:
+ run:
+ shell: bash
+ working-directory: python
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [ ubuntu-latest]
+ arch: [X64]
+ python-version: ['3.8']
+ client-index: ['0', '1', '2']
+# exclude:
+# - os: macos-latest
+# python-version: '3.8'
+# - os: windows-latest
+# python-version: '3.6'
+ runs-on: [self-hosted, runner-linux, devops]
+ timeout-minutes: 15
+ steps:
+ - uses: actions/setup-python@v4
+ with:
+ python-version: ${{ matrix.python-version }}
+ - uses: actions/checkout@v3
+ - name: pip install -e ./
+ run: |
+ pip install -e ./
+ pip install -e '.[tensorflow]'
+
+ - name: server - tensorflow - fedavg
+ run: |
+ cd examples/cross_silo/tf_mqtt_s3_fedavg_mnist_lr_example
+ run_id=tf-ml-engine-${{ format('{0}{1}{2}{3}', github.run_id, matrix.os, matrix.arch, matrix.python-version) }}
+ echo ${run_id}
+ bash run_server.sh $run_id
+ if: ${{ matrix.client-index == '0' }}
+
+ - name: client 1 - tensorflow - fedavg
+ run: |
+ cd examples/cross_silo/tf_mqtt_s3_fedavg_mnist_lr_example
+ run_id=tf-ml-engine-${{ format('{0}{1}{2}{3}', github.run_id, matrix.os, matrix.arch, matrix.python-version) }}
+ echo ${run_id}
+ bash run_client.sh 1 $run_id
+ if: ${{ matrix.client-index == '1' }}
+
+ - name: client 2 - tensorflow - fedavg
+ run: |
+ cd examples/cross_silo/tf_mqtt_s3_fedavg_mnist_lr_example
+ run_id=tf-ml-engine-${{ format('{0}{1}{2}{3}', github.run_id, matrix.os, matrix.arch, matrix.python-version) }}
+ echo ${run_id}
+ bash run_client.sh 2 $run_id
+ if: ${{ matrix.client-index == '2' }}
+
+ jax-ml-engines-test:
+ defaults:
+ run:
+ shell: bash
+ working-directory: python
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [ ubuntu-latest ]
+ arch: [ X64 ]
+ python-version: [ '3.8' ]
+ client-index: [ '0', '1', '2' ]
+ # exclude:
+ # - os: macos-latest
+ # python-version: '3.8'
+ # - os: windows-latest
+ # python-version: '3.6'
+ runs-on: [ self-hosted, runner-linux, devops ]
+ timeout-minutes: 15
+ steps:
+ - uses: actions/setup-python@v4
+ with:
+ python-version: ${{ matrix.python-version }}
+ - uses: actions/checkout@v3
+ - name: pip install -e ./
+ run: |
+ pip install -e ./
+ pip install -e '.[jax]'
+
+ - name: server - jax - fedavg
+ run: |
+ cd examples/cross_silo/jax_haiku_mqtt_s3_fedavg_mnist_lr_example
+ run_id=jax-ml-engine-${{ format('{0}{1}{2}{3}', github.run_id, matrix.os, matrix.arch, matrix.python-version) }}
+ echo ${run_id}
+ bash run_server.sh $run_id
+ if: ${{ matrix.client-index == '0' }}
+
+ - name: client 1 - jax - fedavg
+ run: |
+ cd examples/cross_silo/jax_haiku_mqtt_s3_fedavg_mnist_lr_example
+ run_id=jax-ml-engine-${{ format('{0}{1}{2}{3}', github.run_id, matrix.os, matrix.arch, matrix.python-version) }}
+ echo ${run_id}
+ bash run_client.sh 1 $run_id
+ if: ${{ matrix.client-index == '1' }}
+
+ - name: client 2 - jax - fedavg
+ run: |
+ cd examples/cross_silo/jax_haiku_mqtt_s3_fedavg_mnist_lr_example
+ run_id=jax-ml-engine-${{ format('{0}{1}{2}{3}', github.run_id, matrix.os, matrix.arch, matrix.python-version) }}
+ echo ${run_id}
+ bash run_client.sh 2 $run_id
+ if: ${{ matrix.client-index == '2' }}
+
+ mxnet-ml-engines-test:
+ defaults:
+ run:
+ shell: bash
+ working-directory: python
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [ ubuntu-latest ]
+ arch: [ X64 ]
+ python-version: [ '3.8' ]
+ client-index: [ '0', '1', '2' ]
+ # exclude:
+ # - os: macos-latest
+ # python-version: '3.8'
+ # - os: windows-latest
+ # python-version: '3.6'
+ runs-on: [ self-hosted, runner-linux, devops ]
+ timeout-minutes: 15
+ steps:
+ - uses: actions/setup-python@v4
+ with:
+ python-version: ${{ matrix.python-version }}
+ - uses: actions/checkout@v3
+ - name: pip install -e ./
+ run: |
+ pip install -e ./
+ pip install -e '.[mxnet]'
+
+ - name: server - mxnet - fedavg
+ run: |
+ cd examples/cross_silo/mxnet_mqtt_s3_fedavg_mnist_lr_example
+ run_id=mxnet-ml-engine-${{ format('{0}{1}{2}{3}', github.run_id, matrix.os, matrix.arch, matrix.python-version) }}
+ echo ${run_id}
+ bash run_server.sh $run_id
+ if: ${{ matrix.client-index == '0' }}
+
+ - name: client 1 - mxnet - fedavg
+ run: |
+ cd examples/cross_silo/mxnet_mqtt_s3_fedavg_mnist_lr_example
+ run_id=mxnet-ml-engine-${{ format('{0}{1}{2}{3}', github.run_id, matrix.os, matrix.arch, matrix.python-version) }}
+ echo ${run_id}
+ bash run_client.sh 1 $run_id
+ if: ${{ matrix.client-index == '1' }}
+
+ - name: client 2 - mxnet - fedavg
+ run: |
+ cd examples/cross_silo/mxnet_mqtt_s3_fedavg_mnist_lr_example
+ run_id=mxnet-ml-engine-${{ format('{0}{1}{2}{3}', github.run_id, matrix.os, matrix.arch, matrix.python-version) }}
+ echo ${run_id}
+ bash run_client.sh 2 $run_id
+ if: ${{ matrix.client-index == '2' }}
diff --git a/.github/workflows/smoke_test_pip_cli_sp_linux.yml b/.github/workflows/smoke_test_pip_cli_sp_linux.yml
new file mode 100644
index 0000000000..d5381ccb4c
--- /dev/null
+++ b/.github/workflows/smoke_test_pip_cli_sp_linux.yml
@@ -0,0 +1,88 @@
+# This is a basic workflow to help you get started with Actions
+
+name: PIP, CLI, SP - On Linux
+
+# Controls when the workflow will run
+on:
+ # Triggers the workflow on push or pull request events but only for the master branch
+ schedule:
+ # Nightly build at 12:12 A.M.
+ - cron: "12 12 */1 * *"
+ pull_request:
+ branches: [ master, test/v0.7.0, dev/0.7.0 ]
+
+ # Allows you to run this workflow manually from the Actions tab
+ workflow_dispatch:
+
+permissions: write-all
+
+# A workflow run is made up of one or more jobs that can run sequentially or in parallel
+jobs:
+ pip-install-fedml-and-test-sp:
+ defaults:
+ run:
+ shell: bash
+ working-directory: python
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [ ubuntu-latest]
+ arch: [X64]
+ python-version: ['3.8']
+# exclude:
+# - os: macos-latest
+# python-version: '3.8'
+# - os: windows-latest
+# python-version: '3.6'
+ runs-on: [self-hosted, runner-linux, devops]
+ timeout-minutes: 15
+ steps:
+ - uses: actions/setup-python@v4
+ with:
+ python-version: ${{ matrix.python-version }}
+ # https://github.com/actions/checkout/issues/116#issuecomment-644419389
+ - uses: actions/checkout@v3
+ - name: pip install -e ./
+ run: |
+ pip install -e ./
+
+ - name: test "fedml login" and "fedml build"
+ run: |
+ cd tests/smoke_test/cli
+ bash login.sh
+ bash build.sh
+ - name: test simulation-sp
+ run: |
+ cd quick_start/parrot
+ python torch_fedavg_mnist_lr_one_line_example.py --cf fedml_config.yaml
+ python torch_fedavg_mnist_lr_custum_data_and_model_example.py --cf fedml_config.yaml
+
+ - name: test sp - sp_decentralized_mnist_lr_example
+ run: |
+ cd examples/simulation/sp_decentralized_mnist_lr_example
+ python torch_fedavg_mnist_lr_step_by_step_example.py --cf fedml_config.yaml
+
+ - name: test sp - sp_fednova_mnist_lr_example
+ run: |
+ cd examples/simulation/sp_fednova_mnist_lr_example
+ python torch_fednova_mnist_lr_step_by_step_example.py --cf fedml_config.yaml
+
+ - name: test sp - sp_fedopt_mnist_lr_example
+ run: |
+ cd examples/simulation/sp_fedopt_mnist_lr_example
+ python torch_fedopt_mnist_lr_step_by_step_example.py --cf fedml_config.yaml
+
+ - name: test sp - sp_hierarchicalfl_mnist_lr_example
+ run: |
+ cd examples/simulation/sp_hierarchicalfl_mnist_lr_example
+ python torch_hierarchicalfl_mnist_lr_step_by_step_example.py --cf fedml_config.yaml
+
+ - name: test sp - sp_turboaggregate_mnist_lr_example
+ run: |
+ cd examples/simulation/sp_turboaggregate_mnist_lr_example
+ python torch_turboaggregate_mnist_lr_step_by_step_example.py --cf fedml_config.yaml
+
+ - name: test sp - sp_vertical_mnist_lr_example
+ run: |
+ cd examples/simulation/sp_vertical_mnist_lr_example
+ python torch_vertical_mnist_lr_step_by_step_example.py --cf fedml_config.yaml
diff --git a/.github/workflows/smoke_test_pip_cli_sp_win.yml b/.github/workflows/smoke_test_pip_cli_sp_win.yml
new file mode 100644
index 0000000000..e60546122d
--- /dev/null
+++ b/.github/workflows/smoke_test_pip_cli_sp_win.yml
@@ -0,0 +1,63 @@
+# This is a basic workflow to help you get started with Actions
+
+name: PIP, CLI, SP - On Windows
+
+# Controls when the workflow will run
+on:
+ # Triggers the workflow on push or pull request events but only for the master branch
+ schedule:
+ # Nightly build at 12:12 A.M.
+ - cron: "12 12 */1 * *"
+ pull_request:
+ branches: [ master, test/v0.7.0, dev/0.7.0 ]
+
+ # Allows you to run this workflow manually from the Actions tab
+ workflow_dispatch:
+
+# A workflow run is made up of one or more jobs that can run sequentially or in parallel
+jobs:
+ pip-install-fedml-and-test-sp:
+ defaults:
+ run:
+ shell: powershell
+ working-directory: fedml-devops\python
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [ windows-2019 ]
+ arch: [X64]
+ python-version: ['3.8']
+# exclude:
+# - os: macos-latest
+# python-version: '3.8'
+# - os: windows-latest
+# python-version: '3.6'
+ runs-on: [self-hosted, runner-windows, devops]
+ timeout-minutes: 15
+ steps:
+ - name: cleanup running processes
+ continue-on-error: true
+ run: |
+ wmic.exe /interactive:off process where "name='python.exe'" call terminate
+ - uses: actions/setup-python@v4
+ with:
+ python-version: ${{ matrix.python-version }}
+ # https://github.com/actions/checkout/issues/116#issuecomment-644419389
+ - uses: actions/checkout@v3
+ with:
+ path: fedml-devops
+ clean: true
+ - name: pip install -e ./
+ run: |
+ pip install -e ./
+
+ - name: test "fedml login" and "fedml build"
+ run: |
+ cd tests/smoke_test/cli
+ .\login.bat
+ .\build.bat
+ - name: test simulation-sp
+ run: |
+ cd quick_start/parrot
+ python torch_fedavg_mnist_lr_one_line_example.py --cf fedml_config.yaml
+ python torch_fedavg_mnist_lr_custum_data_and_model_example.py --cf fedml_config.yaml
diff --git a/.github/workflows/smoke_test_security.yml b/.github/workflows/smoke_test_security.yml
new file mode 100644
index 0000000000..2911809b26
--- /dev/null
+++ b/.github/workflows/smoke_test_security.yml
@@ -0,0 +1,57 @@
+# This is a basic workflow to help you get started with Actions
+
+name: Security(attack/defense) on Linux
+
+# Controls when the workflow will run
+on:
+ # Triggers the workflow on push or pull request events but only for the master branch
+ schedule:
+ # Nightly build at 12:12 A.M.
+ - cron: "12 12 */1 * *"
+ pull_request:
+ branches: [ master, test/v0.7.0, dev/0.7.0 ]
+
+ # Allows you to run this workflow manually from the Actions tab
+ workflow_dispatch:
+
+permissions: write-all
+
+# A workflow run is made up of one or more jobs that can run sequentially or in parallel
+jobs:
+ security-attack-defense-tests:
+ defaults:
+ run:
+ shell: bash
+ working-directory: python
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [ ubuntu-latest]
+ arch: [X64]
+ python-version: ['3.8']
+# exclude:
+# - os: macos-latest
+# python-version: '3.8'
+# - os: windows-latest
+# python-version: '3.6'
+ runs-on: [self-hosted, runner-linux, devops]
+ timeout-minutes: 15
+ steps:
+ - uses: actions/setup-python@v4
+ with:
+ python-version: ${{ matrix.python-version }}
+ # https://github.com/actions/checkout/issues/116#issuecomment-644419389
+ - uses: actions/checkout@v3
+ - name: pip install -e ./
+ run: |
+ pip install -e ./
+
+ - name: attack tests
+ run: |
+ cd tests/security
+ sh run_attacker_tests.sh
+
+ - name: defense tests
+ run: |
+ cd tests/security
+ sh run_defender_tests.sh
\ No newline at end of file
diff --git a/.github/workflows/smoke_test_simulation_mpi_linux.yml b/.github/workflows/smoke_test_simulation_mpi_linux.yml
new file mode 100644
index 0000000000..375398fcaf
--- /dev/null
+++ b/.github/workflows/smoke_test_simulation_mpi_linux.yml
@@ -0,0 +1,94 @@
+# This is a basic workflow to help you get started with Actions
+
+name: MPI - On Linux
+
+# Controls when the workflow will run
+on:
+ # Triggers the workflow on push or pull request events but only for the master branch
+ schedule:
+ # Nightly build at 12:12 A.M.
+ - cron: "12 12 */1 * *"
+ pull_request:
+ branches: [ master, test/v0.7.0, dev/0.7.0 ]
+
+ # Allows you to run this workflow manually from the Actions tab
+ workflow_dispatch:
+
+# A workflow run is made up of one or more jobs that can run sequentially or in parallel
+
+jobs:
+ # https://github.com/mpi4py/mpi4py/actions/runs/34979774/workflow
+ mpi_run:
+ runs-on: [self-hosted, runner-linux, devops-mpi]
+ timeout-minutes: 15
+ defaults:
+ run:
+ shell: bash
+ working-directory: python
+ strategy:
+ matrix:
+ python-version: [3.8]
+ mpi: [mpich]
+# mpi: [mpich, openmpi]
+ os: [ ubuntu-latest ]
+# include:
+# - os: ubuntu-latest
+# mpi: mpich
+# install-mpi: sudo apt install -y mpich libmpich-dev
+# - os: ubuntu-latest
+# mpi: openmpi
+# install-mpi: sudo apt install -y openmpi-bin libopenmpi-dev
+ steps:
+ - uses: actions/checkout@v2
+ - name: Install MPI
+ run: ${{ matrix.install-mpi }}
+ - name: Use Python ${{ matrix.python-version }}
+ uses: actions/setup-python@v1
+ with:
+ python-version: ${{ matrix.python-version }}
+ - name: Install packaging tools
+ run: python -m pip install --upgrade setuptools pip wheel
+ - name: Install build dependencies
+ run: python -m pip install --upgrade cython
+ - name: Build package
+ run: python -m pip wheel -vvv --wheel-dir=dist .
+ - name: Install test dependencies
+ run: python -m pip install --upgrade numpy
+
+ - name: pip install -e ./
+ run: |
+ pip install -e ./
+ python -m pip install mpi4py
+
+ - name: Test package - FedAvg
+ run: |
+ cd examples/simulation/mpi_torch_fedavg_mnist_lr_example
+ sh run_custom_data_and_model_example.sh 4
+
+ - name: Test package - Base
+ run: |
+ cd examples/simulation/mpi_base_framework_example
+ sh run.sh 4
+
+ - name: Test package - Decentralized
+ run: |
+ cd examples/simulation/mpi_decentralized_fl_example
+ sh run.sh 4
+
+ - name: Test package - FedOPT
+ run: |
+ cd examples/simulation/mpi_fedopt_datasets_and_models_example
+ sh run_step_by_step_example.sh 4 config/mnist_lr/fedml_config.yaml
+
+ - name: Test package - FedProx
+ run: |
+ cd examples/simulation/mpi_fedprox_datasets_and_models_example
+ sh run_step_by_step_example.sh 4 config/mnist_lr/fedml_config.yaml
+
+ - name: Test package - FedGAN
+ run: |
+ cd examples/simulation/mpi_torch_fedgan_mnist_gan_example
+ sh run_step_by_step_example.sh 4
+
+ - name: Uninstall package after testing
+ run: python -m pip uninstall --yes mpi4py
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index ae1f7929c1..33bfde48a6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,14 @@
.idea
.idea/*
.vscode/*
+*.pkl
+
+data/*
+python/tests/smoke_test/data
+python/tests/smoke_test/data/*
+
+android/fedmlsdk/MobileNN/MNN
+android/fedmlsdk/MobileNN/pytorch
*.pyc
./*/*.pyc
@@ -10,6 +18,12 @@
./*/*/*/*/*.pyc
./*/*/*/*/*/*.pyc
+python/data
+python/fedml.egg-info
+python/examples/simulation/sp_fedavg_mnist_lr_example/data
+python/examples/simulation/sp_fedsgd_cifar10_resnet20_example
+python/examples/simulation/sp_fedsgd_cifar10_resnet20_example/*
+
*.log
wandb
@@ -24,7 +38,7 @@ python/dist
python/FedML.egg-info
doc/deploy
-doc/en/_build
+doc/en/_build/doctrees
*.h5
@@ -37,6 +51,7 @@ cifar-10-batches-py
*.zip
*.json
*.tar.bz2
+*.stats
data/cifar10/*-python
data/cifar100/*-python
@@ -61,31 +76,106 @@ mimiconda.sh
data/fednlp/*
*.npz
-test/fedml_user_code/simulation_sp/data/mnist/MNIST/stats.sh
-test/fedml_user_code/simulation_sp/data/mnist/MNIST/stats.py
-test/fedml_user_code/simulation_sp/data/mnist/MNIST/README.md
-test/fedml_user_code/simulation_sp/data/mnist/MNIST/download_and_unzip.sh
-test/fedml_user_code/simulation_sp/data/mnist/__MACOSX/MNIST/._train
-test/fedml_user_code/simulation_sp/data/mnist/__MACOSX/MNIST/._test
-test/fedml_user_code/simulation_sp/data/mnist/__MACOSX/MNIST/._.DS_Store
-test/fedml_user_code/simulation_mpi/data/mnist/MNIST/stats.sh
-test/fedml_user_code/simulation_mpi/data/mnist/MNIST/stats.py
-test/fedml_user_code/simulation_mpi/data/mnist/MNIST/README.md
-test/fedml_user_code/simulation_mpi/data/mnist/MNIST/download_and_unzip.sh
-test/fedml_user_code/simulation_mpi/data/mnist/__MACOSX/MNIST/._train
-test/fedml_user_code/simulation_mpi/data/mnist/__MACOSX/MNIST/._test
-test/fedml_user_code/simulation_mpi/data/mnist/__MACOSX/MNIST/._.DS_Store
-test/fedml_user_code/simulation_sp/data/mnist/__MACOSX/MNIST/._.DS_Store
-test/fedml_user_code/simulation_sp/data/mnist/__MACOSX/MNIST/._test
-test/fedml_user_code/simulation_sp/data/mnist/__MACOSX/MNIST/._train
-test/fedml_user_code/simulation_sp/data/mnist/MNIST/download_and_unzip.sh
-test/fedml_user_code/simulation_sp/data/mnist/MNIST/README.md
-test/fedml_user_code/simulation_sp/data/mnist/MNIST/stats.py
-test/fedml_user_code/simulation_sp/data/mnist/MNIST/stats.sh
-test/fedml_user_code/simulation_mpi/data/mnist/__MACOSX/MNIST/._.DS_Store
-test/fedml_user_code/simulation_mpi/data/mnist/__MACOSX/MNIST/._test
-test/fedml_user_code/simulation_mpi/data/mnist/__MACOSX/MNIST/._train
-test/fedml_user_code/simulation_mpi/data/mnist/MNIST/download_and_unzip.sh
-test/fedml_user_code/simulation_mpi/data/mnist/MNIST/README.md
-test/fedml_user_code/simulation_mpi/data/mnist/MNIST/stats.py
-test/fedml_user_code/simulation_mpi/data/mnist/MNIST/stats.sh
+python/tests/smoke_test/simulation_sp/data/mnist/MNIST/stats.sh
+python/tests/smoke_test/simulation_sp/data/mnist/MNIST/stats.py
+python/tests/smoke_test/simulation_sp/data/mnist/MNIST/README.md
+python/tests/smoke_test/simulation_sp/data/mnist/MNIST/download_and_unzip.sh
+python/tests/smoke_test/simulation_sp/data/mnist/__MACOSX/MNIST/._train
+python/tests/smoke_test/simulation_sp/data/mnist/__MACOSX/MNIST/._test
+python/tests/smoke_test/simulation_sp/data/mnist/__MACOSX/MNIST/._.DS_Store
+python/tests/smoke_test/simulation_mpi/data/mnist/MNIST/stats.sh
+python/tests/smoke_test/simulation_mpi/data/mnist/MNIST/stats.py
+python/tests/smoke_test/simulation_mpi/data/mnist/MNIST/README.md
+python/tests/smoke_test/simulation_mpi/data/mnist/MNIST/download_and_unzip.sh
+python/tests/smoke_test/simulation_mpi/data/mnist/__MACOSX/MNIST/._train
+python/tests/smoke_test/simulation_mpi/data/mnist/__MACOSX/MNIST/._test
+python/tests/smoke_test/simulation_mpi/data/mnist/__MACOSX/MNIST/._.DS_Store
+
+python/app/fednlp/text_classification/cache_dir
+python/app/fednlp/seq2seq/cache_dir
+python/app/fednlp/span_extraction/cache_dir
+
+app/fedgraphnn/moleculenet_graph_clf/data/bace/*.pkl
+app/fedgraphnn/moleculenet_graph_clf/data/bace/*.npy
+app/fedgraphnn/moleculenet_graph_clf/data/bbbp/*.pkl
+app/fedgraphnn/moleculenet_graph_clf/data/bbbp/*.npy
+app/fedgraphnn/moleculenet_graph_clf/data/clintox/*.pkl
+app/fedgraphnn/moleculenet_graph_clf/data/clintox/*.npy
+app/fedgraphnn/moleculenet_graph_clf/data/hiv/*.pkl
+app/fedgraphnn/moleculenet_graph_clf/data/hiv/*.npy
+app/fedgraphnn/moleculenet_graph_clf/data/lipo/*.pkl
+app/fedgraphnn/moleculenet_graph_clf/data/lipo/*.npy
+app/fedgraphnn/moleculenet_graph_clf/data/muv/*.pkl
+app/fedgraphnn/moleculenet_graph_clf/data/muv/*.npy
+app/fedgraphnn/moleculenet_graph_clf/data/pcba/*.pkl
+app/fedgraphnn/moleculenet_graph_clf/data/pcba/*.npy
+app/fedgraphnn/moleculenet_graph_clf/data/sider/*.pkl
+app/fedgraphnn/moleculenet_graph_clf/data/sider/*.npy
+app/fedgraphnn/moleculenet_graph_clf/data/tox21/*.pkl
+app/fedgraphnn/moleculenet_graph_clf/data/tox21/*.npy
+app/fedgraphnn/moleculenet_graph_clf/data/toxcast/*.pkl
+app/fedgraphnn/moleculenet_graph_clf/data/toxcast/*.npy
+
+app/fedgraphnn/moleculenet_graph_reg/data/esol/*.pkl
+app/fedgraphnn/moleculenet_graph_reg/data/esol/*.npy
+app/fedgraphnn/moleculenet_graph_reg/data/freesolv/*.pkl
+app/fedgraphnn/moleculenet_graph_reg/data/freesolv/*.npy
+app/fedgraphnn/moleculenet_graph_reg/data/herg/*.pkl
+app/fedgraphnn/moleculenet_graph_reg/data/herg/*.npy
+app/fedgraphnn/moleculenet_graph_reg/data/lipo/*.pkl
+app/fedgraphnn/moleculenet_graph_reg/data/lipo/*.npy
+app/fedgraphnn/moleculenet_graph_reg/data/qm9/*.pkl
+app/fedgraphnn/moleculenet_graph_reg/data/qm9/*.npy
+
+
+python/app/fedgraphnn/social_networks_graph_clf/data/TUDataset/*
+python/app/fedgraphnn/social_networks_graph_clf/data/TUDataset/collab.pickle
+python/app/fedgraphnn/social_networks_graph_clf/x_hist.png
+
+python/app/fedgraphnn/social_networks_graph_clf/x_hist.png
+python/app/healthcare/fed_lidc_idri /*
+
+
+
+python/app/fedgraphnn/social_networks_graph_clf/data/TUDataset/*
+python/app/fedgraphnn/social_networks_graph_clf/data/TUDataset/collab.pickle
+python/app/fedgraphnn/social_networks_graph_clf/x_hist.png
+
+app/fedgraphnn/subgraph_relation_pred/data/FB15k-237/*.dict
+app/fedgraphnn/subgraph_relation_pred/data/FB15k-237/*.txt
+app/fedgraphnn/subgraph_relation_pred/data/wn18rr/*.dict
+app/fedgraphnn/subgraph_relation_pred/data/wn18rr/*.txt
+app/fedgraphnn/subgraph_relation_pred/data/YAGO3-10/*.dict
+app/fedgraphnn/subgraph_relation_pred/data/YAGO3-10/*.txt
+
+app/fedgraphnn/subgraph_link_pred/data/FB15k-237/*.dict
+app/fedgraphnn/subgraph_link_pred/data/FB15k-237/*.txt
+app/fedgraphnn/subgraph_link_pred/data/wn18rr/*.dict
+app/fedgraphnn/subgraph_link_pred/data/wn18rr/*.txt
+app/fedgraphnn/subgraph_link_pred/data/YAGO3-10/*.dict
+app/fedgraphnn/subgraph_link_pred/data/YAGO3-10/*.txt
+
+python/app/fedgraphnn/ego_networks_link_pred/data/ego-networks
+python/app/fedgraphnn/ego_networks_node_clf/data/ego-networks
+/devops/scripts/aws/
+devops/scripts/docker
+devops/scripts/kubectl
+android/gradlew
+android/gradlew.bat
+
+/iot/anomaly_detection_for_cybersecurity/data/Danmini_Doorbell/
+/iot/anomaly_detection_for_cybersecurity/data/Ecobee_Thermostat/
+/iot/anomaly_detection_for_cybersecurity/data/Ennio_Doorbell/
+/iot/anomaly_detection_for_cybersecurity/data/Philips_B120N10_Baby_Monitor/
+/iot/anomaly_detection_for_cybersecurity/data/Provision_PT_737E_Security_Camera/
+/iot/anomaly_detection_for_cybersecurity/data/Provision_PT_838_Security_Camera/
+/iot/anomaly_detection_for_cybersecurity/data/Samsung_SNH_1011_N_Webcam/
+/iot/anomaly_detection_for_cybersecurity/data/SimpleHome_XCS7_1002_WHT_Security_Camera/
+/iot/anomaly_detection_for_cybersecurity/data/SimpleHome_XCS7_1003_WHT_Security_Camera/
+
+
+doc/en/_build
+/docker-2/
+/swap/actions-runner/
+*.txt
+python/examples/cross_silo/light_sec_agg_example/mpi_host_file
diff --git a/README.md b/README.md
index 813509a91b..59b4b461e2 100644
--- a/README.md
+++ b/README.md
@@ -1,24 +1,44 @@
-# FedML: The Community Connecting and Building AI Anywhere at Any Scale
+# FedML: The Community Building Open and Collaborative AI Anywhere at Any Scale
-
-
+
At the current stage, FedML library provides a research and production integrated edge-cloud platform for Federated/Distributed Machine Learning at anywhere at any scale.
-Homepage: [https://FedML.ai](https://FedML.ai)
-
)
# News
+* [2022/08/01] (Product Introduction) FedML AI platform releases the world’s federated learning open platform on the public cloud with an in-depth introduction of products and technologies! Please visit this blog for details.
+
* [2022/03/15] (Fundraising): FedML, Inc. has finished the 1st-round fundraising. We are backed by top VCs who focus on AI, SaaS, and Blockchain/Web3/Crypto from the Bay Area, California of the USA.
* [2022/02/14] (Company): FedML is upgraded as a Delaware-registered C-Corp company. Our headquarter is in California, USA. The two co-founders are CEO Salman Avestimehr (https://www.avestimehr.com/) and CTO Chaoyang He (https://chaoyanghe.com). We welcome contributors anywhere in the world.
* [2021/02/01] (Award): #NeurIPS 2020# FedML won Best Paper Award at NeurIPS Federated Learning workshop 2020
@@ -28,7 +48,7 @@ FedML is hiring! [Come and join us](https://fedml.ai/careers/)!
# **FedML Feature Overview**
-![image](/doc/en/_static/image/4animals.png)
+![image](./doc/en/_static/image/4animals.png)
FedML logo reflects the mission of FedML Inc. FedML aims to build simple and versatile APIs for machine learning running anywhere at any scale.
In other words, FedML supports both federated learning for data silos and distributed training for acceleration with MLOps and Open Source support, covering cutting-edge academia research and industrial grade use cases.
@@ -210,7 +230,7 @@ Simulation with Message Passing Interface (MPI):
Simulation with NCCL-based MPI (the fastest training):
- In case your cross-GPU bandwidth is high (e.g., InfiniBand, NVLink, EFA, etc.), we suggest using this NCCL-based MPI FL simulator to accelerate your development.
-## **FedML Octopu Exampless**
+## **FedML Octopus Examples**
Horizontal Federated Learning:
- [mqtt_s3_fedavg_mnist_lr_example](./doc/en/cross-silo/examples/mqtt_s3_fedavg_mnist_lr_example.md): an example to illustrate how to run horizontal federated learning in data silos (hospitals, banks, etc.)
@@ -226,6 +246,25 @@ Here `hierarchical` means that inside each FL Client (data silo), there are mult
- [Federated Learning on Android Smartphones](./doc/en/cross-device/examples/mqtt_s3_fedavg_mnist_lr_example.md)
+# FedML on Smartphone and IoTs
+
+
+
+
+
+
+
+
+
+
+
+
+See the introduction and tutorial at [FedML/android](./android).
+
+
+
+See the introduction and tutorial at [FedML/iot](./iot)
+
# **MLOps User Guide**
[https://open.fedml.ai](https://open.fedml.ai)
@@ -236,14 +275,13 @@ FedML MLOps Platform simplifies the workflow of federated learning anywhere at a
It enables zero-code, lightweight, cross-platform, and provably secure federated learning.
It enables machine learning from decentralized data at various users/silos/edge nodes, without the need to centralize any data to the cloud, hence providing maximum privacy and efficiency.
-![image](./doc/en/_static/image/mlops_workflow.png)
-
+![image](./doc/en/_static/image/MLOps_workflow.png)
The above figure shows the workflow. Such a workflow is handled by web UI without the need to handle complex deployment. Check the following live demo for details:
![image](./doc/en/_static/image/mlops_invite.png)
-3 Minutes Introduction: [https://www.youtube.com/watch?v=E1k05jd1Tyw](https://www.youtube.com/watch?v=E1k05jd1Tyw)
+3 Minutes Introduction: [https://www.youtube.com/watch?v=E1k05jd1Tyw](https://www.youtube.com/watch?v=Xgm0XEaMlVQ)
A detailed guidance for the MLOps can be found at [FedML MLOps User Guide](./doc/en/mlops/user_guide.md).
@@ -275,7 +313,7 @@ FedML’s core technology is backed by years of cutting-edge research represente
5. AI Applications
A Full-stack of Scientific Publications in ML Algorithms, Security/Privacy, Systems, Applications, and Visionary Impacts
-Please check [this publication list](./doc/en/resource/papers.md) for details.
+Please check [this publication list](./doc/en/resources/papers.md) for details.
## Video (Invited Talks)
@@ -298,12 +336,7 @@ Please check [this publication list](./doc/en/resource/papers.md) for details.
Our WeChat group exceeds 200 members, please add the following account and ask him to invite you to join.
-
-
-## FAQ
-
-We organize the frequently asked questions at [https://github.com/FedML-AI/FedML/discussions](https://github.com/FedML-AI/FedML/discussions).
-Please feel free to ask questions there. We are happy to discuss on supporting your special demands.
+
# Contributing
diff --git a/android/.gitignore b/android/.gitignore
new file mode 100644
index 0000000000..92f7d6fef9
--- /dev/null
+++ b/android/.gitignore
@@ -0,0 +1,22 @@
+.gradle
+/.idea
+.cxx
+
+cpp/build/lightsecagg/build_x86_linux
+cpp/build/lightsecagg/build_arm_android_64
+cpp/build/train/build_x86_linux
+cpp/build/train/build_arm_android_64
+
+*.iml
+/local.properties
+.DS_Store
+/captures
+.externalNativeBuild
+./idea
+
+cpp/build_arm_android_64
+cpp/build_x86_linux
+
+cpp/build/FedMLTrainer
+secring.gpg
+/build/
diff --git a/android/README.md b/android/README.md
new file mode 100644
index 0000000000..20cd3ebd7f
--- /dev/null
+++ b/android/README.md
@@ -0,0 +1,155 @@
+# FedML Android App and SDK
+
+
+
+
+
+
+
+
+- Android project root path: https://github.com/FedML-AI/FedML/tree/master/android
+
+
+
+The architecture is divided into three vertical layers and multiple horizontal modules:
+
+### 1. Android APK Layer
+- app
+
+https://github.com/FedML-AI/FedML/tree/master/android/app
+
+
+- fedmlsdk_demo
+
+https://github.com/FedML-AI/FedML/tree/master/android/fedmlsdk_demo
+
+### 2. Android SDK layer (Java API + JNI + So library)
+
+https://github.com/FedML-AI/FedML/tree/master/android/fedmlsdk
+
+
+### 3. MobileNN: FedML Mobile Training Engine Layer (C++, MNN, PyTorch, etc.)
+
+https://github.com/FedML-AI/FedML/tree/master/android/fedmlsdk/MobileNN
+
+https://github.com/FedML-AI/MNN
+
+https://github.com/FedML-AI/pytorch
+
+## Get Started with FedML Android APP
+[https://doc.fedml.ai/cross-device/examples/cross_device_android_example.html](https://doc.fedml.ai/cross-device/examples/cross_device_android_example.html)
+
+## Get Started with FedML Android SDK
+
+`android/fedmlsdk_demo` is a short tutorial for integrating Android SDK for your host App.
+
+1. add repositories by maven
+
+```groovy
+ maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots' }
+```
+
+2. add dependency in build.gradle
+
+check `android/fedmlsdk_demo/build.gradle` as an example:
+
+```groovy
+ implementation 'ai.fedml:fedml-edge-android:1.0.0-SNAPSHOT'
+```
+
+3. add FedML account id to meta-data in AndroidManifest.xml
+
+check `android/fedmlsdk_demo/src/main/AndroidManifest.xml` as an example:
+
+
+```xml
+
+
+```
+
+or
+
+```xml
+
+
+```
+
+You can find your account ID at FedML Open Platform (https://open.fedml.ai):
+![account](./doc/beehive_account.png)
+
+4. initial FedML Android SDK on your `Application` class.
+
+Taking `android/fedmlsdk_demo/src/main/java/ai/fedml/edgedemo/App.java` as an example:
+```java
+package ai.fedml.edgedemo;
+
+import android.app.Application;
+import android.os.Handler;
+import android.os.Looper;
+
+import ai.fedml.edge.FedEdgeManager;
+
+public class App extends Application {
+ private static Handler sHandler = new Handler(Looper.getMainLooper());
+
+ @Override
+ public void onCreate() {
+ super.onCreate();
+
+ // initial Edge SDK
+ FedEdgeManager.getFedEdgeApi().init(this);
+
+ // set data path (to prepare data, please check this script `android/data/prepare.sh`)
+ FedEdgeManager.getFedEdgeApi().setPrivatePath(Environment.getExternalStorageDirectory().getPath()
+ + "/ai.fedml/device_1/user_0");
+ }
+}
+```
+
+## Android SDK APIs
+At the current stage, we provide high-level APIs with the following three classes.
+
+
+- ai.fedml.edge.FedEdgeManager
+
+This is the top APIs in FedML Android SDK, it supports core training engine and related control commands on your Android devices.
+
+- ai.fedml.edge.OnTrainProgressListener
+
+This is the message flow to interact between FedML Android SDK and your host APP.
+
+- ai.fedml.edge.request.RequestManager
+
+This is used to to connect your Android SDK with FedML Open Platform (https://open.fedml.ai), which helps you to simplify the deployment, edge collaborative training, experimental tracking, and more.
+
+You can import them in your Java/Android projects as follows. See [android/fedmlsdk_demo/src/main/java/ai/fedml/edgedemo/ui/main/MainFragment.java](fedmlsdk_demo/src/main/java/ai/fedml/edgedemo/ui/main/MainFragment.java) as an example.
+```
+import ai.fedml.edge.FedEdgeManager;
+import ai.fedml.edge.OnTrainProgressListener;
+import ai.fedml.edge.request.RequestManager;
+```
+
+4. Running Android SDK Demo with MLOps (https://open.fedml.ai)
+
+Please follow this tutorial (https://doc.fedml.ai/mlops/user_guide.html) to start training using FedML BeeHive Platform.
+
+