-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #769 from opentensor/devnet
Testnet Deployment 280824
- Loading branch information
Showing
6 changed files
with
69 additions
and
87 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
.devcontainer | ||
.github | ||
.vscode | ||
!scripts/init.sh | ||
target | ||
target/ | ||
.dockerignore | ||
Dockerfile |
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 |
---|---|---|
@@ -1,65 +1,44 @@ | ||
|
||
ARG BASE_IMAGE=ubuntu:20.04 | ||
|
||
FROM $BASE_IMAGE as builder | ||
FROM $BASE_IMAGE AS builder | ||
SHELL ["/bin/bash", "-c"] | ||
|
||
# This is being set so that no interactive components are allowed when updating. | ||
# Set noninteractive mode for apt-get | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
LABEL ai.opentensor.image.authors="[email protected]" \ | ||
ai.opentensor.image.vendor="Opentensor Foundation" \ | ||
ai.opentensor.image.title="opentensor/subtensor" \ | ||
ai.opentensor.image.description="Opentensor Subtensor Blockchain" \ | ||
ai.opentensor.image.revision="${VCS_REF}" \ | ||
ai.opentensor.image.created="${BUILD_DATE}" \ | ||
ai.opentensor.image.documentation="https://docs.bittensor.com" | ||
|
||
# show backtraces | ||
ENV RUST_BACKTRACE 1 | ||
|
||
# Necessary libraries for Rust execution | ||
# Set up Rust environment | ||
ENV RUST_BACKTRACE=1 | ||
RUN apt-get update && \ | ||
apt-get install -y curl build-essential protobuf-compiler clang git && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Install cargo and Rust | ||
RUN set -o pipefail && curl https://sh.rustup.rs -sSf | sh -s -- -y | ||
ENV PATH="/root/.cargo/bin:${PATH}" | ||
RUN rustup update stable | ||
RUN rustup target add wasm32-unknown-unknown --toolchain stable | ||
|
||
RUN mkdir -p /subtensor && \ | ||
mkdir /subtensor/scripts | ||
|
||
# Scripts | ||
COPY ./scripts/init.sh /subtensor/scripts/ | ||
|
||
# Capture dependencies | ||
COPY Cargo.lock Cargo.toml /subtensor/ | ||
# Copy entire repository | ||
COPY . /build | ||
WORKDIR /build | ||
|
||
# Specs | ||
COPY ./snapshot.json /subtensor/snapshot.json | ||
COPY ./raw_spec_testfinney.json /subtensor/raw_spec_testfinney.json | ||
COPY ./raw_spec_finney.json /subtensor/raw_spec_finney.json | ||
# Build the project | ||
RUN cargo build -p node-subtensor --profile production --features="runtime-benchmarks metadata-hash" --locked | ||
|
||
# Copy our sources | ||
COPY ./node /subtensor/node | ||
COPY ./pallets /subtensor/pallets | ||
COPY ./runtime /subtensor/runtime | ||
COPY ./support /subtensor/support | ||
# Verify the binary was produced | ||
RUN test -e /build/target/production/node-subtensor | ||
|
||
# Copy our toolchain | ||
COPY rust-toolchain.toml /subtensor/ | ||
RUN /subtensor/scripts/init.sh | ||
|
||
# Cargo build | ||
WORKDIR /subtensor | ||
RUN cargo build --profile production --features runtime-benchmarks --locked | ||
EXPOSE 30333 9933 9944 | ||
|
||
|
||
FROM $BASE_IMAGE AS subtensor | ||
|
||
COPY --from=builder /subtensor/snapshot.json / | ||
COPY --from=builder /subtensor/raw_spec_testfinney.json / | ||
COPY --from=builder /subtensor/raw_spec_finney.json / | ||
COPY --from=builder /subtensor/target/production/node-subtensor /usr/local/bin | ||
# Copy all chainspec files | ||
COPY --from=builder /build/*.json / | ||
|
||
# Copy final binary | ||
COPY --from=builder /build/target/production/node-subtensor /usr/local/bin |
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