Skip to content

Commit

Permalink
build: merge v10010062 into master
Browse files Browse the repository at this point in the history
  • Loading branch information
CertainLach committed Oct 17, 2023
2 parents ebc1378 + 092e9b8 commit 748989c
Show file tree
Hide file tree
Showing 243 changed files with 15,540 additions and 14,973 deletions.
3 changes: 2 additions & 1 deletion .baedeker/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/.bdk-env
/rewrites.jsonnet
/rewrites*.jsonnet
/vendor
/baedeker-library
!/rewrites.example.jsonnet
4 changes: 2 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | b
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \
nvm install v16.2.0 && \
npm install -g yarn && \
rustup toolchain install nightly-2021-11-11 && \
rustup default nightly-2021-11-11 && \
rustup toolchain install nightly-2023-05-22 && \
rustup default nightly-2023-05-22 && \
rustup target add wasm32-unknown-unknown && \
rustup component add rustfmt clippy && \
cargo install cargo-expand cargo-edit cargo-contract
4 changes: 2 additions & 2 deletions .docker/Dockerfile-chain-dev
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ COPY . /dev_chain

WORKDIR /dev_chain

RUN cargo build --release
RUN cargo build --profile integration-tests --features=${NETWORK}-runtime
RUN echo "$NETWORK"

CMD cargo run --release --features=${NETWORK}-runtime -- --dev -linfo --rpc-cors=all --unsafe-rpc-external
CMD cargo run --profile integration-tests --features=${NETWORK}-runtime -- --dev -linfo --rpc-cors=all --unsafe-rpc-external
6 changes: 3 additions & 3 deletions .docker/Dockerfile-unique
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ RUN --mount=type=cache,target=/cargo-home/registry \
--mount=type=cache,target=/unique_parachain/unique-chain/target \
cd unique-chain && \
echo "Using runtime features '$RUNTIME_FEATURES'" && \
CARGO_INCREMENTAL=0 cargo build --release --features="$RUNTIME_FEATURES" --locked && \
mv ./target/release/unique-collator /unique_parachain/unique-chain/ && \
cd target/release/wbuild && find . -name "*.wasm" -exec sh -c 'mkdir -p "../../../wasm/$(dirname {})"; cp {} "../../../wasm/{}"' \;
CARGO_INCREMENTAL=0 cargo build --profile integration-tests --features="$RUNTIME_FEATURES" --locked && \
mv ./target/integration-tests/unique-collator /unique_parachain/unique-chain/ && \
cd target/integration-tests/wbuild && find . -name "*.wasm" -exec sh -c 'mkdir -p "../../../wasm/$(dirname {})"; cp {} "../../../wasm/{}"' \;

# ===== BIN ======

Expand Down
6 changes: 3 additions & 3 deletions .docker/additional/Dockerfile-chainql
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ RUN apt-get update && \
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none

RUN rustup toolchain uninstall $(rustup toolchain list) && \
rustup toolchain install nightly-2022-11-15 && \
rustup default nightly-2022-11-15 && \
rustup toolchain install nightly-2023-05-22 && \
rustup default nightly-2023-05-22 && \
rustup target list --installed && \
rustup show
RUN rustup target add wasm32-unknown-unknown --toolchain nightly-2022-11-15
RUN rustup target add wasm32-unknown-unknown --toolchain nightly-2023-05-22

RUN mkdir /unique_parachain
WORKDIR /unique_parachain
Expand Down
2 changes: 1 addition & 1 deletion .docker/additional/Dockerfile-polkadot
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
FROM ubuntu:22.04 as rust-builder
LABEL maintainer="Unique.Network"

ARG RUST_TOOLCHAIN=nightly-2022-10-09
ARG RUST_TOOLCHAIN=nightly-2023-05-22

ENV CARGO_HOME="/cargo-home"
ENV PATH="/cargo-home/bin:$PATH"
Expand Down
2 changes: 1 addition & 1 deletion .docker/docker-compose.gov.j2
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ services:
options:
max-size: "1m"
max-file: "3"
command: cargo run --release --features={{ NETWORK }}-runtime,gov-test-timings -- --dev -linfo --rpc-cors=all --unsafe-rpc-external
command: cargo run --profile integration-tests --features={{ NETWORK }}-runtime,gov-test-timings -- --dev -linfo --rpc-cors=all --unsafe-rpc-external
83 changes: 0 additions & 83 deletions .docker/forkless-config/zombienet-forkless-data.toml

This file was deleted.

39 changes: 0 additions & 39 deletions .docker/forkless-config/zombienet-forkless-nodata.toml

This file was deleted.

6 changes: 5 additions & 1 deletion .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ function check_bdk {
fi
}

if ! diff .githooks/pre-commit .git/hooks/pre-commit >/dev/null; then
echo -e "${RED}Hooks are updated, run make git-hooks${RESET}"
fi

watch_file .baedeker/.bdk-env/discover.env
if test -f .baedeker/.bdk-env/discover.env; then
check_bdk baedeker
Expand All @@ -30,7 +34,7 @@ if test -f .baedeker/.bdk-env/discover.env; then
fi

