Skip to content

Commit 1ab8751

Browse files
authored
fix: docker agent build (#4481)
fix: docker agent build - update image from 1.72.1 -> 1.80.1 drive-by: update more `rust/` --> `rust/main/` drive-by: consolidate e2e non-cosmwasm cache, multiple cache steps per job can get in the way of each other --------- Signed-off-by: pbio <[email protected]>
1 parent 096aeff commit 1ab8751

File tree

14 files changed

+32
-44
lines changed

14 files changed

+32
-44
lines changed

Diff for: .gitattributes

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
typescript/sdk/src/cw-types/*.types.ts linguist-generated=true
2-
rust/chains/hyperlane-ethereum/abis/*.abi.json linguist-generated=true
2+
rust/main/chains/hyperlane-ethereum/abis/*.abi.json linguist-generated=true
33
solidity/contracts/interfaces/avs/*.sol linguist-vendored=true
44
solidity/contracts/avs/ECDSA*.sol linguist-vendored=true

Diff for: .github/workflows/agent-release-artifacts.yml

+9-9
Original file line numberDiff line numberDiff line change
@@ -65,23 +65,23 @@ jobs:
6565
target: ${{ matrix.TARGET }}
6666
- name: setup target
6767
run: rustup target add ${{ matrix.TARGET }}
68-
working-directory: ./rust
68+
working-directory: ./rust/main
6969
- name: build
7070
run: cargo build --release --target ${{ matrix.TARGET }} --bin relayer --bin scraper --bin validator
71-
working-directory: ./rust
71+
working-directory: ./rust/main
7272
- name: make executable
7373
if: ${{ matrix.OS == 'larger-runner' || matrix.OS == 'macos-latest' }}
7474
run: chmod ug+x,-w relayer scraper validator
75-
working-directory: rust/target/${{ matrix.TARGET }}/release
75+
working-directory: rust/main/target/${{ matrix.TARGET }}/release
7676
- name: upload binaries
7777
uses: actions/upload-artifact@v4
7878
with:
7979
name: ${{ matrix.TARGET }}-${{ needs.prepare.outputs.tag_sha }}-${{ needs.prepare.outputs.tag_date }}
8080
path: |
81-
rust/target/${{ matrix.TARGET }}/release/relayer
82-
rust/target/${{ matrix.TARGET }}/release/relayer.exe
83-
rust/target/${{ matrix.TARGET }}/release/scraper
84-
rust/target/${{ matrix.TARGET }}/release/scraper.exe
85-
rust/target/${{ matrix.TARGET }}/release/validator
86-
rust/target/${{ matrix.TARGET }}/release/validator.exe
81+
rust/main/target/${{ matrix.TARGET }}/release/relayer
82+
rust/main/target/${{ matrix.TARGET }}/release/relayer.exe
83+
rust/main/target/${{ matrix.TARGET }}/release/scraper
84+
rust/main/target/${{ matrix.TARGET }}/release/scraper.exe
85+
rust/main/target/${{ matrix.TARGET }}/release/validator
86+
rust/main/target/${{ matrix.TARGET }}/release/validator.exe
8787
if-no-files-found: error

Diff for: .github/workflows/test.yml

+2-12
Original file line numberDiff line numberDiff line change
@@ -172,23 +172,13 @@ jobs:
172172
- name: rust cache
173173
uses: Swatinem/rust-cache@v2
174174
with:
175-
prefix-key: 'v2-rust-main'
175+
prefix-key: 'v2-rust-e2e'
176176
shared-key: ${{ matrix.e2e-type }}
177177
cache-provider: 'buildjet'
178178
save-if: ${{ !startsWith(github.ref, 'refs/heads/gh-readonly-queue') }}
179179
workspaces: |
180180
./rust/main
181-
182-
- name: rust cache
183-
uses: Swatinem/rust-cache@v2
184-
if: matrix.e2e-type == 'non-cosmwasm'
185-
with:
186-
prefix-key: 'v2-rust-sealevel'
187-
shared-key: ${{ matrix.e2e-type }}
188-
cache-provider: 'buildjet'
189-
save-if: ${{ !startsWith(github.ref, 'refs/heads/gh-readonly-queue') }}
190-
workspaces: |
191-
./rust/sealevel
181+
${{ matrix.e2e-type == 'non-cosmwasm' && './rust/sealevel' || '' }}
192182
193183
- name: Free disk space
194184
run: |

Diff for: .husky/pre-commit

+5-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ echo "📝 If you haven't yet, please add a changeset for your changes via 'yarn
77

88
# if any *.rs files have changed
99
if git diff --staged --exit-code --name-only | grep -q -E ".*\.rs$"; then
10-
echo "Running cargo fmt pre-commit hook"
11-
cargo fmt --all --check --manifest-path rust/Cargo.toml
10+
echo "Running cargo fmt pre-commit hook for rust/main"
11+
cargo fmt --all --check --manifest-path rust/main/Cargo.toml
12+
13+
echo "Running cargo fmt pre-commit hook for rust/sealevel"
14+
cargo fmt --all --check --manifest-path rust/sealevel/Cargo.toml
1215
fi

Diff for: rust/Dockerfile

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# syntax=docker/dockerfile:experimental
22

3-
FROM rust:1.72.1 as builder
3+
FROM rust:1.80.1 as builder
44
WORKDIR /usr/src
55

66
# 1a: Prepare for static linking
@@ -23,18 +23,13 @@ COPY rust/main/utils rust/main/utils
2323
COPY rust/sealevel rust/sealevel
2424

2525
COPY rust/main/Cargo.toml rust/main/.
26-
COPY rust/main/Cargo.toml rust/main/.
27-
COPY rust/sealevel/Cargo.lock rust/sealevel/.
28-
COPY rust/sealevel/Cargo.lock rust/sealevel/.
26+
COPY rust/main/Cargo.lock rust/main/.
2927

3028

3129
WORKDIR /usr/src/rust/main
3230

3331
# Build binaries
3432
RUN \
35-
--mount=id=cargo,type=cache,sharing=locked,target=/usr/src/target \
36-
--mount=id=cargo-home-registry,type=cache,sharing=locked,target=/usr/local/cargo/registry \
37-
--mount=id=cargo-home-git,type=cache,sharing=locked,target=/usr/local/cargo/git \
3833
RUSTFLAGS="--cfg tokio_unstable" cargo build --release --bin validator --bin relayer --bin scraper && \
3934
mkdir -p /release && \
4035
cp /usr/src/rust/main/target/release/validator /release && \

Diff for: rust/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ cd rust
117117

118118
### Deploy Procedure
119119

120-
The contract addresses of each deploy can be found in `rust/config`. The agents will
120+
The contract addresses of each deploy can be found in `rust/main/config`. The agents will
121121
automatically pull in all configs in this directory.
122122

123123
When agents are deployed to point at a new environment, they cease to point at

Diff for: rust/main/hyperlane-base/src/settings/loader/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ where
2727
let mut base_config_sources = vec![];
2828
let mut builder = Config::builder();
2929

30-
// Always load the default config files (`rust/config/*.json`)
30+
// Always load the default config files (`rust/main/config/*.json`)
3131
for entry in PathBuf::from("./config")
3232
.read_dir()
3333
.context("Failed to open config directory")

Diff for: rust/main/hyperlane-base/tests/chain_config.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use hyperlane_base::settings::{parser::RawAgentConf, Settings};
66
use hyperlane_core::{config::*, KnownHyperlaneDomain};
77
use walkdir::WalkDir;
88

9-
/// Relative path to the `hyperlane-monorepo/rust/config/`
9+
/// Relative path to the `hyperlane-monorepo/rust/main/config/`
1010
/// directory, which is where the agent's config files
1111
/// currently live.
1212
const AGENT_CONFIG_PATH_ROOT: &str = "../config";

Diff for: rust/main/utils/run-locally/src/cosmos/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ fn run_locally() {
581581
postgres,
582582
};
583583

584-
// Mostly copy-pasta from `rust/utils/run-locally/src/main.rs`
584+
// Mostly copy-pasta from `rust/main/utils/run-locally/src/main.rs`
585585
// TODO: refactor to share code
586586
let loop_start = Instant::now();
587587
let mut failure_occurred = false;

Diff for: solidity/update_abis.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
#!/bin/sh
1+
#!/bin/sh
22

33
# Must be ran from the `solidity` directory
44

55
copy() {
66
# Optionally allow path to be passed in, and extract the contract name
77
# as the string following the last instance of `/`
88
CONTRACT_NAME="${1##*/}"
9-
jq .abi < artifacts/contracts/"$1".sol/"$CONTRACT_NAME".json > ../rust/chains/hyperlane-ethereum/abis/"$CONTRACT_NAME".abi.json
9+
jq .abi < artifacts/contracts/"$1".sol/"$CONTRACT_NAME".json > ../rust/main/chains/hyperlane-ethereum/abis/"$CONTRACT_NAME".abi.json
1010
}
1111

