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

ref(docker): use cache mounts for build cache #7617

Closed
wants to merge 2 commits into from

Conversation

gustavovalverde
Copy link
Member

Motivation

Caching Rust is not straightforward and we've been using Cargo Chef so far to accomplish that, but build caches are being invalidated most of the time, not making it very useful.

This is considerably documented:

Depends-On: #7616
Fixes: #6169

Specifications

Complex Code or Requirements

This changes are advanced Docker use cases, the above documentation might make it easier to understand what's going on.

This aldo depends on #7616, but the only change to focus here is the Dockerfile

Solution

Implement the approach in https://docs.docker.com/language/rust/develop/ with COPY --link

Review

We must confirm with several changes:

  • Rust code
  • Workflows (which has been invalidating the image, recently)
  • etc

Reviewer Checklist

  • Will the PR name make sense to users?
    • Does it need extra CHANGELOG info? (new features, breaking changes, large changes)
  • Are the PR labels correct?
  • Does the code do what the ticket and PR says?
    • Does it change concurrent code, unsafe code, or consensus rules?
  • How do you know it works? Does it have tests?

Follow Up Work

This also renames the workflows to make their naming more consistent and adding a naming convention

Fixes: #6166
Fixes: #6167
@gustavovalverde gustavovalverde added A-devops Area: Pipelines, CI/CD and Dockerfiles C-enhancement Category: This is an improvement P-High 🔥 I-slow Problems with performance or responsiveness C-tech-debt Category: Code maintainability issues labels Sep 25, 2023
@gustavovalverde gustavovalverde self-assigned this Sep 25, 2023
@github-actions github-actions bot added the C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG label Sep 25, 2023
@gustavovalverde gustavovalverde changed the title Fix docker build cache ref(docker): use cache mounts for build cache Sep 25, 2023
@upbqdn upbqdn added the do-not-merge Tells Mergify not to merge this PR label Sep 25, 2023
@mergify
Copy link
Contributor

mergify bot commented Sep 25, 2023

⚠️ The sha of the head commit of this PR conflicts with #7616. Mergify cannot evaluate rules on this PR. ⚠️

@upbqdn upbqdn removed the do-not-merge Tells Mergify not to merge this PR label Sep 25, 2023
@mergify
Copy link
Contributor

mergify bot commented Sep 26, 2023

⚠️ The sha of the head commit of this PR conflicts with #7616. Mergify cannot evaluate rules on this PR. ⚠️

2 similar comments
@mergify
Copy link
Contributor

mergify bot commented Sep 27, 2023

⚠️ The sha of the head commit of this PR conflicts with #7616. Mergify cannot evaluate rules on this PR. ⚠️

@mergify
Copy link
Contributor

mergify bot commented Oct 6, 2023

⚠️ The sha of the head commit of this PR conflicts with #7616. Mergify cannot evaluate rules on this PR. ⚠️

@teor2345 teor2345 added the do-not-merge Tells Mergify not to merge this PR label Oct 9, 2023
@mergify
Copy link
Contributor

mergify bot commented Oct 9, 2023

⚠️ The sha of the head commit of this PR conflicts with #7616. Mergify cannot evaluate rules on this PR. ⚠️

@mergify
Copy link
Contributor

mergify bot commented Oct 11, 2023

⚠️ The sha of the head commit of this PR conflicts with #7616. Mergify cannot evaluate rules on this PR. ⚠️

2 similar comments
@mergify
Copy link
Contributor

mergify bot commented Oct 12, 2023

⚠️ The sha of the head commit of this PR conflicts with #7616. Mergify cannot evaluate rules on this PR. ⚠️

@mergify
Copy link
Contributor

mergify bot commented Oct 17, 2023

⚠️ The sha of the head commit of this PR conflicts with #7616. Mergify cannot evaluate rules on this PR. ⚠️

@upbqdn upbqdn removed the do-not-merge Tells Mergify not to merge this PR label Oct 17, 2023
@mergify
Copy link
Contributor

mergify bot commented Oct 18, 2023

⚠️ The sha of the head commit of this PR conflicts with #7616. Mergify cannot evaluate rules on this PR. ⚠️

@teor2345 teor2345 added do-not-merge Tells Mergify not to merge this PR and removed do-not-merge Tells Mergify not to merge this PR labels Nov 5, 2023
@arya2 arya2 added the do-not-merge Tells Mergify not to merge this PR label Dec 11, 2023
@teor2345 teor2345 removed the do-not-merge Tells Mergify not to merge this PR label Dec 12, 2023
@oxarbitrage oxarbitrage added the do-not-merge Tells Mergify not to merge this PR label Jan 17, 2024
@oxarbitrage oxarbitrage removed the do-not-merge Tells Mergify not to merge this PR label Jan 23, 2024
@gustavovalverde
Copy link
Member Author

I'll reopen this when needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-devops Area: Pipelines, CI/CD and Dockerfiles C-enhancement Category: This is an improvement C-tech-debt Category: Code maintainability issues C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG I-slow Problems with performance or responsiveness
Projects
None yet
Development

Successfully merging this pull request may close these issues.

docker: improve Rust dependency caching in CI to avoid rebuilding
6 participants