Skip to content
This repository has been archived by the owner on Jun 12, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1011 from helium/pevm/fix-val-releases
Browse files Browse the repository at this point in the history
improve validator build ux
  • Loading branch information
evanmcc authored Aug 27, 2021
2 parents 2faa6f5 + 347553b commit 9f67694
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 8 deletions.
4 changes: 3 additions & 1 deletion .buildkite/scripts/Dockerfile-testval-amd64
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM erlang:23.3.4.4-alpine as builder

ARG version

RUN apk add --no-cache --update \
git tar build-base linux-headers autoconf automake libtool pkgconfig \
dbus-dev bzip2 bison flex gmp-dev cmake lz4 libsodium-dev openssl-dev \
Expand All @@ -19,7 +21,7 @@ ENV CC=gcc CXX=g++ CFLAGS="-U__sun__" \
# Add our code
ADD . /usr/src/miner/

RUN ./rebar3 as docker_testval tar
RUN ./rebar3 as docker_testval tar -n miner -v ${version}

RUN mkdir -p /opt/docker/update
RUN tar -zxvf _build/docker_testval/rel/*/*.tar.gz -C /opt/docker
Expand Down
4 changes: 3 additions & 1 deletion .buildkite/scripts/Dockerfile-testval-arm64
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM arm64v8/erlang:23.3.4.4-alpine as builder

ARG version

RUN apk add --no-cache --update \
git tar build-base linux-headers autoconf automake libtool pkgconfig \
dbus-dev bzip2 bison flex gmp-dev cmake lz4 libsodium-dev openssl-dev \
Expand All @@ -19,7 +21,7 @@ ENV CC=gcc CXX=g++ CFLAGS="-U__sun__" \
# Add our code
ADD . /usr/src/miner/

RUN ./rebar3 as docker_testval tar
RUN ./rebar3 as docker_testval tar -n miner -v ${version}

RUN mkdir -p /opt/docker/update
RUN tar -zxvf _build/docker_testval/rel/*/*.tar.gz -C /opt/docker
Expand Down
4 changes: 3 additions & 1 deletion .buildkite/scripts/Dockerfile-val-amd64
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM erlang:23.3.4.4-alpine as builder

ARG version

RUN apk add --no-cache --update \
git tar build-base linux-headers autoconf automake libtool pkgconfig \
dbus-dev bzip2 bison flex gmp-dev cmake lz4 libsodium-dev openssl-dev \
Expand All @@ -19,7 +21,7 @@ ENV CC=gcc CXX=g++ CFLAGS="-U__sun__" \
# Add our code
ADD . /usr/src/miner/

RUN ./rebar3 as docker_val tar
RUN ./rebar3 as docker_val tar -n miner -v ${version}

RUN mkdir -p /opt/docker/update
RUN tar -zxvf _build/docker_val/rel/*/*.tar.gz -C /opt/docker
Expand Down
4 changes: 3 additions & 1 deletion .buildkite/scripts/Dockerfile-val-arm64
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM arm64v8/erlang:23.3.4.4-alpine as builder

ARG version

RUN apk add --no-cache --update \
git tar build-base linux-headers autoconf automake libtool pkgconfig \
dbus-dev bzip2 bison flex gmp-dev cmake lz4 libsodium-dev openssl-dev \
Expand All @@ -19,7 +21,7 @@ ENV CC=gcc CXX=g++ CFLAGS="-U__sun__" \
# Add our code
ADD . /usr/src/miner/

RUN ./rebar3 as docker_val tar
RUN ./rebar3 as docker_val tar -n miner -v ${version}

RUN mkdir -p /opt/docker/update
RUN tar -zxvf _build/docker_val/rel/*/*.tar.gz -C /opt/docker
Expand Down
4 changes: 3 additions & 1 deletion .buildkite/scripts/make_testval_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ MINER_REGISTRY_NAME="$REGISTRY_HOST/team-helium/$REGISTRY_NAME"
DOCKER_NAME="$(basename $(pwd))-${IMAGE_ARCH}_testnet_${BUILDKITE_TAG}"
DOCKERFILE_NAME=".buildkite/scripts/Dockerfile-testval-${IMAGE_ARCH}"

VERSION=$(git describe --abbrev=0 | sed -e 's,val,,')

docker login -u="team-helium+buildkite" -p="${QUAY_BUILDKITE_PASSWORD}" ${REGISTRY_HOST}
docker build -t helium:$DOCKER_NAME -f "${DOCKERFILE_NAME}" .
docker build --build-arg version=$VERSION -t helium:$DOCKER_NAME -f "${DOCKERFILE_NAME}" .
docker tag helium:$DOCKER_NAME "$MINER_REGISTRY_NAME:$DOCKER_NAME"
docker push "$MINER_REGISTRY_NAME:$DOCKER_NAME"
docker tag helium:$DOCKER_NAME "$MINER_REGISTRY_NAME:latest-val-${IMAGE_ARCH}"
Expand Down
6 changes: 3 additions & 3 deletions .buildkite/scripts/make_val_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ MINER_REGISTRY_NAME="$REGISTRY_HOST/team-helium/$REGISTRY_NAME"
DOCKER_NAME="$(basename $(pwd))-${IMAGE_ARCH}_${BUILDKITE_TAG}"
DOCKERFILE_NAME=".buildkite/scripts/Dockerfile-val-${IMAGE_ARCH}"

VERSION=$(git describe --abbrev=0 | sed -e 's,validator,,')

docker login -u="team-helium+buildkite" -p="${QUAY_BUILDKITE_PASSWORD}" ${REGISTRY_HOST}
docker build -t helium:$DOCKER_NAME -f "${DOCKERFILE_NAME}" .
docker build --build-arg version=$VERSION -t helium:$DOCKER_NAME -f "${DOCKERFILE_NAME}" .
docker tag helium:$DOCKER_NAME "$MINER_REGISTRY_NAME:$DOCKER_NAME"
docker push "$MINER_REGISTRY_NAME:$DOCKER_NAME"
# docker tag helium:$DOCKER_NAME "$MINER_REGISTRY_NAME:latest-validator-${IMAGE_ARCH}"
# docker push "$MINER_REGISTRY_NAME:latest-validator-${IMAGE_ARCH}"
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.PHONY: deps compile test typecheck cover

REBAR=./rebar3
VAL_VERSION=$(shell git describe --abbrev=0 | sed -e 's,validator,,')
ifeq ($(BUILDKITE), true)
# get branch name and replace any forward slashes it may contain
CIBRANCH=$(subst /,-,$(BUILDKITE_BRANCH))
Expand Down Expand Up @@ -31,6 +32,9 @@ ci: compile
release:
$(REBAR) as prod release -n miner

validator:
$(REBAR) as validator release -n miner -v $(VAL_VERSION)

cover:
$(REBAR) cover

Expand Down

0 comments on commit 9f67694

Please sign in to comment.