Skip to content

Commit 0a8db01

Browse files
author
Stanisław Drozd
authored
Dockerfile.client, Dockerfile.solana: harden caching to cut CI time (#332)
* Dockerfile.client, Dockerfile.solana: harden caching to cut CI time This change attempts to add useful items to the docker caching which should save time downloading crates and by adding path=<full path> and dropping id=<name> ensure that no Dockerfile cache mismatches occur. I think the id= param is meant to help group builds that benefit from common cache, but in case of pyth2wormhole-client/SOL contract builds it became a competition between the two replacing the other's caches * Dockerfile.client: remove malformed id= params
1 parent b784abd commit 0a8db01

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

Dockerfile.client

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ COPY solana /usr/src/solana
1212
WORKDIR /usr/src/solana/pyth2wormhole
1313

1414
RUN --mount=type=cache,target=/root/.cache \
15-
--mount=type=cache,target=target \
15+
--mount=type=cache,target=/usr/local/cargo/registry,id=cargo_registry \
16+
--mount=type=cache,target=/usr/src/solana/pyth2wormhole/target,id=p2w_cargo_build \
1617
cargo install --version =2.0.12 --locked spl-token-cli --target-dir target
1718

1819

@@ -23,8 +24,8 @@ ENV EMITTER_ADDRESS="11111111111111111111111111111115"
2324
ENV BRIDGE_ADDRESS="Bridge1p5gheXUvJ6jGWGeCsgPKgnE3YgdGKRVCMY9o"
2425

2526
RUN --mount=type=cache,target=/root/.cache \
26-
--mount=type=cache,target=/usr/local/cargo/registry,id=cargo_registry \
27-
--mount=type=cache,target=target,id=cargo_registry \
27+
--mount=type=cache,target=/usr/local/cargo/registry \
28+
--mount=type=cache,target=/usr/src/solana/pyth2wormhole/target \
2829
set -xe && \
2930
cargo install bridge_client --git https://github.com/wormhole-foundation/wormhole --tag $WORMHOLE_TAG --locked --root /usr/local --target-dir target && \
3031
cargo install token_bridge_client --git https://github.com/wormhole-foundation/wormhole --tag $WORMHOLE_TAG --locked --root /usr/local --target-dir target

Dockerfile.solana

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,10 @@ ENV BRIDGE_ADDRESS="Bridge1p5gheXUvJ6jGWGeCsgPKgnE3YgdGKRVCMY9o"
4646
WORKDIR /usr/src/bridge/solana
4747

4848
# Build Wormhole Solana programs
49-
RUN --mount=type=cache,target=../wormhole/solana/target \
50-
--mount=type=cache,target=pyth2wormhole/target \
49+
RUN --mount=type=cache,target=/usr/src/bridge/wormhole/solana/target \
50+
--mount=type=cache,target=/usr/src/bridge/solana/pyth2wormhole/target \
51+
--mount=type=cache,target=/usr/local/cargo/registry \
52+
--mount=type=cache,target=/root/.cache \
5153
cargo build-bpf --manifest-path "../wormhole/solana/bridge/program/Cargo.toml" -- --locked && \
5254
cargo build-bpf --manifest-path "../wormhole/solana/bridge/cpi_poster/Cargo.toml" -- --locked && \
5355
cargo build-bpf --manifest-path "pyth2wormhole/program/Cargo.toml" -- --locked && \

0 commit comments

Comments
 (0)