Skip to content

Commit

Permalink
Merge pull request #66 from unifyai/ci-testing
Browse files Browse the repository at this point in the history
Integrating Demos Tests in the CI
  • Loading branch information
vedpatwardhan authored Nov 8, 2023
2 parents 2bf43d2 + 0c8ae63 commit b5104bb
Show file tree
Hide file tree
Showing 21 changed files with 119,237 additions and 205 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/_basic-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: test-basics
on: [workflow_call, workflow_dispatch]

jobs:
cpu:
runs-on: ubuntu-latest #ToDo: ${{ needs.build.outputs.os }}
strategy:
fail-fast: false
matrix:
mods: [01_write_ivy_code, 02_unify_code, 03_trace_code, 04_transpile_code, 05_lazy_vs_eager,
06_how_to_use_decorators, 07_transpile_any_library, 08_transpile_any_model,
09_write_a_model_using_ivy]

steps:
- name: Checkout Demos🛎
uses: actions/checkout@v4
with:
repository: unifyai/demos
path: demos
persist-credentials: false
submodules: "recursive"
fetch-depth: 1

- name: Run Integration testing for Basic Demos
id: tests
run: |
cd demos
docker run -v "$(pwd)":/ivy/demos unifyai/ivy:latest demos/tests/test_demos.sh ${{ secrets.USER_API_KEY }} learn_the_basics/${{ matrix.mods }}.ipynb
29 changes: 29 additions & 0 deletions .github/workflows/_demo-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: test-examples
on: [workflow_call, workflow_dispatch]

jobs:
gpu:
runs-on: self-hosted #ToDo: ${{ needs.build.outputs.os }}
strategy:
fail-fast: false
matrix:
modules: [alexnet_demo, bert_demo, image_segmentation_with_ivy_unet, mmpretrain_to_jax, resnet_demo, torch_to_jax]

steps:
- name: Clean repository
run:
sudo rm -fr $GITHUB_WORKSPACE && mkdir $GITHUB_WORKSPACE

- name: Checkout Demos🛎
uses: actions/checkout@v4
with:
repository: unifyai/demos
path: demos
persist-credentials: false
submodules: "recursive"
fetch-depth: 1

- name: Run Integration Tests for Enterprise Demos
run: |
cd demos
docker run --gpus all -v "$(pwd)":/ivy/demos unifyai/ivy:latest-gpu demos/tests/test_demos.sh ${{ secrets.USER_API_KEY }} examples_and_demos/${{ matrix.modules }}.ipynb
15 changes: 9 additions & 6 deletions .github/workflows/run-test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@ name: E2E-QA-and-Deployment
on:
workflow_dispatch:
push:
branches:
- ci-testing
pull_request:
branches:
- 'main'

permissions:
actions: read

concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false

jobs:
start-vm:
runs-on: ubuntu-latest
Expand All @@ -24,15 +27,15 @@ jobs:

- name: Install clients for GCP/Mongo
run: |
pip3 install pymongo google-api-python-client paramiko==2.7.1
pip3 install pymongo google-api-python-client paramiko
- name: Start GPU VM
run: |
cd demos/tests/auth
mkdir -p ~/.ssh
touch ~/.ssh/id_rsa
echo "${{ secrets.SSH_KEY }}" > $HOME/.ssh/id_rsa
chmod 600 $HOME/.ssh/id_rsa
echo -n "${{ secrets.SSH_KEY }}" > ~/.ssh/id_rsa
chmod +x ~/.ssh/id_rsa
python3 db_auth.py ${{ secrets.DB_ENDPOINT }} ${{ secrets.DB_OBJ_ID }}
python3 vm_auth.py ${{ secrets.SSH_USERNAME }} ${{ secrets.SSH_PASSPHRASE }} "false"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.vscode
.idea/*
**/.ipynb_checkpoints/*
__pycache__/
**pem**
**fn_path_cache**
*.DS_Store
Expand Down
26 changes: 26 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
repos:
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
language_version: python3
args:
- "--preview"
- repo: https://github.com/PyCQA/autoflake
rev: v2.1.1
hooks:
- id: autoflake
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
exclude: ^.*__init__.py$
- repo: https://github.com/PyCQA/docformatter
rev: v1.6.3
hooks:
- id: docformatter
- repo: https://github.com/pycqa/pydocstyle
rev: 6.3.0
hooks:
- id: pydocstyle

117,565 changes: 117,565 additions & 0 deletions data/train.csv

Large diffs are not rendered by default.

Loading

0 comments on commit b5104bb

Please sign in to comment.