Skip to content
Closed
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
77 changes: 35 additions & 42 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -381,15 +381,14 @@ jobs:
key: build-${{ hashFiles('**/pom.xml', 'project/build.properties', 'build/mvn', 'build/sbt', 'build/sbt-launch-lib.bash', 'build/spark-build-info') }}
restore-keys: |
build-
- name: Cache Coursier local repository
uses: actions/cache@v5
- name: Restore Coursier local repository
uses: actions/cache/restore@v5
with:
path: ~/.cache/coursier
key: ${{ matrix.java }}-${{ matrix.hadoop }}-coursier-${{ hashFiles('**/pom.xml', '**/plugins.sbt') }}
key: ${{ runner.os }}-${{ matrix.java }}-${{ matrix.hadoop }}-coursier-${{ hashFiles('**/pom.xml', '**/plugins.sbt') }}
restore-keys: |
${{ matrix.java }}-${{ matrix.hadoop }}-coursier-
precompile-coursier-${{ hashFiles('**/pom.xml', '**/plugins.sbt') }}
precompile-coursier-
${{ runner.os }}-${{ matrix.java }}-${{ matrix.hadoop }}-coursier-
${{ runner.os }}-coursier-
- name: Free up disk space
run: |
if [ -f ./dev/free_disk_space ]; then
Expand Down Expand Up @@ -620,9 +619,9 @@ jobs:
uses: actions/cache@v5
with:
path: ~/.cache/coursier
key: precompile-coursier-${{ hashFiles('**/pom.xml', '**/plugins.sbt') }}
key: ${{ runner.os }}-coursier-${{ hashFiles('**/pom.xml', '**/plugins.sbt') }}
restore-keys: |
precompile-coursier-
${{ runner.os }}-coursier-
- name: Install Java ${{ inputs.java }}
uses: actions/setup-java@v5
with:
Expand Down Expand Up @@ -745,13 +744,13 @@ jobs:
key: build-${{ hashFiles('**/pom.xml', 'project/build.properties', 'build/mvn', 'build/sbt', 'build/sbt-launch-lib.bash', 'build/spark-build-info') }}
restore-keys: |
build-
- name: Cache Coursier local repository
uses: actions/cache@v5
- name: Restore Coursier local repository
uses: actions/cache/restore@v5
with:
path: ~/.cache/coursier
key: pyspark-coursier-${{ hashFiles('**/pom.xml', '**/plugins.sbt') }}
key: ${{ runner.os }}-coursier-${{ hashFiles('**/pom.xml', '**/plugins.sbt') }}
restore-keys: |
pyspark-coursier-
${{ runner.os }}-coursier-
- name: Free up disk space
shell: 'script -q -e -c "bash {0}"'
run: ./dev/free_disk_space_container
Expand Down Expand Up @@ -936,13 +935,13 @@ jobs:
key: build-${{ hashFiles('**/pom.xml', 'project/build.properties', 'build/mvn', 'build/sbt', 'build/sbt-launch-lib.bash', 'build/spark-build-info') }}
restore-keys: |
build-
- name: Cache Coursier local repository
uses: actions/cache@v5
- name: Restore Coursier local repository
uses: actions/cache/restore@v5
with:
path: ~/.cache/coursier
key: sparkr-coursier-${{ hashFiles('**/pom.xml', '**/plugins.sbt') }}
key: ${{ runner.os }}-coursier-${{ hashFiles('**/pom.xml', '**/plugins.sbt') }}
restore-keys: |
sparkr-coursier-
${{ runner.os }}-coursier-
- name: Free up disk space
run: ./dev/free_disk_space_container
- name: Install Java ${{ inputs.java }}
Expand Down Expand Up @@ -1087,13 +1086,13 @@ jobs:
key: build-${{ hashFiles('**/pom.xml', 'project/build.properties', 'build/mvn', 'build/sbt', 'build/sbt-launch-lib.bash', 'build/spark-build-info') }}
restore-keys: |
build-
- name: Cache Coursier local repository
uses: actions/cache@v5
- name: Restore Coursier local repository
uses: actions/cache/restore@v5
with:
path: ~/.cache/coursier
key: docs-coursier-${{ hashFiles('**/pom.xml', '**/plugins.sbt') }}
key: ${{ runner.os }}-coursier-${{ hashFiles('**/pom.xml', '**/plugins.sbt') }}
restore-keys: |
docs-coursier-
${{ runner.os }}-coursier-
- name: Cache Maven local repository
uses: actions/cache@v5
with:
Expand Down Expand Up @@ -1286,13 +1285,13 @@ jobs:
key: build-${{ hashFiles('**/pom.xml', 'project/build.properties', 'build/mvn', 'build/sbt', 'build/sbt-launch-lib.bash', 'build/spark-build-info') }}
restore-keys: |
build-
- name: Cache Coursier local repository
uses: actions/cache@v5
- name: Restore Coursier local repository
uses: actions/cache/restore@v5
with:
path: ~/.cache/coursier
key: docs-coursier-${{ hashFiles('**/pom.xml', '**/plugins.sbt') }}
key: ${{ runner.os }}-coursier-${{ hashFiles('**/pom.xml', '**/plugins.sbt') }}
restore-keys: |
docs-coursier-
${{ runner.os }}-coursier-
- name: Cache Maven local repository
uses: actions/cache@v5
with:
Expand Down Expand Up @@ -1481,15 +1480,13 @@ jobs:
key: build-${{ hashFiles('**/pom.xml', 'project/build.properties', 'build/mvn', 'build/sbt', 'build/sbt-launch-lib.bash', 'build/spark-build-info') }}
restore-keys: |
build-
- name: Cache Coursier local repository
uses: actions/cache@v5
- name: Restore Coursier local repository

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The tpcds-1g Coursier step is also restore-only, but the job only depends on precondition, not precompile. Normal SQL changes and explicit full workflows can trigger both jobs, yet tpcds-1g may start before precompile saves the shared cache; the old tpcds-coursier-* writer was also removed. TPC-DS can still cold-download dependencies in that run.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed by SPARK-57142 which was merged before this PR. tpcds-1g now depends on precompile, so it always waits for precompile to finish (and its cache to be saved) before starting. The restore-only approach is fully valid.

