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

feat(ci,docker): save RUN --mount=type=cache ccache on GitHub Actions cache #4854

Merged
merged 7 commits into from
Jun 12, 2024

Conversation

youtalk
Copy link
Member

@youtalk youtalk commented Jun 11, 2024

Description

I've finally understood the BuildKit doesn't preserve cache mounts in the GitHub Actions cache by default. If we wish to put our cache mounts into GitHub Actions cache and reuse it between builds, we can use a workaround provided by reproducible-containers/buildkit-cache-dance

https://docs.docker.com/build/ci/github-actions/cache/#cache-mounts

I found that the buildkit-cache-dance action does not work effectively unless the setup-buildx-action action is executed beforehand, so it was temporarily moved from docker-build-and-push/action.yaml to the beginning of each workflow file. This will be improved in the next PR.

Tests performed

Currently, as part of autoware.universe is broken, I show the build results of only the core module.
https://github.com/youtalk/autoware/actions/runs/9462979885?pr=44

Effects on system behavior

Not applicable.

Interface changes

Pre-review checklist for the PR author

The PR author must check the checkboxes below when creating the PR.

In-review checklist for the PR reviewers

The PR reviewers must check the checkboxes below before approval.

Post-review checklist for the PR author

The PR author must check the checkboxes below before merging.

  • There are no open discussions or they are tracked via tickets.

After all checkboxes are checked, anyone who has write access can merge the PR.

Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp>
Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp>
…ache-dance

Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp>
Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp>
Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp>
Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp>
Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp>
@youtalk youtalk marked this pull request as ready for review June 11, 2024 13:06
@youtalk youtalk self-assigned this Jun 11, 2024
@xmfcx xmfcx merged commit 23a0f14 into main Jun 12, 2024
17 of 19 checks passed
@xmfcx xmfcx deleted the upstream-buildkit-cache-dance branch June 12, 2024 06:29
@xmfcx
Copy link
Contributor

xmfcx commented Jun 14, 2024

@youtalk I think after this PR was merged, docker-build-and-push-main-self-hosted.yaml started failing.

image

https://github.com/autowarefoundation/autoware/actions/runs/9477822140/job/26113063357#step:9:859

  /usr/bin/docker buildx bake --file docker/docker-bake.hcl --file /home/ubuntu/actions-runner/_work/_temp/docker-actions-toolkit-MB8IMw/docker-metadata-action-bake.json --file /home/ubuntu/actions-runner/_work/_temp/docker-actions-toolkit-Jw8xni/docker-metadata-action-bake.json --file /home/ubuntu/actions-runner/_work/_temp/docker-actions-toolkit-zQNIl8/docker-metadata-action-bake.json --set *.platform=linux/arm64 --set *.args.ROS_DISTRO=humble --set *.args.BASE_IMAGE=ros:humble-ros-base-jammy --set *.args.SETUP_ARGS= --set *.args.LIB_DIR=aarch64 --set *.cache-from=type=registry,ref=ghcr.io/autowarefoundation/autoware-buildcache:cuda-arm64-main --set *.cache-from=type=registry,ref=ghcr.io/autowarefoundation/autoware-buildcache:cuda-arm64-main --set *.cache-to=type=registry,ref=ghcr.io/autowarefoundation/autoware-buildcache:cuda-arm64-main,mode=max --provenance false --push --print
  unknown flag: --provenance
  See 'docker buildx bake --help'.

Do I need to install something to the arm64 machine to make this work? It is a self hosted machine and I have access to it.

@xmfcx
Copy link
Contributor

xmfcx commented Jun 14, 2024

I've updated the machine and maybe it will start working again 🤷‍♂️

https://github.com/autowarefoundation/autoware/actions/runs/9516463540

@youtalk
Copy link
Member Author

youtalk commented Jun 14, 2024

@xmfcx Thank you! I think we need to update docker and you did it.

@xmfcx
Copy link
Contributor

xmfcx commented Jun 14, 2024

Yes, it seems the system upgrade solved it. I've also restarted and reinstalled the actions runner to have it clean.

pravinkmr26 pushed a commit to pravinkmr26/autoware that referenced this pull request Jul 15, 2024
…ns cache (autowarefoundation#4854)

Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp>
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

Successfully merging this pull request may close these issues.

2 participants