Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Cache Rust build cache when building docker images #14130

Merged
merged 5 commits into from
Oct 17, 2022

Conversation

erikjohnston
Copy link
Member

Builds on #14129

Hopefully helps with #13204

@erikjohnston erikjohnston marked this pull request as ready for review October 11, 2022 10:12
@erikjohnston erikjohnston requested a review from a team as a code owner October 11, 2022 10:12
Comment on lines +132 to +133
RUN --mount=type=cache,target=/synapse/target,sharing=locked \
--mount=type=cache,target=${CARGO_HOME}/registry,sharing=locked \
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need sharing=locked on the other caching that we do?

Copy link
Contributor

Choose a reason for hiding this comment

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

Discussed in #synapse-dev,

I think the answer is probably? Otherwise concurrent runs will write over each others caches
though in practice I don't think you'd really build many docker images in parallel

-- @erikjohnston

Copy link
Contributor

@DMRobertson DMRobertson left a comment

Choose a reason for hiding this comment

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

Probably want to wait for 1.69 to merge into develop, otherwise let's try it.

@erikjohnston erikjohnston enabled auto-merge (squash) October 17, 2022 16:26
@erikjohnston erikjohnston merged commit 6fee2f4 into develop Oct 17, 2022
@erikjohnston erikjohnston deleted the erikj/cache_docker_rust branch October 17, 2022 17:21
Comment on lines +138 to +139
RUN --mount=type=cache,target=/synapse/target,sharing=locked \
--mount=type=cache,target=${CARGO_HOME}/registry,sharing=locked \
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
RUN --mount=type=cache,target=/synapse/target,sharing=locked \
--mount=type=cache,target=${CARGO_HOME}/registry,sharing=locked \
//
// We also cache the Rust build in `/synapse/target` and Rust dependencies in `${CARGO_HOME}/registry` to speed-up rebuilds
RUN --mount=type=cache,target=/synapse/target,sharing=locked \
--mount=type=cache,target=${CARGO_HOME}/registry,sharing=locked \

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

Successfully merging this pull request may close these issues.

3 participants