1212
copy interfaces/IMailbox && \

Diff for: typescript/infra/scripts/funding/fund-keys-from-deployer.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ const constMetricLabels = {
7272
const metricsRegister = new Registry();
7373

7474
const walletBalanceGauge = new Gauge({
75-
// Mirror the rust/ethers-prometheus `wallet_balance` gauge metric.
75+
// Mirror the rust/main/ethers-prometheus `wallet_balance` gauge metric.
7676
name: 'hyperlane_wallet_balance',
7777
help: 'Current balance of eth and other tokens in the `tokens` map for the wallet addresses in the `wallets` set',
7878
registers: [metricsRegister],

Diff for: typescript/infra/src/config/agent/agent.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ export type DeepPartial<T> = T extends object
3030
}
3131
: T;
3232

33-
// See rust/helm/values.yaml for the full list of options and their defaults.
33+
// See rust/main/helm/values.yaml for the full list of options and their defaults.
3434
// This is the root object in the values file.
3535
export interface HelmRootAgentValues {
3636
image: HelmImageValues;
3737
hyperlane: HelmHyperlaneValues;
3838
nameOverride?: string;
3939
}
4040

41-
// See rust/helm/values.yaml for the full list of options and their defaults.
41+
// See rust/main/helm/values.yaml for the full list of options and their defaults.
4242
// This is at `.hyperlane` in the values file.
4343
interface HelmHyperlaneValues {
4444
runEnv: DeployEnvironment;
@@ -54,7 +54,7 @@ interface HelmHyperlaneValues {
5454
scraper?: HelmScraperValues;
5555
}
5656

57-
// See rust/helm/values.yaml for the full list of options and their defaults.
57+
// See rust/main/helm/values.yaml for the full list of options and their defaults.
5858
// This is at `.hyperlane.chains` in the values file.
5959
export interface HelmAgentChainOverride
6060
extends DeepPartial<AgentChainMetadata> {

Diff for: typescript/infra/src/config/agent/relayer.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ export interface BaseRelayerConfig {
5151
// Full relayer-specific agent config for a single chain
5252
export type RelayerConfig = Omit<RelayerAgentConfig, keyof AgentConfig>;
5353

54-
// See rust/helm/values.yaml for the full list of options and their defaults.
54+
// See rust/main/helm/values.yaml for the full list of options and their defaults.
5555
// This is at `.hyperlane.relayer` in the values file.
5656
export interface HelmRelayerValues extends HelmStatefulSetValues {
5757
aws: boolean;
5858
config?: RelayerConfig;
5959
}
6060

61-
// See rust/helm/values.yaml for the full list of options and their defaults.
61+
// See rust/main/helm/values.yaml for the full list of options and their defaults.
6262
// This is at `.hyperlane.relayerChains` in the values file.
6363
export interface HelmRelayerChainValues {
6464
name: string;

Diff for: typescript/sdk/src/ism/metadata/aggregation.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export interface AggregationMetadata<T = string> {
2626

2727
const RANGE_SIZE = 4;
2828

29-
// adapted from rust/agents/relayer/src/msg/metadata/aggregation.rs
29+
// adapted from rust/main/agents/relayer/src/msg/metadata/aggregation.rs
3030
export class AggregationMetadataBuilder implements MetadataBuilder {
3131
protected logger = rootLogger.child({
3232
module: 'AggregationIsmMetadataBuilder',

0 commit comments

Comments
 (0)