You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fory.apache.org by "prakash-218 (via GitHub)" <gi...@apache.org> on 2025/11/04 02:33:15 UTC

[PR] chore(CI): Add caching for bazel in github workflows [fory]

prakash-218 opened a new pull request, #2888:
URL: https://github.com/apache/fory/pull/2888

   <!--
   **Thanks for contributing to Apache Fory™.**
   
   **If this is your first time opening a PR on fory, you can refer to [CONTRIBUTING.md](https://github.com/apache/fory/blob/main/CONTRIBUTING.md).**
   
   Contribution Checklist
   
       - The **Apache Fory™** community has requirements on the naming of pr titles. You can also find instructions in [CONTRIBUTING.md](https://github.com/apache/fory/blob/main/CONTRIBUTING.md).
   
       - Apache Fory™ has a strong focus on performance. If the PR you submit will have an impact on performance, please benchmark it first and provide the benchmark result here.
   -->
   
   ## Why?
   
   Due to lack of caching of bazel, every CI run takes too much time
   
   <!-- Describe the purpose of this PR. -->
   
   ## What does this PR do?
   
   This PR adds caching for bazel in github workflows
   
   <!-- Describe the details of this PR. -->
   
   ## Related issues
   
   closes #2880
   
   <!--
   Is there any related issue? If this PR closes them you say say fix/closes:
   
   - #xxxx0
   - #xxxx1
   - Fixes #xxxx2
   -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For additional commands, e-mail: commits-help@fory.apache.org


Re: [PR] chore(CI): Add caching for bazel in github workflows [fory]

Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang commented on PR #2888:
URL: https://github.com/apache/fory/pull/2888#issuecomment-3487426535

   https://github.com/apache/fory/actions/runs/19078458415/job/54500347478


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For additional commands, e-mail: commits-help@fory.apache.org


Re: [PR] chore(CI): Add caching for bazel in github workflows [fory]

Posted by "prakash-218 (via GitHub)" <gi...@apache.org>.
prakash-218 commented on PR #2888:
URL: https://github.com/apache/fory/pull/2888#issuecomment-3486638863

   Thank you! please merge the PR when you see fit


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For additional commands, e-mail: commits-help@fory.apache.org


Re: [PR] chore(CI): Add caching for bazel in github workflows [fory]

Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang commented on code in PR #2888:
URL: https://github.com/apache/fory/pull/2888#discussion_r2488492248


##########
.github/workflows/build-native-release.yml:
##########
@@ -36,6 +36,37 @@ jobs:
       - uses: actions/setup-python@v5
         with:
           python-version: ${{ matrix.python-version }}
+      - name: Cache Bazel binary
+        uses: actions/cache@v4
+        with:
+          path: |
+            ~/bin/bazel
+            ~/.local/bin/bazel
+            C:\bazel\bazel.exe
+          key: bazel-binary-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.bazelversion') }}
+          restore-keys: |
+            bazel-binary-${{ runner.os }}-${{ runner.arch }}-
+      - name: Cache Bazel repository cache
+        uses: actions/cache@v4
+        with:
+          path: |
+            ~/.cache/bazel/_bazel_*/*/external
+            ~/Library/Caches/bazel/_bazel_*/*/external
+            C:\users\runneradmin\_bazel_runneradmin\*/external
+          key: bazel-repo-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('WORKSPACE', '.bazelrc', 'bazel/**') }}
+          restore-keys: |
+            bazel-repo-${{ runner.os }}-${{ runner.arch }}-
+      - name: Cache Bazel build outputs
+        uses: actions/cache@v4
+        with:
+          path: |
+            ~/.cache/bazel
+            ~/Library/Caches/bazel
+            C:\users\runneradmin\_bazel_runneradmin
+          key: bazel-build-release-native-${{ runner.os }}-${{ runner.arch }}-${{ matrix.python-version }}-${{ hashFiles('cpp/**', 'python/**/*.pyx', 'BUILD', 'WORKSPACE') }}
+          restore-keys: |

