-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Cache Rust build cache when building docker images #14130
Conversation
RUN --mount=type=cache,target=/synapse/target,sharing=locked \ | ||
--mount=type=cache,target=${CARGO_HOME}/registry,sharing=locked \ |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this 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.
RUN --mount=type=cache,target=/synapse/target,sharing=locked \ | ||
--mount=type=cache,target=${CARGO_HOME}/registry,sharing=locked \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 \ |
Builds on #14129
Hopefully helps with #13204