Skip to content

Commit 8fb75a1

Browse files
authored
manage dependencies with rapids-dependency-file-generator (#120)
1 parent 2293a7c commit 8fb75a1

File tree

5 files changed

+110
-12
lines changed

5 files changed

+110
-12
lines changed

.github/workflows/github-actions.yml

+23-12
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,15 @@ on:
1111
- "branch-*"
1212
- "main"
1313
jobs:
14+
pre-commit:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-python@v5
19+
- uses: pre-commit/[email protected]
20+
1421
build-test:
22+
needs: [pre-commit]
1523
defaults:
1624
run:
1725
shell: bash -el {0}
@@ -23,14 +31,25 @@ jobs:
2331
env:
2432
NVIDIA_VISIBLE_DEVICES: ${{ env.NVIDIA_VISIBLE_DEVICES }} # GPU jobs must set this container env variable
2533
steps:
26-
- name: Install legate/cunumeric
27-
run: |
28-
mamba install -y -c legate -c conda-forge legate-core=24.06 cunumeric=24.06 build cmake scikit-build scikit-learn hypothesis 'pytest<8' notebook 'numpy<2' mypy openblas
29-
pip install matplotlib seaborn xgboost
3034
- name: Checkout legateboost
3135
uses: actions/checkout@v4
3236
with:
3337
lfs: true
38+
- name: Install legate/cunumeric
39+
run: |
40+
mamba install --yes -c rapidsai \
41+
'rapids-dependency-file-generator>=1.14.0'
42+
43+
rapids-dependency-file-generator \
44+
--output conda \
45+
--file-key all \
46+
--matrix "cuda=${CUDA_VERSION};arch=$(arch)" | tee /tmp/env.yaml
47+
48+
# update the current environment (instead of creating a new one), as that
49+
# persists across all steps
50+
mamba env update \
51+
--name base \
52+
--file /tmp/env.yaml
3453
- name: Type check legateboost
3554
run: |
3655
mypy ./legateboost --config-file ./setup.cfg --exclude=legateboost/test --exclude=install_info
@@ -52,7 +71,6 @@ jobs:
5271
- name: Build legateboost docs
5372
working-directory: docs
5473
run: |
55-
pip install sphinx pydata-sphinx-theme myst-parser
5674
# invoke sphinx build using legate
5775
legate --run-mode=python --module sphinx.cmd.build source build -b html
5876
- uses: actions/upload-pages-artifact@v1
@@ -81,10 +99,3 @@ jobs:
8199
- name: Deploy to GitHub Pages
82100
id: deployment
83101
uses: actions/deploy-pages@v2
84-
85-
pre-commit:
86-
runs-on: ubuntu-latest
87-
steps:
88-
- uses: actions/checkout@v4
89-
- uses: actions/setup-python@v5
90-
- uses: pre-commit/[email protected]

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
build
2+
dist/
23
_skbuild
34
*.pyc
45
*.egg-info

.pre-commit-config.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,10 @@ repos:
2828
- id: clang-format
2929
files: \.(cu|cuh|h|cc|inl)$
3030
types_or: []
31+
- repo: https://github.com/rapidsai/dependency-file-generator
32+
rev: v1.14.0
33+
hooks:
34+
- id: rapids-dependency-file-generator
35+
args: ["--clean"]
3136
default_language_version:
3237
python: python3

conda/environments/all_cuda-118.yaml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# This file is generated by `rapids-dependency-file-generator`.
2+
# To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`.
3+
channels:
4+
- legate
5+
- conda-forge
6+
dependencies:
7+
- cmake>=3.24.0,!=3.30.0
8+
- cunumeric=24.06.*
9+
- hypothesis
10+
- legate-core=24.06.*
11+
- matplotlib
12+
- mypy
13+
- myst-parser
14+
- nbconvert
15+
- notebook
16+
- numpy
17+
- openblas
18+
- pydata-sphinx-theme
19+
- pytest<8
20+
- python-build
21+
- scikit-build>=0.18.0
22+
- scikit-learn
23+
- seaborn
24+
- setuptools>=70.0
25+
- sphinx
26+
- typing-extensions>=4.0
27+
- xgboost
28+
name: all_cuda-118

dependencies.yaml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Dependency list for https://github.com/rapidsai/dependency-file-generator
2+
files:
3+
all:
4+
output: conda
5+
matrix:
6+
cuda: ["11.8"]
7+
includes:
8+
- build
9+
- docs
10+
- run
11+
- test
12+
channels:
13+
- legate
14+
- conda-forge
15+
dependencies:
16+
build:
17+
common:
18+
- output_types: [conda]
19+
packages:
20+
- cmake>=3.24.0,!=3.30.0
21+
- &legate_core legate-core=24.06.*
22+
- openblas
23+
- python-build
24+
- scikit-build>=0.18.0
25+
- setuptools>=70.0
26+
docs:
27+
common:
28+
- output_types: [conda]
29+
packages:
30+
- sphinx
31+
- pydata-sphinx-theme
32+
- myst-parser
33+
run:
34+
common:
35+
- output_types: [conda]
36+
packages:
37+
- cunumeric=24.06.*
38+
- *legate_core
39+
- numpy
40+
- scikit-learn
41+
- typing-extensions>=4.0
42+
test:
43+
common:
44+
- output_types: [conda]
45+
packages:
46+
- hypothesis
47+
- matplotlib
48+
- mypy
49+
- nbconvert
50+
- notebook
51+
- pytest<8
52+
- seaborn
53+
- xgboost

0 commit comments

Comments
 (0)