Review Comment:
   Cache build outputs is tricky, maybe we could remove `restore-keys`, and only use exact match for `bazel-build-release-native-${{ runner.os }}-${{ runner.arch }}-${{ matrix.python-version }}-${{ hashFiles('cpp/**', 'python/**/*.pyx', 'python/**/*.pxd', 'BUILD', 'WORKSPACE') }}`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For additional commands, e-mail: commits-help@fory.apache.org


Re: [PR] chore(CI): Add caching for bazel in github workflows [fory]

Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang commented on PR #2888:
URL: https://github.com/apache/fory/pull/2888#issuecomment-3487445509

   Some file is softlinks. Cache reload May not work


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For additional commands, e-mail: commits-help@fory.apache.org


Re: [PR] chore(CI): Add caching for bazel in github workflows [fory]

Posted by "prakash-218 (via GitHub)" <gi...@apache.org>.
prakash-218 commented on code in PR #2888:
URL: https://github.com/apache/fory/pull/2888#discussion_r2490579702


##########
.github/workflows/ci.yml:
##########
@@ -65,6 +65,30 @@ jobs:
         uses: actions/setup-python@v5
         with:
           python-version: 3.8
+      - name: Cache Bazel binary
+        uses: actions/cache@v4
+        with:
+          path: |
+            ~/bin/bazel
+            ~/.local/bin/bazel
+          key: bazel-binary-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.bazelversion') }}
+          restore-keys: |
+            bazel-binary-${{ runner.os }}-${{ runner.arch }}-
+      - name: Cache Bazel repository cache
+        uses: actions/cache@v4
+        with:
+          path: ~/.cache/bazel/_bazel_*/*/external
+          key: bazel-repo-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('WORKSPACE', '.bazelrc', 'bazel/**') }}
+          restore-keys: |
+            bazel-repo-${{ runner.os }}-${{ runner.arch }}-
+      - name: Cache Bazel build outputs
+        uses: actions/cache@v4
+        with:
+          path: ~/.cache/bazel
+          key: bazel-build-java-${{ runner.os }}-${{ runner.arch }}-${{ matrix.java-version }}-${{ hashFiles('cpp/**', 'python/**/*.pyx', 'BUILD', 'WORKSPACE') }}

Review Comment:
   Added



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For additional commands, e-mail: commits-help@fory.apache.org


Re: [PR] chore(CI): Add caching for bazel in github workflows [fory]

Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang commented on code in PR #2888:
URL: https://github.com/apache/fory/pull/2888#discussion_r2488480789


##########
.github/workflows/ci.yml:
##########
@@ -65,6 +65,30 @@ jobs:
         uses: actions/setup-python@v5
         with:
           python-version: 3.8
+      - name: Cache Bazel binary
+        uses: actions/cache@v4
+        with:
+          path: |
+            ~/bin/bazel
+            ~/.local/bin/bazel
+          key: bazel-binary-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.bazelversion') }}
+          restore-keys: |
+            bazel-binary-${{ runner.os }}-${{ runner.arch }}-
+      - name: Cache Bazel repository cache
+        uses: actions/cache@v4
+        with:
+          path: ~/.cache/bazel/_bazel_*/*/external
+          key: bazel-repo-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('WORKSPACE', '.bazelrc', 'bazel/**') }}
+          restore-keys: |
+            bazel-repo-${{ runner.os }}-${{ runner.arch }}-
+      - name: Cache Bazel build outputs
+        uses: actions/cache@v4
+        with:
+          path: ~/.cache/bazel
+          key: bazel-build-java-${{ runner.os }}-${{ runner.arch }}-${{ matrix.java-version }}-${{ hashFiles('cpp/**', 'python/**/*.pyx', 'BUILD', 'WORKSPACE') }}

