-
Notifications
You must be signed in to change notification settings - Fork 277
Expand file tree
/
Copy pathtest_package_install_inference_gpu.yml
More file actions
74 lines (68 loc) · 2.86 KB
/
Copy pathtest_package_install_inference_gpu.yml
File metadata and controls
74 lines (68 loc) · 2.86 KB
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
name: Test package install - inference-gpu
on:
push:
branches: [main]
workflow_dispatch:
permissions:
id-token: write
contents: read
jobs:
call_is_mergeable:
uses: ./.github/workflows/check_if_branch_is_mergeable.yml
secrets: inherit
build:
needs: call_is_mergeable
if: ${{ github.event_name != 'pull_request' || needs.call_is_mergeable.outputs.mergeable_state != 'not_clean' }}
runs-on: Roboflow-GPU-VM-Runner
timeout-minutes: 15
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- name: 🛎️ Checkout
uses: actions/checkout@v6
- name: 🐍 Set up Python 3.10 to create wheels
uses: actions/setup-python@v6
with:
python-version: "3.10"
- name: 🛞 Create Wheels
run: |
make create_wheels
- name: 🐍 Set up Python ${{ matrix.python-version }} to test package install process
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: 📦 Cache Python packages
uses: actions/cache@v5
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('requirements/**') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}-
- name: 🔧 Install CUDA development toolkit
if: ${{ (github.event.inputs.extras == '' || github.event.inputs.extras == matrix.extras.marker) && (github.event.inputs.python_version == '' || github.event.inputs.python_version == matrix.python-version) }}
run: |
mkdir -p ~/apt-cache
sudo mkdir -p /var/cache/apt/archives
sudo cp -r ~/apt-cache/* /var/cache/apt/archives/ 2>/dev/null || true
sudo apt-get update
sudo apt-get install -y \
cuda-cudart-dev-12-5 \
cuda-nvcc-12-5 \
cuda-profiler-api-12-5 \
libcurand-dev-12-5 \
libvips-dev
sudo cp /var/cache/apt/archives/*.deb ~/apt-cache/ 2>/dev/null || true
sudo chown -R $(whoami):$(whoami) ~/apt-cache
- name: 📦 Installing `inference` package...
run: |
export CUDA_HOME=/usr/local/cuda-12.5
export PATH=/usr/local/cuda-12.5/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-12.5/targets/x86_64-linux/lib64:$LD_LIBRARY_PATH
export CPATH=/usr/local/cuda-12.5/targets/x86_64-linux/include:$CPATH
export LIBRARY_PATH=/usr/local/cuda-12.5/targets/x86_64-linux/lib64:$LIBRARY_PATH
pip install ./dist/inference_gpu-*-py3-none-any.whl
- name: 🧪 Testing package installation
working-directory: "/"
run: |
python -c "import os; import platform; print(f'Python version: {platform.python_version()}'); print(f'CWD: {os.getcwd()}'); from inference import get_model"