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, update pre-commit hooks #738

Merged
merged 9 commits into from
Mar 19, 2025

Conversation

jameslamb
Copy link
Member

@jameslamb jameslamb commented Mar 5, 2025

Contributes to #667

Expands testing to improve release confidence in these images.

  • adds new pre-commit hooks:
    • rapidsai/verify-copyright = keep copyright notices up to date
    • shellcheck = catch issues and enforce consistency in shell scripts
  • updates all other pre-commit hooks
  • switches from a manual run: to pre-commit/[email protected] in CI, for faster runs of pre-commit and simpler CI configuration

@jameslamb
Copy link
Member Author

The arm64 builds that install cuvs-bench-cpu are failing because of #739

That'll be fixed (and CI unblocked here) once rapidsai/cuvs#750 is merged

@@ -26,7 +24,7 @@ function sed_runner() {
sed -i.bak ''"$1"'' $2 && rm -f ${2}.bak
}

for FILE in $(find . -name Dockerfile); do
find . -name Dockerfile | while IFS= read -r -d '' FILE; do
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes this from shellcheck:

SC2044 (warning): For loops over find output are fragile. Use find -exec or a while read loop.

for notebook in nb_errors.keys():
if nb_errors[notebook]:
print(f'Errors during {notebook}')
for notebook_id, errors in nb_errors.items():
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixes this from ruff:

context/test_notebooks.py:200:9: PLC0206 Extracting value from dictionary without calling `.items()

@@ -35,6 +37,8 @@
'cuspatial/ZipCodes_Stops_PiP_cuSpatial.ipynb',
# context on this being skipped: https://github.com/rapidsai/docker/issues/726
'cuspatial/trajectory_clustering.ipynb',
# context on this being skipped: https://github.com/rapidsai/docker/issues/740
'cuspatial/Taxi_Dropoff_Reverse_Geocoding.ipynb',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

proposing this to unblock CI, see #740

@isVoid I'll start a separate offline thread about our strategy for these notebooks.

@jameslamb
Copy link
Member Author

Seeing the one arm test job here fail with this error from cudf:

Jitify fatal error: Uninitialized

(build link)

I think that's related to other ongoing jitify issues cudf has been experiencing on arm the last few days (don't have a great tracking issue, but things that led to PRs like rapidsai/cudf#18175).

set -eEuo pipefail

common_path="$(dirname "$(realpath "$0")")/common.sh"
# shellcheck source=common.sh
source "$common_path"

cuvs_bench_source_tags=()
cuvs_bench_datasets_source_tags=()
# cuvs_bench_datasets_source_tags=()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and other things I'm commenting out in this file are unused as long as this other code is commented out:

# check_tag_exists "$CUVS_BENCH_DATASETS_IMAGE_REPO" "$full_cuvs_bench_datasets_tag"
# cuvs_bench_datasets_source_tags+=("${org}/${CUVS_BENCH_DATASETS_IMAGE_REPO}:$full_cuvs_bench_datasets_tag")

as it was in #725

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR mentioned in #725 as a patch was closed, but there is a comment that indicates this might have been fixed in 25.02, though it's unclear, see #723 (review)

Is there an issue or PR in progress tracking this? that we can reference so when it's fixed we can uncomment this back?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, good point. I just pushed ca8832f, which adds a comment to the issue tracking the cuVS dataset stuff: #724

@jameslamb jameslamb changed the title WIP: add shellcheck, update pre-commit hooks add shellcheck, update pre-commit hooks Mar 7, 2025
@jameslamb jameslamb marked this pull request as ready for review March 7, 2025 20:00
@jameslamb jameslamb requested a review from a team as a code owner March 7, 2025 20:00
Copy link

@ncclementi ncclementi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I left a comment about the cuvs commented code. I wasn't able to find an issue or anything suggesting we should fix this, but I think ideally we should leave comment in code referencing an issue on why are we commenting this out.

set -eEuo pipefail

common_path="$(dirname "$(realpath "$0")")/common.sh"
# shellcheck source=common.sh
source "$common_path"

cuvs_bench_source_tags=()
cuvs_bench_datasets_source_tags=()
# cuvs_bench_datasets_source_tags=()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR mentioned in #725 as a patch was closed, but there is a comment that indicates this might have been fixed in 25.02, though it's unclear, see #723 (review)

Is there an issue or PR in progress tracking this? that we can reference so when it's fixed we can uncomment this back?

Copy link
Contributor

@bdice bdice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few nits, otherwise LGTM.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we pin to SHAs of these actions?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want to switch from tags to SHAs, I think that'd be better done as a RAPIDS-wide thing and not in the scope of this PR.

I'd like to not have to worry, for this PR, about questions I have about that, such as how that'd affect auto-updates from dependabot / renovate.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've started a separate (private) discussion about switching to commit SHAs RAPIDS-wide. Let's defer the decision on that to the outcome of that discussion.

I'm going to merge this with these pinned to tags, as other actions in this repo's CI already are.

Copy link

@KyleFromNVIDIA KyleFromNVIDIA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a few minor questions and changes.

@jameslamb
Copy link
Member Author

/merge

@rapids-bot rapids-bot bot merged commit e6f193d into rapidsai:branch-25.04 Mar 19, 2025
62 checks passed
@jameslamb jameslamb deleted the more-repo-checks branch March 19, 2025 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants