From a4fedded37694eee37ad9fb44014a03ee0a5dd92 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Mon, 18 Nov 2024 15:27:33 +0700 Subject: [PATCH] forkless-update-data with two branches forkless-update-nodata with two branches deleting unused entities deleting Dockerfiles of third-party chains --- .docker/Dockerfile-acala.j2 | 47 ------------------ .docker/Dockerfile-astar.j2 | 46 ------------------ .docker/Dockerfile-cumulus.j2 | 46 ------------------ .docker/Dockerfile-hydradx | 50 -------------------- .docker/Dockerfile-hydradx.j2 | 47 ------------------ .docker/Dockerfile-moonbeam.j2 | 47 ------------------ .docker/Dockerfile-polkadex.j2 | 47 ------------------ .docker/Dockerfile-unique | 4 +- .docker/Dockerfile-unique-release | 22 +++++---- .env | 12 +++-- .github/workflows/forkless-update-data.yml | 44 +++++++++++------ .github/workflows/forkless-update-nodata.yml | 36 ++++++++++---- .github/workflows/node-only-update.yml | 30 ++++++------ js-packages/scripts/generateEnv.ts | 6 +-- 14 files changed, 98 insertions(+), 386 deletions(-) delete mode 100644 .docker/Dockerfile-acala.j2 delete mode 100644 .docker/Dockerfile-astar.j2 delete mode 100644 .docker/Dockerfile-cumulus.j2 delete mode 100644 .docker/Dockerfile-hydradx delete mode 100644 .docker/Dockerfile-hydradx.j2 delete mode 100644 .docker/Dockerfile-moonbeam.j2 delete mode 100644 .docker/Dockerfile-polkadex.j2 diff --git a/.docker/Dockerfile-acala.j2 b/.docker/Dockerfile-acala.j2 deleted file mode 100644 index cc0de2594f..0000000000 --- a/.docker/Dockerfile-acala.j2 +++ /dev/null @@ -1,47 +0,0 @@ -# ===== Rust builder ===== -FROM ubuntu:22.04 as rust-builder -LABEL maintainer="Unique.Network" - -ENV CARGO_HOME="/cargo-home" -ENV PATH="/cargo-home/bin:$PATH" -ENV TZ=UTC -RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone - -RUN apt-get update && \ - apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev protobuf-compiler && \ - apt-get clean && \ - rm -r /var/lib/apt/lists/* - -RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none - -RUN rustup toolchain install {{ RUST_TOOLCHAIN }} && \ - rustup target add wasm32-unknown-unknown --toolchain {{ RUST_TOOLCHAIN }} && \ - rustup default {{ RUST_TOOLCHAIN }} && \ - rustup component add --toolchain {{ RUST_TOOLCHAIN }} rust-src && \ - rustup target list --installed && \ - rustup show - -RUN mkdir /unique_parachain -WORKDIR /unique_parachain - -# ===== BUILD ACALA ===== -FROM rust-builder as builder-acala-bin - -WORKDIR /unique_parachain - -RUN git clone -b {{ ACALA_BUILD_BRANCH }} --depth 1 https://github.com/AcalaNetwork/Acala.git - -RUN --mount=type=cache,target=/cargo-home/registry \ - --mount=type=cache,target=/cargo-home/git \ - --mount=type=cache,target=/unique_parachain/Acala/target \ - cd Acala && \ - make init && \ - make build-release && \ - mv ./target/production/acala /unique_parachain/Acala/ - -# ===== BIN ====== - -FROM ubuntu:22.04 as builder-acala - -COPY --from=builder-acala-bin /unique_parachain/Acala/acala /bin/acala -ENTRYPOINT ["/bin/acala"] diff --git a/.docker/Dockerfile-astar.j2 b/.docker/Dockerfile-astar.j2 deleted file mode 100644 index 311aa3410a..0000000000 --- a/.docker/Dockerfile-astar.j2 +++ /dev/null @@ -1,46 +0,0 @@ -# ===== Rust builder ===== -FROM ubuntu:22.04 as rust-builder -LABEL maintainer="Unique.Network" - -ENV CARGO_HOME="/cargo-home" -ENV PATH="/cargo-home/bin:$PATH" -ENV TZ=UTC -RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone - -RUN apt-get update && \ - apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev protobuf-compiler && \ - apt-get clean && \ - rm -r /var/lib/apt/lists/* - -RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none - -RUN rustup toolchain install {{ RUST_TOOLCHAIN }} && \ - rustup target add wasm32-unknown-unknown --toolchain {{ RUST_TOOLCHAIN }} && \ - rustup default {{ RUST_TOOLCHAIN }} && \ - rustup component add --toolchain {{ RUST_TOOLCHAIN }} rust-src && \ - rustup target list --installed && \ - rustup show - -RUN mkdir /unique_parachain -WORKDIR /unique_parachain - -# ===== BUILD ACALA ===== -FROM rust-builder as builder-astar-bin - -WORKDIR /unique_parachain - -RUN git clone --recurse-submodules -b {{ ASTAR_BUILD_BRANCH }} --depth 1 https://github.com/AstarNetwork/Astar.git - -RUN --mount=type=cache,target=/cargo-home/registry \ - --mount=type=cache,target=/cargo-home/git \ - --mount=type=cache,target=/unique_parachain/Astar/target \ - cd Astar && \ - CARGO_INCREMENTAL=0 cargo build --release --locked && \ - mv ./target/release/astar-collator /unique_parachain/Astar/astar - -# ===== BIN ====== - -FROM ubuntu:22.04 as builder-astar - -COPY --from=builder-astar-bin /unique_parachain/Astar/astar /bin/astar -ENTRYPOINT ["/bin/astar"] diff --git a/.docker/Dockerfile-cumulus.j2 b/.docker/Dockerfile-cumulus.j2 deleted file mode 100644 index afb05e7970..0000000000 --- a/.docker/Dockerfile-cumulus.j2 +++ /dev/null @@ -1,46 +0,0 @@ -# ===== Rust builder ===== -FROM ubuntu:22.04 as rust-builder -LABEL maintainer="Unique.Network" - -ENV CARGO_HOME="/cargo-home" -ENV PATH="/cargo-home/bin:$PATH" -ENV TZ=UTC -RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone - -RUN apt-get update && \ - apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev protobuf-compiler && \ - apt-get clean && \ - rm -r /var/lib/apt/lists/* - -RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none - -RUN rustup toolchain install {{ RUST_TOOLCHAIN }} && \ - rustup target add wasm32-unknown-unknown --toolchain {{ RUST_TOOLCHAIN }} && \ - rustup default {{ RUST_TOOLCHAIN }} && \ - rustup component add --toolchain {{ RUST_TOOLCHAIN }} rust-src && \ - rustup target list --installed && \ - rustup show - -RUN mkdir /unique_parachain -WORKDIR /unique_parachain - -# ===== BUILD CUMULUS ===== -FROM rust-builder as builder-cumulus-bin - -WORKDIR /unique_parachain - -RUN git clone -b {{ CUMULUS_BUILD_BRANCH }} --depth 1 https://github.com/paritytech/cumulus.git - -RUN --mount=type=cache,target=/cargo-home/registry \ - --mount=type=cache,target=/cargo-home/git \ - --mount=type=cache,target=/unique_parachain/cumulus/target \ - cd cumulus && \ - CARGO_INCREMENTAL=0 cargo build --release --locked && \ - mv ./target/release/polkadot-parachain /unique_parachain/cumulus/cumulus - -# ===== BIN ====== - -FROM ubuntu:22.04 as builder-cumulus - -COPY --from=builder-cumulus-bin /unique_parachain/cumulus/cumulus /bin/cumulus -ENTRYPOINT ["/bin/cumulus"] diff --git a/.docker/Dockerfile-hydradx b/.docker/Dockerfile-hydradx deleted file mode 100644 index e92c99b466..0000000000 --- a/.docker/Dockerfile-hydradx +++ /dev/null @@ -1,50 +0,0 @@ -# ===== Rust builder ===== -FROM ubuntu:22.04 as rust-builder -LABEL maintainer="Unique.Network" - -ARG RUST_TOOLCHAIN -ENV CARGO_HOME="/cargo-home" -ENV PATH="/cargo-home/bin:$PATH" -ENV TZ=UTC -RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone - -RUN apt-get update && \ - apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev protobuf-compiler && \ - apt-get clean && \ - rm -r /var/lib/apt/lists/* - -RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none - -RUN rustup toolchain install "${RUST_TOOLCHAIN}" && \ - rustup target add wasm32-unknown-unknown --toolchain "${RUST_TOOLCHAIN}" && \ - rustup default "${RUST_TOOLCHAIN}" && \ - rustup component add --toolchain "${RUST_TOOLCHAIN}" rust-src && \ - rustup target list --installed && \ - rustup show - -RUN mkdir /unique_parachain -WORKDIR /unique_parachain - -# ===== BUILD BIN ===== -FROM rust-builder as builder-hydradx-bin - -ARG HYDRADX_BUILD_BRANCH - -WORKDIR /unique_parachain - -RUN git clone --depth 1 -b "${HYDRADX_BUILD_BRANCH}" https://github.com/galacticcouncil/HydraDX-node.git - -RUN --mount=type=cache,target=/cargo-home/registry \ - --mount=type=cache,target=/cargo-home/git \ - --mount=type=cache,target=/unique_parachain/parachain/target \ - cd HydraDX-node && \ - CARGO_INCREMENTAL=0 cargo build --release --locked && \ - mkdir /unique_parachain/Hydradx && \ - mv ./target/release/hydradx /unique_parachain/Hydradx/hydradx - -# ===== BIN ====== - -FROM ubuntu:22.04 as builder-hydradx - -COPY --from=builder-hydradx-bin /unique_parachain/Hydradx/hydradx /bin/hydradx -ENTRYPOINT ["/bin/hydradx"] diff --git a/.docker/Dockerfile-hydradx.j2 b/.docker/Dockerfile-hydradx.j2 deleted file mode 100644 index f42bcd7f4b..0000000000 --- a/.docker/Dockerfile-hydradx.j2 +++ /dev/null @@ -1,47 +0,0 @@ -# ===== Rust builder ===== -FROM ubuntu:22.04 as rust-builder -LABEL maintainer="Unique.Network" - -ENV CARGO_HOME="/cargo-home" -ENV PATH="/cargo-home/bin:$PATH" -ENV TZ=UTC -RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone - -RUN apt-get update && \ - apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev protobuf-compiler && \ - apt-get clean && \ - rm -r /var/lib/apt/lists/* - -RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none - -RUN rustup toolchain install {{ RUST_TOOLCHAIN }} && \ - rustup target add wasm32-unknown-unknown --toolchain {{ RUST_TOOLCHAIN }} && \ - rustup default {{ RUST_TOOLCHAIN }} && \ - rustup component add --toolchain {{ RUST_TOOLCHAIN }} rust-src && \ - rustup target list --installed && \ - rustup show - -RUN mkdir /unique_parachain -WORKDIR /unique_parachain - -# ===== BUILD ACALA ===== -FROM rust-builder as builder-hydradx-bin - -WORKDIR /unique_parachain - -RUN git clone --depth 1 -b {{ HYDRADX_BUILD_BRANCH }} https://github.com/galacticcouncil/HydraDX-node.git - -RUN --mount=type=cache,target=/cargo-home/registry \ - --mount=type=cache,target=/cargo-home/git \ - --mount=type=cache,target=/unique_parachain/parachain/target \ - cd HydraDX-node && \ - CARGO_INCREMENTAL=0 cargo build --release --locked && \ - mkdir /unique_parachain/Hydradx && \ - mv ./target/release/hydradx /unique_parachain/Hydradx/hydradx - -# ===== BIN ====== - -FROM ubuntu:22.04 as builder-hydradx - -COPY --from=builder-hydradx-bin /unique_parachain/Hydradx/hydradx /bin/hydradx -ENTRYPOINT ["/bin/hydradx"] diff --git a/.docker/Dockerfile-moonbeam.j2 b/.docker/Dockerfile-moonbeam.j2 deleted file mode 100644 index 927b306147..0000000000 --- a/.docker/Dockerfile-moonbeam.j2 +++ /dev/null @@ -1,47 +0,0 @@ -# ===== Rust builder ===== -FROM ubuntu:22.04 as rust-builder -LABEL maintainer="Unique.Network" - -ENV CARGO_HOME="/cargo-home" -ENV PATH="/cargo-home/bin:$PATH" -ENV TZ=UTC -RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone - -RUN apt-get update && \ - apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev protobuf-compiler && \ - apt-get clean && \ - rm -r /var/lib/apt/lists/* - -RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none - -RUN rustup toolchain install {{ RUST_TOOLCHAIN }} && \ - rustup target add wasm32-unknown-unknown --toolchain {{ RUST_TOOLCHAIN }} && \ - rustup default {{ RUST_TOOLCHAIN }} && \ - rustup component add --toolchain {{ RUST_TOOLCHAIN }} rust-src && \ - rustup target list --installed && \ - rustup show - -RUN mkdir /unique_parachain -WORKDIR /unique_parachain - - -# ===== BUILD MOONBEAM ===== -FROM rust-builder as builder-moonbeam-bin - -WORKDIR /unique_parachain - -RUN git clone -b {{ MOONBEAM_BUILD_BRANCH }} --depth 1 https://github.com/PureStake/moonbeam.git - -RUN --mount=type=cache,target=/cargo-home/registry \ - --mount=type=cache,target=/cargo-home/git \ - --mount=type=cache,target=/unique_parachain/moonbeam/target \ - cd moonbeam && \ - CARGO_INCREMENTAL=0 cargo build --release --locked && \ - mv ./target/release/moonbeam /unique_parachain/moonbeam/ - -# ===== BIN ====== - -FROM ubuntu:22.04 as builder-moonbeam - -COPY --from=builder-moonbeam-bin /unique_parachain/moonbeam/moonbeam /bin/moonbeam -ENTRYPOINT ["/bin/moonbeam"] diff --git a/.docker/Dockerfile-polkadex.j2 b/.docker/Dockerfile-polkadex.j2 deleted file mode 100644 index a5ea6cf7c7..0000000000 --- a/.docker/Dockerfile-polkadex.j2 +++ /dev/null @@ -1,47 +0,0 @@ -# ===== Rust builder ===== -FROM ubuntu:22.04 as rust-builder -LABEL maintainer="Unique.Network" - -ENV CARGO_HOME="/cargo-home" -ENV PATH="/cargo-home/bin:$PATH" -ENV TZ=UTC -RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone - -RUN apt-get update && \ - apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev protobuf-compiler && \ - apt-get clean && \ - rm -r /var/lib/apt/lists/* - -RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none - -RUN rustup toolchain install {{ RUST_TOOLCHAIN }} && \ - rustup target add wasm32-unknown-unknown --toolchain {{ RUST_TOOLCHAIN }} && \ - rustup default {{ RUST_TOOLCHAIN }} && \ - rustup component add --toolchain {{ RUST_TOOLCHAIN }} rust-src && \ - rustup target list --installed && \ - rustup show - -RUN mkdir /unique_parachain -WORKDIR /unique_parachain - -# ===== BUILD ACALA ===== -FROM rust-builder as builder-polkadex-bin - -WORKDIR /unique_parachain - -RUN git clone --depth 1 -b {{ POLKADEX_BUILD_BRANCH }} https://github.com/Polkadex-Substrate/parachain.git - -RUN --mount=type=cache,target=/cargo-home/registry \ - --mount=type=cache,target=/cargo-home/git \ - --mount=type=cache,target=/unique_parachain/parachain/target \ - cd parachain && \ - CARGO_INCREMENTAL=0 cargo build --release --locked && \ - mkdir /unique_parachain/Polkadex && \ - mv ./target/release/parachain-polkadex-node /unique_parachain/Polkadex/polkadex - -# ===== BIN ====== - -FROM ubuntu:22.04 as builder-polkadex - -COPY --from=builder-polkadex-bin /unique_parachain/Polkadex/polkadex /bin/polkadex -ENTRYPOINT ["/bin/polkadex"] diff --git a/.docker/Dockerfile-unique b/.docker/Dockerfile-unique index a821e6b8e2..aa8e92da6b 100644 --- a/.docker/Dockerfile-unique +++ b/.docker/Dockerfile-unique @@ -1,5 +1,5 @@ -# ===== BUILD UNIQUE ===== -FROM uniquenetwork/services:base-stable-1.77.0 AS builder +# ===== BUILD POLKADOT ===== +FROM "uniquenetwork/services:base-nightly-1.67.0" as builder WORKDIR /workdir diff --git a/.docker/Dockerfile-unique-release b/.docker/Dockerfile-unique-release index e1b2d84b24..b9f505729f 100644 --- a/.docker/Dockerfile-unique-release +++ b/.docker/Dockerfile-unique-release @@ -1,22 +1,26 @@ # ===== BUILD POLKADOT ===== -FROM uniquenetwork/services:base-stable-1.77.0 as builder +FROM "uniquenetwork/services:base-nightly-1.67.0" as builder WORKDIR /workdir ARG UNIQUE_VERSION -RUN git clone -b "$UNIQUE_VERSION" --depth 1 https://github.com/uniquenetwork/unique-chain.git - +ARG UNIQUE_HASH ARG FEATURES -RUN --mount=type=cache,target=/cargo-home/registry \ + +RUN git clone -b "$UNIQUE_VERSION" --depth 1 https://github.com/uniquenetwork/unique-chain.git && \ + cd unique-chain && git checkout "$UNIQUE_HASH" && \ + --mount=type=cache,target=/cargo-home/registry \ --mount=type=cache,target=/cargo-home/git \ --mount=type=cache,target=/workdir/unique-chain/target \ - cd unique-chain && \ CARGO_INCREMENTAL=0 cargo build --release --features="${FEATURES}" --locked && \ - mv ./target/release/unique-collator /workdir/unique-chain/ + mv ./target/release/unique-collator /workdir/unique-chain/ && \ + cd target/release/wbuild && find . -name "*.wasm" -exec sh -c 'mkdir -p "../../../wasm/$(dirname {})"; cp {} "../../../wasm/{}"' \; # ===== BIN ====== -FROM ubuntu:24.04 as builder-polkadot +FROM ubuntu:24.04 +LABEL maintainer="Unique.Network" -COPY --from=builder-polkadot-bin /workdir/unique-chain/unique-collator /bin/unique-collator -ENTRYPOINT ["/bin/unique-collator"] +COPY --from=builder /workdir/unique-chain/unique-collator /bin/unique-collator +COPY --from=builder /workdir/unique-chain/wasm /wasm +ENTRYPOINT ["/bin/unique-collator"] \ No newline at end of file diff --git a/.env b/.env index 192214fd36..c68685bcaa 100644 --- a/.env +++ b/.env @@ -1,6 +1,13 @@ +# common RUST_TOOLCHAIN=nightly-2024-04-10 RELAY_CHAIN_TYPE=rococo +NODE_BRANCH=v20241016-node +NODE_HASH=d494986dd5d20b3f459918d9aae63ae6a218317f +MAINNET_BRANCH=release-v10030070 +MAINNET_HASH=387b0373b6f516481e7df757c7d436465b67ae2c + +# Unique POLKADOT_MAINNET_BRANCH=v1.14.0 STATEMINT_BUILD_BRANCH=1.14.0 ACALA_BUILD_BRANCH=2.25.0 @@ -8,19 +15,18 @@ MOONBEAM_BUILD_BRANCH=runtime-2901 ASTAR_BUILD_BRANCH=v5.39.1 HYDRADX_BUILD_BRANCH=latest@sha256:50d9e0cfb582af6058f298479981a10f3e3c3da2d49995d2b0d31292f08b2589 POLKADEX_BUILD_BRANCH=v1.0.0 -UNIQUE_MAINNET_BRANCH=release-v10030070 UNIQUE_REPLICA_FROM=wss://ws.unique.network:443 +# Quartz KUSAMA_MAINNET_BRANCH=v1.14.0 STATEMINE_BUILD_BRANCH=1.14.0 KARURA_BUILD_BRANCH=2.25.0 MOONRIVER_BUILD_BRANCH=runtime-2901 SHIDEN_BUILD_BRANCH=v5.39.1 -QUARTZ_MAINNET_BRANCH=release-v10030070 QUARTZ_REPLICA_FROM=wss://ws-quartz.unique.network:443 +# Opal UNIQUEWEST_MAINNET_BRANCH=v1.14.0 WESTMINT_BUILD_BRANCH=1.14.0 -OPAL_MAINNET_BRANCH=release-v10030070 OPAL_REPLICA_FROM=wss://ws-opal.unique.network:443 diff --git a/.github/workflows/forkless-update-data.yml b/.github/workflows/forkless-update-data.yml index 499242bf6a..ee7e99af77 100644 --- a/.github/workflows/forkless-update-data.yml +++ b/.github/workflows/forkless-update-data.yml @@ -38,9 +38,9 @@ jobs: id: create_matrix with: matrix: | - network {opal}, mainnet_branch {${{ env.OPAL_MAINNET_BRANCH }}}, relay_branch {${{ env.UNIQUEWEST_MAINNET_BRANCH }}}, fork_source {${{ env.OPAL_REPLICA_FROM }}} - network {quartz}, mainnet_branch {${{ env.QUARTZ_MAINNET_BRANCH }}}, relay_branch {${{ env.KUSAMA_MAINNET_BRANCH }}}, fork_source {${{ env.QUARTZ_REPLICA_FROM }}} - network {unique}, mainnet_branch {${{ env.UNIQUE_MAINNET_BRANCH }}}, relay_branch {${{ env.POLKADOT_MAINNET_BRANCH }}}, fork_source {${{ env.UNIQUE_REPLICA_FROM }}} + network {opal}, relay_branch {${{ env.UNIQUEWEST_MAINNET_BRANCH }}}, fork_source {${{ env.OPAL_REPLICA_FROM }}} + network {quartz}, relay_branch {${{ env.KUSAMA_MAINNET_BRANCH }}}, fork_source {${{ env.QUARTZ_REPLICA_FROM }}} + network {unique}, relay_branch {${{ env.POLKADOT_MAINNET_BRANCH }}}, fork_source {${{ env.UNIQUE_REPLICA_FROM }}} forkless-data: @@ -92,12 +92,27 @@ jobs: password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} tag: ${{ matrix.relay_branch }} - - name: Prepare latest + - name: Prepare mainnet uses: ./.github/actions/buildContainer - id: latest + id: mainnet with: - container: uniquenetwork/ci-data-${{ matrix.network }} - tag: ${{ env.REF_SLUG }}-${{ env.BUILD_SHA }} + container: uniquenetwork/ci-nodata-${{ matrix.network }} + tag: ${{ matrix.network }}-${{ env.MAINNET_BRANCH }}-${{ env.MAINNET_HASH}} + context: .docker + dockerfile: Dockerfile-unique-release + args: | + --build-arg NETWORK=${{ matrix.network }} + --build-arg UNIQUE_VERSION=${{ env.MAINNET_BRANCH}} + --build-arg UNIQUE_HASH=${{ env.MAINNET_HASH}} + dockerhub_username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} + dockerhub_token: ${{ secrets.CORE_DOCKERHUB_TOKEN }} + + - name: Prepare target runtime + uses: ./.github/actions/buildContainer + id: runtime + with: + container: uniquenetwork/ci-nodata-${{ matrix.network }} + tag: ${{ matrix.network }}-${{ env.REF_SLUG }}-${{ env.BUILD_SHA }} context: . dockerfile: .docker/Dockerfile-unique args: | @@ -109,20 +124,21 @@ jobs: uses: ./.github/actions/extractDocker id: wasms with: - image: ${{ steps.latest.outputs.name }} + image: ${{ steps.runtime.outputs.name }} directory: /wasm - - name: Prepare mainnet + - name: Prepare target node uses: ./.github/actions/buildContainer - id: mainnet + id: node with: - container: uniquenetwork/ci-nodata-${{ matrix.network }} - tag: ${{ matrix.mainnet_branch }} + container: uniquenetwork/ci-data-${{ matrix.network }} + tag: ${{ matrix.network }}-${{ env.NODE_BRANCH }}-${{ env.NODE_HASH}} context: .docker dockerfile: Dockerfile-unique-release args: | --build-arg NETWORK=${{ matrix.network }} - --build-arg UNIQUE_VERSION=${{ matrix.mainnet_branch }} + --build-arg UNIQUE_VERSION=${{ env.NODE_BRANCH}} + --build-arg UNIQUE_HASH=${{ env.NODE_HASH}} dockerhub_username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} dockerhub_token: ${{ secrets.CORE_DOCKERHUB_TOKEN }} @@ -154,7 +170,7 @@ jobs: .baedeker/forkless-data.jsonnet snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/polkadot':{dockerImage:'${{ steps.polkadot.outputs.image }}:${{ steps.polkadot.outputs.tag }}'}}) # with data build uses old runtime, but new node, thus we use mainnet image for spec generation, and then latest image for nodes. - snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/unique':{dockerImage:'${{ steps.latest.outputs.name }}'}}, extra_node_mixin={extraArgs: []}, for_chain = false) + snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/unique':{dockerImage:'${{ steps.node.outputs.name }}'}}, extra_node_mixin={extraArgs: []}, for_chain = false) snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/unique':{dockerImage:'${{ steps.mainnet.outputs.name }}'}}, extra_node_mixin={extraArgs: []}) - name: Ensure network is alive diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index abfdd3aaac..3230af8100 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -38,9 +38,9 @@ jobs: id: create_matrix with: matrix: | - network {opal}, mainnet_branch {${{ env.OPAL_MAINNET_BRANCH }}}, relay_branch {${{ env.UNIQUEWEST_MAINNET_BRANCH }}} - network {quartz}, mainnet_branch {${{ env.QUARTZ_MAINNET_BRANCH }}}, relay_branch {${{ env.KUSAMA_MAINNET_BRANCH }}} - network {unique}, mainnet_branch {${{ env.UNIQUE_MAINNET_BRANCH }}}, relay_branch {${{ env.POLKADOT_MAINNET_BRANCH }}} + network {opal}, relay_branch {${{ env.UNIQUEWEST_MAINNET_BRANCH }}} + network {quartz}, relay_branch {${{ env.KUSAMA_MAINNET_BRANCH }}} + network {unique}, relay_branch {${{ env.POLKADOT_MAINNET_BRANCH }}} forkless-nodata: @@ -97,21 +97,22 @@ jobs: id: mainnet with: container: uniquenetwork/ci-nodata-${{ matrix.network }} - tag: ${{ matrix.mainnet_branch }} + tag: ${{ matrix.network }}-${{ env.MAINNET_BRANCH }}-${{ env.MAINNET_HASH}} context: .docker dockerfile: Dockerfile-unique-release args: | --build-arg NETWORK=${{ matrix.network }} - --build-arg UNIQUE_VERSION=${{ matrix.mainnet_branch }} + --build-arg UNIQUE_VERSION=${{ env.MAINNET_BRANCH}} + --build-arg UNIQUE_HASH=${{ env.MAINNET_HASH}} dockerhub_username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} dockerhub_token: ${{ secrets.CORE_DOCKERHUB_TOKEN }} - - name: Prepare latest + - name: Prepare target runtime uses: ./.github/actions/buildContainer - id: latest + id: runtime with: container: uniquenetwork/ci-nodata-${{ matrix.network }} - tag: ${{ env.REF_SLUG }}-${{ env.BUILD_SHA }} + tag: ${{ matrix.network }}-${{ env.REF_SLUG }}-${{ env.BUILD_SHA }} context: . dockerfile: .docker/Dockerfile-unique args: | @@ -123,9 +124,24 @@ jobs: uses: ./.github/actions/extractDocker id: wasms with: - image: ${{ steps.latest.outputs.name }} + image: ${{ steps.runtime.outputs.name }} directory: /wasm + - name: Prepare target node + uses: ./.github/actions/buildContainer + id: node + with: + container: uniquenetwork/ci-data-${{ matrix.network }} + tag: ${{ matrix.network }}-${{ env.NODE_BRANCH }}-${{ env.NODE_HASH}} + context: .docker + dockerfile: Dockerfile-unique-release + args: | + --build-arg NETWORK=${{ matrix.network }} + --build-arg UNIQUE_VERSION=${{ env.NODE_BRANCH}} + --build-arg UNIQUE_HASH=${{ env.NODE_HASH}} + dockerhub_username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} + dockerhub_token: ${{ secrets.CORE_DOCKERHUB_TOKEN }} + - uses: actions/setup-node@v4.0.2 with: node-version: 20 @@ -152,7 +168,7 @@ jobs: .baedeker/node-only.jsonnet snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/polkadot':{dockerImage:'${{ steps.polkadot.outputs.image }}:${{ steps.polkadot.outputs.tag }}'}}) # nodata build uses old runtime, but new chain, thus we use mainnet image for spec generation, and then latest image for nodes. - snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/unique':{dockerImage:'${{ steps.latest.outputs.name }}'}}, extra_node_mixin={extraArgs: []}, for_chain = false) + snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/unique':{dockerImage:'${{ steps.node.outputs.name }}'}}, extra_node_mixin={extraArgs: []}, for_chain = false) snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/unique':{dockerImage:'${{ steps.mainnet.outputs.name }}'}}, extra_node_mixin={extraArgs: []}) - name: Ensure network is alive diff --git a/.github/workflows/node-only-update.yml b/.github/workflows/node-only-update.yml index e2c055460a..6bf8cc2e74 100644 --- a/.github/workflows/node-only-update.yml +++ b/.github/workflows/node-only-update.yml @@ -38,9 +38,9 @@ jobs: id: create_matrix with: matrix: | - network {opal}, mainnet_branch {${{ env.OPAL_MAINNET_BRANCH }}}, relay_branch {${{ env.UNIQUEWEST_MAINNET_BRANCH }}} - network {quartz}, mainnet_branch {${{ env.QUARTZ_MAINNET_BRANCH }}}, relay_branch {${{ env.KUSAMA_MAINNET_BRANCH }}} - network {unique}, mainnet_branch {${{ env.UNIQUE_MAINNET_BRANCH }}}, relay_branch {${{ env.POLKADOT_MAINNET_BRANCH }}} + network {opal}, relay_branch {${{ env.UNIQUEWEST_MAINNET_BRANCH }}} + network {quartz}, relay_branch {${{ env.KUSAMA_MAINNET_BRANCH }}} + network {unique}, relay_branch {${{ env.POLKADOT_MAINNET_BRANCH }}} node-only-update: @@ -101,12 +101,12 @@ jobs: id: mainnet with: container: uniquenetwork/ci-node-only-${{ matrix.network }} - tag: ${{ matrix.mainnet_branch }} + tag: ${{ matrix.network }}-${{ env.MAINNET_BRANCH }}-${{ env.MAINNET_HASH}} context: .docker dockerfile: Dockerfile-unique-release args: | --build-arg FEATURES=${{ matrix.network }}-runtime - --build-arg UNIQUE_VERSION=${{ matrix.mainnet_branch }} + --build-arg UNIQUE_VERSION=${{ env.MAINNET_BRANCH }} dockerhub_username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} dockerhub_token: ${{ secrets.CORE_DOCKERHUB_TOKEN }} @@ -123,12 +123,12 @@ jobs: dockerhub_username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} dockerhub_token: ${{ secrets.CORE_DOCKERHUB_TOKEN }} - - name: Checkout at '${{ matrix.mainnet_branch }}' branch + - name: Checkout at '${{ env.MAINNET_BRANCH }}' branch uses: actions/checkout@v4.1.7 with: #ref: ${{ github.head_ref }} - ref: ${{ matrix.mainnet_branch }} #Checking out head commit - path: ${{ matrix.mainnet_branch }} + ref: ${{ env.MAINNET_BRANCH }} #Checking out head commit + path: ${{ env.MAINNET_BRANCH }} - uses: actions/setup-node@v4.0.2 with: @@ -158,7 +158,7 @@ jobs: ephemeral:snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/unique':{dockerImage:'${{ steps.mainnet.outputs.name }}'}}, extra_node_mixin={extraArgs: []}) - name: Ensure network is alive - working-directory: ${{ matrix.mainnet_branch }}/js-packages/tests + working-directory: ${{ env.MAINNET_BRANCH }}/js-packages/tests id: alive1 if: ${{ !cancelled() && steps.bdk.outcome == 'success' }} run: | @@ -169,7 +169,7 @@ jobs: RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }} - name: Run Parallel tests before Node Parachain upgrade - working-directory: ${{ matrix.mainnet_branch }}/js-packages/tests + working-directory: ${{ env.MAINNET_BRANCH }}/js-packages/tests if: ${{ !cancelled() && steps.alive1.outcome == 'success' }} run: | echo "Ready to start tests" @@ -179,7 +179,7 @@ jobs: - name: Run Sequential tests before Node Parachain upgrade if: ${{ !cancelled() && steps.alive1.outcome == 'success' }} - working-directory: ${{ matrix.mainnet_branch }}/js-packages/tests + working-directory: ${{ env.MAINNET_BRANCH }}/js-packages/tests run: NOW=$(date +%s) && yarn testSequential --reporter mochawesome --reporter-options reportFilename=test-sequential-${NOW} env: RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }} @@ -197,7 +197,7 @@ jobs: snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/unique':{dockerImage:'${{ steps.mainnet.outputs.name }}'}}) - name: Ensure network is alive - working-directory: ${{ matrix.mainnet_branch }}/js-packages/tests + working-directory: ${{ env.MAINNET_BRANCH }}/js-packages/tests id: alive2 if: ${{ !cancelled() && steps.reconcile1.outcome == 'success' }} run: | @@ -217,7 +217,7 @@ jobs: snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/unique':{dockerImage:'${{ steps.mainnet.outputs.name }}'}}) - name: Ensure network is alive - working-directory: ${{ matrix.mainnet_branch }}/js-packages/tests + working-directory: ${{ env.MAINNET_BRANCH }}/js-packages/tests id: alive3 if: ${{ !cancelled() && steps.reconcile2.outcome == 'success' }} run: | @@ -226,7 +226,7 @@ jobs: RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }} - name: Run Parallel tests after Node Parachain upgrade - working-directory: ${{ matrix.mainnet_branch }}/js-packages/tests + working-directory: ${{ env.MAINNET_BRANCH }}/js-packages/tests if: ${{ !cancelled() && steps.alive3.outcome == 'success' }} run: | echo "Ready to start tests" @@ -236,7 +236,7 @@ jobs: - name: Run Sequential tests after Node Parachain upgrade if: ${{ !cancelled() && steps.alive3.outcome == 'success' }} - working-directory: ${{ matrix.mainnet_branch }}/js-packages/tests + working-directory: ${{ env.MAINNET_BRANCH }}/js-packages/tests run: NOW=$(date +%s) && yarn testSequential --reporter mochawesome --reporter-options reportFilename=test-sequential-${NOW} env: RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }} diff --git a/js-packages/scripts/generateEnv.ts b/js-packages/scripts/generateEnv.ts index 153b2610cc..51bc360687 100644 --- a/js-packages/scripts/generateEnv.ts +++ b/js-packages/scripts/generateEnv.ts @@ -46,18 +46,18 @@ function fixupUnique(version: string): string { // ff('wss://statemint-rpc.polkadot.io/', /^(....)$/, 'release-parachains-v$1').then(v => env = setVar(env, 'STATEMINT_BUILD_BRANCH', v)), ff('wss://acala-rpc-0.aca-api.network/', /^(.)(..)(.)$/, '$1.$2.$3').then(v => env = setVar(env, 'ACALA_BUILD_BRANCH', v)), ff('wss://wss.api.moonbeam.network/', /^(....)$/, 'runtime-$1').then(v => env = setVar(env, 'MOONBEAM_BUILD_BRANCH', v)), - ff('wss://ws.unique.network/', /^(........)$/, 'release-v$1').then(v => env = setVar(env, 'UNIQUE_MAINNET_BRANCH', fixupUnique(v))), + ff('wss://ws.unique.network/', /^(........)$/, 'release-v$1').then(v => env = setVar(env, 'MAINNET_BRANCH', fixupUnique(v))), // ff('wss://kusama-rpc.polkadot.io/', /^(.)(...)(...)$/, 'v$1.$2.$3').then(v => env = setVar(env, 'KUSAMA_MAINNET_BRANCH', v)), ff('wss://rococo-rpc.polkadot.io/', /^(.)(...)(...)$/, 'v$1.$2.$3').then(v => env = setVar(env, 'KUSAMA_MAINNET_BRANCH', v)), // ff('wss://statemine-rpc.polkadot.io/', /^(....)$/, 'release-parachains-v$1').then(v => env = setVar(env, 'STATEMINE_BUILD_BRANCH', v)), ff('wss://karura-rpc-0.aca-api.network/', /^(.)(..)(.)$/, 'release-karura-$1.$2.$3').then(v => env = setVar(env, 'KARURA_BUILD_BRANCH', v)), ff('wss://wss.api.moonriver.moonbeam.network/', /^(....)$/, 'runtime-$1').then(v => env = setVar(env, 'MOONRIVER_BUILD_BRANCH', v)), - ff('wss://ws-quartz.unique.network/', /^(........)$/, 'release-v$1').then(v => env = setVar(env, 'QUARTZ_MAINNET_BRANCH', fixupUnique(v))), + ff('wss://ws-quartz.unique.network/', /^(........)$/, 'release-v$1').then(v => env = setVar(env, 'MAINNET_BRANCH', fixupUnique(v))), ff('wss://eu-ws-westend.unique.network/', /^(.)(..)(.)$/, 'release-v$1.$2.$3').then(v => env = setVar(env, 'UNIQUEWEST_MAINNET_BRANCH', v)), ff('wss://westmint-rpc.polkadot.io/', /^(.......)$/, 'bad-branch-v$1').then(v => env = setVar(env, 'WESTMINT_BUILD_BRANCH', v)), - ff('wss://ws-opal.unique.network/', /^(........)$/, 'release-v$1').then(v => env = setVar(env, 'OPAL_MAINNET_BRANCH', fixupUnique(v))), + ff('wss://ws-opal.unique.network/', /^(........)$/, 'release-v$1').then(v => env = setVar(env, 'MAINNET_BRANCH', fixupUnique(v))), ff('wss://rpc.astar.network/', /^(.+)$/, (_, r) => { switch (r) {