diff --git a/.baedeker/collator-selection.jsonnet b/.baedeker/collator-selection.jsonnet index 4f41662da5..9fa845b7ab 100644 --- a/.baedeker/collator-selection.jsonnet +++ b/.baedeker/collator-selection.jsonnet @@ -2,18 +2,21 @@ local m = import 'baedeker-library/mixin/spec.libsonnet', ; +function(relay_spec) + local relay = { name: 'relay', bin: 'bin/polkadot', validatorIdAssignment: 'staking', spec: {Genesis:{ - chain: 'rococo-local', + chain: relay_spec, modify:: m.genericRelay($), }}, nodes: { [name]: { bin: $.bin, wantedKeys: 'relay', + expectedDataPath: '/parity', }, for name in ['alice', 'bob', 'charlie', 'dave', 'eve'] }, diff --git a/.baedeker/forkless-data.jsonnet b/.baedeker/forkless-data.jsonnet index 68059e5c81..38b6b9c8fb 100644 --- a/.baedeker/forkless-data.jsonnet +++ b/.baedeker/forkless-data.jsonnet @@ -17,6 +17,7 @@ local relay = { [name]: { bin: $.bin, wantedKeys: 'relay', + expectedDataPath: '/parity', }, for name in ['alice', 'bob', 'charlie', 'dave', 'eve'] }, diff --git a/.baedeker/node-only.jsonnet b/.baedeker/node-only.jsonnet index dce3a85cd3..9c816d4b9e 100644 --- a/.baedeker/node-only.jsonnet +++ b/.baedeker/node-only.jsonnet @@ -2,18 +2,21 @@ local m = import 'baedeker-library/mixin/spec.libsonnet', ; +function(relay_spec) + local relay = { name: 'relay', bin: 'bin/polkadot', validatorIdAssignment: 'staking', spec: {Genesis:{ - chain: 'rococo-local', + chain: relay_spec, modify:: m.genericRelay($), }}, nodes: { [name]: { bin: $.bin, wantedKeys: 'relay', + expectedDataPath: '/parity', }, for name in ['alice', 'bob', 'charlie', 'dave', 'eve'] }, diff --git a/.baedeker/xcm-opal-async-backing.jsonnet b/.baedeker/xcm-opal-async-backing.jsonnet index 3887267a3a..4a6b3c1d70 100644 --- a/.baedeker/xcm-opal-async-backing.jsonnet +++ b/.baedeker/xcm-opal-async-backing.jsonnet @@ -39,13 +39,14 @@ local relay = { [name]: { bin: $.bin, wantedKeys: 'relay', + expectedDataPath: '/parity', }, for name in ['alice', 'bob', 'charlie', 'dave', 'eve'] }, }; -local opal = { - name: 'opal', +local unique = { + name: 'unique', bin: 'bin/unique', paraId: 1001, spec: {Genesis:{ @@ -66,6 +67,6 @@ local opal = { relay + { parachains: { [para.name]: para, - for para in [opal] + for para in [unique] }, } diff --git a/.baedeker/xcm-opal.jsonnet b/.baedeker/xcm-opal.jsonnet index 2d5be2992a..994e615ea7 100644 --- a/.baedeker/xcm-opal.jsonnet +++ b/.baedeker/xcm-opal.jsonnet @@ -19,13 +19,14 @@ local relay = { [name]: { bin: $.bin, wantedKeys: 'relay', + expectedDataPath: '/parity', }, for name in ['alice', 'bob', 'charlie', 'dave', 'eve'] }, }; -local opal = { - name: 'opal', +local unique = { + name: 'unique', bin: 'bin/unique', paraId: 1001, spec: {Genesis:{ @@ -45,7 +46,7 @@ local opal = { local westmint = { name: 'westmint', - bin: 'bin/cumulus', + bin: 'bin/assethub', paraId: 1002, spec: {Genesis:{ chain: 'westmint-local', @@ -55,6 +56,7 @@ local westmint = { [name]: { bin: $.bin, wantedKeys: 'para', + expectedDataPath: '/parity', }, for name in ['alice', 'bob'] }, @@ -63,6 +65,6 @@ local westmint = { relay + { parachains: { [para.name]: para, - for para in [opal, westmint] + for para in [unique, westmint] }, } diff --git a/.baedeker/xcm-quartz.jsonnet b/.baedeker/xcm-quartz.jsonnet index 173c6c4c31..9e396743dd 100644 --- a/.baedeker/xcm-quartz.jsonnet +++ b/.baedeker/xcm-quartz.jsonnet @@ -24,13 +24,14 @@ local relay = { [name]: { bin: $.bin, wantedKeys: 'relay', + expectedDataPath: '/parity', }, for name in ['alice', 'bob', 'charlie', 'dave', 'eve', 'ferdie'] }, }; -local quartz = { - name: 'quartz', +local unique = { + name: 'unique', bin: 'bin/unique', paraId: 1001, spec: {Genesis:{ @@ -89,7 +90,7 @@ local moonriver = { local statemine = { name: 'statemine', - bin: 'bin/cumulus', + bin: 'bin/assethub', paraId: 1004, spec: {Genesis:{ chain: 'statemine-local', @@ -99,6 +100,7 @@ local statemine = { [name]: { bin: $.bin, wantedKeys: 'para', + expectedDataPath: '/parity', }, for name in ['alice', 'bob'] }, @@ -124,6 +126,6 @@ local shiden = { relay + { parachains: { [para.name]: para, - for para in [quartz, karura, moonriver, statemine, shiden] + for para in [unique, karura, moonriver, statemine, shiden] }, } diff --git a/.baedeker/xcm-unique.jsonnet b/.baedeker/xcm-unique.jsonnet index 603bbd7724..865de8a5c4 100644 --- a/.baedeker/xcm-unique.jsonnet +++ b/.baedeker/xcm-unique.jsonnet @@ -25,6 +25,7 @@ local relay = { [name]: { bin: $.bin, wantedKeys: 'relay', + expectedDataPath: '/parity', }, for name in ['alice', 'bob', 'charlie', 'dave', 'eve', 'ferdie', 'gregory', 'holly'] }, @@ -90,7 +91,7 @@ local moonbeam = { local statemint = { name: 'statemint', - bin: 'bin/cumulus', + bin: 'bin/assethub', paraId: 1004, spec: {Genesis:{ chain: 'statemint-local', @@ -100,6 +101,7 @@ local statemint = { [name]: { bin: $.bin, wantedKeys: 'para-ed', + expectedDataPath: '/parity', }, for name in ['alice', 'bob'] }, diff --git a/.docker/Dockerfile-chain-dev b/.docker/Dockerfile-chain-dev index a3002c56bc..19ed4ffb04 100644 --- a/.docker/Dockerfile-chain-dev +++ b/.docker/Dockerfile-chain-dev @@ -1,6 +1,5 @@ FROM uniquenetwork/services:latest -ARG RUST_TOOLCHAIN ARG NETWORK ENV DEBIAN_FRONTEND=noninteractive @@ -9,14 +8,6 @@ ENV NETWORK=$NETWORK ENV CARGO_HOME="/cargo-home" ENV PATH="/cargo-home/bin:$PATH" -RUN echo "$NETWORK\n" && echo "$RUST_TOOLCHAIN\n" - -RUN rustup toolchain uninstall $(rustup toolchain list) && \ - rustup toolchain install $RUST_TOOLCHAIN && \ - rustup default $RUST_TOOLCHAIN && \ - rustup component add --toolchain $RUST_TOOLCHAIN rust-src && \ - rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN - RUN mkdir /dev_chain COPY . /dev_chain diff --git a/.docker/Dockerfile-chain-dev-unit b/.docker/Dockerfile-chain-dev-unit index fbe8f36ad7..12856428e8 100644 --- a/.docker/Dockerfile-chain-dev-unit +++ b/.docker/Dockerfile-chain-dev-unit @@ -4,15 +4,8 @@ ENV DEBIAN_FRONTEND=noninteractive ENV CARGO_HOME="/cargo-home" ENV PATH="/cargo-home/bin:$PATH" -ARG RUST_TOOLCHAIN ARG NETWORK -RUN rustup toolchain uninstall $(rustup toolchain list) && \ - rustup toolchain install $RUST_TOOLCHAIN && \ - rustup default $RUST_TOOLCHAIN && \ - rustup component add --toolchain $RUST_TOOLCHAIN rust-src && \ - rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN - RUN mkdir /dev_chain COPY . /dev_chain diff --git a/.docker/Dockerfile-collators.j2 b/.docker/Dockerfile-collators.j2 deleted file mode 100644 index cd12c5c0cc..0000000000 --- a/.docker/Dockerfile-collators.j2 +++ /dev/null @@ -1,64 +0,0 @@ -FROM uniquenetwork/builder-polkadot:{{ POLKADOT_BUILD_BRANCH }} as polkadot - -# ===== Rust builder ===== -FROM uniquenetwork/services:latest as rust-builder - -ENV CARGO_HOME="/cargo-home" -ENV PATH="/cargo-home/bin:$PATH" -ENV TZ=UTC -RUN rustup toolchain uninstall $(rustup toolchain list) && \ - rustup toolchain install {{ RUST_TOOLCHAIN }} && \ - rustup default {{ RUST_TOOLCHAIN }} && \ - rustup component add --toolchain {{ RUST_TOOLCHAIN }} rust-src && \ - rustup target list --installed && \ - rustup show -RUN rustup target add wasm32-unknown-unknown --toolchain {{ RUST_TOOLCHAIN }} - -RUN mkdir /unique_parachain -WORKDIR /unique_parachain - -# ===== BUILD ====== -FROM rust-builder as builder-unique - -WORKDIR /unique_parachain - -ARG PROFILE=release - -RUN git clone https://github.com/UniqueNetwork/unique-chain.git -b {{ BRANCH }} . && \ - cargo build --features={{ NETWORK }}-runtime --$PROFILE - -# ===== RUN ====== - -FROM ubuntu:22.04 - -RUN apt-get -y update && \ - apt-get -y install curl git && \ - curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \ - export NVM_DIR="$HOME/.nvm" && \ - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ - nvm install v16.16.0 && \ - nvm use v16.16.0 - -RUN git clone https://github.com/uniquenetwork/polkadot-launch -b {{ POLKADOT_LAUNCH_BRANCH }} - -RUN export NVM_DIR="$HOME/.nvm" && \ - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ - cd /polkadot-launch && \ - npm install --global yarn && \ - yarn install - -COPY --from=builder-unique /unique_parachain/target/release/unique-collator /unique-chain/target/release/ -COPY --from=builder-unique /unique_parachain/launch-config.json /polkadot-launch/launch-config.json - -COPY --from=polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ - -EXPOSE 9844 -EXPOSE 9944 -EXPOSE 9833 -EXPOSE 40333 -EXPOSE 30333 - -CMD export NVM_DIR="$HOME/.nvm" && \ - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ - cd /polkadot-launch && \ - yarn start launch-config.json diff --git a/.docker/Dockerfile-polkadot.j2 b/.docker/Dockerfile-hydradx similarity index 50% rename from .docker/Dockerfile-polkadot.j2 rename to .docker/Dockerfile-hydradx index d268f5ef2c..e92c99b466 100644 --- a/.docker/Dockerfile-polkadot.j2 +++ b/.docker/Dockerfile-hydradx @@ -2,6 +2,7 @@ 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 @@ -14,33 +15,36 @@ RUN apt-get update && \ 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 && \ +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 POLKADOT ===== -FROM rust-builder as builder-polkadot-bin +# ===== BUILD BIN ===== +FROM rust-builder as builder-hydradx-bin + +ARG HYDRADX_BUILD_BRANCH WORKDIR /unique_parachain -RUN git clone -b {{ POLKADOT_BUILD_BRANCH }} --depth 1 https://github.com/paritytech/polkadot.git +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/polkadot/target \ - cd polkadot && \ + --mount=type=cache,target=/unique_parachain/parachain/target \ + cd HydraDX-node && \ CARGO_INCREMENTAL=0 cargo build --release --locked && \ - mv ./target/release/polkadot /unique_parachain/polkadot/ + mkdir /unique_parachain/Hydradx && \ + mv ./target/release/hydradx /unique_parachain/Hydradx/hydradx # ===== BIN ====== -FROM ubuntu:22.04 as builder-polkadot +FROM ubuntu:22.04 as builder-hydradx -COPY --from=builder-polkadot-bin /unique_parachain/polkadot/polkadot /bin/polkadot -ENTRYPOINT ["/bin/polkadot"] +COPY --from=builder-hydradx-bin /unique_parachain/Hydradx/hydradx /bin/hydradx +ENTRYPOINT ["/bin/hydradx"] diff --git a/.docker/Dockerfile-testnet.j2 b/.docker/Dockerfile-testnet.j2 deleted file mode 100644 index 2abb57ab0a..0000000000 --- a/.docker/Dockerfile-testnet.j2 +++ /dev/null @@ -1,66 +0,0 @@ -# ===== Rust builder ===== -FROM uniquenetwork/services:latest as rust-builder -ARG RUST_TOOLCHAIN= - -ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN -ENV CARGO_HOME="/cargo-home" -ENV PATH="/cargo-home/bin:$PATH" -ENV TZ=UTC - -RUN rustup toolchain uninstall $(rustup toolchain list) && \ - rustup toolchain install {{ RUST_TOOLCHAIN }} && \ - rustup default {{ RUST_TOOLCHAIN }} && \ - rustup component add --toolchain {{ RUST_TOOLCHAIN }} rust-src && \ - rustup target list --installed && \ - rustup show -RUN rustup target add wasm32-unknown-unknown --toolchain {{ RUST_TOOLCHAIN }} - -RUN mkdir /unique_parachain -WORKDIR /unique_parachain - -# ===== BUILD ====== -FROM rust-builder as builder-unique - -ARG PROFILE=release - -WORKDIR /unique_parachain - -RUN git clone -b {{ BRANCH }} https://github.com/UniqueNetwork/unique-chain.git && \ - cd unique-chain && \ - cargo build --features={{ NETWORK }}-runtime --$PROFILE - -# ===== RUN ====== - -FROM ubuntu:22.04 - -RUN apt-get -y update && \ - apt-get -y install curl git && \ - curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \ - export NVM_DIR="$HOME/.nvm" && \ - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ - nvm install v16.16.0 && \ - nvm use v16.16.0 - -RUN git clone https://github.com/uniquenetwork/polkadot-launch -b {{ POLKADOT_LAUNCH_BRANCH }} - -RUN export NVM_DIR="$HOME/.nvm" && \ - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ - cd /polkadot-launch && \ - npm install --global yarn && \ - yarn install - -COPY --from=builder-unique /unique_parachain/unique-chain/.docker/testnet-config/launch-config.json /polkadot-launch/launch-config.json -COPY --from=builder-unique /unique_parachain/unique-chain/target/release/unique-collator /unique-chain/target/release/ - -COPY --from=uniquenetwork/builder-polkadot:{{ POLKADOT_BUILD_BRANCH }} /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ - -EXPOSE 9844 -EXPOSE 9944 -EXPOSE 9833 -EXPOSE 40333 -EXPOSE 30333 - -CMD export NVM_DIR="$HOME/.nvm" && \ - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ - cd /polkadot-launch && \ - yarn start launch-config.json diff --git a/.docker/Dockerfile-try-runtime.j2 b/.docker/Dockerfile-try-runtime.j2 index 8a43fe527c..3eda406897 100644 --- a/.docker/Dockerfile-try-runtime.j2 +++ b/.docker/Dockerfile-try-runtime.j2 @@ -1,18 +1,18 @@ # ===== Rust builder ===== -FROM uniquenetwork/services:latest as rust-builder +FROM ubuntu:22.04 as rust-builder +LABEL maintainer="Unique.Network" -ENV RUST_TOOLCHAIN $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 rustup toolchain uninstall $(rustup toolchain list) && \ - rustup toolchain install {{ RUST_TOOLCHAIN }} && \ - rustup default {{ RUST_TOOLCHAIN }} && \ - rustup target list --installed && \ - rustup component add --toolchain {{ RUST_TOOLCHAIN }} rust-src && \ - rustup show -RUN rustup target add wasm32-unknown-unknown --toolchain {{ RUST_TOOLCHAIN }} +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 mkdir /unique_parachain WORKDIR /unique_parachain @@ -30,4 +30,4 @@ RUN echo "Requested features: {{ NETWORK }}-runtime\n" && \ echo "Fork from: {{ REPLICA_FROM }}\n" && \ cargo build --features=try-runtime,{{ NETWORK }}-runtime --release -CMD cargo run --release --features {{ NETWORK }}-runtime,try-runtime -- try-runtime --runtime target/release/wbuild/{{ WASM_NAME }}-runtime/{{ WASM_NAME }}_runtime.compact.compressed.wasm -lruntime=debug -ltry-runtime::cli=debug on-runtime-upgrade --checks live --uri {{ REPLICA_FROM }} +CMD cargo run --release --features {{ NETWORK }}-runtime,try-runtime -- try-runtime --runtime target/release/wbuild/{{ NETWORK }}-runtime/{{ NETWORK }}_runtime.compact.compressed.wasm -lruntime=debug -ltry-runtime::cli=debug on-runtime-upgrade --checks live --uri {{ REPLICA_FROM }} diff --git a/.docker/Dockerfile-unique b/.docker/Dockerfile-unique index fb1aec06b2..301a243acb 100644 --- a/.docker/Dockerfile-unique +++ b/.docker/Dockerfile-unique @@ -14,15 +14,6 @@ RUN apt-get update && \ RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none -ARG RUST_TOOLCHAIN -RUN echo "Using Rust '$RUST_TOOLCHAIN'" && \ - 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 @@ -33,7 +24,7 @@ WORKDIR /unique_parachain COPY . unique-chain/ -ARG RUNTIME_FEATURES +ARG FEATURES # registry for Updating registry. It is safe to cache it, because it only contains references to the dependency files, # and the caches for the files themselves are set in Cargo.lock, which won't be updated because of --locked flag # git for Updating git repository. It is safe to cache it, because git dependencies are cached by revision, @@ -47,8 +38,8 @@ RUN --mount=type=cache,target=/cargo-home/registry \ --mount=type=cache,target=/cargo-home/git \ --mount=type=cache,target=/unique_parachain/unique-chain/target \ cd unique-chain && \ - echo "Using runtime features '$RUNTIME_FEATURES'" && \ - CARGO_INCREMENTAL=0 cargo build --profile integration-tests --features=fast-inflation,"$RUNTIME_FEATURES" --locked && \ + echo "Using runtime features ${FEATURES}" && \ + CARGO_INCREMENTAL=0 cargo build --profile integration-tests --features=fast-inflation,"${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/{}"' \; diff --git a/.docker/Dockerfile-unique-release b/.docker/Dockerfile-unique-release index 06ae0d040b..3c1f0462fc 100644 --- a/.docker/Dockerfile-unique-release +++ b/.docker/Dockerfile-unique-release @@ -14,15 +14,6 @@ RUN apt-get update && \ RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none -ARG RUST_TOOLCHAIN -RUN echo "Using Rust '$RUST_TOOLCHAIN'" && \ - 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 @@ -34,12 +25,12 @@ WORKDIR /unique_parachain ARG UNIQUE_VERSION RUN git clone -b "$UNIQUE_VERSION" --depth 1 https://github.com/uniquenetwork/unique-chain.git -ARG RUNTIME_FEATURES +ARG FEATURES RUN --mount=type=cache,target=/cargo-home/registry \ --mount=type=cache,target=/cargo-home/git \ --mount=type=cache,target=/unique_parachain/polkadot/target \ cd unique-chain && \ - CARGO_INCREMENTAL=0 cargo build --release --features="$RUNTIME_FEATURES" --locked && \ + CARGO_INCREMENTAL=0 cargo build --release --features="${FEATURES}" --locked && \ mv ./target/release/unique-collator /unique_parachain/unique-chain/ # ===== BIN ====== diff --git a/.docker/docker-compose.collators.j2 b/.docker/docker-compose.collators.j2 deleted file mode 100644 index ad7bb4d290..0000000000 --- a/.docker/docker-compose.collators.j2 +++ /dev/null @@ -1,10 +0,0 @@ -version: "3.5" - -services: - forkless-data: - image: uniquenetwork/ci-collator-selection-local:{{ NETWORK }}-{{ BUILD_TAG }} - container_name: collator-selection-{{ NETWORK }} - expose: - - 9944 - ports: - - 127.0.0.1:9944:9944 diff --git a/.docker/docker-compose.forkless-data.j2 b/.docker/docker-compose.forkless-data.j2 deleted file mode 100644 index 4ab0e70ba9..0000000000 --- a/.docker/docker-compose.forkless-data.j2 +++ /dev/null @@ -1,24 +0,0 @@ -version: "3.5" - -services: - forkless-data: - image: uniquenetwork/ci-forkless-data-local:{{ NETWORK }}-{{ BUILD_TAG }} - container_name: forkless-data-{{ NETWORK }} - expose: - - 9944 - - 33044 - - 33055 - - 33066 - - 33077 - - 33088 - - 33144 - - 33155 - ports: - - 127.0.0.1:9944:9944 - - 127.0.0.1:33044:33044 - - 127.0.0.1:33055:33055 - - 127.0.0.1:33066:33066 - - 127.0.0.1:33077:33077 - - 127.0.0.1:33088:33088 - - 127.0.0.1:33144:33144 - - 127.0.0.1:33155:33155 diff --git a/.docker/docker-compose.forkless-nodata.j2 b/.docker/docker-compose.forkless-nodata.j2 deleted file mode 100644 index 34975d4f83..0000000000 --- a/.docker/docker-compose.forkless-nodata.j2 +++ /dev/null @@ -1,10 +0,0 @@ -version: "3.5" - -services: - forkless-nodata: - image: uniquenetwork/ci-forkless-nodata-local:{{ NETWORK }}-{{ BUILD_TAG }} - container_name: forkless-nodata - expose: - - 9944 - ports: - - 127.0.0.1:9944:9944 diff --git a/.docker/docker-compose.gov.j2 b/.docker/docker-compose.gov.j2 index b411da8672..f86ae261f2 100644 --- a/.docker/docker-compose.gov.j2 +++ b/.docker/docker-compose.gov.j2 @@ -4,9 +4,7 @@ services: node-dev: build: args: - - "RUST_TOOLCHAIN={{ RUST_TOOLCHAIN }}" - "NETWORK={{ NETWORK }}" - - "WASM_NAME={{ WASM_NAME }}" context: ../ dockerfile: .docker/Dockerfile-chain-dev image: node-dev diff --git a/.docker/docker-compose.tmp-dev.j2 b/.docker/docker-compose.tmp-dev.j2 index bfac7fa28a..94af4d3f6a 100644 --- a/.docker/docker-compose.tmp-dev.j2 +++ b/.docker/docker-compose.tmp-dev.j2 @@ -4,7 +4,6 @@ services: node-dev: build: args: - - "RUST_TOOLCHAIN={{ RUST_TOOLCHAIN }}" - "NETWORK={{ NETWORK }}" context: ../ dockerfile: .docker/Dockerfile-chain-dev diff --git a/.docker/docker-compose.tmp-node.j2 b/.docker/docker-compose.tmp-node.j2 deleted file mode 100644 index e5e9d6b4a4..0000000000 --- a/.docker/docker-compose.tmp-node.j2 +++ /dev/null @@ -1,36 +0,0 @@ -version: "3.5" - -services: - node-parachain: - build: - args: - - "RUST_TOOLCHAIN={{ RUST_TOOLCHAIN }}" - - "BRANCH={{ BRANCH }}" - - "REPO_URL={{ REPO_URL }}" - - "NETWORK={{ NETWORK }}" - - "POLKADOT_BUILD_BRANCH={{ POLKADOT_BUILD_BRANCH }}" - - "POLKADOT_LAUNCH_BRANCH={{ POLKADOT_LAUNCH_BRANCH }}" - - "MAINNET_TAG={{ MAINNET_TAG }}" - - "MAINNET_BRANCH={{ MAINNET_BRANCH }}" - - "WASM_NAME={{ WASM_NAME }}" - context: ../ - dockerfile: .docker/Dockerfile-parachain-node-only - image: node-parachain - container_name: node-parachain - volumes: - - type: bind - source: ./launch-config-forkless-nodata.json - target: /polkadot-launch/launch-config.json - read_only: true - expose: - - 9944 - - 9945 - - 9844 - ports: - - 127.0.0.1:9944:9944 - - 127.0.0.1:9945:9945 - - 127.0.0.1:9844:9844 - logging: - options: - max-size: "1m" - max-file: "3" diff --git a/.docker/docker-compose.tmp-unit.j2 b/.docker/docker-compose.tmp-unit.j2 index 831ddffb5e..eb9376d7fc 100644 --- a/.docker/docker-compose.tmp-unit.j2 +++ b/.docker/docker-compose.tmp-unit.j2 @@ -6,7 +6,6 @@ services: context: ../ dockerfile: .docker/Dockerfile-chain-dev-unit args: - - "RUST_TOOLCHAIN={{ RUST_TOOLCHAIN }}" - "NETWORK={{ NETWORK }}" image: node-dev container_name: node-dev diff --git a/.docker/forkless-config/launch-config-forkless-nodata.j2 b/.docker/forkless-config/launch-config-forkless-nodata.j2 deleted file mode 100644 index d170cb22e1..0000000000 --- a/.docker/forkless-config/launch-config-forkless-nodata.j2 +++ /dev/null @@ -1,128 +0,0 @@ -{ - "relaychain": { - "bin": "/polkadot/target/release/polkadot", - "upgradeBin": "/polkadot/target/release/polkadot", - "upgradeWasm": "/polkadot/target/release/wbuild/{{ RELAY_CHAIN_TYPE }}-runtime/{{ RELAY_CHAIN_TYPE }}_runtime.compact.compressed.wasm", - "chain": "{{ RELAY_CHAIN_TYPE }}-local", - "nodes": [ - { - "name": "alice", - "rpcPort": 9844, - "port": 30444, - "flags": [ - "-lparachain::candidate_validation=debug", - "-lxcm=trace", - "--rpc-cors=all", - "--unsafe-rpc-external", - "--unsafe-ws-external" - ] - }, - { - "name": "bob", - "rpcPort": 9855, - "port": 30555, - "flags": [ - "-lparachain::candidate_validation=debug", - "-lxcm=trace", - "--rpc-cors=all", - "--unsafe-rpc-external", - "--unsafe-ws-external" - ] - }, - { - "name": "charlie", - "rpcPort": 9866, - "port": 30666, - "flags": [ - "-lparachain::candidate_validation=debug", - "-lxcm=trace", - "--rpc-cors=all", - "--unsafe-rpc-external", - "--unsafe-ws-external" - ] - }, - { - "name": "dave", - "rpcPort": 9877, - "port": 30777, - "flags": [ - "-lparachain::candidate_validation=debug", - "-lxcm=trace", - "--rpc-cors=all", - "--unsafe-rpc-external", - "--unsafe-ws-external" - ] - }, - { - "name": "eve", - "rpcPort": 9888, - "port": 30888, - "flags": [ - "-lparachain::candidate_validation=debug", - "-lxcm=trace", - "--rpc-cors=all", - "--unsafe-rpc-external", - "--unsafe-ws-external" - ] - } - ], - "genesis": { - "runtime": { - "runtime_genesis_config": { - "parachainsConfiguration": { - "config": { - "validation_upgrade_frequency": 1, - "validation_upgrade_delay": 1 - } - } - } - } - } - }, - "parachains": [ - { - "bin": "/unique-chain/current/release/unique-collator", - "upgradeBin": "/unique-chain/target/release/unique-collator", - "upgradeWasm": "/unique-chain/target/release/wbuild/{{ WASM_NAME }}-runtime/{{ WASM_NAME }}_runtime.compact.compressed.wasm", - "id": "1000", - "balance": "1000000000000000000000000", - "nodes": [ - { - "port": 31200, - "rpcPort": 9944, - "name": "alice", - "flags": [ - "--rpc-cors=all", - "--unsafe-rpc-external", - "--unsafe-ws-external", - "-lxcm=trace,parity_ws::handler=debug,jsonrpsee_core=trace,jsonrpsee-core=trace,jsonrpsee_ws_server=debug", - "--ws-max-connections=1000", - "--", - "--port=31335", - "--ws-port=9745", - "--rpc-port=9734" - ] - }, - { - "port": 31201, - "rpcPort": 9945, - "name": "bob", - "flags": [ - "--rpc-cors=all", - "--unsafe-rpc-external", - "--unsafe-ws-external", - "-lxcm=trace,parity_ws::handler=debug,jsonrpsee_core=trace,jsonrpsee-core=trace,jsonrpsee_ws_server=debug", - "--ws-max-connections=1000", - "--", - "--port=31337", - "--ws-port=9747", - "--rpc-port=9737" - ] - } - ] - } - ], - "simpleParachains": [], - "hrmpChannels": [], - "finalization": false -} diff --git a/.docker/testnet-config/launch-config.json b/.docker/testnet-config/launch-config.json deleted file mode 100644 index 01d230cbb6..0000000000 --- a/.docker/testnet-config/launch-config.json +++ /dev/null @@ -1,147 +0,0 @@ -{ - "relaychain": { - "bin": "/polkadot/target/release/polkadot", - "chain": "rococo-local", - "nodes": [ - { - "name": "alice", - "rpcPort": 9844, - "port": 30444, - "flags": [ - "-lparachain::candidate_validation=debug", - "-lxcm=trace", - "--rpc-cors=all", - "--unsafe-rpc-external", - "--unsafe-ws-external" - ] - }, - { - "name": "bob", - "rpcPort": 9855, - "port": 30555, - "flags": [ - "-lparachain::candidate_validation=debug", - "-lxcm=trace", - "--rpc-cors=all", - "--unsafe-rpc-external", - "--unsafe-ws-external" - ] - }, - { - "name": "charlie", - "rpcPort": 9866, - "port": 30666, - "flags": [ - "-lparachain::candidate_validation=debug", - "-lxcm=trace", - "--rpc-cors=all", - "--unsafe-rpc-external", - "--unsafe-ws-external" - ] - }, - { - "name": "dave", - "rpcPort": 9877, - "port": 30777, - "flags": [ - "-lparachain::candidate_validation=debug", - "-lxcm=trace", - "--rpc-cors=all", - "--unsafe-rpc-external", - "--unsafe-ws-external" - ] - }, - { - "name": "eve", - "rpcPort": 9888, - "port": 30888, - "flags": [ - "-lparachain::candidate_validation=debug", - "-lxcm=trace", - "--rpc-cors=all", - "--unsafe-rpc-external", - "--unsafe-ws-external" - ] - } - ], - "genesis": { - "runtime": { - "runtime_genesis_config": { - "parachainsConfiguration": { - "config": { - "validation_upgrade_frequency": 1, - "validation_upgrade_delay": 1 - } - } - } - } - } - }, - "parachains": [ - { - "bin": "/unique-chain/target/release/unique-collator", - "id": "1000", - "balance": "1000000000000000000000000", - "nodes": [ - { - "port": 31200, - "rpcPort": 9944, - "name": "alice", - "flags": [ - "--rpc-cors=all", - "--unsafe-rpc-external", - "--unsafe-ws-external", - "-lxcm=trace" - ] - }, - { - "port": 31201, - "rpcPort": 9945, - "name": "bob", - "flags": [ - "--rpc-cors=all", - "--unsafe-rpc-external", - "--unsafe-ws-external", - "-lxcm=trace" - ] - }, - { - "port": 31202, - "rpcPort": 9946, - "name": "charlie", - "flags": [ - "--rpc-cors=all", - "--unsafe-rpc-external", - "--unsafe-ws-external", - "-lxcm=trace" - ] - }, - { - "port": 31203, - "rpcPort": 9947, - "name": "dave", - "flags": [ - "--rpc-cors=all", - "--unsafe-rpc-external", - "--unsafe-ws-external", - "-lxcm=trace" - ] - }, - { - "port": 31204, - "rpcPort": 9948, - "name": "eve", - "flags": [ - "--rpc-cors=all", - "--unsafe-rpc-external", - "--unsafe-ws-external", - "-lxcm=trace" - ] - } - ] - } - ], - "simpleParachains": [], - "hrmpChannels": [], - "finalization": false -} diff --git a/.env b/.env index 7025420769..fe5f68bc8d 100644 --- a/.env +++ b/.env @@ -1,25 +1,26 @@ RUST_TOOLCHAIN=nightly-2024-04-10 -POLKADOT_LAUNCH_BRANCH=unique-network -RELAY_CHAIN_TYPE=westend +RELAY_CHAIN_TYPE=rococo -POLKADOT_MAINNET_BRANCH=v1.2.4 +POLKADOT_MAINNET_BRANCH=v1.9.0 +STATEMINT_BUILD_BRANCH=1.9.0 ACALA_BUILD_BRANCH=2.25.0 MOONBEAM_BUILD_BRANCH=runtime-2901 ASTAR_BUILD_BRANCH=v5.39.1 -UNIQUE_MAINNET_BRANCH=release-v10030071 +HYDRADX_BUILD_BRANCH=v27.0.0 +POLKADEX_BUILD_BRANCH=v6.0.0 +UNIQUE_MAINNET_BRANCH=release-v10030070 UNIQUE_REPLICA_FROM=wss://ws.unique.network:443 -POLKADEX_BUILD_BRANCH=v1.1.0 -HYDRADX_BUILD_BRANCH=v20.1.1 -KUSAMA_MAINNET_BRANCH=v1.2.5 -KARURA_BUILD_BRANCH=release-karura-2.25.0 +KUSAMA_MAINNET_BRANCH=v1.9.0 +STATEMINE_BUILD_BRANCH=1.9.0 +KARURA_BUILD_BRANCH=2.25.0 MOONRIVER_BUILD_BRANCH=runtime-2901 SHIDEN_BUILD_BRANCH=v5.39.1 -QUARTZ_MAINNET_BRANCH=release-v10030071 +QUARTZ_MAINNET_BRANCH=release-v10030070 QUARTZ_REPLICA_FROM=wss://ws-quartz.unique.network:443 -UNIQUEWEST_MAINNET_BRANCH=release-v0.9.43 -WESTMINT_BUILD_BRANCH=bad-branch-v1011001 -OPAL_MAINNET_BRANCH=release-v10030071 +UNIQUEWEST_MAINNET_BRANCH=v1.9.0 +WESTMINT_BUILD_BRANCH=1.9.0 +OPAL_MAINNET_BRANCH=release-v10030070 OPAL_REPLICA_FROM=wss://ws-opal.unique.network:443 diff --git a/.github/actions/prepare/action.yml b/.github/actions/prepare/action.yml index 6c4e817950..f2efbfcaaa 100644 --- a/.github/actions/prepare/action.yml +++ b/.github/actions/prepare/action.yml @@ -15,7 +15,7 @@ runs: run: | echo "LAST_COMMIT_SHA=${GITHUB_SHA}" >> ${GITHUB_ENV} - name: Run find-and-replace to remove slashes from branch name - uses: mad9000/actions-find-and-replace-string@4 + uses: mad9000/actions-find-and-replace-string@5 id: ref_slug with: source: ${{ github.head_ref }} diff --git a/.github/workflows/canary.yml b/.github/workflows/canary.yml deleted file mode 100644 index 69968a70f2..0000000000 --- a/.github/workflows/canary.yml +++ /dev/null @@ -1,12 +0,0 @@ -on: - workflow_call: - -jobs: - - market-e2e-test: - name: market e2e tests - uses: ./.github/workflows/market-test.yml - secrets: inherit - - - diff --git a/.github/workflows/ci-develop.yml b/.github/workflows/ci-develop.yml index e9f200efe0..21b86b779a 100644 --- a/.github/workflows/ci-develop.yml +++ b/.github/workflows/ci-develop.yml @@ -26,11 +26,6 @@ jobs: uses: ./.github/workflows/unit-test.yml secrets: inherit - canary: - if: github.event.pull_request.draft == false && contains(github.event.pull_request.labels.*.name, 'CI-canary') - uses: ./.github/workflows/canary.yml - secrets: inherit - xcm: if: github.event.pull_request.draft == false && contains(github.event.pull_request.labels.*.name, 'CI-xcm') uses: ./.github/workflows/xcm.yml @@ -67,7 +62,7 @@ jobs: secrets: inherit governance: - if: github.event.pull_request.draft == false && contains(github.event.pull_request.labels.*.name, 'CI-gov') + if: github.event.pull_request.draft == false && contains(github.event.pull_request.labels.*.name, 'CI-governance') uses: ./.github/workflows/governance.yml secrets: inherit diff --git a/.github/workflows/ci-master.yml b/.github/workflows/ci-master.yml index 1434295f45..91d8bac83b 100644 --- a/.github/workflows/ci-master.yml +++ b/.github/workflows/ci-master.yml @@ -24,10 +24,6 @@ jobs: uses: ./.github/workflows/unit-test.yml secrets: inherit - # canary: - # uses: ./.github/workflows/canary.yml - # secrets: inherit # pass all secrets from initial workflow to nested - xcm: uses: ./.github/workflows/xcm.yml secrets: inherit # pass all secrets from initial workflow to nested diff --git a/.github/workflows/codestyle.yml b/.github/workflows/codestyle.yml index 761de6ae16..93bfa0604c 100644 --- a/.github/workflows/codestyle.yml +++ b/.github/workflows/codestyle.yml @@ -13,17 +13,17 @@ jobs: steps: - name: Clean Workspace uses: AutoModality/action-clean@v1.1.0 - - uses: actions/checkout@v3.1.0 + - uses: actions/checkout@v4.1.7 with: ref: ${{ github.head_ref }} - name: Read .env file - uses: xom9ikk/dotenv@v2 + uses: xom9ikk/dotenv@v2.3.0 - name: Install toolchain version from .env uses: dtolnay/rust-toolchain@master with: toolchain: ${{ env.RUST_TOOLCHAIN }} targets: wasm32-unknown-unknown - components: rustfmt, clippy + components: rustfmt, clippy - name: Run cargo fmt run: cargo fmt -- --check # In that mode it returns only exit code. - name: Cargo fmt state @@ -35,10 +35,10 @@ jobs: steps: - name: Clean Workspace uses: AutoModality/action-clean@v1.1.0 - - uses: actions/checkout@v3.1.0 + - uses: actions/checkout@v4.1.7 with: ref: ${{ github.head_ref }} - - uses: actions/setup-node@v3.5.1 + - uses: actions/setup-node@v4.0.2 with: node-version: 20 - name: Install modules @@ -50,17 +50,21 @@ jobs: clippy: runs-on: [ self-hosted-ci ] steps: - - uses: actions/checkout@v3.1.0 + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + - uses: actions/checkout@v4.1.7 + with: + ref: ${{ github.head_ref }} - name: Install substrate dependencies run: sudo apt install -y libssl-dev pkg-config libclang-dev clang protobuf-compiler - name: Read .env file - uses: xom9ikk/dotenv@v2 + uses: xom9ikk/dotenv@v2.3.0 - name: Install toolchain version from .env uses: dtolnay/rust-toolchain@master with: toolchain: ${{ env.RUST_TOOLCHAIN }} targets: wasm32-unknown-unknown - components: rustfmt, clippy + components: rustfmt, clippy - name: Run cargo check run: cargo clippy --features=quartz-runtime,unique-runtime,try-runtime,runtime-benchmarks --tests -- -Dwarnings env: diff --git a/.github/workflows/collator-selection.yml b/.github/workflows/collator-selection.yml index 023bdb76fd..f99c046163 100644 --- a/.github/workflows/collator-selection.yml +++ b/.github/workflows/collator-selection.yml @@ -1,4 +1,4 @@ -name: collator-selection-test-run +name: collator-selection # Controls when the action will run. on: @@ -15,25 +15,22 @@ env: jobs: prepare-execution-marix: - name: Prepare execution matrix - - runs-on: [self-hosted-ci] + runs-on: [ self-hosted-ci ] outputs: matrix: ${{ steps.create_matrix.outputs.matrix }} steps: - - name: Clean Workspace uses: AutoModality/action-clean@v1.1.0 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.1.0 + - uses: actions/checkout@v4.1.7 with: ref: ${{ github.head_ref }} #Checking out head commit - name: Read .env file - uses: xom9ikk/dotenv@v2 + uses: xom9ikk/dotenv@v2.3.0 - name: Create Execution matrix uses: CertainLach/create-matrix-action@v4 @@ -44,10 +41,9 @@ jobs: network {quartz}, relay_branch {${{ env.KUSAMA_MAINNET_BRANCH }}} collator-selection: - needs: prepare-execution-marix # The type of runner that the job will run on - runs-on: [self-hosted-ci,large] + runs-on: [ self-hosted-ci ] timeout-minutes: 1380 @@ -68,7 +64,7 @@ jobs: uses: AutoModality/action-clean@v1.1.0 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.1.0 + - uses: actions/checkout@v4.1.7 with: ref: ${{ github.head_ref }} #Checking out head commit @@ -77,57 +73,24 @@ jobs: uses: ./.github/actions/prepare - name: Read .env file - uses: xom9ikk/dotenv@v2 + uses: xom9ikk/dotenv@v2.3.0 - name: Log in to Docker Hub - uses: docker/login-action@v2.1.0 + uses: docker/login-action@v3.2.0 with: username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} - - name: Run find-and-replace to remove slashes from branch name - uses: mad9000/actions-find-and-replace-string@4 - id: branchname - with: - source: ${{ github.head_ref }} - find: '/' - replace: '-' - - - name: Generate ENV related extend Dockerfile file for POLKADOT - uses: cuchi/jinja2-action@v1.2.0 - with: - template: .docker/Dockerfile-polkadot.j2 - output_file: .docker/Dockerfile-polkadot.${{ matrix.relay_branch }}.yml - variables: | - RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} - POLKADOT_BUILD_BRANCH=${{ matrix.relay_branch }} - - - name: Prepare polkadot - uses: ./.github/actions/buildContainer + - name: Check and pull polkadot image id: polkadot + uses: cloudposse/github-action-docker-image-exists@main with: - container: uniquenetwork/builder-polkadot + registry: registry.hub.docker.com + organization: parity + repository: polkadot + login: ${{ secrets.CORE_DOCKERHUB_USERNAME }} + password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} tag: ${{ matrix.relay_branch }} - context: .docker - dockerfile: Dockerfile-polkadot.${{ matrix.relay_branch }}.yml - dockerhub_username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} - dockerhub_token: ${{ secrets.CORE_DOCKERHUB_TOKEN }} - - # - name: pull needed images - # run: | - # docker pull uniquenetwork/builder-polkadot:${{ matrix.relay_branch }} - - # - name: Build unique-chain - # run: | - # docker build --file .docker/Dockerfile-unique \ - # --build-arg RUNTIME_FEATURES=${{ matrix.runtime_features }} \ - # --build-arg RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} \ - # --tag uniquenetwork/ci-collator-selection-local:${{ matrix.network }}-${{ steps.branchname.outputs.value }}-${{ env.BUILD_SHA }} \ - # . - - # - name: Push docker image version - # run: docker push uniquenetwork/ci-collator-selection-local:${{ matrix.network }}-${{ steps.branchname.outputs.value }}-${{ env.BUILD_SHA }} - - name: Prepare latest uses: ./.github/actions/buildContainer @@ -138,23 +101,25 @@ jobs: context: . dockerfile: .docker/Dockerfile-unique args: | - --build-arg RUNTIME_FEATURES=${{ matrix.runtime_features }},session-test-timings - --build-arg RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + --build-arg FEATURES=${{ matrix.network }}-runtime,session-test-timings dockerhub_username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} dockerhub_token: ${{ secrets.CORE_DOCKERHUB_TOKEN }} - - uses: actions/setup-node@v3.5.1 + - uses: actions/setup-node@v4.0.2 with: node-version: 20 - name: Install baedeker - uses: UniqueNetwork/baedeker-action/setup@built + uses: UniqueNetwork/baedeker-action/setup@v1-no-debug-output + with: + useCache: false - name: Setup library run: mkdir -p .baedeker/vendor/ && git clone https://github.com/UniqueNetwork/baedeker-library .baedeker/vendor/baedeker-library - name: Start network - uses: UniqueNetwork/baedeker-action@built + uses: UniqueNetwork/baedeker-action@v1-no-debug-output + if: success() id: bdk with: jpath: | @@ -163,7 +128,7 @@ jobs: relay_spec=${{ env.RELAY_CHAIN_TYPE }}-local inputs: | .baedeker/collator-selection.jsonnet - snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/polkadot':{dockerImage:'${{ steps.polkadot.outputs.name }}'}}) + snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/polkadot':{dockerImage:'${{ steps.polkadot.outputs.image }}:${{ steps.polkadot.outputs.tag }}'}}) snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/unique':{dockerImage:'${{ steps.latest.outputs.name }}'}}) - name: Upload network config @@ -173,21 +138,28 @@ jobs: path: ${{ steps.bdk.outputs.composeProject }} retention-days: 2 - - name: Run tests + - name: Ensure network is alive working-directory: js-packages/tests + id: alive1 + if: ${{ !cancelled() && steps.bdk.outcome == 'success' }} run: | - yarn install + yarn yarn add mochawesome - # Wanted by both wait_for_first_block - # export RPC_URL="${RELAY_SAPPHIRE_HTTP_URL:-${RELAY_OPAL_HTTP_URL:-${RELAY_QUARTZ_HTTP_URL:-${RELAY_UNIQUE_HTTP_URL:-}}}}" ../scripts/wait_for_first_block.sh + env: + RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }} + + - name: Run tests + working-directory: js-packages/tests + if: ${{ !cancelled() && steps.alive1.outcome == 'success' }} + run: | echo "Ready to start tests" NOW=$(date +%s) && yarn testCollators --reporter mochawesome --reporter-options reportFilename=test-collators-${NOW} env: RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }} - name: Test Report - uses: phoenix-actions/test-reporting@v10 + uses: phoenix-actions/test-reporting@v15 id: test-report if: success() || failure() with: diff --git a/.github/workflows/execution-matrix.yml b/.github/workflows/execution-matrix.yml deleted file mode 100644 index 1a55b4b172..0000000000 --- a/.github/workflows/execution-matrix.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Reusable workflow - -on: - workflow_call: - # Map the workflow outputs to job outputs - outputs: - matrix: - description: "The first output string" - value: ${{ jobs.create-matrix.outputs.matrix_output }} - -jobs: - - create-marix: - - name: Prepare execution matrix - - runs-on: self-hosted-ci - outputs: - matrix_output: ${{ steps.create_matrix.outputs.matrix }} - - steps: - - - name: Clean Workspace - uses: AutoModality/action-clean@v1.1.0 - - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.1.0 - with: - ref: ${{ github.head_ref }} #Checking out head commit - - - name: Read .env file - uses: xom9ikk/dotenv@v2 - - - name: Create Execution matrix - uses: CertainLach/create-matrix-action@v4 - id: create_matrix - with: - matrix: | - network {opal}, mainnet_branch {${{ env.OPAL_MAINNET_BRANCH }}}, replica_from_address {${{ env.OPAL_REPLICA_FROM }}} - network {quartz}, mainnet_branch {${{ env.QUARTZ_MAINNET_BRANCH }}}, replica_from_address {${{ env.QUARTZ_REPLICA_FROM }}} - network {unique}, mainnet_branch {${{ env.UNIQUE_MAINNET_BRANCH }}}, replica_from_address {${{ env.UNIQUE_REPLICA_FROM }}} - diff --git a/.github/workflows/forkless-update-data.yml b/.github/workflows/forkless-update-data.yml index 1e83a17b81..30d239f053 100644 --- a/.github/workflows/forkless-update-data.yml +++ b/.github/workflows/forkless-update-data.yml @@ -2,8 +2,11 @@ # https://cryptousetech.atlassian.net/wiki/spaces/CI/pages/2586869792/Forkless+update+with+data # Triger: only call from main workflow(re-usable workflows) +name: forkless-update-data + on: workflow_call: + workflow_dispatch: # A workflow run is made up of one or more jobs that can run sequentially or in parallel @@ -13,7 +16,7 @@ jobs: name: execution matrix - runs-on: self-hosted-ci + runs-on: [ self-hosted-ci ] outputs: matrix: ${{ steps.create_matrix.outputs.matrix }} @@ -23,27 +26,27 @@ jobs: uses: AutoModality/action-clean@v1.1.0 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.1.0 + - uses: actions/checkout@v4.1.7 with: ref: ${{ github.head_ref }} #Checking out head commit - name: Read .env file - uses: xom9ikk/dotenv@v2 + uses: xom9ikk/dotenv@v2.3.0 - name: Create Execution matrix uses: CertainLach/create-matrix-action@v4 id: create_matrix with: matrix: | - network {opal}, mainnet_branch {${{ env.OPAL_MAINNET_BRANCH }}}, relay_branch {${{ env.UNIQUEWEST_MAINNET_BRANCH }}}, runtime_features {opal-runtime}, wasm_name {opal}, fork_source {${{ env.OPAL_REPLICA_FROM }}} - 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 }}} + 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 }}} forkless-data: needs: prepare-execution-matrix # The type of runner that the job will run on - runs-on: [self-hosted-ci,large] + runs-on: [ self-hosted-ci,large ] timeout-minutes: 1380 @@ -61,7 +64,7 @@ jobs: uses: AutoModality/action-clean@v1.1.0 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.1.0 + - uses: actions/checkout@v4.1.7 with: ref: ${{ github.head_ref }} #Checking out head commit @@ -70,33 +73,24 @@ jobs: uses: ./.github/actions/prepare - name: Read .env file - uses: xom9ikk/dotenv@v2 + uses: xom9ikk/dotenv@v2.3.0 - name: Log in to Docker Hub - uses: docker/login-action@v2.1.0 + uses: docker/login-action@v3.2.0 with: username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} - - name: Generate ENV related extend Dockerfile file for POLKADOT - uses: cuchi/jinja2-action@v1.2.0 - with: - template: .docker/Dockerfile-polkadot.j2 - output_file: .docker/Dockerfile-polkadot.${{ matrix.relay_branch }}.yml - variables: | - RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} - POLKADOT_BUILD_BRANCH=${{ matrix.relay_branch }} - - - name: Prepare polkadot - uses: ./.github/actions/buildContainer + - name: Check and pull polkadot image id: polkadot + uses: cloudposse/github-action-docker-image-exists@main with: - container: uniquenetwork/builder-polkadot + registry: registry.hub.docker.com + organization: parity + repository: polkadot + login: ${{ secrets.CORE_DOCKERHUB_USERNAME }} + password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} tag: ${{ matrix.relay_branch }} - context: .docker - dockerfile: Dockerfile-polkadot.${{ matrix.relay_branch }}.yml - dockerhub_username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} - dockerhub_token: ${{ secrets.CORE_DOCKERHUB_TOKEN }} - name: Prepare latest uses: ./.github/actions/buildContainer @@ -107,8 +101,7 @@ jobs: context: . dockerfile: .docker/Dockerfile-unique args: | - --build-arg RUNTIME_FEATURES=${{ matrix.runtime_features }} - --build-arg RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + --build-arg FEATURES=${{ matrix.network }}-runtime dockerhub_username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} dockerhub_token: ${{ secrets.CORE_DOCKERHUB_TOKEN }} @@ -119,18 +112,21 @@ jobs: image: ${{ steps.latest.outputs.name }} directory: /wasm - - uses: actions/setup-node@v3.5.1 + - uses: actions/setup-node@v4.0.2 with: node-version: 20 - name: Install baedeker - uses: UniqueNetwork/baedeker-action/setup@built + uses: UniqueNetwork/baedeker-action/setup@v1-no-debug-output + with: + useCache: false - name: Setup library run: mkdir -p .baedeker/vendor/ && git clone https://github.com/UniqueNetwork/baedeker-library .baedeker/vendor/baedeker-library - name: Start network - uses: UniqueNetwork/baedeker-action@built + uses: UniqueNetwork/baedeker-action@v1-no-debug-output + if: success() id: bdk with: jpath: | @@ -141,36 +137,52 @@ jobs: fork_source=${{ matrix.fork_source }} inputs: | .baedeker/forkless-data.jsonnet - snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/polkadot':{dockerImage:'${{ steps.polkadot.outputs.name }}'}}) + snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/polkadot':{dockerImage:'${{ steps.polkadot.outputs.image }}:${{ steps.polkadot.outputs.tag }}'}}) snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/unique':{dockerImage:'${{ steps.latest.outputs.name }}'}}) - - name: "Reconcile: runtime is upgraded" + - name: Ensure network is alive working-directory: js-packages/tests + id: alive1 + if: ${{ !cancelled() && steps.bdk.outcome == 'success' }} run: | - yarn + yarn ../scripts/wait_for_first_block.sh + env: + RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }} + + - name: "Reconcile: runtime is upgraded" + working-directory: js-packages/tests + id: reconcile1 + if: ${{ !cancelled() && steps.alive1.outcome == 'success' }} + run: | echo "Executing upgrade" - yarn node --no-warnings=ExperimentalWarning --loader ts-node/esm ../scripts/authorizeEnactUpgrade.ts ${{ steps.wasms.outputs.dir }}/${{ matrix.wasm_name }}-runtime/${{ matrix.wasm_name }}_runtime.compact.compressed.wasm + yarn node --no-warnings=ExperimentalWarning --loader ts-node/esm ../scripts/authorizeEnactUpgrade.ts ${{ steps.wasms.outputs.dir }}/${{ matrix.network }}-runtime/${{ matrix.network }}_runtime.compact.compressed.wasm env: RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }} - - name: Run Parallel tests after forkless upgrade + - name: Ensure network is alive working-directory: js-packages/tests + id: alive2 + if: ${{ !cancelled() && steps.reconcile1.outcome == 'success' }} run: | - yarn - yarn add mochawesome + yarn ../scripts/wait_for_first_block.sh + env: + RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }} + + - name: Run Parallel tests after forkless upgrade + working-directory: js-packages/tests + if: ${{ !cancelled() && steps.alive2.outcome == 'success' }} + run: | echo "Ready to start tests" NOW=$(date +%s) && yarn testParallel --reporter mochawesome --reporter-options reportFilename=test-parallel-${NOW} env: RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }} - name: Run Sequential tests after forkless upgrade - if: success() || failure() working-directory: js-packages/tests + if: ${{ !cancelled() && steps.alive2.outcome == 'success' }} run: | - yarn - yarn add mochawesome NOW=$(date +%s) && yarn testSequential --reporter mochawesome --reporter-options reportFilename=test-sequential-${NOW} env: RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }} diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index eca8841a09..4318cfb2eb 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -2,8 +2,11 @@ # Forkless update without data replication # Triger: only call from main workflow(re-usable workflows) +name: forkless-update-nodata + on: workflow_call: + workflow_dispatch: # A workflow run is made up of one or more jobs that can run sequentially or in parallel @@ -13,7 +16,7 @@ jobs: name: execution matrix - runs-on: self-hosted-ci + runs-on: [ self-hosted-ci ] outputs: matrix: ${{ steps.create_matrix.outputs.matrix }} @@ -23,27 +26,27 @@ jobs: uses: AutoModality/action-clean@v1.1.0 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.1.0 + - uses: actions/checkout@v4.1.7 with: ref: ${{ github.head_ref }} #Checking out head commit - name: Read .env file - uses: xom9ikk/dotenv@v2 + uses: xom9ikk/dotenv@v2.3.0 - name: Create Execution matrix uses: CertainLach/create-matrix-action@v4 id: create_matrix with: matrix: | - network {opal}, mainnet_branch {${{ env.OPAL_MAINNET_BRANCH }}}, relay_branch {${{ env.UNIQUEWEST_MAINNET_BRANCH }}}, runtime_features {opal-runtime}, wasm_name {opal} - 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} + 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 }}} forkless-nodata: needs: prepare-execution-matrix # The type of runner that the job will run on - runs-on: [self-hosted-ci,large] + runs-on: [ self-hosted-ci,large ] timeout-minutes: 1380 @@ -61,7 +64,7 @@ jobs: uses: AutoModality/action-clean@v1.1.0 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.1.0 + - uses: actions/checkout@v4.1.7 with: ref: ${{ github.head_ref }} #Checking out head commit @@ -70,33 +73,24 @@ jobs: uses: ./.github/actions/prepare - name: Read .env file - uses: xom9ikk/dotenv@v2 + uses: xom9ikk/dotenv@v2.3.0 - name: Log in to Docker Hub - uses: docker/login-action@v2.1.0 + uses: docker/login-action@v3.2.0 with: username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} - - name: Generate ENV related extend Dockerfile file for POLKADOT - uses: cuchi/jinja2-action@v1.2.0 - with: - template: .docker/Dockerfile-polkadot.j2 - output_file: .docker/Dockerfile-polkadot.${{ matrix.relay_branch }}.yml - variables: | - RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} - POLKADOT_BUILD_BRANCH=${{ matrix.relay_branch }} - - - name: Prepare polkadot - uses: ./.github/actions/buildContainer + - name: Check and pull polkadot image id: polkadot + uses: cloudposse/github-action-docker-image-exists@main with: - container: uniquenetwork/builder-polkadot + registry: registry.hub.docker.com + organization: parity + repository: polkadot + login: ${{ secrets.CORE_DOCKERHUB_USERNAME }} + password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} tag: ${{ matrix.relay_branch }} - context: .docker - dockerfile: Dockerfile-polkadot.${{ matrix.relay_branch }}.yml - dockerhub_username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} - dockerhub_token: ${{ secrets.CORE_DOCKERHUB_TOKEN }} - name: Prepare mainnet uses: ./.github/actions/buildContainer @@ -107,8 +101,7 @@ jobs: context: .docker dockerfile: Dockerfile-unique-release args: | - --build-arg RUNTIME_FEATURES=${{ matrix.runtime_features }} - --build-arg RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + --build-arg NETWORK=${{ matrix.network }} --build-arg UNIQUE_VERSION=${{ matrix.mainnet_branch }} dockerhub_username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} dockerhub_token: ${{ secrets.CORE_DOCKERHUB_TOKEN }} @@ -122,8 +115,7 @@ jobs: context: . dockerfile: .docker/Dockerfile-unique args: | - --build-arg RUNTIME_FEATURES=${{ matrix.runtime_features }} - --build-arg RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + --build-arg FEATURES=${{ matrix.network }}-runtime dockerhub_username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} dockerhub_token: ${{ secrets.CORE_DOCKERHUB_TOKEN }} @@ -134,54 +126,76 @@ jobs: image: ${{ steps.latest.outputs.name }} directory: /wasm - - uses: actions/setup-node@v3.5.1 + - uses: actions/setup-node@v4.0.2 with: node-version: 20 - name: Install baedeker - uses: UniqueNetwork/baedeker-action/setup@built + uses: UniqueNetwork/baedeker-action/setup@v1-no-debug-output + with: + useCache: false - name: Setup library run: mkdir -p .baedeker/vendor/ && git clone https://github.com/UniqueNetwork/baedeker-library .baedeker/vendor/baedeker-library - name: Start network - uses: UniqueNetwork/baedeker-action@built + uses: UniqueNetwork/baedeker-action@v1-no-debug-output id: bdk + if: success() with: jpath: | .baedeker/vendor tla-str: | - relay_spec=rococo-local + relay_spec=${{ env.RELAY_CHAIN_TYPE }}-local inputs: | .baedeker/node-only.jsonnet - snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/polkadot':{dockerImage:'${{ steps.polkadot.outputs.name }}'}}) + 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 }}'}}, for_chain = false) snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/unique':{dockerImage:'${{ steps.mainnet.outputs.name }}'}}) - - name: "Reconcile: runtime is upgraded" + - name: Ensure network is alive working-directory: js-packages/tests + id: alive1 + if: ${{ !cancelled() && steps.bdk.outcome == 'success' }} run: | yarn + yarn add mochawesome ../scripts/wait_for_first_block.sh + env: + RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }} + + - name: "Reconcile: runtime is upgraded" + working-directory: js-packages/tests + id: reconcile1 + if: ${{ !cancelled() && steps.alive1.outcome == 'success' }} + run: | echo "Executing upgrade" - yarn node --no-warnings=ExperimentalWarning --loader ts-node/esm ../scripts/authorizeEnactUpgrade.ts ${{ steps.wasms.outputs.dir }}/${{ matrix.wasm_name }}-runtime/${{ matrix.wasm_name }}_runtime.compact.compressed.wasm + yarn node --no-warnings=ExperimentalWarning --loader ts-node/esm ../scripts/authorizeEnactUpgrade.ts ${{ steps.wasms.outputs.dir }}/${{ matrix.network }}-runtime/${{ matrix.network }}_runtime.compact.compressed.wasm env: RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }} - - name: Run Parallel tests after forkless upgrade + - name: Ensure network is alive working-directory: js-packages/tests + id: alive2 + if: ${{ !cancelled() && steps.reconcile1.outcome == 'success' }} run: | - yarn add mochawesome ../scripts/wait_for_first_block.sh + env: + RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }} + + - name: Run Parallel tests after forkless upgrade + working-directory: js-packages/tests + if: ${{ !cancelled() && steps.alive2.outcome == 'success' }} + run: | echo "Ready to start tests" NOW=$(date +%s) && yarn testParallel --reporter mochawesome --reporter-options reportFilename=test-parallel-${NOW} env: RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }} - name: Run Sequential tests after forkless upgrade - if: success() || failure() working-directory: js-packages/tests + if: ${{ !cancelled() && steps.alive2.outcome == 'success' }} 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/.github/workflows/generate-execution-matrix.yml b/.github/workflows/generate-execution-matrix.yml deleted file mode 100644 index 4881399e53..0000000000 --- a/.github/workflows/generate-execution-matrix.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Prepare execution matrix - -on: - workflow_call: - # Map the workflow outputs to job outputs - outputs: - matrix_values: - description: "Matix output" - matrix: ${{ jobs.prepare-execution-matrix.outputs.matrix }} - - -#concurrency: -# group: ${{ github.workflow }}-${{ github.head_ref }} -# cancel-in-progress: true - - -jobs: - prepare-execution-matrix: - name: Generate output - runs-on: self-hosted-ci - # Map the job outputs to step outputs - outputs: - matrix: ${{ steps.create_matrix.outputs.matrix }} - - steps: - - - name: Clean Workspace - uses: AutoModality/action-clean@v1.1.0 - - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.1.0 - with: - ref: ${{ github.head_ref }} #Checking out head commit - - - name: Read .env file - uses: xom9ikk/dotenv@v2 - - - name: Create Execution matrix - uses: CertainLach/create-matrix-action@v4 - id: create_matrix - with: - matrix: | - network {opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.OPAL_MAINNET_TAG }}}, replica_from_address {${{ env.OPAL_REPLICA_FROM }}} - network {quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}}, replica_from_address {${{ env.QUARTZ_REPLICA_FROM }}} - network {unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}}, replica_from_address {${{ env.UNIQUE_REPLICA_FROM }}} diff --git a/.github/workflows/governance.yml b/.github/workflows/governance.yml index e663841326..88941ac98b 100644 --- a/.github/workflows/governance.yml +++ b/.github/workflows/governance.yml @@ -1,16 +1,17 @@ # Governance tests in --dev mode with gov-test-timings feature enabled to reduce gov timings -name: governance tests +name: governance # Triger: only call from main workflow(re-usable workflows) on: workflow_call: + workflow_dispatch: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: prepare-execution-marix: name: Prepare execution matrix - runs-on: self-hosted-ci + runs-on: [ self-hosted ] outputs: matrix: ${{ steps.create_matrix.outputs.matrix }} @@ -19,26 +20,26 @@ jobs: uses: AutoModality/action-clean@v1.1.0 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.1.0 + - uses: actions/checkout@v4.1.7 with: ref: ${{ github.head_ref }} #Checking out head commit - name: Read .env file - uses: xom9ikk/dotenv@v2 + uses: xom9ikk/dotenv@v2.3.0 - name: Create Execution matrix uses: CertainLach/create-matrix-action@v4 id: create_matrix with: matrix: | - network {unique}, wasm_name {unique} - network {quartz}, wasm_name {quartz} - network {opal}, wasm_name {opal} + network {unique} + network {quartz} + network {opal} dev_build_int_tests: needs: prepare-execution-marix # The type of runner that the job will run on - runs-on: [self-hosted-ci, medium] + runs-on: [ self-hosted-ci, medium ] timeout-minutes: 1380 name: ${{ matrix.network }} @@ -53,12 +54,12 @@ jobs: uses: AutoModality/action-clean@v1.1.0 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.1.0 + - uses: actions/checkout@v4.1.7 with: ref: ${{ github.head_ref }} #Checking out head commit - name: Read .env file - uses: xom9ikk/dotenv@v2 + uses: xom9ikk/dotenv@v2.3.0 - name: Generate ENV related extend file for docker-compose uses: cuchi/jinja2-action@v1.2.0 @@ -66,17 +67,15 @@ jobs: template: .docker/docker-compose.gov.j2 output_file: .docker/docker-compose.${{ matrix.network }}.yml variables: | - RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} NETWORK=${{ matrix.network }} - WASM_NAME=${{ matrix.wasm_name }} - name: Show build configuration run: cat .docker/docker-compose.${{ matrix.network }}.yml - name: Build the stack - run: docker-compose -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --remove-orphans + run: docker compose -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --remove-orphans - - uses: actions/setup-node@v3.5.1 + - uses: actions/setup-node@v4.0.2 with: node-version: 20 @@ -92,7 +91,7 @@ jobs: RPC_URL: http://127.0.0.1:9944/ - name: Test Report - uses: phoenix-actions/test-reporting@v10 + uses: phoenix-actions/test-reporting@v15 id: test-report if: success() || failure() # run this step even if previous step failed with: @@ -107,7 +106,7 @@ jobs: - name: Stop running containers if: always() # run this step always - run: docker-compose -f ".docker/docker-compose.${{ matrix.network }}.yml" down + run: docker compose -f ".docker/docker-compose.${{ matrix.network }}.yml" down - name: Remove builder cache if: always() # run this step always diff --git a/.github/workflows/make-bench.yml b/.github/workflows/make-bench.yml index 187c8922fe..1eb47cc09f 100644 --- a/.github/workflows/make-bench.yml +++ b/.github/workflows/make-bench.yml @@ -17,23 +17,16 @@ jobs: - name: Clean Workspace uses: AutoModality/action-clean@v1.1.0 - - uses: actions/checkout@v3.3.0 + - uses: actions/checkout@v4.1.7 with: ref: develop - name: Read .env file - uses: xom9ikk/dotenv@v2.1.1 + uses: xom9ikk/dotenv@v2.3.0.3.0 - name: Install substrate dependencies run: sudo apt install -y curl cmake make libssl-dev pkg-config libclang-dev clang protobuf-compiler - - name: Install actual toolchain - uses: actions-rs/toolchain@v1.0.7 - with: - toolchain: ${{ env.RUST_TOOLCHAIN }} - default: true - target: wasm32-unknown-unknown - - uses: actions/setup-node@v3 with: node-version: 20 diff --git a/.github/workflows/market-test.yml b/.github/workflows/market-test.yml deleted file mode 100644 index 09de459c30..0000000000 --- a/.github/workflows/market-test.yml +++ /dev/null @@ -1,216 +0,0 @@ -# https://cryptousetech.atlassian.net/wiki/spaces/CI/pages/2586509375/Market+e2e+test -# Nested workflow for lunching Market e2e tests from external repository https://github.com/UniqueNetwork/market-e2e-tests - -name: market api tests - -# Controls when the action will run. -on: - workflow_call: - - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - - prepare-execution-marix: - - name: Prepare execution matrix - - runs-on: [self-hosted-ci] - outputs: - matrix: ${{ steps.create_matrix.outputs.matrix }} - - steps: - - - name: Clean Workspace - uses: AutoModality/action-clean@v1.1.0 - - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.1.0 - with: - ref: ${{ github.head_ref }} #Checking out head commit - - - name: Read .env file - uses: xom9ikk/dotenv@v2 - - - name: Create Execution matrix - uses: CertainLach/create-matrix-action@v4 - id: create_matrix - with: - matrix: | - network {opal}, relay_branch {${{ env.UNIQUEWEST_MAINNET_BRANCH }}} - - - market_test: - needs: prepare-execution-marix - # The type of runner that the job will run on - runs-on: [self-hosted-ci,large] - timeout-minutes: 360 - - 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. - - strategy: - matrix: - include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}} - - steps: - - name: Clean Workspace - uses: AutoModality/action-clean@v1.1.0 - - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - name: Checkout master repo - uses: actions/checkout@master - with: - ref: ${{ github.head_ref }} #Checking out head commit - - - name: Checkout Market e2e tests - uses: actions/checkout@v3.1.0 - with: - repository: 'UniqueNetwork/market-e2e-tests' - ssh-key: ${{ secrets.GH_PAT }} - path: 'qa-tests' - ref: 'master' - - - name: Read .env file - uses: xom9ikk/dotenv@v2 - - - name: Copy qa-tests/.env.example to qa-tests/.env - working-directory: qa-tests - run: cp .env.docker .env - - - name: Generate ENV related extend file for docker-compose - uses: cuchi/jinja2-action@v1.2.0 - with: - template: qa-tests/.docker/docker-compose.tmp-market.j2 - output_file: qa-tests/.docker/docker-compose.${{ matrix.network }}.yml - variables: | - REPO_URL=${{ github.server_url }}/${{ github.repository }}.git - RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} - POLKADOT_BUILD_BRANCH=${{ matrix.relay_branch }} - POLKADOT_LAUNCH_BRANCH=${{ env.POLKADOT_LAUNCH_BRANCH }} - NETWORK=${{ matrix.network }} - BRANCH=${{ github.head_ref }} - - - - name: Show build configuration - working-directory: qa-tests - run: cat .docker/docker-compose.${{ matrix.network }}.yml - - - name: Start node-parachain - working-directory: qa-tests - run: docker-compose -f ".docker/docker-compose.market.yml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --remove-orphans --force-recreate node-parachain - - - uses: actions/setup-node@v3.5.1 - with: - node-version: 20 - - - name: Setup TypeScript - working-directory: qa-tests - run: | - npm install -g ts-node - npm install - - - name: Copy qa-tests/.env.docker to qa-tests/.env - working-directory: qa-tests - run: | - rm -rf .env - cp .env.docker .env - -# Temporary disable node readyness check. Have to dig into the script logic. -# - name: Wait for chain up and running -# working-directory: js-packages/tests -# run: | -# yarn install -# ../scripts/wait_for_first_block.sh -# echo "Ready to start tests" -# env: -# RPC_URL: http://127.0.0.1:9944/ - - - name: Wait for chain up and running - run: | - sleep 1200s - echo "Ready to start Market e2e tests" - - - name: Show content of .env file and Generate accounts - working-directory: qa-tests - run: | - cat .env - ts-node ./src/scripts/create-market-accounts.ts - - - name: Copy qa-tests/.env to qa-tests/.env.docker - working-directory: qa-tests - run: | - rm -rf .env.docker - cp .env .env.docker - - - name: Get chain logs - if: always() # run this step always - run: | - docker exec node-parachain cat /polkadot-launch/9944.log - docker exec node-parachain cat /polkadot-launch/9945.log - docker exec node-parachain cat /polkadot-launch/alice.log - docker exec node-parachain cat /polkadot-launch/eve.log - docker exec node-parachain cat /polkadot-launch/dave.log - docker exec node-parachain cat /polkadot-launch/charlie.log - - - name: Deploy contracts - run: | - cd qa-tests - ts-node ./src/scripts/deploy-contract.ts - - - name: Timeout for debug - if: failure() - run: sleep 300s - - - name: Import test data - working-directory: qa-tests - run: ts-node ./src/scripts/create-test-collections.ts - - - name: Show content of qa-test .env - working-directory: qa-tests - run: cat .env - - - name: Read qa -test .env file Before market start - uses: xom9ikk/dotenv@v2 - with: - path: qa-tests/ - - - name: local-market:start - run: docker-compose -f "qa-tests/.docker/docker-compose.market.yml" -f "qa-tests/.docker/docker-compose.${{ matrix.network }}.yml" up -d --build - - - name: Wait for market readyness - working-directory: qa-tests - run: src/scripts/wait-market-ready.sh - shell: bash - - - name: Install dependecies - working-directory: qa-tests - run: | - npm ci - npm install -D @playwright/test - npx playwright install-deps - npx playwright install - - - name: Show content of qa-test .env - working-directory: qa-tests - run: cat .env - - - name: Test API interface - working-directory: qa-tests - run: | - npx playwright test --workers=3 --quiet .*.api.test.ts --reporter=github --config playwright.config.ts - - - name: Timeout for debug - if: failure() - run: sleep 300s - - - name: Stop running containers - if: always() # run this step always - run: docker-compose -f "qa-tests/.docker/docker-compose.market.yml" -f "qa-tests/.docker/docker-compose.${{ matrix.network }}.yml" down --volumes - - - name: Remove builder cache - if: always() # run this step always - run: | - docker builder prune -f - docker system prune -f diff --git a/.github/workflows/node-only-update.yml b/.github/workflows/node-only-update.yml index c1df29db8d..d42a00cf0e 100644 --- a/.github/workflows/node-only-update.yml +++ b/.github/workflows/node-only-update.yml @@ -1,11 +1,12 @@ # https://cryptousetech.atlassian.net/wiki/spaces/CI/pages/2586837028/Nodes+only+update # Node only update with restart polkadot-launch process. -name: nodes-only update +name: node-only-update # Triger: only call from main workflow(re-usable workflows) on: workflow_call: + workflow_dispatch: # A workflow run is made up of one or more jobs that can run sequentially or in parallel @@ -15,7 +16,7 @@ jobs: name: execution matrix - runs-on: self-hosted-ci + runs-on: [ self-hosted-ci ] outputs: matrix: ${{ steps.create_matrix.outputs.matrix }} @@ -25,27 +26,27 @@ jobs: uses: AutoModality/action-clean@v1.1.0 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.1.0 + - uses: actions/checkout@v4.1.7 with: ref: ${{ github.head_ref }} #Checking out head commit - name: Read .env file - uses: xom9ikk/dotenv@v2 + uses: xom9ikk/dotenv@v2.3.0 - name: Create Execution matrix uses: CertainLach/create-matrix-action@v4 id: create_matrix with: matrix: | - network {opal}, mainnet_branch {${{ env.OPAL_MAINNET_BRANCH }}}, relay_branch {${{ env.UNIQUEWEST_MAINNET_BRANCH }}}, runtime_features {opal-runtime} - 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} + 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 }}} node-only-update: needs: prepare-execution-matrix # The type of runner that the job will run on - runs-on: [self-hosted-ci] + runs-on: [ self-hosted-ci ] timeout-minutes: 2880 # 48 hours for execution jobs. @@ -67,7 +68,7 @@ jobs: uses: AutoModality/action-clean@v1.1.0 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.1.0 + - uses: actions/checkout@v4.1.7 with: ref: ${{ github.head_ref }} #Checking out head commit @@ -76,33 +77,24 @@ jobs: uses: ./.github/actions/prepare - name: Read .env file - uses: xom9ikk/dotenv@v2 + uses: xom9ikk/dotenv@v2.3.0 - name: Log in to Docker Hub - uses: docker/login-action@v2.1.0 + uses: docker/login-action@v3.2.0 with: username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} - - name: Generate ENV related extend Dockerfile file for POLKADOT - uses: cuchi/jinja2-action@v1.2.0 - with: - template: .docker/Dockerfile-polkadot.j2 - output_file: .docker/Dockerfile-polkadot.${{ matrix.relay_branch }}.yml - variables: | - RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} - POLKADOT_BUILD_BRANCH=${{ matrix.relay_branch }} - - - name: Prepare polkadot - uses: ./.github/actions/buildContainer + - name: Check and pull polkadot image id: polkadot + uses: cloudposse/github-action-docker-image-exists@main with: - container: uniquenetwork/builder-polkadot + registry: registry.hub.docker.com + organization: parity + repository: polkadot + login: ${{ secrets.CORE_DOCKERHUB_USERNAME }} + password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} tag: ${{ matrix.relay_branch }} - context: .docker - dockerfile: Dockerfile-polkadot.${{ matrix.relay_branch }}.yml - dockerhub_username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} - dockerhub_token: ${{ secrets.CORE_DOCKERHUB_TOKEN }} - name: Prepare mainnet uses: ./.github/actions/buildContainer @@ -113,8 +105,7 @@ jobs: context: .docker dockerfile: Dockerfile-unique-release args: | - --build-arg RUNTIME_FEATURES=${{ matrix.runtime_features }} - --build-arg RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + --build-arg FEATURES=${{ matrix.network }}-runtime --build-arg UNIQUE_VERSION=${{ matrix.mainnet_branch }} dockerhub_username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} dockerhub_token: ${{ secrets.CORE_DOCKERHUB_TOKEN }} @@ -128,30 +119,32 @@ jobs: context: . dockerfile: .docker/Dockerfile-unique args: | - --build-arg RUNTIME_FEATURES=${{ matrix.runtime_features }} - --build-arg RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + --build-arg FEATURES=${{ matrix.network }}-runtime dockerhub_username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} dockerhub_token: ${{ secrets.CORE_DOCKERHUB_TOKEN }} - name: Checkout at '${{ matrix.mainnet_branch }}' branch - uses: actions/checkout@master + uses: actions/checkout@v4.1.7 with: #ref: ${{ github.head_ref }} ref: ${{ matrix.mainnet_branch }} #Checking out head commit path: ${{ matrix.mainnet_branch }} - - uses: actions/setup-node@v3.5.1 + - uses: actions/setup-node@v4.0.2 with: - node-version: 18.17.1 # Update node version to 20 after mainnet will have changes for it + node-version: 20 - name: Install baedeker - uses: UniqueNetwork/baedeker-action/setup@built + uses: UniqueNetwork/baedeker-action/setup@v1-no-debug-output + with: + useCache: false - name: Setup library run: mkdir -p .baedeker/vendor/ && git clone https://github.com/UniqueNetwork/baedeker-library .baedeker/vendor/baedeker-library - name: Start network - uses: UniqueNetwork/baedeker-action@built + uses: UniqueNetwork/baedeker-action@v1-no-debug-output + if: success() id: bdk with: jpath: | @@ -160,33 +153,40 @@ jobs: relay_spec=${{ env.RELAY_CHAIN_TYPE }}-local inputs: | .baedeker/node-only.jsonnet - snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/polkadot':{dockerImage:'${{ steps.polkadot.outputs.name }}'}}) - # extra_node_mixin due to mainnet unique node not supporting --increase-future-pool + snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/polkadot':{dockerImage:'${{ steps.polkadot.outputs.image }}:${{ steps.polkadot.outputs.tag }}'}}) ephemeral:snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/unique':{dockerImage:'${{ steps.mainnet.outputs.name }}'}}, extra_node_mixin={extraArgs: []}) - - name: Run Parallel tests before Node Parachain upgrade - working-directory: ${{ matrix.mainnet_branch }}/tests - if: success() + - name: Ensure network is alive + working-directory: ${{ matrix.mainnet_branch }}/js-packages/tests + id: alive1 + if: ${{ !cancelled() && steps.bdk.outcome == 'success' }} run: | yarn yarn add mochawesome - # TODO: Update to new script structure after mainnet will have it - ./scripts/wait_for_first_block.sh + ../scripts/wait_for_first_block.sh + env: + RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }} + + - name: Run Parallel tests before Node Parachain upgrade + working-directory: ${{ matrix.mainnet_branch }}/js-packages/tests + if: ${{ !cancelled() && steps.alive1.outcome == 'success' }} + run: | echo "Ready to start tests" NOW=$(date +%s) && yarn testParallel --reporter mochawesome --reporter-options reportFilename=test-parallel-${NOW} env: RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }} - name: Run Sequential tests before Node Parachain upgrade - if: success() || failure() - working-directory: ${{ matrix.mainnet_branch }}/tests + if: ${{ !cancelled() && steps.alive1.outcome == 'success' }} + working-directory: ${{ matrix.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 }} - name: "Reconcile: only one old node" - if: success() || failure() - uses: UniqueNetwork/baedeker-action/reconcile@built + if: ${{ !cancelled() && steps.alive1.outcome == 'success' }} + id: reconcile1 + uses: UniqueNetwork/baedeker-action/reconcile@v1-no-debug-output with: baedeker: ${{ steps.bdk.outputs.baedeker }} # Chain should always be built with the mainnet spec, this we first set binary for all nodes expect one, then set mainnet binary for the last node, and then force chainspec to be still generated from mainnet @@ -196,15 +196,18 @@ jobs: snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/unique':{dockerImage:'${{ steps.mainnet.outputs.name }}'}}) - name: Ensure network is alive - if: success() + working-directory: ${{ matrix.mainnet_branch }}/js-packages/tests + id: alive2 + if: ${{ !cancelled() && steps.reconcile1.outcome == 'success' }} run: | - ./js-packages/scripts/wait_for_first_block.sh + ../scripts/wait_for_first_block.sh env: RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }} - name: "Reconcile: all nodes are updated" - if: success() || failure() - uses: UniqueNetwork/baedeker-action/reconcile@built + if: ${{ !cancelled() && steps.alive2.outcome == 'success' }} + id: reconcile2 + uses: UniqueNetwork/baedeker-action/reconcile@v1-no-debug-output with: baedeker: ${{ steps.bdk.outputs.baedeker }} # Chain should always be built with the mainnet spec, this we first set binary for all nodes, and then force chainspec to be still generated from mainnet @@ -212,22 +215,27 @@ jobs: snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/unique':{dockerImage:'${{ steps.latest.outputs.name }}'}}, for_chain = false) 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 + id: alive3 + if: ${{ !cancelled() && steps.reconcile2.outcome == 'success' }} + run: | + ../scripts/wait_for_first_block.sh + env: + RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }} + - name: Run Parallel tests after Node Parachain upgrade - working-directory: ${{ matrix.mainnet_branch }}/tests - if: success() || failure() # run this step even if previous step failed + working-directory: ${{ matrix.mainnet_branch }}/js-packages/tests + if: ${{ !cancelled() && steps.alive3.outcome == 'success' }} run: | - yarn install - yarn add mochawesome - # TODO: Update to new script structure after mainnet will have it - ./scripts/wait_for_first_block.sh echo "Ready to start tests" NOW=$(date +%s) && yarn testParallel --reporter mochawesome --reporter-options reportFilename=test-parallel-${NOW} env: RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }} - name: Run Sequential tests after Node Parachain upgrade - if: success() || failure() - working-directory: ${{ matrix.mainnet_branch }}/tests + if: ${{ !cancelled() && steps.alive3.outcome == 'success' }} + working-directory: ${{ matrix.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/.github/workflows/polkadot-types.yml b/.github/workflows/polkadot-types.yml index a553bea8be..b13d5f910a 100644 --- a/.github/workflows/polkadot-types.yml +++ b/.github/workflows/polkadot-types.yml @@ -1,6 +1,6 @@ # Integration test in --dev mode # https://cryptousetech.atlassian.net/wiki/spaces/CI/pages/2586411104/Integration+tests -name: Polkadot types +name: polkadot-types # Triger: only call from main workflow(re-usable workflows) on: @@ -19,7 +19,7 @@ jobs: polkadot_generate_types: # The type of runner that the job will run on - runs-on: [self-hosted-ci,medium] + runs-on: [ self-hosted-ci,medium ] timeout-minutes: 1380 name: ${{ matrix.network }} @@ -42,12 +42,12 @@ jobs: uses: AutoModality/action-clean@v1.1.0 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 + - uses: actions/checkout@v4.1.7 with: ref: ${{ github.head_ref }} #Checking out head commit - name: Read .env file - uses: xom9ikk/dotenv@v2 + uses: xom9ikk/dotenv@v2.3.0 - name: Generate ENV related extend file for docker-compose uses: cuchi/jinja2-action@v1.2.0 @@ -55,16 +55,15 @@ jobs: template: .docker/docker-compose.tmp-dev.j2 output_file: .docker/docker-compose.${{ matrix.network }}.yml variables: | - RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} NETWORK=${{ matrix.network }} - name: Show build configuration run: cat .docker/docker-compose.${{ matrix.network }}.yml - name: Build the stack - run: docker-compose -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --remove-orphans + run: docker compose -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --remove-orphans - - uses: actions/setup-node@v3.5.1 + - uses: actions/setup-node@v4.0.2 with: node-version: 20 @@ -84,7 +83,7 @@ jobs: - name: Stop running containers if: always() # run this step always - run: docker-compose -f ".docker/docker-compose.${{ matrix.network }}.yml" down + run: docker compose -f ".docker/docker-compose.${{ matrix.network }}.yml" down - name: Remove builder cache if: always() # run this step always diff --git a/.github/workflows/schedule-trigger-for-develop-build.yml b/.github/workflows/schedule-trigger-for-develop-build.yml index ae1c35a8be..4f569a81e8 100644 --- a/.github/workflows/schedule-trigger-for-develop-build.yml +++ b/.github/workflows/schedule-trigger-for-develop-build.yml @@ -16,7 +16,7 @@ jobs: - name: Clean Workspace uses: AutoModality/action-clean@v1.1.0 - name: Checkout 🛎 - uses: actions/checkout@v3.1.0 + uses: actions/checkout@v4.1.7 with: # check out all branches fetch-depth: 0 diff --git a/.github/workflows/testnet-build.yml b/.github/workflows/testnet-build.yml deleted file mode 100644 index 3a2241ed46..0000000000 --- a/.github/workflows/testnet-build.yml +++ /dev/null @@ -1,128 +0,0 @@ -name: testnet-image-build - -# Controls when the action will run. -on: - workflow_call: - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -#Define Workflow variables -env: - REPO_URL: ${{ github.server_url }}/${{ github.repository }} - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - - prepare-execution-marix: - - name: Prepare execution matrix - - runs-on: [self-hosted-ci,medium] - outputs: - matrix: ${{ steps.create_matrix.outputs.matrix }} - - steps: - - - name: Clean Workspace - uses: AutoModality/action-clean@v1.1.0 - - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.1.0 - with: - ref: ${{ github.head_ref }} #Checking out head commit - - - name: Read .env file - uses: xom9ikk/dotenv@v2 - - - name: Create Execution matrix - uses: CertainLach/create-matrix-action@v4 - id: create_matrix - with: - matrix: | - network {opal}, relay_branch {${{ env.UNIQUEWEST_MAINNET_BRANCH }}} - network {quartz}, relay_branch {${{ env.KUSAMA_MAINNET_BRANCH }}} - network {unique}, relay_branch {${{ env.POLKADOT_MAINNET_BRANCH }}} - - testnet-build: - needs: prepare-execution-marix - # The type of runner that the job will run on - runs-on: [self-hosted-ci,medium] - - timeout-minutes: 600 - - 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. - - strategy: - matrix: - include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}} - - steps: - - name: Skip if pull request is in Draft - if: github.event.pull_request.draft == true - run: exit 1 - - - name: Clean Workspace - uses: AutoModality/action-clean@v1.1.0 - - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.1.0 - with: - ref: ${{ github.head_ref }} #Checking out head commit - - - name: Read .env file - uses: xom9ikk/dotenv@v2 - - - name: Generate ENV related extend file for docker-compose - uses: cuchi/jinja2-action@v1.2.0 - with: - template: .docker/Dockerfile-testnet.j2 - output_file: .docker/Dockerfile-testnet.${{ matrix.network }}.yml - variables: | - RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} - NETWORK=${{ matrix.network }} - POLKADOT_BUILD_BRANCH=${{ matrix.relay_branch }} - POLKADOT_LAUNCH_BRANCH=${{ env.POLKADOT_LAUNCH_BRANCH }} - NETWORK=${{ matrix.network }} - BRANCH=${{ github.head_ref }} - - - name: Show build configuration - run: cat .docker/Dockerfile-testnet.${{ matrix.network }}.yml - - - name: Show launch-config configuration - run: cat launch-config.json - - - name: Run find-and-replace to remove slashes from branch name - uses: mad9000/actions-find-and-replace-string@4 - id: branchname - with: - source: ${{ github.head_ref }} - find: '/' - replace: '-' - - - name: Log in to Docker Hub - uses: docker/login-action@v2.1.0 - with: - username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} - password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} - - - name: Pull polkadot docker image - run: docker pull uniquenetwork/builder-polkadot:${{ matrix.relay_branch }} - - - name: Build the stack - run: cd .docker/ && docker build --file ./Dockerfile-testnet.${{ matrix.network }}.yml --tag uniquenetwork/${{ matrix.network }}-testnet-local-nightly:nightly-${{ steps.branchname.outputs.value }}-${{ github.sha }} . - - - name: Push docker version image - run: docker push uniquenetwork/${{ matrix.network }}-testnet-local-nightly:nightly-${{ steps.branchname.outputs.value }}-${{ github.sha }} - - - name: Clean Workspace - if: always() - uses: AutoModality/action-clean@v1.1.0 - - - name: Remove builder cache - if: always() # run this step always - run: | - docker builder prune -f - docker system prune -f diff --git a/.github/workflows/try-runtime.yml b/.github/workflows/try-runtime.yml index 24c5c844c1..262e8baef7 100644 --- a/.github/workflows/try-runtime.yml +++ b/.github/workflows/try-runtime.yml @@ -2,8 +2,11 @@ # https://cryptousetech.atlassian.net/wiki/spaces/CI/pages/2587656213/Try+runtime # Triger: only call from main workflow(re-usable workflows) +name: try-runtime + on: workflow_call: + workflow_dispatch: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -11,7 +14,7 @@ jobs: name: Prepare execution matrix - runs-on: self-hosted-ci + runs-on: [ self-hosted-ci ] outputs: matrix: ${{ steps.create_matrix.outputs.matrix }} @@ -21,27 +24,27 @@ jobs: uses: AutoModality/action-clean@v1.1.0 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.1.0 + - uses: actions/checkout@v4.1.7 with: ref: ${{ github.head_ref }} #Checking out head commit - name: Read .env file - uses: xom9ikk/dotenv@v2 + uses: xom9ikk/dotenv@v2.3.0 - name: Create Execution matrix uses: CertainLach/create-matrix-action@v4 id: create_matrix with: matrix: | - network {opal}, wasm_name {opal}, replica_from_address {${{ env.OPAL_REPLICA_FROM }}} - network {quartz}, wasm_name {quartz}, replica_from_address {${{ env.QUARTZ_REPLICA_FROM }}} - network {unique}, wasm_name {unique}, replica_from_address {${{ env.UNIQUE_REPLICA_FROM }}} + network {opal}, replica_from_address {${{ env.OPAL_REPLICA_FROM }}} + network {quartz}, replica_from_address {${{ env.QUARTZ_REPLICA_FROM }}} + network {unique}, replica_from_address {${{ env.UNIQUE_REPLICA_FROM }}} try-runtime-build: needs: prepare-execution-marix # The type of runner that the job will run on - runs-on: [self-hosted-ci] + runs-on: [ self-hosted-ci ] 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. name: ${{ matrix.network }}-try-runtime-build @@ -55,7 +58,7 @@ jobs: uses: AutoModality/action-clean@v1.1.0 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.1.0 + - uses: actions/checkout@v4.1.7 with: ref: ${{ github.head_ref }} #Checking out head commit @@ -64,10 +67,10 @@ jobs: uses: ./.github/actions/prepare - name: Read .env file - uses: xom9ikk/dotenv@v2 + uses: xom9ikk/dotenv@v2.3.0 - name: Log in to Docker Hub - uses: docker/login-action@v2.1.0 + uses: docker/login-action@v3.2.0 with: username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} @@ -79,16 +82,14 @@ jobs: template: .docker/Dockerfile-try-runtime.j2 output_file: .docker/Dockerfile-try-runtime.${{ matrix.network }}.yml variables: | - RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} NETWORK=${{ matrix.network }} - WASM_NAME=${{ matrix.wasm_name }} REPLICA_FROM=${{ matrix.replica_from_address }} - name: Show build Dockerfile run: cat .docker/Dockerfile-try-runtime.${{ matrix.network }}.yml - name: Run find-and-replace to remove slashes from branch name - uses: mad9000/actions-find-and-replace-string@4 + uses: mad9000/actions-find-and-replace-string@5 id: branchname with: source: ${{ github.head_ref }} @@ -137,7 +138,7 @@ jobs: uses: AutoModality/action-clean@v1.1.0 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.1.0 + - uses: actions/checkout@v4.1.7 with: ref: ${{ github.head_ref }} #Checking out head commit @@ -150,7 +151,7 @@ jobs: echo "BUILD_SHA=${LAST_COMMIT_SHA:0:8}" >> $GITHUB_ENV - name: Run find-and-replace to remove slashes from branch name - uses: mad9000/actions-find-and-replace-string@4 + uses: mad9000/actions-find-and-replace-string@5 id: branchname with: source: ${{ github.head_ref }} @@ -158,7 +159,7 @@ jobs: replace: '-' - name: Read .env file - uses: xom9ikk/dotenv@v2 + uses: xom9ikk/dotenv@v2.3.0 - name: Generate ENV related extend file for docker-compose uses: cuchi/jinja2-action@v1.2.0 @@ -172,18 +173,18 @@ jobs: - name: Show build configuration run: cat .docker/docker-compose.try-runtime.${{ matrix.network }}.yml - - uses: actions/setup-node@v3.5.1 + - uses: actions/setup-node@v4.0.2 with: node-version: 20 - name: Log in to Docker Hub - uses: docker/login-action@v2.1.0 + uses: docker/login-action@v3.2.0 with: username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} - name: Build the stack - run: docker-compose -f ".docker/docker-compose.try-runtime.${{ matrix.network }}.yml" up -d --remove-orphans --force-recreate --timeout 300 + run: docker compose -f ".docker/docker-compose.try-runtime.${{ matrix.network }}.yml" up -d --remove-orphans --force-recreate --timeout 300 - name: Check if docker logs consist logs related to Runtime Upgrade testing. if: success() @@ -243,7 +244,7 @@ jobs: - name: Stop running containers if: always() # run this step always - run: docker-compose -f ".docker/docker-compose.try-runtime.${{ matrix.network }}.yml" down + run: docker compose -f ".docker/docker-compose.try-runtime.${{ matrix.network }}.yml" down - name: Remove builder cache if: always() # run this step always diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 6a399fb1df..4a4070c7d6 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -1,18 +1,19 @@ # https://cryptousetech.atlassian.net/wiki/spaces/CI/pages/2586738699/Unit+Tests # Re-Usable Workflow for lanching Unit tests -name: unit tests +name: unit-tests # Controls when the action will run. # Triger: only call from main workflow(re-usable workflows) on: workflow_call: + workflow_dispatch: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: unit_tests: # The type of runner that the job will run on - runs-on: [self-hosted-ci,medium] + runs-on: [ self-hosted-ci,medium ] timeout-minutes: 1380 name: ${{ github.base_ref }} @@ -25,31 +26,28 @@ jobs: uses: AutoModality/action-clean@v1.1.0 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.1.0 + - uses: actions/checkout@v4.1.7 with: ref: ${{ github.head_ref }} #Checking out head commit - name: Read .env file - uses: xom9ikk/dotenv@v2 + uses: xom9ikk/dotenv@v2.3.0 - name: Generate ENV related extend file for docker-compose uses: cuchi/jinja2-action@v1.2.0 with: template: .docker/docker-compose.tmp-unit.j2 output_file: .docker/docker-compose.unit.yml - variables: | - RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} - - name: Show build configuration run: cat .docker/docker-compose.unit.yml - name: Build the stack - run: docker-compose -f ".docker/docker-compose.unit.yml" up --build --force-recreate --timeout 300 --remove-orphans --exit-code-from node-dev + run: docker compose -f ".docker/docker-compose.unit.yml" up --build --force-recreate --timeout 300 --remove-orphans --exit-code-from node-dev - name: Stop running containers if: always() # run this step always - run: docker-compose -f ".docker/docker-compose.unit.yml" down + run: docker compose -f ".docker/docker-compose.unit.yml" down - name: Remove builder cache if: always() # run this step always diff --git a/.github/workflows/xcm.yml b/.github/workflows/xcm.yml index 998a80380c..01f2748178 100644 --- a/.github/workflows/xcm.yml +++ b/.github/workflows/xcm.yml @@ -16,7 +16,7 @@ jobs: prepare-execution-marix: name: Prepare execution matrix - runs-on: [self-hosted-ci] + runs-on: [ self-hosted-ci ] outputs: matrix: ${{ steps.create_matrix.outputs.matrix }} @@ -25,21 +25,21 @@ jobs: uses: AutoModality/action-clean@v1.1.0 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.1.0 + - uses: actions/checkout@v4.1.7 with: ref: ${{ github.head_ref }} #Checking out head commit - name: Read .env file - uses: xom9ikk/dotenv@v2 + uses: xom9ikk/dotenv@v2.3.0 - name: Create Execution matrix uses: CertainLach/create-matrix-action@v4 id: create_matrix with: matrix: | - network {opal}, relay_branch {${{ env.UNIQUEWEST_MAINNET_BRANCH }}}, acala_version {${{ env.ACALA_BUILD_BRANCH }}}, moonbeam_version {${{ env.MOONBEAM_BUILD_BRANCH }}}, cumulus_version {${{ env.WESTMINT_BUILD_BRANCH }}}, astar_version {${{ env.ASTAR_BUILD_BRANCH }}}, polkadex_version {${{ env.POLKADEX_BUILD_BRANCH }}}, hydradx_version {${{ env.HYDRADX_BUILD_BRANCH }}}, runtest {testXcmOpal}, runtime_features {opal-runtime} - network {quartz}, relay_branch {${{ env.KUSAMA_MAINNET_BRANCH }}}, acala_version {${{ env.KARURA_BUILD_BRANCH }}}, moonbeam_version {${{ env.MOONRIVER_BUILD_BRANCH }}}, cumulus_version {${{ env.STATEMINE_BUILD_BRANCH }}}, astar_version {${{ env.SHIDEN_BUILD_BRANCH }}}, polkadex_version {${{ env.POLKADEX_BUILD_BRANCH }}}, hydradx_version {${{ env.HYDRADX_BUILD_BRANCH }}}, runtest {testFullXcmQuartz}, runtime_features {quartz-runtime} - network {unique}, relay_branch {${{ env.POLKADOT_MAINNET_BRANCH }}}, acala_version {${{ env.ACALA_BUILD_BRANCH }}}, moonbeam_version {${{ env.MOONBEAM_BUILD_BRANCH }}}, cumulus_version {${{ env.STATEMINT_BUILD_BRANCH }}}, astar_version {${{ env.ASTAR_BUILD_BRANCH }}}, polkadex_version {${{ env.POLKADEX_BUILD_BRANCH }}}, hydradx_version {${{ env.HYDRADX_BUILD_BRANCH }}}, runtest {testFullXcmUnique}, runtime_features {unique-runtime} + network {opal}, relay_branch {${{ env.UNIQUEWEST_MAINNET_BRANCH }}}, assethub_version {${{ env.WESTMINT_BUILD_BRANCH }}}, acala_version {${{ env.ACALA_BUILD_BRANCH }}}, acala_repository {acala-node}, moonbeam_version {${{ env.MOONBEAM_BUILD_BRANCH }}}, astar_version {${{ env.ASTAR_BUILD_BRANCH }}}, runtest {testXcmOpal} + network {quartz}, relay_branch {${{ env.KUSAMA_MAINNET_BRANCH }}}, assethub_version {${{ env.STATEMINE_BUILD_BRANCH }}}, acala_version {${{ env.KARURA_BUILD_BRANCH }}}, acala_repository {karura-node}, moonbeam_version {${{ env.MOONRIVER_BUILD_BRANCH }}}, astar_version {${{ env.SHIDEN_BUILD_BRANCH }}}, runtest {testFullXcmQuartz} + network {unique}, relay_branch {${{ env.POLKADOT_MAINNET_BRANCH }}}, assethub_version {${{ env.STATEMINT_BUILD_BRANCH }}}, acala_version {${{ env.ACALA_BUILD_BRANCH }}}, acala_repository {acala-node}, moonbeam_version {${{ env.MOONBEAM_BUILD_BRANCH }}}, astar_version {${{ env.ASTAR_BUILD_BRANCH }}}, runtest {testFullXcmUnique} xcm: needs: prepare-execution-marix @@ -65,7 +65,7 @@ jobs: uses: AutoModality/action-clean@v1.1.0 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.1.0 + - uses: actions/checkout@v4.1.7 with: ref: ${{ github.head_ref }} #Checking out head commit @@ -74,269 +74,121 @@ jobs: uses: ./.github/actions/prepare - name: Read .env file - uses: xom9ikk/dotenv@v2 + uses: xom9ikk/dotenv@v2.3.0 - name: Log in to Docker Hub - uses: docker/login-action@v2.1.0 + uses: docker/login-action@v3.2.0 with: username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} - # Check POLKADOT version and build it if it doesn't exist in repository - - name: Generate ENV related extend Dockerfile file for POLKADOT - uses: cuchi/jinja2-action@v1.2.0 + - name: Check and pull polkadot image + id: polkadot + uses: cloudposse/github-action-docker-image-exists@main with: - template: .docker/Dockerfile-polkadot.j2 - output_file: .docker/Dockerfile-polkadot.${{ matrix.relay_branch }}.yml - variables: | - RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} - POLKADOT_BUILD_BRANCH=${{ matrix.relay_branch }} + registry: registry.hub.docker.com + organization: parity + repository: polkadot + login: ${{ secrets.CORE_DOCKERHUB_USERNAME }} + password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} + tag: ${{ matrix.relay_branch }} - - name: Check if the dockerhub repository contains the needed version POLKADOT - run: | - # aquire token - TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token) - export TOKEN=$TOKEN - - # Get TAGS from DOCKERHUB POLKADOT repository - POLKADOT_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-polkadot/tags/?page_size=100 | jq -r '."results"[]["name"]') - # Show TAGS - echo "POLKADOT TAGS:" - echo $POLKADOT_TAGS - # Check correct version POLKADOT and build it if it doesn't exist in POLKADOT TAGS - if [[ ${POLKADOT_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.relay_branch }}"($|[[:space:]]) ]]; then - echo "Repository has needed POLKADOT version"; - docker pull uniquenetwork/builder-polkadot:${{ matrix.relay_branch }} - else - echo "Repository has not needed POLKADOT version, so build it"; - cd .docker/ && docker build --file ./Dockerfile-polkadot.${{ matrix.relay_branch }}.yml --tag uniquenetwork/builder-polkadot:${{ matrix.relay_branch }} . - echo "Push needed POLKADOT version to the repository"; - docker push uniquenetwork/builder-polkadot:${{ matrix.relay_branch }} - fi - shell: bash - - # Check ACALA version and build it if it doesn't exist in repository - - name: Generate ENV related extend Dockerfile file for ACALA - uses: cuchi/jinja2-action@v1.2.0 + - name: Check and pull acala image + id: acala + uses: cloudposse/github-action-docker-image-exists@main with: - template: .docker/Dockerfile-acala.j2 - output_file: .docker/Dockerfile-acala.${{ matrix.acala_version }}.yml - variables: | - RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} - ACALA_BUILD_BRANCH=${{ matrix.acala_version }} + registry: registry.hub.docker.com + organization: acala + repository: ${{ matrix.acala_repository }} + login: ${{ secrets.CORE_DOCKERHUB_USERNAME }} + password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} + tag: ${{ matrix.acala_version }} - - name: Check if the dockerhub repository contains the needed ACALA version - run: | - # aquire token - TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token) - export TOKEN=$TOKEN - - # Get TAGS from DOCKERHUB repository - ACALA_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-acala/tags/?page_size=100 | jq -r '."results"[]["name"]') - # Show TAGS - echo "ACALA TAGS:" - echo $ACALA_TAGS - # Check correct version ACALA and build it if it doesn't exist in ACALA TAGS - if [[ ${ACALA_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.acala_version }}"($|[[:space:]]) ]]; then - echo "Repository has needed ACALA version"; - docker pull uniquenetwork/builder-acala:${{ matrix.acala_version }} - else - echo "Repository has not needed ACALA version, so build it"; - cd .docker/ && docker build --file ./Dockerfile-acala.${{ matrix.acala_version }}.yml --tag uniquenetwork/builder-acala:${{ matrix.acala_version }} . - echo "Push needed ACALA version to the repository"; - docker push uniquenetwork/builder-acala:${{ matrix.acala_version }} - fi - shell: bash - - # Check MOONBEAM version and build it if it doesn't exist in repository - - name: Generate ENV related extend Dockerfile file for MOONBEAM - uses: cuchi/jinja2-action@v1.2.0 + - name: Check and pull MOONBEAM image + id: moonbeam + uses: cloudposse/github-action-docker-image-exists@main with: - template: .docker/Dockerfile-moonbeam.j2 - output_file: .docker/Dockerfile-moonbeam.${{ matrix.moonbeam_version }}.yml - variables: | - RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} - MOONBEAM_BUILD_BRANCH=${{ matrix.moonbeam_version }} + registry: registry.hub.docker.com + organization: moonbeamfoundation + repository: moonbeam + login: ${{ secrets.CORE_DOCKERHUB_USERNAME }} + password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} + tag: ${{ matrix.moonbeam_version }} - - name: Check if the dockerhub repository contains the needed MOONBEAM version - run: | - # aquire token - TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token) - export TOKEN=$TOKEN - - # Get TAGS from DOCKERHUB repository - MOONBEAM_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-moonbeam/tags/?page_size=100 | jq -r '."results"[]["name"]') - # Show TAGS - echo "MOONBEAM TAGS:" - echo $MOONBEAM_TAGS - # Check correct version MOONBEAM and build it if it doesn't exist in MOONBEAM TAGS - if [[ ${MOONBEAM_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.moonbeam_version }}"($|[[:space:]]) ]]; then - echo "Repository has needed MOONBEAM version"; - docker pull uniquenetwork/builder-moonbeam:${{ matrix.moonbeam_version }} - else - echo "Repository has not needed MOONBEAM version, so build it"; - cd .docker/ && docker build --file ./Dockerfile-moonbeam.${{ matrix.moonbeam_version }}.yml --tag uniquenetwork/builder-moonbeam:${{ matrix.moonbeam_version }} . - echo "Push needed MOONBEAM version to the repository"; - docker push uniquenetwork/builder-moonbeam:${{ matrix.moonbeam_version }} - fi - shell: bash - - # Check CUMULUS version and build it if it doesn't exist in repository - - name: Generate ENV related extend Dockerfile file for CUMULUS - uses: cuchi/jinja2-action@v1.2.0 + - name: Check and pull ASSETHUB image + id: assethub + uses: cloudposse/github-action-docker-image-exists@main with: - template: .docker/Dockerfile-cumulus.j2 - output_file: .docker/Dockerfile-cumulus.${{ matrix.cumulus_version }}.yml - variables: | - RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} - CUMULUS_BUILD_BRANCH=${{ matrix.cumulus_version }} + registry: registry.hub.docker.com + organization: parity + repository: polkadot-parachain + login: ${{ secrets.CORE_DOCKERHUB_USERNAME }} + password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} + tag: ${{ matrix.assethub_version }} - - name: Check if the dockerhub repository contains the needed CUMULUS version - run: | - # aquire token - TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token) - export TOKEN=$TOKEN - - # Get TAGS from DOCKERHUB repository - CUMULUS_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-cumulus/tags/?page_size=100 | jq -r '."results"[]["name"]') - # Show TAGS - echo "CUMULUS TAGS:" - echo $CUMULUS_TAGS - # Check correct version CUMULUS and build it if it doesn't exist in CUMULUS TAGS - if [[ ${CUMULUS_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.cumulus_version }}"($|[[:space:]]) ]]; then - echo "Repository has needed CUMULUS version"; - docker pull uniquenetwork/builder-cumulus:${{ matrix.cumulus_version }} - else - echo "Repository has not needed CUMULUS version, so build it"; - cd .docker/ && docker build --file ./Dockerfile-cumulus.${{ matrix.cumulus_version }}.yml --tag uniquenetwork/builder-cumulus:${{ matrix.cumulus_version }} . - echo "Push needed CUMULUS version to the repository"; - docker push uniquenetwork/builder-cumulus:${{ matrix.cumulus_version }} - fi - shell: bash - - # Check ASTAR version and build it if it doesn't exist in repository - - name: Generate ENV related extend Dockerfile file for ASTAR - uses: cuchi/jinja2-action@v1.2.0 + - name: Check and pull ASTAR image + id: astar + uses: cloudposse/github-action-docker-image-exists@main with: - template: .docker/Dockerfile-astar.j2 - output_file: .docker/Dockerfile-astar.${{ matrix.astar_version }}.yml - variables: | - RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} - ASTAR_BUILD_BRANCH=${{ matrix.astar_version }} + registry: registry.hub.docker.com + organization: staketechnologies + repository: astar-collator + login: ${{ secrets.CORE_DOCKERHUB_USERNAME }} + password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} + tag: ${{ matrix.astar_version }} - - name: Check if the dockerhub repository contains the needed ASTAR version - run: | - # aquire token - TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token) - export TOKEN=$TOKEN - - # Get TAGS from DOCKERHUB repository - ASTAR_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-astar/tags/?page_size=100 | jq -r '."results"[]["name"]') - # Show TAGS - echo "ASTAR TAGS:" - echo $ASTAR_TAGS - # Check correct version ASTAR and build it if it doesn't exist in ASTAR TAGS - if [[ ${ASTAR_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.astar_version }}"($|[[:space:]]) ]]; then - echo "Repository has needed ASTAR version"; - docker pull uniquenetwork/builder-astar:${{ matrix.astar_version }} - else - echo "Repository has not needed ASTAR version, so build it"; - cd .docker/ && docker build --file ./Dockerfile-astar.${{ matrix.astar_version }}.yml --tag uniquenetwork/builder-astar:${{ matrix.astar_version }} . - echo "Push needed ASTAR version to the repository"; - docker push uniquenetwork/builder-astar:${{ matrix.astar_version }} - fi - shell: bash - - # Check POLKADEX version and build it if it doesn't exist in repository - - name: Generate ENV related extend Dockerfile file for POLKADEX - uses: cuchi/jinja2-action@v1.2.0 + - name: Check and pull POLKADEX image + id: polkadex + uses: cloudposse/github-action-docker-image-exists@main with: - template: .docker/Dockerfile-polkadex.j2 - output_file: .docker/Dockerfile-polkadex.${{ matrix.polkadex_version }}.yml - variables: | - RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} - POLKADEX_BUILD_BRANCH=${{ matrix.polkadex_version }} + registry: registry.hub.docker.com + organization: polkadex + repository: mainnet + login: ${{ secrets.CORE_DOCKERHUB_USERNAME }} + password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} + tag: ${{ env.POLKADEX_BUILD_BRANCH }} - - name: Check if the dockerhub repository contains the needed POLKADEX version - run: | - # aquire token - TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token) - export TOKEN=$TOKEN - - # Get TAGS from DOCKERHUB repository - POLKADEX_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-polkadex/tags/?page_size=100 | jq -r '."results"[]["name"]') - # Show TAGS - echo "POLKADEX TAGS:" - echo $POLKADEX_TAGS - # Check correct version POLKADEX and build it if it doesn't exist in POLKADEX TAGS - if [[ ${POLKADEX_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.polkadex_version }}"($|[[:space:]]) ]]; then - echo "Repository has needed POLKADEX version"; - docker pull uniquenetwork/builder-polkadex:${{ matrix.polkadex_version }} - else - echo "Repository has not needed POLKADEX version, so build it"; - cd .docker/ && docker build --file ./Dockerfile-polkadex.${{ matrix.polkadex_version }}.yml --tag uniquenetwork/builder-polkadex:${{ matrix.polkadex_version }} . - echo "Push needed POLKADEX version to the repository"; - docker push uniquenetwork/builder-polkadex:${{ matrix.polkadex_version }} - fi - shell: bash - - # Check Hydradx version and build it if it doesn't exist in repository - - name: Generate ENV related extend Dockerfile file for Hydradx - uses: cuchi/jinja2-action@v1.2.0 + - name: Prepare Hydradx + uses: ./.github/actions/buildContainer + id: hydradx with: - template: .docker/Dockerfile-hydradx.j2 - output_file: .docker/Dockerfile-hydradx.${{ matrix.hydradx_version }}.yml - variables: | - RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} - HYDRADX_BUILD_BRANCH=${{ matrix.hydradx_version }} - - - name: Check if the dockerhub repository contains the needed HYDRADX version - run: | - # aquire token - TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token) - export TOKEN=$TOKEN - - # Get TAGS from DOCKERHUB repository - HYDRADX_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-hydradx/tags/?page_size=100 | jq -r '."results"[]["name"]') - # Show TAGS - echo "HYDRADX TAGS:" - echo $HYDRADX_TAGS - # Check correct version HYDRADX and build it if it doesn't exist in HYDRADX TAGS - if [[ ${HYDRADX_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.hydradx_version }}"($|[[:space:]]) ]]; then - echo "Repository has needed HYDRADX version"; - docker pull uniquenetwork/builder-hydradx:${{ matrix.hydradx_version }} - else - echo "Repository has not needed HYDRADX version, so build it"; - cd .docker/ && docker build --file ./Dockerfile-hydradx.${{ matrix.hydradx_version }}.yml --tag uniquenetwork/builder-hydradx:${{ matrix.hydradx_version }} . - echo "Push needed HYDRADX version to the repository"; - docker push uniquenetwork/builder-hydradx:${{ matrix.hydradx_version }} - fi - shell: bash - - - - name: Build unique-chain - run: | - docker build --file .docker/Dockerfile-unique \ - --build-arg RUNTIME_FEATURES=${{ matrix.runtime_features }} \ - --build-arg RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} \ - --tag uniquenetwork/ci-xcm-local:${{ matrix.network }}-${{ env.REF_SLUG }}-${{ env.BUILD_SHA }} \ - . - - - name: Push docker image version - run: docker push uniquenetwork/ci-xcm-local:${{ matrix.network }}-${{ env.REF_SLUG }}-${{ env.BUILD_SHA }} - - - uses: actions/setup-node@v3.5.1 + container: uniquenetwork/builder-hydradx + tag: ${{ env.HYDRADX_BUILD_BRANCH }} + context: . + dockerfile: .docker/Dockerfile-hydradx + args: | + --build-arg HYDRADX_BUILD_BRANCH=${{ env.HYDRADX_BUILD_BRANCH }} + --build-arg RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + dockerhub_username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} + dockerhub_token: ${{ secrets.CORE_DOCKERHUB_TOKEN }} + + - name: Prepare latest + uses: ./.github/actions/buildContainer + id: latest + with: + container: uniquenetwork/ci-xcm-local + tag: ${{ matrix.network }}-${{ env.REF_SLUG }}-${{ env.BUILD_SHA }} + context: . + dockerfile: .docker/Dockerfile-unique + args: | + --build-arg FEATURES=${{ matrix.network }}-runtime + dockerhub_username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} + dockerhub_token: ${{ secrets.CORE_DOCKERHUB_TOKEN }} + + - uses: actions/setup-node@v4.0.2 with: node-version: 20 - name: Install baedeker - uses: UniqueNetwork/baedeker-action/setup@built + uses: UniqueNetwork/baedeker-action/setup@v1-no-debug-output + with: + useCache: false - name: Setup library run: mkdir -p .baedeker/vendor/ && git clone https://github.com/UniqueNetwork/baedeker-library .baedeker/vendor/baedeker-library - name: Start network - uses: UniqueNetwork/baedeker-action@built + uses: UniqueNetwork/baedeker-action@v1-no-debug-output id: bdk with: jpath: | @@ -345,14 +197,14 @@ jobs: relay_spec=${{ env.RELAY_CHAIN_TYPE }}-local inputs: | .baedeker/xcm-${{ matrix.network }}.jsonnet - snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/polkadot':{dockerImage:'uniquenetwork/builder-polkadot:${{ matrix.relay_branch }}'}}) - snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/unique':{dockerImage:'uniquenetwork/ci-xcm-local:${{ matrix.network }}-${{ env.REF_SLUG }}-${{ env.BUILD_SHA }}'}}) - snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/acala':{dockerImage:'uniquenetwork/builder-acala:${{ matrix.acala_version }}'}}) - snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/moonbeam':{dockerImage:'uniquenetwork/builder-moonbeam:${{ matrix.moonbeam_version }}'}}) - snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/cumulus':{dockerImage:'uniquenetwork/builder-cumulus:${{ matrix.cumulus_version }}'}}) - snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/astar':{dockerImage:'uniquenetwork/builder-astar:${{ matrix.astar_version }}'}}) - snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/polkadex':{dockerImage:'uniquenetwork/builder-polkadex:${{ matrix.polkadex_version }}'}}) - snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/hydradx':{dockerImage:'uniquenetwork/builder-hydradx:${{ matrix.hydradx_version }}'}}) + snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/polkadot':{dockerImage:'${{ steps.polkadot.outputs.image }}:${{ steps.polkadot.outputs.tag }}'}}) + snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/unique':{dockerImage:'${{ steps.latest.outputs.name }}'}}) + snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/acala':{dockerImage:'${{ steps.acala.outputs.image }}:${{ steps.acala.outputs.tag }}'}}) + snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/moonbeam':{dockerImage:'${{ steps.moonbeam.outputs.image }}:${{ steps.moonbeam.outputs.tag }}'}}) + snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/assethub':{dockerImage:'${{ steps.assethub.outputs.image }}:${{ steps.assethub.outputs.tag }}'}}) + snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/astar':{dockerImage:'${{ steps.astar.outputs.image }}:${{ steps.astar.outputs.tag }}', docker:'/usr/local/bin/astar-collator'}}) + snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/polkadex':{dockerImage:'${{ steps.polkadex.outputs.image }}:${{ steps.polkadex.outputs.tag }}'}}) + snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/hydradx':{dockerImage:'${{ steps.latest.outputs.name }}'}}) - name: Upload network config uses: actions/upload-artifact@v3 @@ -361,28 +213,36 @@ jobs: path: ${{ steps.bdk.outputs.composeProject }} retention-days: 2 - - name: Yarn install + - name: Ensure network is alive working-directory: js-packages/tests + id: alive1 + if: ${{ !cancelled() && steps.bdk.outcome == 'success' }} run: | - yarn install + yarn yarn add mochawesome + ../scripts/wait_for_first_block.sh + env: + RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }} - name: Call HRMP initialization working-directory: js-packages/scripts + id: hrmp + if: ${{ !cancelled() && steps.alive1.outcome == 'success' }} run: | yarn node --no-warnings=ExperimentalWarning --loader ts-node/esm createHrmp.ts ${{matrix.network}} - name: Run XCM tests working-directory: js-packages/tests + id: tests + if: ${{ !cancelled() && steps.hrmp.outcome == 'success' }} run: | - # Wanted by both wait_for_first_block - export RPC_URL="${RELAY_OPAL_HTTP_URL:-${RELAY_QUARTZ_HTTP_URL:-${RELAY_UNIQUE_HTTP_URL:-}}}" - ../scripts/wait_for_first_block.sh echo "Ready to start tests" NOW=$(date +%s) && yarn ${{ matrix.runtest }} --reporter mochawesome --reporter-options reportFilename=test-${NOW} + env: + RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }} - name: XCM Test Report - uses: phoenix-actions/test-reporting@v10 + uses: phoenix-actions/test-reporting@v15 id: test-report if: success() || failure() with: diff --git a/.github/workflows/xnft.yml b/.github/workflows/xnft.yml index d6fd158c7f..bc9807dd43 100644 --- a/.github/workflows/xnft.yml +++ b/.github/workflows/xnft.yml @@ -16,7 +16,7 @@ jobs: prepare-execution-marix: name: Prepare execution matrix - runs-on: [self-hosted-ci] + runs-on: [ self-hosted-ci ] outputs: matrix: ${{ steps.create_matrix.outputs.matrix }} @@ -25,19 +25,19 @@ jobs: uses: AutoModality/action-clean@v1.1.0 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.1.0 + - uses: actions/checkout@v4.1.7 with: ref: ${{ github.head_ref }} #Checking out head commit - name: Read .env file - uses: xom9ikk/dotenv@v2 + uses: xom9ikk/dotenv@v2.3.0 - name: Create Execution matrix uses: CertainLach/create-matrix-action@v4 id: create_matrix with: matrix: | - network {quartz}, relay_branch {${{ env.KUSAMA_MAINNET_BRANCH }}}, acala_version {${{ env.KARURA_BUILD_BRANCH }}}, runtest {all-quartz}, runtime_features {quartz-runtime} + network {quartz}, relay_branch {${{ env.KUSAMA_MAINNET_BRANCH }}}, acala_version {${{ env.KARURA_BUILD_BRANCH }}}, acala_repository {karura-node}, runtest {all-quartz} xnft: needs: prepare-execution-marix @@ -60,10 +60,11 @@ jobs: run: exit 1 - name: Clean Workspace + if: always() uses: AutoModality/action-clean@v1.1.0 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.1.0 + - uses: actions/checkout@v4.1.7 with: ref: ${{ github.head_ref }} #Checking out head commit @@ -72,117 +73,89 @@ jobs: uses: ./.github/actions/prepare - name: Read .env file - uses: xom9ikk/dotenv@v2 + uses: xom9ikk/dotenv@v2.3.0 - name: Log in to Docker Hub - uses: docker/login-action@v2.1.0 + uses: docker/login-action@v3.2.0 with: username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} - # Check POLKADOT version and build it if it doesn't exist in repository - - name: Generate ENV related extend Dockerfile file for POLKADOT - uses: cuchi/jinja2-action@v1.2.0 + - name: Check and pull polkadot image + id: polkadot + uses: cloudposse/github-action-docker-image-exists@main with: - template: .docker/Dockerfile-polkadot.j2 - output_file: .docker/Dockerfile-polkadot.${{ matrix.relay_branch }}.yml - variables: | - RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} - POLKADOT_BUILD_BRANCH=${{ matrix.relay_branch }} + registry: registry.hub.docker.com + organization: parity + repository: polkadot + login: ${{ secrets.CORE_DOCKERHUB_USERNAME }} + password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} + tag: ${{ matrix.relay_branch }} - - name: Check if the dockerhub repository contains the needed version POLKADOT - run: | - # aquire token - TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token) - export TOKEN=$TOKEN - - # Get TAGS from DOCKERHUB POLKADOT repository - POLKADOT_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-polkadot/tags/?page_size=100 | jq -r '."results"[]["name"]') - # Show TAGS - echo "POLKADOT TAGS:" - echo $POLKADOT_TAGS - # Check correct version POLKADOT and build it if it doesn't exist in POLKADOT TAGS - if [[ ${POLKADOT_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.relay_branch }}"($|[[:space:]]) ]]; then - echo "Repository has needed POLKADOT version"; - docker pull uniquenetwork/builder-polkadot:${{ matrix.relay_branch }} - else - echo "Repository has not needed POLKADOT version, so build it"; - cd .docker/ && docker build --file ./Dockerfile-polkadot.${{ matrix.relay_branch }}.yml --tag uniquenetwork/builder-polkadot:${{ matrix.relay_branch }} . - echo "Push needed POLKADOT version to the repository"; - docker push uniquenetwork/builder-polkadot:${{ matrix.relay_branch }} - fi - shell: bash - - # Check ACALA version and build it if it doesn't exist in repository - - name: Generate ENV related extend Dockerfile file for ACALA - uses: cuchi/jinja2-action@v1.2.0 + - name: Check and pull acala image + id: acala + uses: cloudposse/github-action-docker-image-exists@main with: - template: .docker/Dockerfile-acala.j2 - output_file: .docker/Dockerfile-acala.${{ matrix.acala_version }}.yml - variables: | - RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} - ACALA_BUILD_BRANCH=${{ matrix.acala_version }} - - - name: Check if the dockerhub repository contains the needed ACALA version - run: | - # aquire token - TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token) - export TOKEN=$TOKEN - - # Get TAGS from DOCKERHUB repository - ACALA_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-acala/tags/?page_size=100 | jq -r '."results"[]["name"]') - # Show TAGS - echo "ACALA TAGS:" - echo $ACALA_TAGS - # Check correct version ACALA and build it if it doesn't exist in ACALA TAGS - if [[ ${ACALA_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.acala_version }}"($|[[:space:]]) ]]; then - echo "Repository has needed ACALA version"; - docker pull uniquenetwork/builder-acala:${{ matrix.acala_version }} - else - echo "Repository has not needed ACALA version, so build it"; - cd .docker/ && docker build --file ./Dockerfile-acala.${{ matrix.acala_version }}.yml --tag uniquenetwork/builder-acala:${{ matrix.acala_version }} . - echo "Push needed ACALA version to the repository"; - docker push uniquenetwork/builder-acala:${{ matrix.acala_version }} - fi - shell: bash - - - name: Build unique-chain - run: | - docker build --file .docker/Dockerfile-unique \ - --build-arg RUNTIME_FEATURES=${{ matrix.runtime_features }} \ - --build-arg RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} \ - --tag uniquenetwork/ci-xnft-local:${{ matrix.network }}-${{ env.REF_SLUG }}-${{ env.BUILD_SHA }} \ - . - - - name: Push docker image version - run: docker push uniquenetwork/ci-xnft-local:${{ matrix.network }}-${{ env.REF_SLUG }}-${{ env.BUILD_SHA }} + registry: registry.hub.docker.com + organization: acala + repository: ${{ matrix.acala_repository }} + login: ${{ secrets.CORE_DOCKERHUB_USERNAME }} + password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} + tag: ${{ matrix.acala_version }} - - uses: actions/setup-node@v3.5.1 + - name: Prepare latest + uses: ./.github/actions/buildContainer + id: latest + with: + container: uniquenetwork/ci-xnft-local + tag: ${{ matrix.network }}-${{ env.REF_SLUG }}-${{ env.BUILD_SHA }} + context: . + dockerfile: .docker/Dockerfile-unique + args: | + --build-arg FEATURES=${{ matrix.network }}-runtime + dockerhub_username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} + dockerhub_token: ${{ secrets.CORE_DOCKERHUB_TOKEN }} + + - uses: actions/setup-node@v4.0.2 with: node-version: 20 - name: Clone xnft-tests - run: git clone https://github.com/UniqueNetwork/xnft-tests.git + run: git clone -b ci https://github.com/UniqueNetwork/xnft-tests.git - name: Install baedeker - uses: UniqueNetwork/baedeker-action/setup@built + uses: UniqueNetwork/baedeker-action/setup@v1-no-debug-output + with: + useCache: false - name: Setup library run: mkdir -p .baedeker/vendor/ && git clone https://github.com/UniqueNetwork/baedeker-library .baedeker/vendor/baedeker-library - name: Start network - uses: UniqueNetwork/baedeker-action@built + uses: UniqueNetwork/baedeker-action@v1-no-debug-output + if: success() id: bdk with: jpath: | .baedeker/vendor tla-str: | - relay_spec=rococo-local + relay_spec=${{ env.RELAY_CHAIN_TYPE }}-local inputs: | xnft-tests/.baedeker/testnets.jsonnet - snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/polkadot':{dockerImage:'uniquenetwork/builder-polkadot:${{ matrix.relay_branch }}'}}) - snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/quartz':{dockerImage:'uniquenetwork/ci-xnft-local:${{ matrix.network }}-${{ env.REF_SLUG }}-${{ env.BUILD_SHA }}'}}) - snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/karura':{dockerImage:'uniquenetwork/builder-acala:${{ matrix.acala_version }}'}}) + snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/polkadot':{dockerImage:'${{ steps.polkadot.outputs.image }}:${{ steps.polkadot.outputs.tag }}'}}) + snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/quartz':{dockerImage:'${{ steps.latest.outputs.name }}'}}) + snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/karura':{dockerImage:'${{ steps.acala.outputs.image }}:${{ steps.acala.outputs.tag }}'}}) + + - name: Ensure network is alive + working-directory: js-packages/tests + id: alive1 + if: ${{ !cancelled() && steps.bdk.outcome == 'success' }} + run: | + yarn + yarn add mochawesome + ../scripts/wait_for_first_block.sh + env: + RPC_URL: ${{ env.RELAY_QUARTZ_HTTP_URL }} - name: Yarn install working-directory: xnft-tests @@ -192,11 +165,14 @@ jobs: - name: Run XNFT Tests working-directory: xnft-tests + if: ${{ !cancelled() && steps.alive1.outcome == 'success' }} run: | NOW=$(date +%s) && yarn ${{ matrix.runtest }} --reporter mochawesome --reporter-options reportFilename=test-${NOW} + env: + RPC_URL: ${{ env.RELAY_QUARTZ_HTTP_URL }} - name: XNFT Tests Report - uses: phoenix-actions/test-reporting@v10 + uses: phoenix-actions/test-reporting@v15 id: test-report if: success() || failure() with: @@ -205,10 +181,6 @@ jobs: reporter: mochawesome-json fail-on-error: 'false' - - name: Clean Workspace - if: always() - uses: AutoModality/action-clean@v1.1.0 - - name: Remove builder cache if: always() run: | diff --git a/.github/workflows/yarn-dev.yml b/.github/workflows/yarn-dev.yml index e671c7772e..5eb4ab7f7f 100644 --- a/.github/workflows/yarn-dev.yml +++ b/.github/workflows/yarn-dev.yml @@ -1,19 +1,18 @@ # Integration test in --dev mode # https://cryptousetech.atlassian.net/wiki/spaces/CI/pages/2586411104/Integration+tests -name: yarn dev +name: yarn-dev # Triger: only call from main workflow(re-usable workflows) on: workflow_call: - - + workflow_dispatch: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: dev_build_int_tests: # The type of runner that the job will run on - runs-on: [self-hosted-ci,medium] + runs-on: [ self-hosted-ci,medium ] timeout-minutes: 1380 name: ${{ matrix.network }} @@ -28,17 +27,16 @@ jobs: - network: "unique" steps: - - name: Clean Workspace uses: AutoModality/action-clean@v1.1.0 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.1.0 + - uses: actions/checkout@v4.1.7 with: ref: ${{ github.head_ref }} #Checking out head commit - name: Read .env file - uses: xom9ikk/dotenv@v2 + uses: xom9ikk/dotenv@v2.3.0 - name: Generate ENV related extend file for docker-compose uses: cuchi/jinja2-action@v1.2.0 @@ -46,17 +44,15 @@ jobs: template: .docker/docker-compose.tmp-dev.j2 output_file: .docker/docker-compose.${{ matrix.network }}.yml variables: | - RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} NETWORK=${{ matrix.network }} - - name: Show build configuration run: cat .docker/docker-compose.${{ matrix.network }}.yml - name: Build the stack - run: docker-compose -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --remove-orphans + run: docker compose -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --remove-orphans - - uses: actions/setup-node@v3.5.1 + - uses: actions/setup-node@v4.0.2 with: node-version: 20 @@ -72,7 +68,7 @@ jobs: RPC_URL: http://127.0.0.1:9944/ - name: Test Report - uses: phoenix-actions/test-reporting@v10 + uses: phoenix-actions/test-reporting@v15 id: test-report if: success() || failure() # run this step even if previous step failed with: @@ -99,7 +95,7 @@ jobs: - name: Stop running containers if: always() # run this step always - run: docker-compose -f ".docker/docker-compose.${{ matrix.network }}.yml" down + run: docker compose -f ".docker/docker-compose.${{ matrix.network }}.yml" down - name: Remove builder cache if: always() # run this step always diff --git a/doc/demo_milestone1-2.md b/doc/demo_milestone1-2.md index 0ad38e7370..f6031b70c4 100755 --- a/doc/demo_milestone1-2.md +++ b/doc/demo_milestone1-2.md @@ -17,7 +17,7 @@ on substrate 2 version. The node can be run using docker container: ``` -docker-compose up -d +docker compose up -d ``` #### NFT Tracking Module diff --git a/kb/how-not-to-break-rpc.md b/doc/how-not-to-break-rpc.md similarity index 100% rename from kb/how-not-to-break-rpc.md rename to doc/how-not-to-break-rpc.md diff --git a/js-packages/scripts/generateEnv.ts b/js-packages/scripts/generateEnv.ts index d0c9496347..7933d4aa2d 100644 --- a/js-packages/scripts/generateEnv.ts +++ b/js-packages/scripts/generateEnv.ts @@ -41,19 +41,21 @@ function fixupUnique(version: string): string { let env = (await readFile(join(dirname, '../../.env'))).toString(); await Promise.all([ // Version from polkadot-fellows - ff('wss://rpc.polkadot.io/', /^(.)(...)(...)$/, 'v$1.$2.$3').then(v => env = setVar(env, 'POLKADOT_MAINNET_BRANCH', v)), + //ff('wss://rpc.polkadot.io/', /^(.)(...)(...)$/, 'v$1.$2.$3').then(v => env = setVar(env, 'POLKADOT_MAINNET_BRANCH', v)), + ff('wss://rococo-rpc.polkadot.io/', /^(.)(...)(...)$/, 'v$1.$2.$3').then(v => env = setVar(env, 'POLKADOT_MAINNET_BRANCH', v)), // 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://kusama-rpc.polkadot.io/', /^(.)(...)(...)$/, 'v$1.$2.$3').then(v => env = setVar(env, 'KUSAMA_MAINNET_BRANCH', 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-westend.unique.network/', /^(.)(..)(.)$/, 'release-v0.$1.$2').then(v => env = setVar(env, 'UNIQUEWEST_MAINNET_BRANCH', 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))), diff --git a/js-packages/scripts/wait_for_first_block.sh b/js-packages/scripts/wait_for_first_block.sh index 8ef51e6a14..2caf07d8a6 100755 --- a/js-packages/scripts/wait_for_first_block.sh +++ b/js-packages/scripts/wait_for_first_block.sh @@ -6,38 +6,52 @@ DIR=$(dirname "$0") last_block_id=0 block_id=0 +counter=0 function get_block { - block_id_hex=$(do_rpc chain_getHeader | jq -r .result.number) - block_id=$((block_id_hex)) - echo Id = $block_id + block_id_hex=$(do_rpc chain_getHeader | jq -r .result.number) + block_id=$((block_id_hex)) + echo Id = $block_id } function had_new_block { - last_block_id=$block_id - get_block - if (( last_block_id != 0 && block_id > last_block_id )); then - return 0 - fi - return 1 + last_block_id=$block_id + get_block + if (( last_block_id != 0 && block_id > last_block_id )); then + return 0 + fi + return 1 } function reset_check { - last_block_id=0 - block_id=0 + last_block_id=0 + block_id=0 + counter=0 } -while ! had_new_block; do - echo "Waiting for next block..." - sleep 12 +while ! had_new_block ; do + echo "Waiting for another block..." + counter=$((counter+1)) + echo "counter="$counter + sleep 12 + if [ $counter -gt 400 ]; then + exit 1; + fi done + reset_check echo "Chain is running, but lets wait for another block after a minute, to avoid startup flakiness." sleep 60 -while ! had_new_block; do - echo "Waiting for another block..." - sleep 12 +while ! had_new_block ; do + echo "Waiting for another block..." + counter=$((counter+1)) + echo "counter="$counter + sleep 12 + if [ $counter -gt 400 ]; then + exit 1; + fi done + echo "Chain is running!" diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000000..dd74b80852 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,4 @@ +[toolchain] +channel = "nightly-2024-04-10" +components = ["clippy", "rust-analyzer", "rust-src", "rustfmt"] +targets = ["wasm32-unknown-unknown"]