Unverified Commit ee6e1aa6 authored by Marc Nijdam's avatar Marc Nijdam Committed by GitHub
Browse files

Merge pull request #1168 from helium/lthiery/miner-testnet

Enable building of Miner Docker for Testnet
parents df861858 50561ba9
Showing with 61 additions and 3 deletions
+61 -3
......@@ -40,6 +40,7 @@ steps:
REGISTRY_HOST: "quay.io"
REGISTRY_NAME: "validator"
VERSION_TAG: $BUILDKITE_TAG
BUILD_NET: "mainnet"
agents:
queue: "erlang"
commands:
......@@ -54,6 +55,7 @@ steps:
REGISTRY_HOST: "quay.io"
REGISTRY_NAME: "validator"
VERSION_TAG: $BUILDKITE_TAG
BUILD_NET: "mainnet"
agents:
queue: "arm64"
commands:
......@@ -68,6 +70,7 @@ steps:
REGISTRY_HOST: "quay.io"
REGISTRY_NAME: "validator"
VERSION_TAG: $BUILDKITE_TAG
BUILD_NET: "testnet"
agents:
queue: "erlang"
commands:
......@@ -82,6 +85,7 @@ steps:
REGISTRY_HOST: "quay.io"
REGISTRY_NAME: "validator"
VERSION_TAG: $BUILDKITE_TAG
BUILD_NET: "testnet"
agents:
queue: "arm64"
commands:
......@@ -96,6 +100,7 @@ steps:
REGISTRY_HOST: "quay.io"
REGISTRY_NAME: "miner"
VERSION_TAG: $BUILDKITE_TAG
BUILD_NET: "mainnet"
agents:
queue: "erlang"
commands:
......@@ -112,6 +117,7 @@ steps:
REGISTRY_HOST: "quay.io"
REGISTRY_NAME: "miner"
VERSION_TAG: $BUILDKITE_TAG
BUILD_NET: "mainnet"
commands:
- "git tag $BUILDKITE_TAG"
- ".buildkite/scripts/make_image.sh"
......@@ -6,6 +6,7 @@ set -euo pipefail
# REGISTRY_NAME
# IMAGE_ARCH
# BUILD_TYPE
# BUILD_NET
# all come from pipeline.yml
TEST_BUILD=${TEST_BUILD:-0}
......@@ -23,7 +24,7 @@ if [[ "$IMAGE_ARCH" == "arm64" ]]; then
fi
VERSION=$(echo $VERSION_TAG | sed -e "s/$BUILD_TYPE//")
DOCKER_BUILD_ARGS="--build-arg VERSION=$VERSION"
DOCKER_BUILD_ARGS="--build-arg VERSION=$VERSION --build-arg BUILD_NET=$BUILD_NET"
if [[ ! $TEST_BUILD -eq "0" ]]; then
REGISTRY_NAME="test-builds"
......@@ -53,6 +54,12 @@ case "$BUILD_TYPE" in
BASE_DOCKER_NAME=$(basename $(pwd))
DOCKER_NAME="${BASE_DOCKER_NAME}-${IMAGE_ARCH}_${VERSION}"
;;
"miner-testnet")
echo "Doing a testnet miner image build for ${IMAGE_ARCH}"
DOCKER_BUILD_ARGS="--build-arg EXTRA_BUILD_APK_PACKAGES=apk-tools --build-arg EXTRA_RUNNER_APK_PACKAGES=apk-tools --build-arg BUILDER_IMAGE=${BUILD_IMAGE} --build-arg RUNNER_IMAGE=${RUN_IMAGE} --build-arg REBAR_BUILD_TARGET=docker_testminer ${DOCKER_BUILD_ARGS}"
BASE_DOCKER_NAME=$(basename $(pwd))
DOCKER_NAME="${BASE_DOCKER_NAME}-${IMAGE_ARCH}_testnet_${VERSION}"
;;
*)
echo "I don't know how to do a build for ${BUILD_TYPE}"
exit 1
......
......@@ -6,9 +6,10 @@ ARG REBAR_DIAGNOSTIC=0
ENV DIAGNOSTIC=${REBAR_DIAGNOSTIC}
ARG VERSION
# default to building for mainnet
ARG BUILD_NET=mainnet
ARG REBAR_BUILD_TARGET
ARG TAR_PATH=_build/$REBAR_BUILD_TARGET/rel/*/*.tar.gz
ARG EXTRA_BUILD_APK_PACKAGES
RUN apk add --no-cache --update \
......@@ -35,7 +36,7 @@ RUN ./rebar3 as ${REBAR_BUILD_TARGET} tar -n miner -v ${VERSION}
RUN mkdir -p /opt/docker/update
RUN tar -zxvf ${TAR_PATH} -C /opt/docker
RUN wget -O /opt/docker/update/genesis https://snapshots.helium.wtf/genesis.mainnet
RUN wget -O /opt/docker/update/genesis https://snapshots.helium.wtf/genesis.${BUILD_NET}
FROM ${RUNNER_IMAGE} as runner
......
%% -*- erlang -*-
[
"config/sys.config",
{lager,
[
{log_root, "/var/data/log"}
]},
{blockchain,
[
{key, undefined},
{seed_nodes, "/ip4/54.244.119.55/tcp/2154"},
{seed_node_dns, ""},
{fetch_latest_from_snap_source, false},
{honor_quick_sync, true},
{quick_sync_mode, blessed_snapshot},
{blessed_snapshot_block_height, 211681},
{blessed_snapshot_block_hash,
<<126, 40, 6, 231, 16, 190, 149, 156, 254, 129, 164, 176, 213, 165, 50, 194, 42, 223, 120, 231, 2, 241, 171, 29, 243, 138, 108, 96, 225, 165, 59, 197>>},
{network, testnet}
]},
{miner,
[
{network, testnet},
{api_base_url, "https://testnet-api.helium.wtf/v1"},
{jsonrpc_ip, {0,0,0,0}}, %% bind jsonrpc to host when in docker container
{use_ebus, false},
{radio_device, { {0,0,0,0}, 1680,
{0,0,0,0}, 31341} }
]}
].
......@@ -280,6 +280,20 @@
{include_src, false},
{include_erts, true}]}]
},
{docker_testminer, [
{relx, [
{release, {miner, {semver, "testminer"}},
[miner,
tools,
runtime_tools,
recon]},
{sys_config, "./config/miner-testnet.config"},
{overlay,
[{copy, "config/sys.config", "config/sys.config"}]},
{dev_mode, false},
{include_src, false},
{include_erts, true}]}]
},
{test,
[
{overrides, [{add, blockchain, [{erl_opts, [{d, 'TEST'}]}]}]},
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment