Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Scenario load tests with simulator #9292

Merged
merged 100 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
220114f
Add scenario tests to the CI
itstauq Sep 15, 2024
f721f73
add support to run scenario tests using mock apis
itstauq Sep 16, 2024
5225e39
Clean up 1
itstauq Sep 16, 2024
22c587b
Refactor
itstauq Sep 17, 2024
7cec793
Merge branch 'dev' into tauquir/scenario-tests
khoaguin Sep 18, 2024
b650495
some early l0 activities in sim
yashgorana Sep 18, 2024
fdb6c87
some more code
yashgorana Sep 18, 2024
ab412f2
exit early if an exception occurs
abyesilyurt Sep 18, 2024
e48b05d
revert sleep duration
abyesilyurt Sep 18, 2024
c3c1ddb
working on low-side ds workflow
khoaguin Sep 19, 2024
50646df
Merge branch 'dev' into tauquir/scenario-tests
yashgorana Sep 20, 2024
a9266aa
user on low-side submits queries and waiting for approval
khoaguin Sep 20, 2024
4abda81
[tox] create tox task for k8s bigquery sync scenario test
khoaguin Sep 20, 2024
e60ab29
fix wrong import
khoaguin Sep 20, 2024
ca356d7
register users
yashgorana Sep 20, 2024
b61559a
Merge branch 'dev' into tauquir/scenario-tests
yashgorana Sep 20, 2024
5a43d46
use unsync_guard
yashgorana Sep 20, 2024
587ae51
polish things up, separately
yashgorana Sep 23, 2024
ab685c3
l0 till bigquery.test_query
yashgorana Sep 23, 2024
63785b2
logs
yashgorana Sep 23, 2024
da9608f
to_thread worker pool create
yashgorana Sep 23, 2024
fd04063
l0 submit_query & sync
yashgorana Sep 23, 2024
eb72983
Merge branch 'dev' into tauquir/scenario-tests
khoaguin Sep 24, 2024
92d2cb6
fix lint
khoaguin Sep 24, 2024
9768691
[tests/scenario] level 2 bigquery scenario test version 2
khoaguin Sep 24, 2024
21de88a
Merge branch 'dev' into tauquir/scenario-tests
yashgorana Sep 24, 2024
0a54fd0
l0 admin high triage requests
yashgorana Sep 24, 2024
4df7fbf
Merge branch 'dev' into tauquir/scenario-tests
yashgorana Sep 24, 2024
459c1c8
Merge branch 'dev' into tauquir/scenario-tests
yashgorana Sep 25, 2024
ef70276
[[tests/scenario] admin low triggers signal when all results are avai…
khoaguin Sep 25, 2024
ea9c3e9
[test/scenarios] admin low breaking from watching sync coroutine afte…
khoaguin Sep 25, 2024
c152819
[tests/scenarios] add a coroutine for users to check results after th…
khoaguin Sep 26, 2024
8b1337d
[tests/scenarios] logs are now saved at /scenariosv2/logs/{date_time}
khoaguin Sep 26, 2024
a5306ea
Merge branch 'dev' into tauquir/scenario-tests
khoaguin Sep 26, 2024
52a0600
fix 'worker_pool_name' var name change
yashgorana Sep 26, 2024
0fff1f9
drop F841
yashgorana Sep 26, 2024
a203de9
[CI] installing `just` and running bigquery scenariov2 on k8s with ju…
khoaguin Sep 26, 2024
7bd6573
[CI] fix bash commands for `syft.test.scenario`
khoaguin Sep 26, 2024
dc9c3ce
[CI] move testing simulation scenario tests to pr-tests-stack
khoaguin Sep 26, 2024
5f30a84
[CI] checking python version
khoaguin Sep 26, 2024
f2aab94
Merge branch 'dev' into tauquir/scenario-tests
yashgorana Sep 26, 2024
6c1267b
drop scenarios
yashgorana Sep 26, 2024
74f6694
tweaked logging
yashgorana Sep 26, 2024
2ca51cf
attempt to make things common
yashgorana Sep 26, 2024
1418756
rename bq api user flows
yashgorana Sep 26, 2024
2227c3a
refactor bq_create_pool
yashgorana Sep 26, 2024
de4b749
register users concurrently
yashgorana Sep 26, 2024
4726bee
admin api concurrency
yashgorana Sep 26, 2024
c4dae92
de-nest sim_entrypoint wrapper
yashgorana Sep 26, 2024
dae5bbe
admin sync refactor
yashgorana Sep 26, 2024
7a98935
add .logs ignore
yashgorana Sep 26, 2024
b5e3f12
fix merge conflicts
yashgorana Sep 26, 2024
2f9fe3d
drop unsync
yashgorana Sep 26, 2024
2abe420
remove unused import. upper case TODO
khoaguin Sep 27, 2024
83ac856
Merge branch 'dev' into tauquir/scenario-tests
khoaguin Sep 27, 2024
bb13be4
[tests/scenarios] always print side-type after "Admin" in logs
khoaguin Sep 27, 2024
3a2a0ca
[tests/scenarios] adding a try catch in `admin_sync`
khoaguin Sep 27, 2024
36be022
[tox] trying to fix `No interpreter found for Python 3.12 in system t…
khoaguin Sep 27, 2024
a3d2470
[CI] install just to `/usr/local/bin`
khoaguin Sep 27, 2024
10de6ec
[tox] change `deps` for `stack.test.scenario.k8s`
khoaguin Sep 27, 2024
c063522
[CI] update uv, tox and uv-tox version
khoaguin Sep 27, 2024
b0f7971
[CI] update uv and tox to latest versions for all tasks
khoaguin Sep 27, 2024
9185cf9
just wait-pods
yashgorana Sep 29, 2024
c7ee5fe
[CI] reverted to use `uv==0.4.1 tox==4.18.0 tox-uv==1.11.2`
khoaguin Sep 30, 2024
9aa6732
[tox] separate simulation k8s test for L0 and L2
khoaguin Sep 30, 2024
53a4cf8
[CI] clean up k3d for simulation k8 tests
khoaguin Sep 30, 2024
5bb27ee
[test/scenarios] launching python server if testing on python
khoaguin Sep 30, 2024
ff6f168
[tests/scenarios] launching python nodes with producer and consumers
khoaguin Sep 30, 2024
40c9387
[tests/scenario] l0 and l2 bigquery tests work with python servers
khoaguin Sep 30, 2024
6cdd3d6
[CI] fix the ORCHESTRA_DEPLOYMENT_TYPE env variable set to wrong value
khoaguin Sep 30, 2024
99f78c2
Merge branch 'dev' into tauquir/scenario-tests
khoaguin Sep 30, 2024
723d21b
[CI] fix tox command for scenario k8s test
khoaguin Sep 30, 2024
53481ca
[CI] re-enable `test-syft-scenario` and add `test-syft-scenario-sync`…
khoaguin Sep 30, 2024
32ea796
[tox] add necessary pip packages for syft scenario tests
khoaguin Sep 30, 2024
dce3ce4
DeploymentType.REMOTE as default - k8s first
yashgorana Sep 30, 2024
23ac669
refactor orchestra stuff
yashgorana Sep 30, 2024
f243637
[tests/scenario] fix small bug
khoaguin Oct 1, 2024
1f10273
[CI] collecting logs for `tests-simulation-scenario-k8s`
khoaguin Oct 1, 2024
9fb8512
[CI] collecting logs for `tests-simulation-scenario-sync-k8s`
khoaguin Oct 1, 2024
e68ae99
[CI] collecting logs for syft-scenario and syft-scenario-sync tests
khoaguin Oct 1, 2024
454ecbf
fix ActionObject.get_sync_dependencies
abyesilyurt Oct 1, 2024
6bfea61
Merge branch 'dev' into tauquir/scenario-tests
khoaguin Oct 3, 2024
6681d8d
[tests/scenarios] increase timeout for l0
khoaguin Oct 4, 2024
a40534a
test with 5 users
abyesilyurt Oct 4, 2024
fc9a952
Merge remote-tracking branch 'origin/fix_status_l0' into tauquir/scen…
abyesilyurt Oct 4, 2024
6be9ea6
update code call
abyesilyurt Oct 6, 2024
45b9f1d
increase timeout
abyesilyurt Oct 6, 2024
b98382f
increase test timeout
abyesilyurt Oct 6, 2024
f2619cd
Merge branch 'dev' into tauquir/scenario-tests
khoaguin Oct 7, 2024
38ff6d4
Merge remote-tracking branch 'origin' into tauquir/scenario-tests
abyesilyurt Oct 8, 2024
2bd24b9
Merge remote-tracking branch 'origin' into tauquir/scenario-tests
abyesilyurt Oct 8, 2024
14682a5
Merge branch 'dev' into tauquir/scenario-tests
abyesilyurt Oct 8, 2024
705ca13
Merge branch 'tauquir/scenario-tests' of github.com:OpenMined/PySyft …
abyesilyurt Oct 9, 2024
f1fdba3
fix
abyesilyurt Oct 9, 2024
78d6c06
fix
abyesilyurt Oct 9, 2024
3a22442
fix results
abyesilyurt Oct 9, 2024
99641ab
Merge branch 'dev' into tauquir/scenario-tests
abyesilyurt Oct 9, 2024
3d9db2d
request.code.__call__ uses the same api as code.funcname
abyesilyurt Oct 9, 2024
f603ccb
Merge branch 'tauquir/scenario-tests' of github.com:OpenMined/PySyft …
abyesilyurt Oct 9, 2024
be685a1
Merge branch 'dev' into tauquir/scenario-tests
khoaguin Oct 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
284 changes: 283 additions & 1 deletion .github/workflows/pr-tests-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ jobs:
if: steps.changes.outputs.stack == 'true'
run: |
python -m pip install --upgrade pip
pip install uv==0.2.17 tox==4.16.0 tox-uv==1.9.0
pip install uv==0.4.1 tox==4.18.0 tox-uv==1.11.2
uv --version
- name: Get uv cache dir
if: steps.changes.outputs.stack == 'true'
Expand Down Expand Up @@ -956,3 +956,285 @@ jobs:
export PATH=`pwd`:$PATH
k3d cluster delete bigquery-high || true
k3d cluster delete bigquery-low || true

pr-tests-simulation-scenario-k8s:
strategy:
max-parallel: 99
matrix:
os: [ubuntu-latest]
python-version: ["3.12"]
fail-fast: false

runs-on: ${{matrix.os}}

steps:
- name: Permission to home directory
run: |
sudo chown -R $USER:$USER $HOME
- uses: actions/checkout@v4
- name: Check for file changes
uses: dorny/paths-filter@v3
id: changes
with:
base: ${{ github.ref }}
token: ${{ github.token }}
filters: .github/file-filters.yml

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
if: steps.changes.outputs.stack == 'true'
with:
python-version: ${{ matrix.python-version }}

- name: Add K3d Registry
run: |
sudo python ./scripts/patch_hosts.py --add-k3d-registry

- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: true
large-packages: false

# free 10GB of space
- name: Remove unnecessary files
if: matrix.os == 'ubuntu-latest'
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
docker image prune --all --force
docker builder prune --all --force
docker system prune --all --force

- name: Install pip dependencies
if: steps.changes.outputs.stack == 'true'
run: |
python -m pip install --upgrade pip
pip install uv==0.4.1 tox==4.18.0 tox-uv==1.11.2
uv --version

- name: Get uv cache dir
if: steps.changes.outputs.stack == 'true'
id: pip-cache
shell: bash
run: |
echo "dir=$(uv cache dir)" >> $GITHUB_OUTPUT

- name: Load github cache
uses: actions/cache@v4
if: steps.changes.outputs.stack == 'true'
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-uv-py${{ matrix.python-version }}
restore-keys: |
${{ runner.os }}-uv-py${{ matrix.python-version }}

- name: Install kubectl
if: steps.changes.outputs.stack == 'true'
run: |
# cleanup apt version
sudo apt remove kubectl || true
# install kubectl 1.27
curl -LO https://dl.k8s.io/release/v1.27.2/bin/linux/amd64/kubectl
chmod +x kubectl
sudo install kubectl /usr/local/bin;

- name: Install helm
if: steps.changes.outputs.stack == 'true'
run: |
# install helm
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh

- name: Install just
if: steps.changes.outputs.stack == 'true'
run: |
curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/local/bin

- name: Run scenario tests
if: steps.changes.outputs.syft == 'true' || steps.changes.outputs.notebooks_scenario == 'true'
env:
TOX_PYTHON: python${{ matrix.python-version }}
shell: bash
run: |
K3D_VERSION=v5.6.3
DEVSPACE_VERSION=v6.3.12
# install k3d
wget https://github.com/k3d-io/k3d/releases/download/${K3D_VERSION}/k3d-linux-amd64
mv k3d-linux-amd64 k3d
chmod +x k3d
export PATH=`pwd`:$PATH
k3d version
curl -sSL https://github.com/loft-sh/devspace/releases/download/${DEVSPACE_VERSION}/devspace-linux-amd64 -o ./devspace
chmod +x devspace
devspace version
tox -e stack.test.scenario.k8s

- name: Collect logs
if: steps.changes.outputs.stack == 'true' && failure()
shell: bash
run: |
mkdir -p ./output-logs
if [ -d "tests/scenariosv2/.logs" ]; then
cp -R tests/scenariosv2/.logs/* ./output-logs/
else
echo "Log directory not found"
fi

- name: Upload logs to GitHub
uses: actions/upload-artifact@master
if: steps.changes.outputs.stack == 'true' && failure()
with:
name: simulation-scenario-k8s-logs-${{ matrix.os }}-${{ steps.date.outputs.date }}
path: ./output-logs/

- name: Cleanup k3d
if: steps.changes.outputs.stack == 'true' && failure()
shell: bash
run: |
export PATH=`pwd`:$PATH
k3d cluster delete syft-low || true
k3d registry delete k3d-registry.localhost || true

pr-tests-simulation-scenario-k8s-sync:
strategy:
max-parallel: 99
matrix:
os: [ubuntu-latest]
python-version: ["3.12"]
fail-fast: false

runs-on: ${{matrix.os}}

steps:
- name: Permission to home directory
run: |
sudo chown -R $USER:$USER $HOME
- uses: actions/checkout@v4
- name: Check for file changes
uses: dorny/paths-filter@v3
id: changes
with:
base: ${{ github.ref }}
token: ${{ github.token }}
filters: .github/file-filters.yml

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
if: steps.changes.outputs.stack == 'true'
with:
python-version: ${{ matrix.python-version }}

- name: Add K3d Registry
run: |
sudo python ./scripts/patch_hosts.py --add-k3d-registry

- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: true
large-packages: false

# free 10GB of space
- name: Remove unnecessary files
if: matrix.os == 'ubuntu-latest'
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
docker image prune --all --force
docker builder prune --all --force
docker system prune --all --force

- name: Install pip dependencies
if: steps.changes.outputs.stack == 'true'
run: |
python -m pip install --upgrade pip
pip install uv==0.4.1 tox==4.18.0 tox-uv==1.11.2
uv --version

- name: Get uv cache dir
if: steps.changes.outputs.stack == 'true'
id: pip-cache
shell: bash
run: |
echo "dir=$(uv cache dir)" >> $GITHUB_OUTPUT

- name: Load github cache
uses: actions/cache@v4
if: steps.changes.outputs.stack == 'true'
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-uv-py${{ matrix.python-version }}
restore-keys: |
${{ runner.os }}-uv-py${{ matrix.python-version }}

- name: Install kubectl
if: steps.changes.outputs.stack == 'true'
run: |
# cleanup apt version
sudo apt remove kubectl || true
# install kubectl 1.27
curl -LO https://dl.k8s.io/release/v1.27.2/bin/linux/amd64/kubectl
chmod +x kubectl
sudo install kubectl /usr/local/bin;

- name: Install helm
if: steps.changes.outputs.stack == 'true'
run: |
# install helm
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh

- name: Install just
if: steps.changes.outputs.stack == 'true'
run: |
curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/local/bin

- name: Run scenario tests
if: steps.changes.outputs.syft == 'true' || steps.changes.outputs.notebooks_scenario == 'true'
env:
BUMP_VERSION: "${{ matrix.bump-version }}"
TOX_PYTHON: python${{ matrix.python-version }}
shell: bash
run: |
K3D_VERSION=v5.6.3
DEVSPACE_VERSION=v6.3.12
# install k3d
wget https://github.com/k3d-io/k3d/releases/download/${K3D_VERSION}/k3d-linux-amd64
mv k3d-linux-amd64 k3d
chmod +x k3d
export PATH=`pwd`:$PATH
k3d version
curl -sSL https://github.com/loft-sh/devspace/releases/download/${DEVSPACE_VERSION}/devspace-linux-amd64 -o ./devspace
chmod +x devspace
devspace version
tox -e stack.test.scenario.k8s.sync

- name: Collect logs
if: steps.changes.outputs.stack == 'true' && failure()
shell: bash
run: |
mkdir -p ./output-logs
if [ -d "tests/scenariosv2/.logs" ]; then
cp -R tests/scenariosv2/.logs/* ./output-logs/
else
echo "Log directory not found"
fi

- name: Upload logs to GitHub
uses: actions/upload-artifact@master
if: steps.changes.outputs.stack == 'true' && failure()
with:
name: simulation-scenario-k8s-sync-logs-${{ matrix.os }}-${{ steps.date.outputs.date }}
path: ./output-logs/

- name: Cleanup k3d
if: steps.changes.outputs.stack == 'true' && failure()
shell: bash
run: |
export PATH=`pwd`:$PATH
k3d cluster delete syft-low || true
k3d cluster delete syft-high || true
k3d registry delete k3d-registry.localhost || true
Loading
Loading