Skip to content

Commit

Permalink
Merge pull request #722 from UniqueNetwork/release-v930032-for-master
Browse files Browse the repository at this point in the history
Release v930032
  • Loading branch information
kozyrevdev authored Nov 14, 2022
2 parents c41d354 + 6e0aa72 commit ea2c4b0
Show file tree
Hide file tree
Showing 497 changed files with 58,077 additions and 27,323 deletions.
41 changes: 41 additions & 0 deletions .docker/Dockerfile-acala.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# ===== Rust builder =====
FROM ubuntu:20.04 as rust-builder
LABEL maintainer="Unique.Network"

ENV CARGO_HOME="/cargo-home"
ENV PATH="/cargo-home/bin:$PATH"
ENV TZ=UTC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN apt-get update && \
apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev protobuf-compiler && \
apt-get clean && \
rm -r /var/lib/apt/lists/*

RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none

RUN rustup toolchain uninstall $(rustup toolchain list) && \
rustup toolchain install {{ RUST_TOOLCHAIN }} && \
rustup default {{ RUST_TOOLCHAIN }} && \
rustup target list --installed && \
rustup show
RUN rustup target add wasm32-unknown-unknown --toolchain {{ RUST_TOOLCHAIN }}

RUN mkdir /unique_parachain
WORKDIR /unique_parachain

# ===== BUILD ACALA =====
FROM rust-builder as builder-acala-bin

WORKDIR /unique_parachain

RUN git clone -b {{ ACALA_BUILD_BRANCH }} --depth 1 https://github.com/AcalaNetwork/Acala.git && \
cd Acala && \
make init && \
make build-release

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

FROM ubuntu:20.04 as builder-acala

COPY --from=builder-acala-bin /unique_parachain/Acala/target/production/acala /unique_parachain/Acala/target/production/acala
31 changes: 31 additions & 0 deletions .docker/Dockerfile-chain-dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM ubuntu:20.04

ARG RUST_TOOLCHAIN=
ARG FEATURE=

ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Etc/UTC
ENV FEATURE=$FEATURE
ENV CARGO_HOME="/cargo-home"
ENV PATH="/cargo-home/bin:$PATH"

RUN echo "$FEATURE\n" && echo "$RUST_TOOLCHAIN\n"

RUN apt-get update && apt-get install -y git curl libssl-dev llvm pkg-config libclang-dev clang git make cmake protobuf-compiler

RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none

RUN rustup toolchain uninstall $(rustup toolchain list) && \
rustup toolchain install $RUST_TOOLCHAIN && \
rustup default $RUST_TOOLCHAIN && \
rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN

RUN mkdir /dev_chain
COPY . /dev_chain

WORKDIR /dev_chain

RUN cargo build --release
RUN echo "$FEATURE"

CMD cargo run --release --features=$FEATURE -- --dev -linfo --unsafe-ws-external --rpc-cors=all --unsafe-rpc-external
26 changes: 26 additions & 0 deletions .docker/Dockerfile-chain-dev-unit
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM ubuntu:20.04

ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Etc/UTC

RUN apt-get update && apt-get install -y git curl libssl-dev llvm pkg-config libclang-dev clang git make cmake protobuf-compiler

ENV CARGO_HOME="/cargo-home"
ENV PATH="/cargo-home/bin:$PATH"

RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none

ARG RUST_TOOLCHAIN=
ARG FEATURE=

RUN rustup toolchain uninstall $(rustup toolchain list) && \
rustup toolchain install $RUST_TOOLCHAIN && \
rustup default $RUST_TOOLCHAIN && \
rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN

RUN mkdir /dev_chain
COPY . /dev_chain

WORKDIR /dev_chain

CMD cargo test --features=limit-testing --workspace
40 changes: 40 additions & 0 deletions .docker/Dockerfile-cumulus.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# ===== Rust builder =====
FROM ubuntu:20.04 as rust-builder
LABEL maintainer="Unique.Network"

ENV CARGO_HOME="/cargo-home"
ENV PATH="/cargo-home/bin:$PATH"
ENV TZ=UTC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN apt-get update && \
apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev protobuf-compiler && \
apt-get clean && \
rm -r /var/lib/apt/lists/*

RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none

RUN rustup toolchain uninstall $(rustup toolchain list) && \
rustup toolchain install {{ RUST_TOOLCHAIN }} && \
rustup default {{ RUST_TOOLCHAIN }} && \
rustup target list --installed && \
rustup show
RUN rustup target add wasm32-unknown-unknown --toolchain {{ RUST_TOOLCHAIN }}

RUN mkdir /unique_parachain
WORKDIR /unique_parachain

# ===== BUILD CUMULUS =====
FROM rust-builder as builder-cumulus-bin

WORKDIR /unique_parachain

RUN git clone -b {{ CUMULUS_BUILD_BRANCH }} --depth 1 https://github.com/paritytech/cumulus.git && \
cd cumulus && \
cargo build --release

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

FROM ubuntu:20.04 as builder-cumulus

COPY --from=builder-cumulus-bin /unique_parachain/cumulus/target/release/polkadot-parachain /unique_parachain/cumulus/target/release/polkadot-parachain
41 changes: 41 additions & 0 deletions .docker/Dockerfile-moonbeam.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# ===== Rust builder =====
FROM ubuntu:20.04 as rust-builder
LABEL maintainer="Unique.Network"

ENV CARGO_HOME="/cargo-home"
ENV PATH="/cargo-home/bin:$PATH"
ENV TZ=UTC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN apt-get update && \
apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev protobuf-compiler && \
apt-get clean && \
rm -r /var/lib/apt/lists/*

RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none

RUN rustup toolchain uninstall $(rustup toolchain list) && \
rustup toolchain install {{ RUST_TOOLCHAIN }} && \
rustup default {{ RUST_TOOLCHAIN }} && \
rustup target list --installed && \
rustup show
RUN rustup target add wasm32-unknown-unknown --toolchain {{ RUST_TOOLCHAIN }}

RUN mkdir /unique_parachain
WORKDIR /unique_parachain


# ===== BUILD MOONBEAM =====
FROM rust-builder as builder-moonbeam-bin

WORKDIR /unique_parachain

RUN git clone -b {{ MOONBEAM_BUILD_BRANCH }} --depth 1 https://github.com/PureStake/moonbeam.git && \
cd moonbeam && \
cargo build --release

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

FROM ubuntu:20.04 as builder-moonbeam

COPY --from=builder-moonbeam-bin /unique_parachain/moonbeam/target/release/moonbeam /unique_parachain/moonbeam/target/release/moonbeam
1 change: 1 addition & 0 deletions .docker/Dockerfile-parachain
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,4 @@ CMD export NVM_DIR="$HOME/.nvm" && \
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \
cd /polkadot-launch && \
yarn start launch-config.json

98 changes: 98 additions & 0 deletions .docker/Dockerfile-parachain-node-only
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
ARG POLKADOT_BUILD_BRANCH
FROM uniquenetwork/builder-polkadot:${POLKADOT_BUILD_BRANCH} as polkadot

# ===== Rust builder =====
FROM ubuntu:20.04 as rust-builder
LABEL maintainer="Unique.Network"

ARG RUST_TOOLCHAIN=

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 apt-get update && \
apt-get install -y curl cmake pkg-config libssl-dev git clang protobuf-compiler && \
apt-get clean && \
rm -r /var/lib/apt/lists/*

RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none

RUN rustup toolchain uninstall $(rustup toolchain list) && \
rustup toolchain install $RUST_TOOLCHAIN && \
rustup default $RUST_TOOLCHAIN && \
rustup target list --installed && \
rustup show
RUN rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN

RUN mkdir /unique_parachain
WORKDIR /unique_parachain


# ===== BUILD current version ======
FROM rust-builder as builder-unique-current

ARG PROFILE=release
ARG FEATURE=
ARG MAINNET_BRANCH=
ARG REPO_URL=

WORKDIR /unique_parachain

RUN git clone $REPO_URL -b $MAINNET_BRANCH . && \
cargo build --features=$FEATURE --$PROFILE

# ===== BUILD target version ======
FROM rust-builder as builder-unique-target

ARG PROFILE=release
ARG FEATURE=

COPY . /unique_parachain
WORKDIR /unique_parachain

RUN cargo build --features=$FEATURE --$PROFILE

# ===== RUN ======

FROM ubuntu:20.04

ARG RUNTIME=
ENV RUNTIME $RUNTIME
ARG POLKADOT_BUILD_BRANCH=
ENV POLKADOT_BUILD_BRANCH $POLKADOT_BUILD_BRANCH

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 unique-network

RUN export NVM_DIR="$HOME/.nvm" && \
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \
cd /polkadot-launch && \
npm install --global yarn && \
yarn install

RUN echo "$RUNTIME"
RUN echo "$POLKADOT_BUILD_BRANCH"

COPY --from=builder-unique-current /unique_parachain/target/release/unique-collator /unique-chain/current/release/
COPY --from=builder-unique-target /unique_parachain/target/release/unique-collator /unique-chain/target/release/
COPY --from=builder-unique-target /unique_parachain/target/release/wbuild/"$RUNTIME"-runtime/"$RUNTIME"_runtime.compact.compressed.wasm /unique-chain/target/release/wbuild/"$RUNTIME"-runtime/"$RUNTIME"_runtime.compact.compressed.wasm

COPY --from=polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/
COPY --from=polkadot /unique_parachain/polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm /polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm

CMD export NVM_DIR="$HOME/.nvm" && \
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \
cd /polkadot-launch && \
yarn start launch-config.json --test-upgrade-parachains -w -n


2 changes: 1 addition & 1 deletion .docker/Dockerfile-parachain-upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@ COPY --from=polkadot /unique_parachain/polkadot/target/release/wbuild/westend-ru
CMD export NVM_DIR="$HOME/.nvm" && \
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \
cd /polkadot-launch && \
yarn start launch-config.json --test-upgrade-parachains
yarn start launch-config.json --test-upgrade-parachains
2 changes: 1 addition & 1 deletion .docker/Dockerfile-parachain-upgrade-data
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,4 @@ COPY --from=polkadot /unique_parachain/polkadot/target/release/wbuild/westend-ru
CMD export NVM_DIR="$HOME/.nvm" PATH="$PATH:/chainql/target/release" REPLICA_FROM && \
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \
cd /polkadot-launch && \
yarn start launch-config.json --test-upgrade-parachains
yarn start launch-config.json --test-upgrade-parachains
40 changes: 40 additions & 0 deletions .docker/Dockerfile-polkadot.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# ===== Rust builder =====
FROM ubuntu:20.04 as rust-builder
LABEL maintainer="Unique.Network"

ENV CARGO_HOME="/cargo-home"
ENV PATH="/cargo-home/bin:$PATH"
ENV TZ=UTC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN apt-get update && \
apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev protobuf-compiler && \
apt-get clean && \
rm -r /var/lib/apt/lists/*

RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none

RUN rustup toolchain uninstall $(rustup toolchain list) && \
rustup toolchain install {{ RUST_TOOLCHAIN }} && \
rustup default {{ RUST_TOOLCHAIN }} && \
rustup target list --installed && \
rustup show
RUN rustup target add wasm32-unknown-unknown --toolchain {{ RUST_TOOLCHAIN }}

RUN mkdir /unique_parachain
WORKDIR /unique_parachain

# ===== BUILD POLKADOT =====
FROM rust-builder as builder-polkadot-bin

WORKDIR /unique_parachain

RUN git clone -b {{ POLKADOT_BUILD_BRANCH }} --depth 1 https://github.com/paritytech/polkadot.git && \
cd polkadot && \
cargo build --release

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

FROM ubuntu:20.04 as builder-polkadot

COPY --from=builder-polkadot-bin /unique_parachain/polkadot/target/release/polkadot /unique_parachain/polkadot/target/release/polkadot
2 changes: 1 addition & 1 deletion .docker/Dockerfile-testnet.j2
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ 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
yarn start launch-config.json
6 changes: 2 additions & 4 deletions .docker/Dockerfile-try-runtime
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,9 @@ ENV REPLICA_FROM $REPLICA_FROM
COPY . /unique_parachain
WORKDIR /unique_parachain

RUN echo "[BE CAREFUL] applying disable-ic patch\n" && \
git apply .docker/patch/disable-ic.patch

RUN echo "Requested features: $FEATURE\n" && \
echo "Fork from: $REPLICA_FROM\n" && \
cargo build --features=try-runtime,$FEATURE --release
cargo build --features=$FEATURE --release

CMD cargo run --features=try-runtime,$FEATURE --release -- try-runtime on-runtime-upgrade live --uri $REPLICA_FROM
CMD cargo run --features=try-runtime,$FEATURE --release -- try-runtime -ltry-runtime::cli=debug --no-spec-check-panic on-runtime-upgrade live --uri $REPLICA_FROM
Loading

0 comments on commit ea2c4b0

Please sign in to comment.