diff --git a/.github/workflows/mvn-verify-check.yml b/.github/workflows/mvn-verify-check.yml index 02152306468..b58799c6110 100644 --- a/.github/workflows/mvn-verify-check.yml +++ b/.github/workflows/mvn-verify-check.yml @@ -53,9 +53,8 @@ jobs: id: generateCacheKey run: | set -x - jniTimestamp=$(. .github/workflows/mvn-verify-check/get-artifact-timestamp.sh spark-rapids-jni) - privateTimestamp=$(. .github/workflows/mvn-verify-check/get-artifact-timestamp.sh rapids-4-spark-private_2.12) - cacheKey="${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ github.event.pull_request.base.ref }}-${jniTimestamp}-${privateTimestamp}" + depsSHA1=$(. .github/workflows/mvn-verify-check/get-deps-sha1.sh 2.12) + cacheKey="${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ github.event.pull_request.base.ref }}-${depsSHA1}" echo "dailyCacheKey=$cacheKey" | tee $GITHUB_ENV $GITHUB_OUTPUT - name: Cache local Maven repository id: cache @@ -167,9 +166,8 @@ jobs: id: generateCacheKey run: | set -x - jniTimestamp=$(. .github/workflows/mvn-verify-check/get-artifact-timestamp.sh spark-rapids-jni) - privateTimestamp=$(. .github/workflows/mvn-verify-check/get-artifact-timestamp.sh rapids-4-spark-private_2.13) - cacheKey="${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ github.event.pull_request.base.ref }}-${jniTimestamp}-${privateTimestamp}" + depsSHA1=$(. .github/workflows/mvn-verify-check/get-deps-sha1.sh 2.13) + cacheKey="${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ github.event.pull_request.base.ref }}-${depsSHA1}" echo "scala213dailyCacheKey=$cacheKey" | tee $GITHUB_ENV $GITHUB_OUTPUT - name: Cache local Maven repository id: cache diff --git a/.github/workflows/mvn-verify-check/get-artifact-timestamp.sh b/.github/workflows/mvn-verify-check/get-artifact-timestamp.sh deleted file mode 100755 index 720f3b49ec8..00000000000 --- a/.github/workflows/mvn-verify-check/get-artifact-timestamp.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2024, NVIDIA CORPORATION. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -e - -project=${1:-"spark-rapids-jni"} -base_URL="https://oss.sonatype.org/service/local/artifact/maven/resolve" - -if [[ $project == spark-rapids-jni ]]; then - project_version=$(mvn help:evaluate -q -pl dist -Dexpression=spark-rapids-jni.version -DforceStdout) -elif [[ $project == rapids-4-spark-private* ]]; then - project_version=$(mvn help:evaluate -q -pl dist -Dexpression=spark-rapids-private.version -DforceStdout) -fi - -TIMESTAMP=$(curl -s -H "Accept: application/json" \ - "${base_URL}?r=snapshots&g=com.nvidia&a=${project}&v=${project_version}&c=&e=jar&wt=json" \ - | jq .data.snapshotTimeStamp) || $(date +'%Y-%m-%d') - -echo $TIMESTAMP diff --git a/.github/workflows/mvn-verify-check/get-deps-sha1.sh b/.github/workflows/mvn-verify-check/get-deps-sha1.sh new file mode 100755 index 00000000000..aa7129bd3ef --- /dev/null +++ b/.github/workflows/mvn-verify-check/get-deps-sha1.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +# Copyright (c) 2024, NVIDIA CORPORATION. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -e + +scala_ver=${1:-"2.12"} +base_URL="https://oss.sonatype.org/service/local/artifact/maven/resolve" +project_jni="spark-rapids-jni" +project_private="rapids-4-spark-private_${scala_ver}" + +jni_ver=$(mvn help:evaluate -q -pl dist -Dexpression=spark-rapids-jni.version -DforceStdout) +private_ver=$(mvn help:evaluate -q -pl dist -Dexpression=spark-rapids-private.version -DforceStdout) + +jni_sha1=$(curl -s -H "Accept: application/json" \ + "${base_URL}?r=snapshots&g=com.nvidia&a=${project_jni}&v=${jni_ver}&c=&e=jar&wt=json" \ + | jq .data.sha1) || $(date +'%Y-%m-%d') +private_sha1=$(curl -s -H "Accept: application/json" \ + "${base_URL}?r=snapshots&g=com.nvidia&a=${project_private}&v=${private_ver}&c=&e=jar&wt=json" \ + | jq .data.sha1) || $(date +'%Y-%m-%d') + +sha1md5=$(echo -n "${jni_sha1}_${private_sha1}" | md5sum | awk '{print $1}') + +echo $sha1md5