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

when used with a docker call how do i get the stats out to the action? #104

Open
altendky opened this issue Mar 5, 2024 · 2 comments
Open

Comments

@altendky
Copy link
Contributor

altendky commented Mar 5, 2024

Thanks for this action, it has sped up my builds by about 6x to get down to 10 minutes which is wonderful. I am setting up builds using QEMU for RISCV in Docker. I was able to propagate the environment variables and the cache directory into the container but I am not sure what to propagate back out so that the post run step is able to show the statistics about cache hits etc.

https://github.com/Chia-Network/build-wheels/actions/runs/8157450783/job/22297172636?pr=30#step:21:1

Post job cleanup.
/opt/hostedtoolcache/sccache/0.7.7/x64/sccache --show-stats
Compile requests                      0
Compile requests executed             0
Cache hits                            0
Cache misses                          0
Cache timeouts                        0
Cache read errors                     0
Forced recaches                       0
Cache write errors                    0
Compilation failures                  0
Cache errors                          0
Non-cacheable compilations            0
Non-cacheable calls                   0
Non-compilation calls                 0
Unsupported compiler calls            0
Average cache write               0.000 s
Average compiler                  0.000 s
Average cache read hit            0.000 s
Failed distributed compilations       0
Cache location                  Local disk: "/home/runner/.cache/sccache"
Use direct/preprocessor mode?   yes
Version (client)                0.[7](https://github.com/Chia-Network/build-wheels/actions/runs/8157450783/job/22297172636?pr=30#step:21:7).7
Max cache size                       [10](https://github.com/Chia-Network/build-wheels/actions/runs/8157450783/job/22297172636?pr=30#step:21:10) GiB

https://github.com/Chia-Network/build-wheels/actions/runs/8157450783/workflow?pr=30#L100

      - name: Run sccache-cache
        uses: mozilla-actions/sccache-action@v0.0.3

      - name: Set up QEMU on x86_64
        if: matrix.arch.matrix == 'risc'
        id: qemu
        uses: docker/setup-qemu-action@v3
        with:
          platforms: riscv64
      
      - name: Build wheel
        run: |
          docker run --rm --platform linux/riscv64 \
          -v ${{ github.workspace }}:/ws \
          -v "${SCCACHE_PATH}":/sccache \
          -e SCCACHE_PATH="/sccache" \
          -e SCCACHE_GHA_ENABLED=true \
          -e ACTIONS_CACHE_URL="${ACTIONS_CACHE_URL}" \
          -e ACTIONS_RUNTIME_TOKEN="${ACTIONS_RUNTIME_TOKEN}" \
          -e RUSTC_WRAPPER=sccache \
          --workdir=/ws \
          chianetwork/ubuntu-22.04-risc-builder:latest \
          bash -exc '\
          pyenv global ${{ matrix.python.matrix }} && \
          python3 -m venv venv && \
          source ./venv/bin/activate && \
          pip install --upgrade pip && \
          pip wheel -w dist ./source \
@altendky
Copy link
Contributor Author

altendky commented Mar 6, 2024

I'll leave this open since someone else may understand better and be able to confidently say this "can't be fixed" or whatever.

Looking around, it appears that the stats come from a running sccache server process which would have existed only inside the docket docker container. I'll dump the stats manually within the docker container for now so I can see them.

@Alex-PLACET
Copy link

You can't do that.
For my qemu builds I use uraimo/run-on-arch-action, actions/cache@v4 and install ccache in the docker container.
You can check this file for example: https://github.com/man-group/sparrow/blob/d18b99bfc067a812824156c7002797e4f50b3e54/.github/workflows/qemu.yaml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants