Skip to content

Commit d163e72

Browse files
committed
[FAB-3387] Clean up Docker Compose configs
Some cruft has been accumulated over time on the orderer-related Docker Compose configurations under the "bddtests" folder. This changeset: 1. Removes environment variables that are either deprecated (e.g. `ORDERER_RAMLEDGER`) or not in use by the BDD tests (e.g. all `CONFIGTX` variables since `bootstrap.feature` does not use the `configtxgen` tool, or the `provisional` bootstrapper). 2. Removes configurations that are either no longer relevant (e.g. `bdd-docker/docker-compose-4-consensus-batch-nosnapshotbuffer.yml`) or no longer in use. 3. Moves all Docker Compose files to the `bddtests` folder and renames them to filenames that are hopefully a bit more expressive. Thanks to Jeff Garratt for guiding me through his. 4. Modified the Kafka environment so that it uses the bare-minimum sensisble defaults, and added comments for the critical settings. UPDATE: Rebased, added more comments, expanded base orderer configuration to a ZK ensemble consisting of 3 ZK servers, and a Kafka cluster consisting of 4 brokers, modified the `SystemUpWaitTime` accordingly. Change-Id: Iac0f55a0bfc3a7a67b70d3de0918cf727058ae16 Signed-off-by: Kostas Christidis <[email protected]>
1 parent 5caa571 commit d163e72

22 files changed

+321
-530
lines changed

Makefile

+1-8
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,7 @@ test-cmd:
151151
docker: $(patsubst %,build/image/%/$(DUMMY), $(IMAGES))
152152
native: peer orderer configtxgen cryptogen
153153

154-
BEHAVE_ENVIRONMENTS = kafka orderer-1-kafka-1 orderer-1-kafka-3
155-
BEHAVE_ENVIRONMENT_TARGETS = $(patsubst %,bddtests/environments/%, $(BEHAVE_ENVIRONMENTS))
156-
.PHONY: behave-environments $(BEHAVE_ENVIRONMENT_TARGETS)
157-
behave-environments: $(BEHAVE_ENVIRONMENT_TARGETS)
158-
$(BEHAVE_ENVIRONMENT_TARGETS):
159-
@docker-compose --file $@/docker-compose.yml build
160-
161-
behave-deps: docker peer build/bin/block-listener behave-environments configtxgen cryptogen
154+
behave-deps: docker peer build/bin/block-listener configtxgen cryptogen
162155
behave: behave-deps
163156
@echo "Running behave tests"
164157
@cd bddtests; behave $(BEHAVE_OPTS)

bddtests/bdd-docker/docker-compose-4-consensus-batch-nosnapshotbuffer.yml

-23
This file was deleted.

bddtests/compose-defaults.yml

-35
This file was deleted.

bddtests/docker-compose-next-4.yml bddtests/dc-base.yml

+12-15
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,19 @@ services:
99

1010
orderer0:
1111
extends:
12-
file: docker-compose-orderer-solo.yml
13-
service: orderer0
12+
file: dc-orderer-base.yml
13+
service: orderer
1414
environment:
1515
- ORDERER_GENERAL_LOCALMSPDIR=${ORDERER0_ORDERER_GENERAL_LOCALMSPDIR}
1616
- ORDERER_GENERAL_LOCALMSPID=${ORDERER0_ORDERER_GENERAL_LOCALMSPID}
17-
- ORDERER_GENERAL_TLS_ENABLED=true
1817
- ORDERER_GENERAL_TLS_PRIVATEKEY=${ORDERER0_ORDERER_GENERAL_TLS_PRIVATEKEY}
1918
- ORDERER_GENERAL_TLS_CERTIFICATE=${ORDERER0_ORDERER_GENERAL_TLS_CERTIFICATE}
2019
- ORDERER_GENERAL_TLS_ROOTCAS=${ORDERER0_ORDERER_GENERAL_TLS_ROOTCAS}
2120

22-
2321
peer0:
2422
extends:
25-
file: docker-compose-next.yml
26-
service: vpNext
23+
file: dc-peer-base.yml
24+
service: peer
2725
environment:
2826
- CORE_PEER_ID=vp0
2927
- CORE_PEER_GOSSIP_BOOTSTRAP=peer1:7051
@@ -37,14 +35,13 @@ services:
3735
- CORE_PEER_TLS_SERVERHOSTOVERRIDE=${PEER0_CORE_PEER_TLS_SERVERHOSTOVERRIDE}
3836
depends_on:
3937
- orderer0
40-
# ports:
41-
# - 7050:6060
42-
38+
#ports:
39+
#- 7050:6060
4340

4441
peer1:
4542
extends:
46-
file: docker-compose-next.yml
47-
service: vpNext
43+
file: dc-peer-base.yml
44+
service: peer
4845
environment:
4946
- CORE_PEER_ID=vp1
5047
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0:7051
@@ -61,8 +58,8 @@ services:
6158

6259
peer2:
6360
extends:
64-
file: docker-compose-next.yml
65-
service: vpNext
61+
file: dc-peer-base.yml
62+
service: peer
6663
environment:
6764
- CORE_PEER_ID=vp2
6865
- CORE_PEER_GOSSIP_BOOTSTRAP=peer3:7051
@@ -79,8 +76,8 @@ services:
7976

8077
peer3:
8178
extends:
82-
file: docker-compose-next.yml
83-
service: vpNext
79+
file: dc-peer-base.yml
80+
service: peer
8481
environment:
8582
- CORE_PEER_ID=vp3
8683
- CORE_PEER_GOSSIP_BOOTSTRAP=peer2:7051

bddtests/dc-orderer-base.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Copyright IBM Corp. All Rights Reserved.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
6+
version: '2'
7+
8+
services:
9+
10+
orderer:
11+
image: hyperledger/fabric-orderer
12+
environment:
13+
- ORDERER_GENERAL_GENESISMETHOD=${ORDERER_GENERAL_GENESISMETHOD}
14+
- ORDERER_GENERAL_GENESISFILE=${ORDERER_GENERAL_GENESISFILE}
15+
- ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
16+
- ORDERER_GENERAL_LOGLEVEL=debug
17+
- ORDERER_KAFKA_VERBOSE=true
18+
- ORDERER_GENERAL_TLS_ENABLED=true
19+
volumes:
20+
- ./volumes/orderer:/var/hyperledger/bddtests/volumes/orderer
21+
- /etc/hyperledger/msp:/etc/hyperledger/msp
22+
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/orderer
23+
command: orderer
24+
ports:
25+
- '7050'

bddtests/dc-orderer-kafka-base.yml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Copyright IBM Corp. All Rights Reserved.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
6+
version: '2'
7+
8+
services:
9+
10+
zookeeper:
11+
image: hyperledger/fabric-zookeeper
12+
restart: always
13+
ports:
14+
- '2181'
15+
- '2888'
16+
- '3888'
17+
18+
kafka:
19+
image: hyperledger/fabric-kafka
20+
restart: always
21+
environment:
22+
# ========================================================================
23+
# Reference: https://kafka.apache.org/documentation/#configuration
24+
# ========================================================================
25+
#
26+
# socket.request.max.bytes
27+
# The maximum number of bytes in a socket request. ATTN: If you set this
28+
# env var, you should make sure that the value assigned to
29+
# `brokerConfig.Producer.MaxMessageBytes` in `newBrokerConfig()` in
30+
# `fabric/orderer/kafka/util.go` matches it.
31+
#- KAFKA_SOCKET_REQUEST_MAX_BYTES=104857600 # 100 * 1024 * 1024 B
32+
#
33+
# message.max.bytes
34+
# The maximum size of envelope that the broker can receive.
35+
- KAFKA_MESSAGE_MAX_BYTES=103809024 # 99 * 1024 * 1024 B
36+
#
37+
# replica.fetch.max.bytes
38+
# The number of bytes of messages to attempt to fetch for each channel.
39+
# This is not an absolute maximum, if the fetched envelope is larger than
40+
# this value, the envelope will still be returned to ensure that progress
41+
# can be made. The maximum message size accepted by the broker is defined
42+
# via message.max.bytes above.
43+
- KAFKA_REPLICA_FETCH_MAX_BYTES=103809024 # 99 * 1024 * 1024 B
44+
#
45+
# unclean.leader.election.enable
46+
# Data consistency is key in a blockchain environment. We cannot have a
47+
# leader chosen outside of the in-sync replica set, or we run the risk of
48+
# overwriting the offsets that the previous leader produced, and --as a
49+
# result-- rewriting the blockchain that the orderers produce.
50+
- KAFKA_UNCLEAN_LEADER_ELECTION_ENABLE=false
51+
ports:
52+
- '9092'

0 commit comments

Comments
 (0)