Skip to content

Commit

Permalink
[FAB-1659] Update BDD Compose ENV vars
Browse files Browse the repository at this point in the history
https://jira.hyperledger.org/browse/FAB-1659

In FAB-1612 [1] new configuration keys were introduced on the
`orderer.yaml` file. The ENV vars on the Compose files we use for the
orderer-related BDD tests however were not updated accordingly. As a
result, all tests would run against the default config setting
(read: solo) and the Kafka path would not get tested.

This changeset addresses this issue.

Additionally it:

1. Removes all environment variables from the Compose files when these
match the defaults in `orderer.yaml`. This reverses an earlier take on
the matter. The thinking behind this change is that we don't need to
keep two sets of settings unless absolutely necessary.

2. Formats `orderer.yaml` so that the recently-added lines break at 80
characters, as is the case with the rest of that file.

[1] https://gerrit.hyperledger.org/r/#/c/3879/

Change-Id: I0d1e137bd4a8e523edb7cb6a060c09ff80d31340
Signed-off-by: Kostas Christidis <[email protected]>
  • Loading branch information
kchristidis committed Jan 15, 2017
1 parent ac48017 commit ba288e1
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 49 deletions.
8 changes: 1 addition & 7 deletions bddtests/docker-compose-orderer-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,9 @@ services:
ordererBase:
image: hyperledger/fabric-orderer
environment:
- ORDERER_GENERAL_LEDGERTYPE=ram
- ORDERER_GENERAL_BATCHTIMEOUT=10s
- ORDERER_GENERAL_BATCHSIZE_MAXMESSAGECOUNT=10
- ORDERER_GENERAL_MAXWINDOWSIZE=1000
- ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
- ORDERER_GENERAL_LOGLEVEL=debug
- ORDERER_GENERAL_GENESISMETHOD=provisional
- ORDERER_GENERAL_GENESISIFILE=${ORDERER_GENERAL_GENESISIFILE}
- ORDERER_RAMLEDGER_HISTORY_SIZE=100
- ORDERER_GENERAL_GENESISFILE=${ORDERER_GENERAL_GENESISFILE}
volumes:
- ./volumes/orderer:/var/hyperledger/bddtests/volumes/orderer
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/orderer
Expand Down
4 changes: 2 additions & 2 deletions bddtests/docker-compose-orderer-kafka.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ orderer0:
file: docker-compose-orderer-base.yml
service: ordererBase
environment:
- ORDERER_GENERAL_ORDERERTYPE=kafka
- ORDERER_KAFKA_BROKERS=[kafka0:9092]
- ORDERER_GENESIS_ORDERERTYPE=kafka
- ORDERER_KAFKA_BROKERS=[kafka0:9092]
links:
- kafka0
command: orderer
2 changes: 1 addition & 1 deletion bddtests/docker-compose-orderer-solo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ services:
file: docker-compose-orderer-base.yml
service: ordererBase
environment:
- ORDERER_GENERAL_ORDERERTYPE=solo
- ORDERER_GENESIS_ORDERERTYPE=solo
16 changes: 4 additions & 12 deletions bddtests/environments/orderer-1-kafka-1/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,11 @@ services:
orderer0:
image: hyperledger/fabric-orderer
environment:
- ORDERER_GENERAL_ORDERERTYPE=kafka
- ORDERER_GENERAL_LEDGERTYPE=ram
- ORDERER_GENERAL_BATCHTIMEOUT=10s
- ORDERER_GENERAL_BATCHSIZE_MAXMESSAGECOUNT=10
- ORDERER_GENERAL_QUEUESIZE=1000
- ORDERER_GENERAL_MAXWINDOWSIZE=1000
- ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
- ORDERER_GENERAL_LISTENPORT=7050
- ORDERER_GENERAL_GENESISMETHOD=provisional
- ORDERER_RAMLEDGER_HISTORY_SIZE=100
- ORDERER_KAFKA_BROKERS=[kafka0:9092]
- ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
- ORDERER_GENESIS_ORDERERTYPE=kafka
- ORDERER_KAFKA_BROKERS=[kafka0:9092]
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/orderer
command: orderer -loglevel debug -verbose true
command: orderer
ports:
- '7050'
depends_on:
Expand Down
12 changes: 2 additions & 10 deletions bddtests/environments/orderer-1-kafka-3/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,11 @@ services:
orderer0:
image: hyperledger/fabric-orderer
environment:
- ORDERER_GENERAL_ORDERERTYPE=kafka
- ORDERER_GENERAL_LEDGERTYPE=ram
- ORDERER_GENERAL_BATCHTIMEOUT=10s
- ORDERER_GENERAL_BATCHSIZE_MAXMESSAGECOUNT=10
- ORDERER_GENERAL_QUEUESIZE=1000
- ORDERER_GENERAL_MAXWINDOWSIZE=1000
- ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
- ORDERER_GENERAL_LISTENPORT=7050
- ORDERER_GENERAL_GENESISMETHOD=provisional
- ORDERER_RAMLEDGER_HISTORY_SIZE=100
- ORDERER_GENESIS_ORDERERTYPE=kafka
- ORDERER_KAFKA_BROKERS=[kafka0:9092,kafka1:9092,kafka2:9092]
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/orderer
command: orderer -loglevel debug -verbose true
command: orderer
ports:
- '7050'
depends_on:
Expand Down
9 changes: 1 addition & 8 deletions bddtests/environments/orderer-n-kafka-n/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,9 @@ services:
orderer:
build: ./orderer
environment:
- ORDERER_GENERAL_ORDERERTYPE=kafka
- ORDERER_GENERAL_LEDGERTYPE=ram
- ORDERER_GENERAL_BATCHTIMEOUT=10s
- ORDERER_GENERAL_BATCHSIZE_MAXMESSAGECOUNT=10
- ORDERER_GENERAL_QUEUESIZE=1000
- ORDERER_GENERAL_MAXWINDOWSIZE=1000
- ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
- ORDERER_GENERAL_LISTENPORT=7050
- ORDERER_GENERAL_GENESISMETHOD=provisional
- ORDERER_RAMLEDGER_HISTORY_SIZE=100
- ORDERER_GENESIS_ORDERERTYPE=kafka
ports:
- '7050'
depends_on:
Expand Down
5 changes: 1 addition & 4 deletions bddtests/steps/bootstrap_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ def decomposing(self, composition, context):
shutil.rmtree(self.getVolumePath(composition))

