-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bb61299
commit a479654
Showing
7 changed files
with
147 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# ===== Rust builder ===== | ||
FROM ubuntu:22.04 as rust-builder | ||
LABEL maintainer="Unique.Network" | ||
|
||
ENV CARGO_HOME="/cargo-home" | ||
ENV PATH="/cargo-home/bin:$PATH" | ||
ENV TZ=UTC | ||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev protobuf-compiler && \ | ||
apt-get clean && \ | ||
rm -r /var/lib/apt/lists/* | ||
|
||
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none | ||
|
||
RUN rustup toolchain install {{ RUST_TOOLCHAIN }} && \ | ||
rustup target add wasm32-unknown-unknown --toolchain {{ RUST_TOOLCHAIN }} && \ | ||
rustup default {{ RUST_TOOLCHAIN }} && \ | ||
rustup target list --installed && \ | ||
rustup show | ||
|
||
RUN mkdir /unique_parachain | ||
WORKDIR /unique_parachain | ||
|
||
# ===== BUILD ACALA ===== | ||
FROM rust-builder as builder-polkadex-bin | ||
|
||
WORKDIR /unique_parachain | ||
|
||
RUN git clone --depth 1 -b {{ POLKADEX_BUILD_BRANCH }} https://github.com/Polkadex-Substrate/parachain.git | ||
|
||
RUN --mount=type=cache,target=/cargo-home/registry \ | ||
--mount=type=cache,target=/cargo-home/git \ | ||
--mount=type=cache,target=/unique_parachain/parachain/target \ | ||
cd parachain && \ | ||
CARGO_INCREMENTAL=0 cargo build --release --locked && \ | ||
mkdir /unique_parachain/Polkadex && \ | ||
mv ./target/release/parachain-polkadex-node /unique_parachain/Polkadex/polkadex | ||
|
||
# ===== BIN ====== | ||
|
||
FROM ubuntu:22.04 as builder-polkadex | ||
|
||
COPY --from=builder-polkadex-bin /unique_parachain/Polkadex/polkadex /bin/polkadex | ||
ENTRYPOINT ["/bin/polkadex"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# ===== Rust builder ===== | ||
FROM ubuntu:22.04 as rust-builder | ||
LABEL maintainer="Unique.Network" | ||
|
||
ENV CARGO_HOME="/cargo-home" | ||
ENV PATH="/cargo-home/bin:$PATH" | ||
ENV TZ=UTC | ||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev protobuf-compiler && \ | ||
apt-get clean && \ | ||
rm -r /var/lib/apt/lists/* | ||
|
||
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none | ||
|
||
RUN rustup toolchain uninstall $(rustup toolchain list) && \ | ||
rustup toolchain install nightly-2022-11-15 && \ | ||
rustup default nightly-2022-11-15 && \ | ||
rustup target list --installed && \ | ||
rustup show | ||
RUN rustup target add wasm32-unknown-unknown --toolchain nightly-2022-11-15 | ||
|
||
RUN mkdir /unique_parachain | ||
WORKDIR /unique_parachain | ||
|
||
# ===== BUILD CHAINQL ===== | ||
FROM rust-builder as builder-chainql-bin | ||
|
||
RUN mkdir chainql | ||
WORKDIR /chainql | ||
|
||
RUN git clone -b {{ CHAINQL }} --depth 1 https://github.com/UniqueNetwork/chainql.git . && \ | ||
cargo build --release | ||
|
||
# ===== RUN ====== | ||
|
||
FROM ubuntu:22.04 as builder-chainql | ||
|
||
COPY --from=builder-chainql-bin /chainql/target/release/chainql /chainql/target/release/chainql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,9 +40,7 @@ jobs: | |
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 }}}, 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 }}}, runtest {testXcmQuartz}, 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 }}}, runtest {testXcmUnique}, runtime_features {unique-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 }}}, runtest {testXcmUnique}, runtime_features {unique-runtime} | ||
xcm-build: | ||
|
||
|
@@ -251,6 +249,40 @@ jobs: | |
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/[email protected] | ||
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 }} | ||
- 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 | ||
|
||
|
||
- name: Run find-and-replace to remove slashes from branch name | ||
uses: mad9000/actions-find-and-replace-string@4 | ||
id: branchname | ||
|
@@ -294,6 +326,7 @@ jobs: | |
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 }}'}}) | ||
- name: Upload network config | ||
uses: actions/upload-artifact@v3 | ||
|