Review Comment:
   could we also add `python/**/*.pyd?  it can also define inline header only functions



##########
.github/workflows/ci.yml:
##########
@@ -65,6 +65,30 @@ jobs:
         uses: actions/setup-python@v5
         with:
           python-version: 3.8
+      - name: Cache Bazel binary
+        uses: actions/cache@v4
+        with:
+          path: |
+            ~/bin/bazel
+            ~/.local/bin/bazel
+          key: bazel-binary-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.bazelversion') }}
+          restore-keys: |
+            bazel-binary-${{ runner.os }}-${{ runner.arch }}-
+      - name: Cache Bazel repository cache
+        uses: actions/cache@v4
+        with:
+          path: ~/.cache/bazel/_bazel_*/*/external
+          key: bazel-repo-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('WORKSPACE', '.bazelrc', 'bazel/**') }}
+          restore-keys: |
+            bazel-repo-${{ runner.os }}-${{ runner.arch }}-
+      - name: Cache Bazel build outputs
+        uses: actions/cache@v4
+        with:
+          path: ~/.cache/bazel
+          key: bazel-build-java-${{ runner.os }}-${{ runner.arch }}-${{ matrix.java-version }}-${{ hashFiles('cpp/**', 'python/**/*.pyx', 'BUILD', 'WORKSPACE') }}

Review Comment:
   could we also add `python/**/*.pyd`?  it can also define inline header only functions



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For additional commands, e-mail: commits-help@fory.apache.org


Re: [PR] chore(CI): Add caching for bazel in github workflows [fory]

Posted by "prakash-218 (via GitHub)" <gi...@apache.org>.
prakash-218 commented on code in PR #2888:
URL: https://github.com/apache/fory/pull/2888#discussion_r2490580461


##########
.github/workflows/build-native-release.yml:
##########
@@ -36,6 +36,37 @@ jobs:
       - uses: actions/setup-python@v5
         with:
           python-version: ${{ matrix.python-version }}
+      - name: Cache Bazel binary
+        uses: actions/cache@v4
+        with:
+          path: |
+            ~/bin/bazel
+            ~/.local/bin/bazel
+            C:\bazel\bazel.exe
+          key: bazel-binary-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.bazelversion') }}
+          restore-keys: |
+            bazel-binary-${{ runner.os }}-${{ runner.arch }}-
+      - name: Cache Bazel repository cache
+        uses: actions/cache@v4
+        with:
+          path: |
+            ~/.cache/bazel/_bazel_*/*/external
+            ~/Library/Caches/bazel/_bazel_*/*/external
+            C:\users\runneradmin\_bazel_runneradmin\*/external
+          key: bazel-repo-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('WORKSPACE', '.bazelrc', 'bazel/**') }}
+          restore-keys: |
+            bazel-repo-${{ runner.os }}-${{ runner.arch }}-
+      - name: Cache Bazel build outputs
+        uses: actions/cache@v4
+        with:
+          path: |
+            ~/.cache/bazel
+            ~/Library/Caches/bazel
+            C:\users\runneradmin\_bazel_runneradmin
+          key: bazel-build-release-native-${{ runner.os }}-${{ runner.arch }}-${{ matrix.python-version }}-${{ hashFiles('cpp/**', 'python/**/*.pyx', 'BUILD', 'WORKSPACE') }}
+          restore-keys: |

Review Comment:
   agreed and made the changes too!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For additional commands, e-mail: commits-help@fory.apache.org


Re: [PR] chore(CI): Add caching for bazel in github workflows [fory]

Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang merged PR #2888:
URL: https://github.com/apache/fory/pull/2888


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For additional commands, e-mail: commits-help@fory.apache.org


Re: [PR] chore(CI): Add caching for bazel in github workflows [fory]

Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang commented on code in PR #2888:
URL: https://github.com/apache/fory/pull/2888#discussion_r2488480789


##########
.github/workflows/ci.yml:
##########
@@ -65,6 +65,30 @@ jobs:
         uses: actions/setup-python@v5
         with:
           python-version: 3.8
+      - name: Cache Bazel binary
+        uses: actions/cache@v4
+        with:
+          path: |
+            ~/bin/bazel
+            ~/.local/bin/bazel
+          key: bazel-binary-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.bazelversion') }}
+          restore-keys: |
+            bazel-binary-${{ runner.os }}-${{ runner.arch }}-
+      - name: Cache Bazel repository cache
+        uses: actions/cache@v4
+        with:
+          path: ~/.cache/bazel/_bazel_*/*/external
+          key: bazel-repo-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('WORKSPACE', '.bazelrc', 'bazel/**') }}
+          restore-keys: |
+            bazel-repo-${{ runner.os }}-${{ runner.arch }}-
+      - name: Cache Bazel build outputs
+        uses: actions/cache@v4
+        with:
+          path: ~/.cache/bazel
+          key: bazel-build-java-${{ runner.os }}-${{ runner.arch }}-${{ matrix.java-version }}-${{ hashFiles('cpp/**', 'python/**/*.pyx', 'BUILD', 'WORKSPACE') }}

Review Comment:
   could we also add `python/**/*.pxd`?  it can also define inline header only functions



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For additional commands, e-mail: commits-help@fory.apache.org


Re: [PR] chore(CI): Add caching for bazel in github workflows [fory]

Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang commented on PR #2888:
URL: https://github.com/apache/fory/pull/2888#issuecomment-3487425170

   ```
         # Execution platform: @local_config_platform//:host
         SUBCOMMAND: # @local_config_pyarrow//:libarrow_python [action 'Executing genrule @local_config_pyarrow//:libarrow_python', configuration: 692eb6610c708216bde8e139a42c505ffc7784763343e8856b8dc070de970ef8, execution platform: @local_config_platform//:host]
         (cd /home/runner/.cache/bazel/_bazel_runner/8d280d35b2da959da0f37ed0093e86d5/execroot/fory && \
           exec env - \
             LD_LIBRARY_PATH=/opt/hostedtoolcache/Python/3.8.18/x64/lib \
             PATH=/home/runner/.cache/bazelisk/downloads/sha256/e78fc3394deae5408d6f49a15c7b1e615901969ecf6e50d55ef899996b0b8458/bin:/tmp/pip-build-env-30uopdic/overlay/bin:/tmp/pip-build-env-30uopdic/normal/bin:/opt/hostedtoolcache/Python/3.8.18/x64/bin:/opt/hostedtoolcache/Python/3.8.18/x64:/opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.17-10/x64/bin:/snap/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin \
           /bin/bash -c 'source external/bazel_tools/tools/genrule/genrule-setup.sh;
         cp -f "/tmp/pip-build-env-lg3oi1jt/overlay/lib/python3.8/site-packages/pyarrow/libarrow_python.so" "bazel-out/k8-opt/bin/external/local_config_pyarrow/libarrow_python.so"
            ')
         # Configuration: 692eb6610c708216bde8e139a42c505ffc7784763343e8856b8dc070de970ef8
         # Execution platform: @local_config_platform//:host
         ERROR: /home/runner/.cache/bazel/_bazel_runner/8d280d35b2da959da0f37ed0093e86d5/external/local_config_pyarrow/BUILD:536:8: Executing genrule @local_config_pyarrow//:libarrow_python failed: (Exit 1): bash failed: error executing command (from target @local_config_pyarrow//:libarrow_python) /bin/bash -c ... (remaining 1 argument skipped)
         
         Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
         cp: cannot stat '/tmp/pip-build-env-lg3oi1jt/overlay/lib/python3.8/site-packages/pyarrow/libarrow_python.so': No such file or directory
         Target //:cp_fory_so failed to build
         Use --verbose_failures to see the command lines of failed build steps.
         INFO: Elapsed time: 5.539s, Critical Path: 0.10s
         INFO: 5 processes: 5 internal.
         FAILED: Build did NOT complete successfully
         DEBUG = False, BAZEL_BUILD_EXT = True, PATH = /tmp/pip-build-env-30uopdic/overlay/bin:/tmp/pip-build-env-30uopdic/normal/bin:/opt/hostedtoolcache/Python/3.8.18/x64/bin:/opt/hostedtoolcache/Python/3.8.18/x64:/opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.17-10/x64/bin:/snap/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
         setup_dir: /home/runner/work/fory/fory/python
         project_dir: /home/runner/work/fory/fory
   ```
   
   Seems all python bazel build fails now


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For additional commands, e-mail: commits-help@fory.apache.org


Re: [PR] chore(CI): Add caching for bazel in github workflows [fory]

Posted by "prakash-218 (via GitHub)" <gi...@apache.org>.
prakash-218 commented on PR #2888:
URL: https://github.com/apache/fory/pull/2888#issuecomment-3487430367

   I will take a look at it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For additional commands, e-mail: commits-help@fory.apache.org