Conversation
Aditya1404Sal
left a comment
There was a problem hiding this comment.
@thomas9911 this is looking good overall, nice use of cargo-chef 👍
I left two small suggestions:
move protoc into the base chef stage so build scripts are covered in both prepare and cook
&
limit the planner stage copy to Cargo.toml files so source changes don’t invalidate the dependency cache.
Both are minor, but it should help with CI stability and caching.
concurrent pulling logic LGTM.
| RUN apk --no-cache add protoc protobuf protobuf-dev | ||
| USER nonroot | ||
| WORKDIR /src | ||
|
|
There was a problem hiding this comment.
| RUN apk --no-cache add protoc protobuf protobuf-dev | |
There was a problem hiding this comment.
To avoid CI breakage if any dependency build script requires protoc, I think it’s safer to install it in the chef stage.
| COPY . . | ||
| FROM chef AS builder | ||
|
|
||
| RUN apk --no-cache add protoc protobuf protobuf-dev |
There was a problem hiding this comment.
| RUN apk --no-cache add protoc protobuf protobuf-dev |
| COPY --parents ./crates/**/Cargo.toml ./ | ||
| RUN cargo fetch | ||
| FROM chef AS planner | ||
| COPY --exclude=rust-toolchain.toml . . |
There was a problem hiding this comment.
| COPY --exclude=rust-toolchain.toml . . | |
| COPY Cargo.toml Cargo.lock ./ | |
| COPY crates/**/Cargo.toml crates/**/ |
There was a problem hiding this comment.
planner stage only needs manifests, copying source here would unnecessarily invalidate dependency cache.
No description provided.