-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add metadatahash, build images only on publish tags
- Loading branch information
Samuel Dare
committed
Aug 28, 2024
1 parent
bc15020
commit bb932e2
Showing
4 changed files
with
30 additions
and
32 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
ARG BASE_IMAGE=ubuntu:20.04 | ||
|
||
FROM $BASE_IMAGE as builder | ||
FROM $BASE_IMAGE AS builder | ||
SHELL ["/bin/bash", "-c"] | ||
|
||
# Set noninteractive mode for apt-get | ||
|
@@ -10,29 +10,25 @@ 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" | ||
|
||
# Set up Rust environment | ||
ENV RUST_BACKTRACE 1 | ||
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/* | ||
|
||
RUN set -o pipefail && curl https://sh.rustup.rs -sSf | sh -s -- -y | ||
ENV PATH="/root/.cargo/bin:${PATH}" | ||
|
||
RUN rustup update nightly | ||
RUN rustup update stable | ||
RUN rustup target add wasm32-unknown-unknown --toolchain nightly | ||
RUN rustup target add wasm32-unknown-unknown --toolchain stable | ||
|
||
# Copy entire repository | ||
COPY . /build | ||
WORKDIR /build | ||
|
||
# Build the project | ||
RUN cargo build -p node-subtensor --profile production --features runtime-benchmarks --locked | ||
RUN cargo build -p node-subtensor --profile production --features="runtime-benchmarks metadata-hash" --locked | ||
|
||
# Verify the binary was produced | ||
RUN test -e /build/target/production/node-subtensor | ||
|
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