echo -e "${GREEN}Baedeker env updated${RESET}"
nginx_id=$(docker compose -f .baedeker/.bdk-env/docker-compose.yml ps --format=json | jq -r '.[] | select(.Service == "nginx") | .ID' -e)
nginx_id=$(docker compose -f .baedeker/.bdk-env/docker-compose.yml ps --format=json | jq -s 'flatten' | jq -r '.[] | select(.Service == "nginx") | .ID' -e)
if ! [ $? -eq 0 ]; then
echo -e "${RED}Nginx container not found${RESET}"
exit 0
Expand Down
42 changes: 42 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/env bash
#
# Pre-push hook verifying that inappropriate code will not be pushed.

# Colors for the terminal output
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m' # No Color

echo "Starting cargo fmt.."
cargo fmt --check
FMT_EXIT="$?"

# Check that prettier formatting rules are not violated.
if [[ "${FMT_EXIT}" = 0 ]]; then
echo -e "${GREEN}cargo fmt succeded${NC}"
else
echo -e "${RED}Commit error!${NC}"
echo "Please format the code via 'cargo fmt', cannot commit unformatted code"
exit 1
fi

STAGED_TEST_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep "\.ts$\|\.js$")

if [[ "$STAGED_TEST_FILES" = "" ]]; then
echo -e "${GREEN}eslint succeded${NC}"
exit 0
fi

echo "Starting eslint.."
./tests/node_modules/.bin/eslint --max-warnings 0 ${STAGED_TEST_FILES[@]}
ESLINT_EXIT="$?"

if [[ "${ESLINT_EXIT}" = 0 ]]; then
echo -e "${GREEN}eslint succeded${NC}"
else
echo -e "${RED}Commit error!${NC}"
echo "Please format the code via 'yarn fix', cannot Commit unformatted code"
exit 1
fi

exit $?
4 changes: 2 additions & 2 deletions .github/workflows/forkless-update-data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ jobs:
network {quartz}, mainnet_branch {${{ env.QUARTZ_MAINNET_BRANCH }}}, relay_branch {${{ env.KUSAMA_MAINNET_BRANCH }}}, runtime_features {quartz-runtime}, wasm_name {quartz}, fork_source {${{ env.QUARTZ_REPLICA_FROM }}}
network {unique}, mainnet_branch {${{ env.UNIQUE_MAINNET_BRANCH }}}, relay_branch {${{ env.POLKADOT_MAINNET_BRANCH }}}, runtime_features {unique-runtime}, wasm_name {unique}, fork_source {${{ env.UNIQUE_REPLICA_FROM }}}
forkless-data-build:
forkless-data:

needs: prepare-execution-matrix
# The type of runner that the job will run on
runs-on: [self-hosted-ci,large]

timeout-minutes: 1380

name: ${{ matrix.network }}-data-build
name: ${{ matrix.network }}-data

continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false.

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/forkless-update-nodata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ jobs:
network {quartz}, mainnet_branch {${{ env.QUARTZ_MAINNET_BRANCH }}}, relay_branch {${{ env.KUSAMA_MAINNET_BRANCH }}}, runtime_features {quartz-runtime}, wasm_name {quartz}
network {unique}, mainnet_branch {${{ env.UNIQUE_MAINNET_BRANCH }}}, relay_branch {${{ env.POLKADOT_MAINNET_BRANCH }}}, runtime_features {unique-runtime}, wasm_name {unique}
forkless-nodata-build:
forkless-nodata:

needs: prepare-execution-matrix
# The type of runner that the job will run on
runs-on: [self-hosted-ci,large]

timeout-minutes: 1380

name: ${{ matrix.network }}-nodata-build
name: ${{ matrix.network }}-nodata

continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false.

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/node-only-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ jobs:
network {quartz}, mainnet_branch {${{ env.QUARTZ_MAINNET_BRANCH }}}, relay_branch {${{ env.KUSAMA_MAINNET_BRANCH }}}, runtime_features {quartz-runtime}
network {unique}, mainnet_branch {${{ env.UNIQUE_MAINNET_BRANCH }}}, relay_branch {${{ env.POLKADOT_MAINNET_BRANCH }}}, runtime_features {unique-runtime}
node-only-update-build:
node-only-update:

needs: prepare-execution-matrix
# The type of runner that the job will run on
runs-on: [self-hosted-ci]

timeout-minutes: 2880 # 48 hours for execution jobs.

name: ${{ matrix.network }}-build
name: ${{ matrix.network }}

continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false.

Expand Down
20 changes: 5 additions & 15 deletions .github/workflows/try-runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -210,31 +210,21 @@ jobs:
return 1
fi
else
DOCKER_LOGS=$(do_docker_logs)
while [ $counter_life -lt 3 ]
do
(( counter_life++ ))
if [[ -n ${DOCKER_LOGS} ]]; then
echo "TryRuntime_on_runtime_upgrade executed without errors"
return 0
else
echo "Container try-runtime not RUNNING"
return 1
fi
done
(( counter_life++ ))
echo "Container try-runtime not RUNNING" $counter_life "time"
return 1
fi
exit 0
}
while ! is_started; do
echo "Waiting for special message in log files "
sleep 30s
counter=$(( $counter - 1 ))
echo "Counter: $counter"
if [ "$counter" -gt "0" ]; then
if [ "$counter" -gt "0" ] && [ "$counter_life" -lt "3" ]; then
continue
else
echo "Counter reached zero, yet upgrade is not finished"
echo "Counter reached zero, yet upgrade is not finished correctly or Container try-runtime is not RUNNING"
exit 1
fi
done
Expand Down
Loading

0 comments on commit 748989c

Please sign in to comment.