Skip to content

Commit d561b6f

Browse files
committed
Add test for custom packages
1 parent 6b7a78b commit d561b6f

File tree

4 files changed

+46
-4
lines changed

4 files changed

+46
-4
lines changed

packages/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ uv build
5555
# Or vanilla python build if UV fails
5656
python3 setup.py bdist_wheel
5757
58+
# Minimum test to check that the package installs and imports
59+
/build/test.sh 'import <pkg>' dist/<pkg>-*.whl
60+
5861
# Copy tarball and wheel to output directory
5962
cp -r dist/* /dst
6063
```

packages/fairseq.sh

+2
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ git checkout d81fac8163364561fd6cd9d82b6ee1ba502c3526
1010

1111
uv build
1212

13+
/build/test.sh 'import fairseq' dist/fairseq-*.whl
14+
1315
cp -r dist/* /dst

packages/mid-splatting.sh

+15-4
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,31 @@
22

33
set -euo pipefail
44

5+
# Torch is needed but not in build requirements
6+
# shellcheck disable=SC1091
7+
source /opt/r8/monobase/activate.sh
8+
9+
# Loosely based on
10+
# https://github.com/pytorch/pytorch/blob/main/.ci/manywheel/build_cuda.sh
11+
export TORCH_CUDA_ARCH_LIST='5.0;6.0;7.0;7.5;8.0;8.6;9.0'
12+
513
git clone https://github.com/autonomousvision/mip-splatting.git
614

715
cd mip-splatting
816
project_dir=$PWD
917

1018
git checkout dda02ab5ecf45d6edb8c540d9bb65c7e451345a9
1119

12-
export TORCH_CUDA_ARCH_LIST='7.0;7.5;8.0;8.6+PTX'
13-
14-
cd "$project_dir/submodules/diff-gaussian-rasterization"
1520
# uv build fails due to missing header, potential bug?
21+
cd "$project_dir/submodules/diff-gaussian-rasterization"
1622
python3 setup.py bdist_wheel
17-
cp dist/* /dst
1823

1924
cd "$project_dir/submodules/simple-knn"
2025
python3 setup.py bdist_wheel
26+
27+
/build/test.sh \
28+
'import diff_gaussian_rasterization; import simple_knn' \
29+
"$project_dir/submodules/diff-gaussian-rasterization/dist/"*.whl \
30+
"$project_dir/submodules/simple-knn/dist/"*.whl \
31+
2132
cp dist/* /dst

packages/test.sh

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
3+
# Test wheel files produced by package scripts
4+
5+
if [ $# -lt 2 ]; then
6+
echo "Usage: $(basename "$0") <SCRIPT> <WHEEL>..."
7+
exit 1
8+
fi
9+
10+
script="$1"
11+
shift
12+
13+
# Install wheel files in the user layer
14+
# This should detect any dependency conflicts
15+
for whl in "$@"; do
16+
echo "$whl" >> /tmp/requirements.txt
17+
done
18+
/opt/r8/monobase/run.sh monobase.user --requirements /tmp/requirements.txt
19+
20+
# Activate the environment including Cog, monobase, and user venv
21+
# shellcheck disable=SC1091
22+
source /opt/r8/monobase/activate.sh
23+
24+
# Run the test script
25+
python3 -c "$script"
26+
echo "PASS: $script"

0 commit comments

Comments
 (0)