Skip to content

Commit

Permalink
Merge pull request #8486 from OpenMined/rasswanth/optimize-post-relea…
Browse files Browse the repository at this point in the history
…se-tests

Optimizing Release Process
  • Loading branch information
rasswanth-s authored Feb 15, 2024
2 parents ef72e35 + e34f8c4 commit 8e6b98e
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/cd-post-release-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,78 @@ on:
type: string

jobs:
notebook-test-hagrid:
strategy:
max-parallel: 99
matrix:
os: [ubuntu-latest]
python-version: ["3.11"]

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5

with:
python-version: ${{ matrix.python-version }}

- name: Upgrade pip
run: |
python -m pip install --upgrade --user pip
- name: Get pip cache dir
id: pip-cache
shell: bash
run: |
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
- name: pip cache
uses: actions/cache@v4
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-py${{ matrix.python-version }}-${{ hashFiles('setup.cfg') }}
restore-keys: |
${{ runner.os }}-pip-py${{ matrix.python-version }}-
- name: Install Hagrid and tox
run: |
pip install -U hagrid
pip install tox
- name: Hagrid Version
run: |
hagrid version
- name: Launch Domain
run: |
hagrid launch test-domain-1 to docker:8081 --tag=${{ github.event.inputs.syft_version }} --low-side
- name: Run tests
env:
NODE_PORT: "8081"
SYFT_VERSION: ${{ github.event.inputs.syft_version }}
EXCLUDE_NOTEBOOKS: "not 11-container-images-k8s.ipynb"
run: |
tox -e e2e.test.notebook
syft-install-check:
strategy:
max-parallel: 99
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
# Re-enable macos-14 when it's available when we remove python 3.9 from syft
# os: [ubuntu-latest, macos-latest, windows-latest, macos-14]
python-version: ["3.11", "3.10", "3.9"]

runs-on: ${{ matrix.os }}
steps:
- name: System Architecture
run: |
echo "System Architecture: $(uname -m)"
echo "System Version: $(uname -a)"
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/cd-syft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -514,3 +514,9 @@ jobs:
add: "helm/"
push: "origin gh-pages"
cwd: "./ghpages/"

# Can we remove the always flag from the below job?
call-cd-post-release-tests:
needs: [deploy-syft]
if: always() && github.repository == 'OpenMined/PySyft' && needs.deploy-syft.result == 'success' # don't run on forks
uses: OpenMined/PySyft/.github/workflows/cd-post-release-tests.yml@dev
38 changes: 38 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ envlist =
syftcli.publish
syftcli.build
backend.test.basecpu
e2e.test.notebook
skipsdist = True


Expand Down Expand Up @@ -1105,3 +1106,40 @@ commands =
bash -c 'for pkg in perl make curl wget; do docker run --rm cpu-worker:custom-cmd apk -e info "$pkg"; done'
bash -c 'docker run --rm cpu-worker:custom-cmd bash -c "cd cowsay-3.7.0 && curl https://api.github.com/zen -s | ./cowsay"'
bash -c 'docker rmi cpu-worker:custom-cmd'


# There are other adjacent notebook tests like
# stack.test.notebook, syft.test.notebook, etc.
# They could be modularized and reused.
# The below is the notebook test suite for point at external servers
[testenv:e2e.test.notebook]
description = E2E Notebook tests
changedir = {toxinidir}/notebooks
allowlist_externals =
bash
setenv =
ORCHESTRA_DEPLOYMENT_TYPE = {env:ORCHESTRA_DEPLOYMENT_TYPE:k8s}
NODE_PORT = {env:NODE_PORT:8080}
NODE_URL = {env:NODE_URL:http://localhost}
EXCLUDE_NOTEBOOKS = {env:EXCLUDE_NOTEBOOKS:}
SYFT_VERSION = {env:SYFT_VERSION:latest}
commands =
bash -c "echo Running with ORCHESTRA_DEPLOYMENT_TYPE=$ORCHESTRA_DEPLOYMENT_TYPE NODE_PORT=$NODE_PORT NODE_URL=$NODE_URL \
Excluding notebooks: $EXCLUDE_NOTEBOOKS SYFT_VERSION=$SYFT_VERSION; date"


# Schema for EXLUDE_NOTEBOOKS is
# for excluding
# notebook1.ipynb, notebook2.ipynb
# EXCLUDE_NOTEBOOKS=not notebook1.ipynb and not notebook2.ipynb
bash -c "pip install pytest pytest-randomly nbmake"
#If the syft version is latest install the latest version of syft
# else install the version of syft specified
bash -c "if [[ $SYFT_VERSION == 'latest' ]]; then \
pip install syft[data_science]; \
else \
pip install syft[data_science]==$SYFT_VERSION; \
fi"


pytest api/0.8 --nbmake -p no:randomly -vvvv --nbmake-timeout=1000 -k '{env:EXCLUDE_NOTEBOOKS:}'

0 comments on commit 8e6b98e

Please sign in to comment.