forked from microsoft/responsible-ai-toolbox
-
Notifications
You must be signed in to change notification settings - Fork 1
133 lines (111 loc) · 4.16 KB
/
CI-notebook-vision.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: CI Vision Notebooks
on:
push:
branches: [main]
pull_request:
branches: [main]
paths:
- "raiwidgets/**"
- "responsibleai_vision/**"
- ".github/workflows/CI-notebook-vision.yml"
- "libs/e2e/src/lib/describer/modelAssessment/**"
- "libs/interpret-vision/**"
- "notebooks/**"
jobs:
ci-notebook-vision:
env:
node-version: 16.x
strategy:
matrix:
operatingSystem: [ubuntu-latest]
pythonVersion: [3.7, 3.8, 3.9, "3.10"]
runs-on: ${{ matrix.operatingSystem }}
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: ${{ matrix.pythonVersion }}
- name: Use Node.js ${{ env.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.node-version }}
- name: Install yarn
run: npm install yarn -g
- name: Install yarn dependencies
run: |
yarn config set network-timeout 300000
yarn install --frozen-lock-file
- name: Build Typescript
run: yarn buildall
- if: ${{ matrix.operatingSystem != 'macos-latest' && matrix.pythonVersion == '3.7' }}
name: Install pytorch on non-MacOS with python 3.7
shell: bash -l {0}
run: |
conda install --yes --quiet "pytorch==1.13.1" "torchvision<0.15" cpuonly "numpy<1.24.0" -c pytorch
- if: ${{ matrix.operatingSystem == 'macos-latest' && matrix.pythonVersion == '3.7' }}
name: Install Anaconda packages on MacOS with python 3.7
shell: bash -l {0}
run: |
conda install --yes --quiet "pytorch==1.13.1" "torchvision<0.15" "numpy<1.24.0" -c pytorch
- if: ${{ matrix.operatingSystem != 'macos-latest' && matrix.pythonVersion != '3.7' }}
name: Install pytorch on non-MacOS
shell: bash -l {0}
run: |
conda install --yes --quiet "pytorch<2.1,>1.13.1" "torchvision<0.16" cpuonly "numpy<1.24.0" -c pytorch
- if: ${{ matrix.operatingSystem == 'macos-latest' && matrix.pythonVersion != '3.7' }}
name: Install Anaconda packages on MacOS, which should not include cpuonly according to official docs
shell: bash -l {0}
run: |
conda install --yes --quiet "pytorch<2.1,>1.13.1" "torchvision<0.16" "numpy<1.24.0" -c pytorch
- name: Setup tools
shell: bash -l {0}
run: |
python -m pip install --upgrade pip
pip install --upgrade setuptools
pip install --upgrade "pip-tools<=7.1.0"
- name: Install dependencies
shell: bash -l {0}
run: |
pip install captum
pip install -r requirements-dev.txt
pip install .
working-directory: raiwidgets
- name: Install vision dependencies
shell: bash -l {0}
run: |
pip install -r requirements-dev.txt
pip install .
working-directory: responsibleai_vision
- if: ${{ matrix.operatingSystem == 'windows-latest' }}
name: Install older pyarrow to fix CI getting stuck on Windows
shell: bash -l {0}
run: |
pip install --force-reinstall pyarrow==11.0.0
pip install "numpy<=1.26.2"
- name: Pip freeze
shell: bash -l {0}
run: |
pip freeze > installed-requirements-dev.txt
cat installed-requirements-dev.txt
working-directory: raiwidgets
- name: Upload requirements
uses: actions/upload-artifact@v3
with:
name: requirements-dev.txt
path: raiwidgets/installed-requirements-dev.txt
- name: Run notebook tests
shell: bash -l {0}
run: python -m pytest -s -v notebooks -m vision_notebooks
- name: Upload notebook test result
if: always()
uses: actions/upload-artifact@v3
with:
name: notebook-test-${{ matrix.operatingSystem }}-${{ matrix.pythonVersion }}
path: notebooks
- name: Upload e2e test screen shot
if: always()
uses: actions/upload-artifact@v3
with:
name: raiwidgets-e2e-screen-shot
path: dist/cypress