Skip to content

Commit 333b480

Browse files
authored
Use 'sharing=locked' for gateway Dockerfile cache mount (tensorzero#3194)
Using a shared cache volume is causing issues on Namespace with parallel builds: ``` 3.749 failed to open `/usr/local/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/minimal-lexical-0.2.1/.cargo-ok` 3.749 Caused by: 3.749 File exists (os error 17) ``` Let's only allow one Docker builder to have access to the registry cache mount
1 parent bdd58a8 commit 333b480

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gateway/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ RUN git rev-parse HEAD
1111

1212
ARG CARGO_BUILD_FLAGS=""
1313

14-
RUN --mount=type=cache,id=tensorzero-gateway-release,sharing=shared,target=/usr/local/cargo/registry \
15-
--mount=type=cache,id=tensorzero-gateway-release,sharing=shared,target=/usr/local/cargo/git \
14+
RUN --mount=type=cache,id=tensorzero-gateway-release,sharing=locked,target=/usr/local/cargo/registry \
15+
--mount=type=cache,id=tensorzero-gateway-release,sharing=locked,target=/usr/local/cargo/git \
1616
cargo build --profile performance -p gateway $CARGO_BUILD_FLAGS && \
1717
cp -r /src/target/performance /release
1818

0 commit comments

Comments
 (0)