Skip to content

Commit f6b9755

Browse files
committed
ci: Constrain all dependencies
Signed-off-by: Ihar Hrachyshka <ihar.hrachyshka@gmail.com>
1 parent 0bb0f7e commit f6b9755

9 files changed

Lines changed: 350 additions & 77 deletions
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Update constraints-dev.txt
2+
3+
on:
4+
schedule:
5+
- cron: '0 3 * * 1' # Every Monday at 03:00 UTC
6+
workflow_dispatch:
7+
8+
jobs:
9+
update-constraints:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
pull-requests: write
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
18+
19+
- name: Checkout "update-constraints" in-house CI action
20+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
21+
with:
22+
repository: instructlab/ci-actions
23+
path: ci-actions
24+
# no tag that includes https://github.com/instructlab/ci-actions/pull/26, yet
25+
ref: 88641ccaf122964eacdc1a82b18bda369b6f99bd # main
26+
sparse-checkout: |
27+
actions/update-constraints
28+
29+
- name: Update constraints
30+
id: update-constraints
31+
uses: ./ci-actions/actions/update-constraints
32+
with:
33+
gh-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}

.github/workflows/e2e-nvidia-l4-x1.yml

Lines changed: 19 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ on:
1818
- '**.py'
1919
- 'pyproject.toml'
2020
- 'requirements**.txt'
21+
- 'constraints-dev.txt'
2122
- '.github/workflows/e2e-nvidia-l4-x1.yml' # This workflow
2223

2324
concurrency:
@@ -111,45 +112,29 @@ jobs:
111112
- name: Install ilab
112113
working-directory: ./instructlab
113114
run: |
114-
export CUDA_HOME="/usr/local/cuda"
115-
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$CUDA_HOME/lib64:$CUDA_HOME/extras/CUPTI/lib64"
116-
export PATH="$PATH:$CUDA_HOME/bin"
117-
python3.11 -m venv --upgrade-deps venv
118-
. venv/bin/activate
119-
nvidia-smi
120-
python3.11 -m pip cache remove llama_cpp_python
121-
122-
pip_install="python3.11 -m pip install -v -c constraints-dev.txt"
123-
124-
pip_install="python3.11 -m pip install -v -c constraints-dev.txt"
125-
126-
# pre-install some build dependencies
127-
$pip_install packaging wheel setuptools-scm
128-
129-
# flash-attn has a bug in the setup.py that causes pip to attempt installing it
130-
# before torch is installed. This is a bug because their setup.py depends on
131-
# importing the module, so it should have been listed in build_requires. Alas!
132-
#
133-
# See: https://github.com/Dao-AILab/flash-attention/pull/958
134-
# Also: https://github.com/instructlab/instructlab/issues/1821
135-
#
136-
# first, pre-install flash-attn build dependencies
137-
$pip_install torch packaging setuptools wheel psutil ninja
138-
139-
# now build flash-attn using the pre-installed build dependencies; this will
140-
# guarantee that the build version of torch will match the runtime version of
141-
# torch; otherwise, all kinds of problems may occur, like missing symbols when
142-
# accessing C extensions and such
143-
$pip_install flash-attn --no-build-isolation
144-
145-
CMAKE_ARGS="-DGGML_CUDA=on" $pip_install .
146-
$pip_install .[cuda] -r requirements-vllm-cuda.txt
115+
PYTHON=python3.11 ./scripts/install-ilab-with-cuda.sh
147116
148117
- name: Update instructlab-eval library
149118
working-directory: ./eval
150119
run: |
151120
. ../instructlab/venv/bin/activate
152-
pip install -v .
121+
# Patch out our own pin from the ilab repo constraints file
122+
ilab_constraints=../instructlab/constraints-dev.txt
123+
sed -i '/instructlab-eval==/d' $ilab_constraints
124+
125+
# Since we reuse the virtual environment prepared using ilab
126+
# constraints, we should stick to the same constraints when
127+
# installing latest eval.
128+
#
129+
# FIX: this is not ideal; a proper fix would require decoupling the
130+
# two repos in CI: either by removing the job completely and relying
131+
# on "sdk" (no ilab) test runs; or by preparing a separate
132+
# constraints file that would consider both the requirements files
133+
# for the eval library AND for the ilab - so that they are
134+
# consistent.
135+
pip_install="pip install -c $ilab_constraints"
136+
$pip_install .
137+
$pip_install .[cuda]
153138
154139
- name: Run e2e test
155140
working-directory: ./instructlab

.github/workflows/e2e-nvidia-l40s-x4.yml

