Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add shellcheck to pre-commit and fix warnings #126

Merged
merged 2 commits into from
Feb 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,9 @@ repos:
hooks:
- id: verify-copyright
args: [--fix, --main-branch=main]
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
- id: shellcheck
args: ["--severity=warning"]
files: ^ci/
5 changes: 3 additions & 2 deletions ci/build_conda.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright (c) 2024, NVIDIA CORPORATION
# Copyright (c) 2024-2025, NVIDIA CORPORATION

set -euo pipefail

Expand All @@ -17,7 +17,8 @@ rapids-print-env

rapids-logger "Begin py build"

export CUDA_VERSION="$(cat pynvjitlink/CUDA_VERSION)"
CUDA_VERSION="$(cat pynvjitlink/CUDA_VERSION)"
export CUDA_VERSION

cat > cuda_compiler_version.yaml << EOF
cuda_compiler_version:
Expand Down
4 changes: 2 additions & 2 deletions ci/build_wheel.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright (c) 2023-2024, NVIDIA CORPORATION
# Copyright (c) 2023-2025, NVIDIA CORPORATION

set -euo pipefail

Expand All @@ -8,7 +8,7 @@ source rapids-configure-sccache
rapids-logger "Install CUDA Toolkit"
source "$(dirname "$0")/install_latest_cuda_toolkit.sh"

RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})"
RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen "${RAPIDS_CUDA_VERSION}")"

sccache --zero-stats

Expand Down
16 changes: 9 additions & 7 deletions ci/install_latest_cuda_toolkit.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright (c) 2024, NVIDIA CORPORATION
# Copyright (c) 2024-2025, NVIDIA CORPORATION

# Installs the latest CUDA Toolkit.
# Supports Rocky Linux 8.
Expand All @@ -13,12 +13,14 @@ if [ "${OS_ID}" != "rocky" ]; then
exit 1
fi

export CUDA_VERSION="$(cat pynvjitlink/CUDA_VERSION)"
export YUM_CUDA_VERSION="${CUDA_VERSION//./-}"
CUDA_VERSION="$(cat pynvjitlink/CUDA_VERSION)"
export CUDA_VERSION
YUM_CUDA_VERSION="${CUDA_VERSION//./-}"
export YUM_CUDA_VERSION

yum install -y \
cuda-nvcc-$YUM_CUDA_VERSION \
cuda-cudart-devel-$YUM_CUDA_VERSION \
cuda-driver-devel-$YUM_CUDA_VERSION \
libnvjitlink-devel-$YUM_CUDA_VERSION \
cuda-nvcc-"$YUM_CUDA_VERSION" \
cuda-cudart-devel-"$YUM_CUDA_VERSION" \
cuda-driver-devel-"$YUM_CUDA_VERSION" \
libnvjitlink-devel-"$YUM_CUDA_VERSION" \
;
4 changes: 2 additions & 2 deletions ci/release/update-version.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright (c) 2024, NVIDIA CORPORATION.
# Copyright (c) 2024-2025, NVIDIA CORPORATION.

## Usage
# bash update-version.sh <new_version>
Expand All @@ -12,7 +12,7 @@ echo "Preparing release $CURRENT_TAG => $NEXT_FULL_TAG"

# Inplace sed replace; workaround for Linux and Mac
function sed_runner() {
sed -i.bak ''"$1"'' $2 && rm -f ${2}.bak
sed -i.bak ''"$1"'' "$2" && rm -f "${2}".bak
}

# Centralized version file update
Expand Down
6 changes: 3 additions & 3 deletions ci/test_wheel.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#!/bin/bash
# Copyright (c) 2023-2024, NVIDIA CORPORATION
# Copyright (c) 2023-2025, NVIDIA CORPORATION

set -euo pipefail

rapids-logger "Download Wheel"
RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})"
RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen "${RAPIDS_CUDA_VERSION}")"
RAPIDS_PY_WHEEL_NAME="pynvjitlink_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 ./dist/

RAPIDS_TESTS_DIR=${RAPIDS_TESTS_DIR:-"${PWD}/test-results"}/
mkdir -p "${RAPIDS_TESTS_DIR}"

rapids-logger "Install wheel"
python -m pip install $(echo ./dist/pynvjitlink_${RAPIDS_PY_CUDA_SUFFIX}*.whl)[test]
python -m pip install "$(echo ./dist/pynvjitlink_"${RAPIDS_PY_CUDA_SUFFIX}"*.whl)[test]"

rapids-logger "Build Tests"
pushd test_binary_generation
Expand Down