uses: actions/cache/restore@v5
with:
path: ~/.cache/coursier
key: tpcds-coursier-${{ hashFiles('**/pom.xml', '**/plugins.sbt') }}
key: ${{ runner.os }}-coursier-${{ hashFiles('**/pom.xml', '**/plugins.sbt') }}
restore-keys: |
tpcds-coursier-
precompile-coursier-${{ hashFiles('**/pom.xml', '**/plugins.sbt') }}
precompile-coursier-
${{ runner.os }}-coursier-
- name: Install Java ${{ inputs.java }}
uses: actions/setup-java@v5
with:
Expand Down Expand Up @@ -1615,15 +1612,13 @@ jobs:
key: build-${{ hashFiles('**/pom.xml', 'project/build.properties', 'build/mvn', 'build/sbt', 'build/sbt-launch-lib.bash', 'build/spark-build-info') }}
restore-keys: |
build-
- name: Cache Coursier local repository
uses: actions/cache@v5
- name: Restore Coursier local repository

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These downstream jobs depend on precompile, but precompile is continue-on-error. If precompile times out or fails, the downstream jobs intentionally continue with local builds. Their Coursier steps are now restore-only, so the dependencies downloaded in that fallback path are not saved. The precompile fallback path can repeatedly cold-download dependencies. Maybe we should keep a writable cache/save path for these fallback jobs when precompile did not produce the cache.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Valid point. In practice precompile very rarely fails, and there is a plan to make it a hard dependency (remove continue-on-error) in a follow-up. On the rare failure a cold Coursier download is an acceptable trade-off — one that already existed before this PR on any run where the per-job caches were cold.

uses: actions/cache/restore@v5
with:
path: ~/.cache/coursier
key: docker-integration-coursier-${{ hashFiles('**/pom.xml', '**/plugins.sbt') }}
key: ${{ runner.os }}-coursier-${{ hashFiles('**/pom.xml', '**/plugins.sbt') }}
restore-keys: |
docker-integration-coursier-
precompile-coursier-${{ hashFiles('**/pom.xml', '**/plugins.sbt') }}
precompile-coursier-
${{ runner.os }}-coursier-
- name: Install Java ${{ inputs.java }}
uses: actions/setup-java@v5
with:
Expand Down Expand Up @@ -1703,15 +1698,13 @@ jobs:
key: build-${{ hashFiles('**/pom.xml', 'project/build.properties', 'build/mvn', 'build/sbt', 'build/sbt-launch-lib.bash', 'build/spark-build-info') }}
restore-keys: |
build-
- name: Cache Coursier local repository
uses: actions/cache@v5
- name: Restore Coursier local repository
uses: actions/cache/restore@v5
with:
path: ~/.cache/coursier
key: k8s-integration-coursier-${{ hashFiles('**/pom.xml', '**/plugins.sbt') }}
key: ${{ runner.os }}-coursier-${{ hashFiles('**/pom.xml', '**/plugins.sbt') }}
restore-keys: |
k8s-integration-coursier-
precompile-coursier-${{ hashFiles('**/pom.xml', '**/plugins.sbt') }}
precompile-coursier-
${{ runner.os }}-coursier-
- name: Free up disk space
run: |
if [ -f ./dev/free_disk_space ]; then
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/python_hosted_runner_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ jobs:
uses: actions/cache@v5
with:
path: ~/.cache/coursier
key: pyspark-coursier-${{ hashFiles('**/pom.xml', '**/plugins.sbt') }}
key: ${{ runner.os }}-coursier-${{ hashFiles('**/pom.xml', '**/plugins.sbt') }}
restore-keys: |
pyspark-coursier-
${{ runner.os }}-coursier-
- name: Install Java ${{ matrix.java }}
uses: actions/setup-java@v5
with:
Expand Down