Skip to content

Commit

Permalink
modify scripting commands
Browse files Browse the repository at this point in the history
  • Loading branch information
lemunozm committed Nov 28, 2023
1 parent 1a858e9 commit a7746ca
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 14 deletions.
6 changes: 3 additions & 3 deletions ci/run-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ cargo --version

case $TARGET in
cargo-build)
cargo build --release "$@"
cargo build -p centrifuge-chain --release "$@"
;;

test-general)
cargo test --workspace --release --features runtime-benchmarks,try-runtime --exclude runtime-integration-tests
cargo test --release --features runtime-benchmarks,try-runtime,fast-runtime --exclude runtime-integration-tests
;;

test-integration)
Expand All @@ -30,7 +30,7 @@ case $TARGET in
;;

lint-clippy)
cargo clippy --workspace -- -D warnings -A clippy::unnecessary-cast -A clippy::bool-to-int-with-if
cargo clippy -- -D warnings -A clippy::unnecessary-cast -A clippy::bool-to-int-with-if
;;
benchmark-check)
./scripts/check_benchmarks.sh $RUNTIME
Expand Down
10 changes: 5 additions & 5 deletions docker/centrifuge-chain/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ FROM --platform=linux/amd64 docker.io/library/rust:bookworm as builder
COPY rust-toolchain.toml ./
# RUN rustup update && rustup default
ENV PATH=~/.cargo/bin:$PATH
RUN scripts/install_toolchain.sh
RUN scripts/install_toolchain.sh

# BUILD
ARG RUSTC_WRAPPER=''
Expand All @@ -32,7 +32,7 @@ FROM --platform=linux/amd64 docker.io/library/rust:bookworm as builder
WORKDIR /centrifuge-chain
ARG FEATURES=""
RUN FEATURES=$(echo ${FEATURES} | tr -d '"') \
cargo build "--release" --features=${FEATURES}
cargo build -p centrifuge-chain "--release" --features=${FEATURES}


# ===== SECOND STAGE ======
Expand All @@ -55,11 +55,11 @@ FROM --platform=linux/amd64 docker.io/library/ubuntu:jammy
COPY --from=builder /centrifuge-chain/target/release/centrifuge-chain /usr/local/bin

RUN apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/* ;

# Because of the following, all data and config directories need to be owned by UID and GID 1000
RUN useradd -m -u 1000 -U -s /bin/sh -d /centrifuge centrifuge
RUN mkdir -p /data && \

RUN mkdir -p /data && \
chown -R centrifuge:centrifuge /data && \
chown -R centrifuge:centrifuge /resources && \
chown -R centrifuge:centrifuge /usr/local/bin/centrifuge-chain && \
Expand Down
2 changes: 1 addition & 1 deletion pallets/liquidity-pools/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
authors = ["Centrifuge <[email protected]>"]
description = "Centrifuge Liquidity Pools Pallet"
edition = "2018"
edition = "2021"
license = "LGPL-3.0"
name = "pallet-liquidity-pools"
repository = "https://github.com/centrifuge/centrifuge-chain"
Expand Down
3 changes: 2 additions & 1 deletion scripts/check_benchmarks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ else
exit 1;
fi

cargo build --release --features runtime-benchmarks
# We use the same features as CI tests to reuse the artifacts
cargo build -p centrifuge-chain --release --features runtime-benchmarks,try-runtime,fast-runtime

all_pallets=$(
./target/release/centrifuge-chain benchmark pallet --list --chain="${chain}" | tail -n+2 | cut -d',' -f1 | sort | uniq
Expand Down
4 changes: 2 additions & 2 deletions scripts/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ stop-parachain-docker)

start-parachain)
printf "\nBuilding parachain with runtime '$parachain' and id '$para_id'...\n"
cargo build --release --features=fast-runtime
cargo build -p centrifuge-chain --release --features=fast-runtime

parachain_dir=$base_dir/parachain/${para_id}
mkdir -p $parachain_dir;
Expand Down Expand Up @@ -92,6 +92,6 @@ onboard-parachain)

benchmark)
pallet=$2
cargo run --features runtime-benchmarks benchmark pallet --chain $parachain --pallet="$pallet" --extrinsic=*
cargo run -p centrifuge-chain --features runtime-benchmarks benchmark pallet --chain $parachain --pallet="$pallet" --extrinsic=*
;;
esac
4 changes: 2 additions & 2 deletions scripts/runtime_benchmarks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ else
fi

# Build only once
echo "Building chain with features: cargo build --release --features runtime-benchmarks"
cargo build --release --features runtime-benchmarks
echo "Building chain with features: cargo build -p centrifuge-chain --release --features runtime-benchmarks"
cargo build -p centrifuge-chain --release --features runtime-benchmarks
check $?

weight_path="${runtime_path}/src/weights"
Expand Down

0 comments on commit a7746ca

Please sign in to comment.