|
1 | 1 | #!/bin/bash |
2 | 2 |
|
3 | 3 | set -euo pipefail |
| 4 | + |
| 5 | +# Enable verbose output for debugging |
| 6 | +set -x |
4 | 7 | ci_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" |
5 | 8 |
|
6 | 9 | source "$ci_dir/pyenv_helper.sh" |
|
39 | 42 | # Determine CUDA major version from environment |
40 | 43 | cuda_major_version=$(nvcc --version | grep release | awk '{print $6}' | tr -d ',' | cut -d '.' -f 1 | cut -d 'V' -f 2) |
41 | 44 |
|
42 | | -# Setup Python environment |
43 | | -setup_python_env "${py_version}" |
| 45 | +# Setup Python environment (skip if we're already in ci-wheel container with correct Python) |
| 46 | +echo "Checking for Python ${py_version}..." |
| 47 | +if command -v python &> /dev/null; then |
| 48 | + actual_py_version=$(python --version 2>&1 | awk '{print $2}' | cut -d. -f1,2) |
| 49 | + echo "Found Python version: ${actual_py_version}" |
| 50 | + if [[ "${actual_py_version}" == "${py_version}" ]]; then |
| 51 | + echo "Python ${py_version} already available, skipping pyenv setup" |
| 52 | + python -m pip install --upgrade pip |
| 53 | + else |
| 54 | + echo "Python version mismatch (found ${actual_py_version}, need ${py_version})" |
| 55 | + echo "Setting up Python ${py_version} with pyenv" |
| 56 | + setup_python_env "${py_version}" |
| 57 | + fi |
| 58 | +else |
| 59 | + echo "Python not found, setting up with pyenv" |
| 60 | + setup_python_env "${py_version}" |
| 61 | +fi |
| 62 | + |
| 63 | +echo "Python setup complete, version: $(python --version)" |
44 | 64 |
|
45 | 65 | # Wheel should be in /workspace/wheelhouse (downloaded by workflow or built locally) |
46 | 66 | WHEELHOUSE_DIR="/workspace/wheelhouse" |
47 | 67 |
|
48 | 68 | # Find and install pynvbench wheel |
49 | | -PYNVBENCH_WHEEL_PATH="$(ls ${WHEELHOUSE_DIR}/pynvbench-*+cu${cuda_version}*.whl 2>/dev/null | head -1)" |
| 69 | +# Look for .cu${cuda_version} in the version string (e.g., pynvbench-0.0.1.dev1+g123.cu12-...) |
| 70 | +PYNVBENCH_WHEEL_PATH="$(ls ${WHEELHOUSE_DIR}/pynvbench-*.cu${cuda_version}-*.whl 2>/dev/null | head -1)" |
50 | 71 | if [[ -z "$PYNVBENCH_WHEEL_PATH" ]]; then |
51 | 72 | echo "Error: No pynvbench wheel found in ${WHEELHOUSE_DIR}" |
52 | | - echo "Looking for: pynvbench-*+cu${cuda_version}*.whl" |
| 73 | + echo "Looking for: pynvbench-*.cu${cuda_version}-*.whl" |
53 | 74 | echo "Contents of ${WHEELHOUSE_DIR}:" |
54 | 75 | ls -la ${WHEELHOUSE_DIR}/ || true |
55 | 76 | exit 1 |
|
0 commit comments