Skip to content

Commit

Permalink
[TEST]: add windows runners tests
Browse files Browse the repository at this point in the history
  • Loading branch information
xiang committed Jun 21, 2024
1 parent 942b223 commit 7a0963e
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 51 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/CI_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ on:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
runs-on: ${{ matrix.python-version }}
runs-on: ["${{ matrix.python-version }}","${{ matrix.os }}"]
strategy:
fail-fast: false
matrix:
os: [ Linux ]
os: [ Linux, Windows ]
arch: [X64]
python-version: ['python3.8', 'python3.9', 'python3.10', 'python3.11']

Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/CI_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ on:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
deploy:
runs-on: ${{ matrix.python-version }}
runs-on: ["${{ matrix.python-version }}","${{ matrix.os }}"]
strategy:
fail-fast: false
matrix:
os: [ Linux ]
os: [ Linux, Windows ]
arch: [X64]
python-version: ['python3.8', 'python3.9', 'python3.10', 'python3.11']


timeout-minutes: 5
steps:
- name: Checkout fedml
uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/CI_federate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ Linux ]
os: [ Linux, Windows ]
arch: [X64]
python-version: ['python3.8', 'python3.9', 'python3.10', 'python3.11']

runs-on: ${{ matrix.python-version }}
runs-on: ["${{ matrix.python-version }}","${{ matrix.os }}"]
timeout-minutes: 5
steps:
- name: Checkout fedml
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/CI_launch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
os: [ Linux, Windows ]
arch: [X64]
python-version: ['python3.8','python3.9','python3.10','python3.11']

runs-on: ${{ matrix.python-version }}
runs-on: ["${{ matrix.python-version }}","${{ matrix.os }}"]
timeout-minutes: 5
steps:
- name: Checkout fedml
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/CI_train.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ on:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
train:
runs-on: ${{ matrix.python-version }}
runs-on: ["${{ matrix.python-version }}","${{ matrix.os }}"]
strategy:
fail-fast: false
matrix:
os: [ Linux ]
os: [ Linux, Windows ]
arch: [X64]
python-version: ['python3.8', 'python3.9', 'python3.10', 'python3.11']

timeout-minutes: 5
steps:
- name: Checkout fedml
uses: actions/checkout@v3
Expand Down
24 changes: 23 additions & 1 deletion .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,28 @@ to check that your runners are all active.

## 2.2 Windows Runners

step1: Install Anaconda packages
Install Anaconda or Miniconda in a windows machine. the Anaconda and Miniconda can manage your python environments.

step2: Create python enviroments
Create 4 python environments named python38、python39、python310、python311, you also need to specific `python==3.8` to install specific python version.
For example
```
conda create -n python38 python==3.8
```
step3: Create directories
Create 4 directories named actions-runner-python38、actions-runner-python39、actions-runner-python310、actions-runner-python311 used for different runners.

step4: Install the latest runner package.
Follow the insturction from navigating this path `Settings -> Actions -> Runners -> New self-hosted runner` to add a new windows runner. Note that You just do the download、extract steps in the directories which we have created, we don't need to configure it and run it. We can run a script to registry all the runners.

step5: Registry all the runners.
Run the script from ./registry-runners/windows.ps1 to registry all the runners to your github. you need to replace the variables $REPO、$ACCESS_TOKEN、$WORKPLACE with the actual value. Note that you can get your $ACCESS_TOKEN from the following path `Settings -> Actions -> Runners -> New self-hosted runner.`.
In the Configure section, you can find the similar line: `./config.sh --url https://github.com/FedML-AI/FedML --token AXRYPL6G2VHVGDFDQQS5XA3ELYI6M` to get your $ACCESS_TOKEN.

step6: Make sure the success.
Check if the runners are registered successfully. Navigate the following path.`Settings -> Actions -> Runners` to check that your runners are all active.

## 2.3 Mac Runners

# 3. bind Test Machines
Expand All @@ -70,5 +92,5 @@ If you need to add a new CI test that is different from the current business, yo

# 6. TODO

Implement the Windows runners and the Mac runners.
Implement the Mac runners.

38 changes: 0 additions & 38 deletions .github/workflows/registry-runners/windows.bat

This file was deleted.

32 changes: 32 additions & 0 deletions .github/workflows/registry-runners/windows.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

$REPO = "Qigemingziba/FedML"
$ACCESS_TOKEN = "AGMK3PY3QDYUXXXEB5LWI4DGOQIFW"
$WORKPLACE=$PWD

Set-Location actions-runner-python38
& conda activate python38
./config.cmd --url https://github.com/$REPO --name windows-python38 --token $ACCESS_TOKEN --labels self-hosted,Windows,X64,python3.8
Start-Process run.cmd start -WindowStyle Hidden

Set-Location $WORKPLACE

Set-Location actions-runner-python39
& conda activate python39
./config.cmd --url https://github.com/$REPO --name windows-python39 --token $ACCESS_TOKEN --labels self-hosted,Windows,X64,python3.9
Start-Process run.cmd start -WindowStyle Hidden

Set-Location $WORKPLACE

Set-Location actions-runner-python310
& conda activate python310
./config.cmd --url https://github.com/$REPO --name windows-python310 --token $ACCESS_TOKEN --labels self-hosted,Windows,X64,python3.10
Start-Process run.cmd start -WindowStyle Hidden

Set-Location $WORKPLACE

Set-Location actions-runner-python311
& conda activate python311
./config.cmd --url https://github.com/$REPO --name windows-python311 --token $ACCESS_TOKEN --labels self-hosted,Windows,X64,python3.11
Start-Process run.cmd start -WindowStyle Hidden

Set-Location $WORKPLACE

0 comments on commit 7a0963e

Please sign in to comment.