def getEnv(self, composition, context, env):
env["ORDERER_GENERAL_GENESISIFILE"]=self.getGenesisFilePath(composition, pathType=PathType.Container)
env["ORDERER_GENERAL_GENESISFILE"]=self.getGenesisFilePath(composition, pathType=PathType.Container)


class PeerCompositionCallback(compose.CompositionCallback):
Expand Down Expand Up @@ -494,6 +494,3 @@ def getEnv(self, composition, context, env):

def setOrdererBootstrapGenesisBlock(genesisBlock):
'Responsible for setting the GensisBlock for the Orderer nodes upon composition'



13 changes: 8 additions & 5 deletions orderer/orderer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,18 @@ General:
# per fabric/docs/Setup/logging-control.md
LogLevel: info

# Genesis method: The method by which to retrieve/generate the genesis block. Available values are "provisional", "file"
# Provisional utilizes the parameters in the Genesis section to dynamically generate a new genesis block
# File uses the fil provided by GenesisFile as the genesis block
# Genesis method: The method by which to retrieve/generate the genesis
# block. Available values are "provisional", "file". Provisional utilizes
# the parameters in the Genesis section to dynamically generate a new
# genesis block. File uses the file provided by GenesisFile as the genesis
# block.
GenesisMethod: provisional

# Genesis file: The file containing the genesis block. Used by the orderer when GenesisMethod is set to "file"
# Genesis file: The file containing the genesis block. Used by the orderer
# when GenesisMethod is set to "file".
GenesisFile: ./genesisblock

# Enable an HTTP service for Go "pprof" profiling as documented at
# Enable an HTTP service for Go "pprof" profiling as documented at:
# https://golang.org/pkg/net/http/pprof
Profile:
Enabled: false
Expand Down

0 comments on commit ba288e1

Please sign in to comment.