Skip to content

PIP, CLI, SP - On Linux #3899

PIP, CLI, SP - On Linux

PIP, CLI, SP - On Linux #3899

# 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/v0.7.0 ]
workflow_run:
workflows: [ CodeQL ]
types:
- completed
# 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, Linux]
timeout-minutes: 15
steps:
- name: Extract branch name
shell: bash
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >>$GITHUB_OUTPUT
id: extract_branch
- id: fedml_source_code_home
name: cd to master or dev branch and git pull
shell: bash
run: |
ls
echo ${{ steps.extract_branch.outputs.branch }}
if [[ ${{ steps.extract_branch.outputs.branch }} == "master" ]]; then
echo "running on master"
path=/home/actions-runner/fedml-master
cd $path
echo "dir=$path" >> $GITHUB_OUTPUT
else
echo "running on dev"
path=/home/actions-runner/fedml-dev
cd $path
echo "dir=$path" >> $GITHUB_OUTPUT
fi
- name: sync git repo to local pip
working-directory: ${{ steps.fedml_source_code_home.outputs.dir }}
run: |
homepath=${{ format('{0}', steps.fedml_source_code_home.outputs.dir) }}
echo $Homepath
cd $homepath
bash ./devops/scripts/sync-fedml-pip.sh
- name: test "fedml login" and "fedml build"
working-directory: ${{ steps.fedml_source_code_home.outputs.dir }}
run: |
cd ${{ format('{0}', steps.fedml_source_code_home.outputs.dir) }}/python
cd tests/smoke_test/cli
bash login.sh
bash build.sh
- name: test simulation-sp
working-directory: ${{ steps.fedml_source_code_home.outputs.dir }}
run: |
cd ${{ format('{0}', steps.fedml_source_code_home.outputs.dir) }}/python
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
working-directory: ${{ steps.fedml_source_code_home.outputs.dir }}
run: |
cd ${{ format('{0}', steps.fedml_source_code_home.outputs.dir) }}/python
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
working-directory: ${{ steps.fedml_source_code_home.outputs.dir }}
run: |
cd ${{ format('{0}', steps.fedml_source_code_home.outputs.dir) }}/python
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
working-directory: ${{ steps.fedml_source_code_home.outputs.dir }}
run: |
cd ${{ format('{0}', steps.fedml_source_code_home.outputs.dir) }}/python
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
working-directory: ${{ steps.fedml_source_code_home.outputs.dir }}
run: |
cd ${{ format('{0}', steps.fedml_source_code_home.outputs.dir) }}/python
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
working-directory: ${{ steps.fedml_source_code_home.outputs.dir }}
run: |
cd ${{ format('{0}', steps.fedml_source_code_home.outputs.dir) }}/python
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
working-directory: ${{ steps.fedml_source_code_home.outputs.dir }}
run: |
cd ${{ format('{0}', steps.fedml_source_code_home.outputs.dir) }}/python
cd examples/simulation/sp_vertical_mnist_lr_example
python torch_vertical_mnist_lr_step_by_step_example.py --cf fedml_config.yaml