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

Commit

Permalink
More docker tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Vagabond committed Jul 26, 2022
1 parent 95afd2a commit fcca1a2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
8 changes: 4 additions & 4 deletions .buildkite/scripts/make_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if [[ "$IMAGE_ARCH" == "arm64" ]]; then
fi

VERSION=$(echo $VERSION_TAG | sed "s/^${BUILD_NET}_//" | sed "s/^${BUILD_TYPE}//")
DOCKER_BUILD_ARGS="--build-arg BUILDER_IMAGE=$BUILD_IMAGE --build-arg RUNNER_IMAGE=$RUN_IMAGE --build-arg VERSION=$VERSION --build-arg BUILD_NET=$BUILD_NET"
DOCKER_BUILD_ARGS=" --build-arg VERSION=$VERSION --build-arg BUILD_NET=$BUILD_NET"

if [[ ! $TEST_BUILD -eq "0" ]]; then
REGISTRY_NAME="test-builds"
Expand Down Expand Up @@ -54,19 +54,19 @@ case "${BUILD_TYPE}-$BUILD_NET" in
;;
"miner-mainnet")
echo "Doing a 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 REBAR_BUILD_TARGET=docker $DOCKER_BUILD_ARGS"
DOCKER_BUILD_ARGS="--build-arg BUILDER_IMAGE=$BUILD_IMAGE --build-arg RUNNER_IMAGE=$RUN_IMAGE --build-arg EXTRA_BUILD_APK_PACKAGES=apk-tools --build-arg EXTRA_RUNNER_APK_PACKAGES=apk-tools --build-arg REBAR_BUILD_TARGET=docker $DOCKER_BUILD_ARGS"
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 REBAR_BUILD_TARGET=docker_testminer $DOCKER_BUILD_ARGS"
DOCKER_BUILD_ARGS="--build-arg BUILDER_IMAGE=$BUILD_IMAGE --build-arg RUNNER_IMAGE=$RUN_IMAGE --build-arg EXTRA_BUILD_APK_PACKAGES=apk-tools --build-arg EXTRA_RUNNER_APK_PACKAGES=apk-tools --build-arg REBAR_BUILD_TARGET=docker_testminer $DOCKER_BUILD_ARGS"
BASE_DOCKER_NAME=$(basename $(pwd))
DOCKER_NAME="${BASE_DOCKER_NAME}-${IMAGE_ARCH}_${VERSION}"
;;
"miner-devnet")
echo "Doing a devnet 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 REBAR_BUILD_TARGET=docker_testminer $DOCKER_BUILD_ARGS"
DOCKER_BUILD_ARGS="--build-arg BUILDER_IMAGE=$BUILD_IMAGE --build-arg RUNNER_IMAGE=$RUN_IMAGE --build-arg EXTRA_BUILD_APK_PACKAGES=apk-tools --build-arg EXTRA_RUNNER_APK_PACKAGES=apk-tools --build-arg REBAR_BUILD_TARGET=docker_testminer $DOCKER_BUILD_ARGS"
BASE_DOCKER_NAME=$(basename $(pwd))
DOCKER_NAME="${BASE_DOCKER_NAME}-${IMAGE_ARCH}_${VERSION}"
;;
Expand Down
1 change: 1 addition & 0 deletions Dockerfile-ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ ENV CC=gcc CXX=g++ CFLAGS="-O2" CXXFLAGS="-O2" \
# Add and compile the dependencies to cache
COPY ./rebar* ./Makefile ./
COPY ./config/grpc_client_gen_local.config ./config/
COPY ./config/grpc_client_gen.config ./config/

RUN ./rebar3 compile

Expand Down
8 changes: 4 additions & 4 deletions src/miner_hbbft_sidecar.erl
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ new_round(Buf, BinTxns) ->
prefilter_round(Buf, Txns) ->
gen_server:call(?SERVER, {prefilter_round, Buf, Txns}, infinity).

handle_txn(submit = RequestType, Txn) ->
handle_txn(submit = _RequestType, Txn) ->
gen_server:call(?SERVER, {submit, Txn}, infinity);
handle_txn(update = RequestType, Txn) ->
handle_txn(update = _RequestType, Txn) ->
gen_server:call(?SERVER, {query_txn, Txn}, infinity).

%%%===================================================================
Expand Down Expand Up @@ -124,11 +124,11 @@ handle_call({set_group, Group}, _From, #state{group = OldGroup} = State) ->
ok = libp2p_swarm:add_stream_handler(blockchain_swarm:tid(), ?TX_PROTOCOL_V2,
{libp2p_framed_stream, server,
[blockchain_txn_handler, ?TX_PROTOCOL_V2, self(),
fun(submit, T) -> ?MODULE:submit(T); (_, T) -> {error, req_not_supported} end]}),
fun(submit, T) -> ?MODULE:submit(T); (_, _T) -> {error, req_not_supported} end]}),
ok = libp2p_swarm:add_stream_handler(blockchain_swarm:tid(), ?TX_PROTOCOL_V1,
{libp2p_framed_stream, server,
[blockchain_txn_handler, ?TX_PROTOCOL_V1, self(),
fun(submit, T) -> ?MODULE:submit(T); (_, T) -> {error, req_not_supported} end]});
fun(submit, T) -> ?MODULE:submit(T); (_, _T) -> {error, req_not_supported} end]});
{P, undefined} when is_pid(P) ->
libp2p_swarm:remove_stream_handler(blockchain_swarm:tid(), ?TX_PROTOCOL_V3),
libp2p_swarm:remove_stream_handler(blockchain_swarm:tid(), ?TX_PROTOCOL_V2),
Expand Down

0 comments on commit fcca1a2

Please sign in to comment.