Lines changed: 18 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -142,44 +142,29 @@ jobs:
142142
- name: Install ilab
143143
working-directory: ./instructlab
144144
run: |
145-
export CUDA_HOME="/usr/local/cuda"
146-
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$CUDA_HOME/lib64:$CUDA_HOME/extras/CUPTI/lib64"
147-
export PATH="$PATH:$CUDA_HOME/bin"
148-
python3.11 -m venv --upgrade-deps venv
149-
. venv/bin/activate
150-
nvidia-smi
151-
python3.11 -m pip cache remove llama_cpp_python
152-
153-
pip_install="python3.11 -m pip install -v -c constraints-dev.txt"
154-
155-
# pre-install some build dependencies
156-
$pip_install packaging wheel setuptools-scm
157-
158-
# flash-attn has a bug in the setup.py that causes pip to attempt installing it
159-
# before torch is installed. This is a bug because their setup.py depends on
160-
# importing the module, so it should have been listed in build_requires. Alas!
161-
#
162-
# See: https://github.com/Dao-AILab/flash-attention/pull/958
163-
# Also: https://github.com/instructlab/instructlab/issues/1821
164-
#
165-
# first, pre-install flash-attn build dependencies
166-
$pip_install torch packaging setuptools wheel psutil ninja
167-
168-
# now build flash-attn using the pre-installed build dependencies; this will
169-
# guarantee that the build version of torch will match the runtime version of
170-
# torch; otherwise, all kinds of problems may occur, like missing symbols when
171-
# accessing C extensions and such
172-
$pip_install flash-attn --no-build-isolation
173-
174-
CMAKE_ARGS="-DGGML_CUDA=on" $pip_install .
175-
$pip_install .[cuda] -r requirements-vllm-cuda.txt
145+
PYTHON=python3.11 ./scripts/install-ilab-with-cuda.sh
176146
177147
- name: Update instructlab-eval library
178148
working-directory: ./eval
179149
run: |
180150
. ../instructlab/venv/bin/activate
181-
pip install .
182-
pip install .[cuda]
151+
# Patch out our own pin from the ilab repo constraints file
152+
ilab_constraints=../instructlab/constraints-dev.txt
153+
sed -i '/instructlab-eval==/d' $ilab_constraints
154+
155+
# Since we reuse the virtual environment prepared using ilab
156+
# constraints, we should stick to the same constraints when
157+
# installing latest eval.
158+
#
159+
# FIX: this is not ideal; a proper fix would require decoupling the
160+
# two repos in CI: either by removing the job completely and relying
161+
# on "sdk" (no ilab) test runs; or by preparing a separate
162+
# constraints file that would consider both the requirements files
163+
# for the eval library AND for the ilab - so that they are
164+
# consistent.
165+
pip_install="pip install -c $ilab_constraints"
166+
$pip_install .
167+
$pip_install .[cuda]
183168
184169
- name: Check disk before tests
185170
run: |

.github/workflows/lint.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111
- '**.py'
1212
- 'pyproject.toml'
1313
- 'requirements*.txt'
14+
- 'constraints-dev.txt'
1415
- 'tox.ini'
1516
- '.pylintrc'
1617
- 'scripts/*.sh' # Used by this workflow
@@ -23,6 +24,7 @@ on:
2324
- '**.py'
2425
- 'pyproject.toml'
2526
- 'requirements*.txt'
27+
- 'constraints-dev.txt'
2628
- 'tox.ini'
2729
- '.pylintrc'
2830
- 'scripts/*.sh' # Used by this workflow
@@ -82,8 +84,9 @@ jobs:
8284
8385
- name: Install tox
8486
run: |
85-
python -m pip install --upgrade pip
86-
python -m pip install tox tox-gh
87+
pip_install="python -m pip install -c constraints-dev.txt"
88+
$pip_install --upgrade pip
89+
$pip_install tox tox-gh
8790
8891
- name: "${{ matrix.lint.name }}"
8992
run: |

.github/workflows/test.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212
- '**.py'
1313
- 'pyproject.toml'
1414
- 'requirements**.txt'
15+
- 'constraints-dev.txt'
1516
- 'tox.ini'
1617
- 'scripts/*.sh' # Used by this workflow
1718
- '.github/workflows/test.yml' # This workflow
@@ -23,6 +24,7 @@ on:
2324
- '**.py'
2425
- 'pyproject.toml'
2526
- 'requirements**.txt'
27+
- 'constraints-dev.txt'
2628
- 'tox.ini'
2729
- 'scripts/*.sh' # Used by this workflow
2830
- '.github/workflows/test.yml' # This workflow
@@ -99,8 +101,9 @@ jobs:
99101

100102
- name: Install dependencies
101103
run: |
102-
python -m pip install --upgrade pip
103-
python -m pip install tox tox-gh>=1.2
104+
pip_install=python -m pip install -c constraints-dev.txt"
105+
$pip_install --upgrade pip
106+
$pip_install tox tox-gh>=1.2
104107
105108
- name: Run unit and functional tests with tox
106109
run: |

0 commit comments

Comments
 (0)