Skip to content

Commit fe39bbc

Browse files
committed
[CE-227] Enable fabric kafka mode
* Enable the kafka mode support; * Fix the setup scripts, remove unused output; * Add necessary docker images for kafka mode; * Remove the unsupported fabric v0.6 version from admin dashboard. Change-Id: I6d92b8c79136aa9741ee3cb0354f0d9ec215916f Signed-off-by: Baohua Yang <yangbaohua@gmail.com>
1 parent 36bcd57 commit fe39bbc

File tree

10 files changed

+532
-34
lines changed

10 files changed

+532
-34
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ test-case: ##@Code Run test case for flask server
138138

139139
clean: ##@Code Clean tox result
140140
rm -rf .tox .cache *.egg-info build/
141-
find . -name "*.pyc" -o -name "__pycache__" -exec rm -rf "{}" \;
141+
find . -name "*.pyc" -o -name "__pycache__" | xargs rm -rf
142142

143143
# TODO (david_dornseier): As long as there are no release versions, always rewrite
144144
# the entire changelog (bug)
@@ -183,7 +183,7 @@ initial-env: ##@Configuration Initial Configuration for dashboard
183183

184184
start: ##@Service Start service
185185
@$(MAKE) $(START_OPTIONS)
186-
echo "Start all services... docker images must exist local now, otherwise, run `make setup-master first` !"
186+
echo "Start all services... docker images must exist local now, otherwise, run 'make setup-master first' !"
187187
docker-compose up -d --no-recreate
188188

189189
stop: ##@Service Stop service

scripts/master_node/download_images.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ ARCH=$(uname -m)
3434
VERSION=latest
3535

3636
for IMG in baseimage mongo nginx ; do
37-
HC_IMG=hyperledger/cello-${IMG}
38-
if [ -z "$(docker images -q ${HC_IMG} 2> /dev/null)" ]; then # not exist
39-
echo_b "Pulling ${HC_IMG}:${ARCH}-${VERSION} from dockerhub"
40-
docker pull ${HC_IMG}:${ARCH}-${VERSION}
41-
docker tag ${HC_IMG}:${ARCH}-${VERSION} ${HC_IMG}
37+
HLC_IMG=hyperledger/cello-${IMG}
38+
if [ -z "$(docker images -q ${HLC_IMG} 2> /dev/null)" ]; then # not exist
39+
echo_b "Pulling ${HLC_IMG}:${ARCH}-${VERSION} from dockerhub"
40+
docker pull ${HLC_IMG}:${ARCH}-${VERSION}
41+
docker tag ${HLC_IMG}:${ARCH}-${VERSION} ${HLC_IMG}
4242
else
43-
echo_g "${HC_IMG} already exist locally"
43+
echo_g "${HLC_IMG} already exist locally"
4444
fi
4545
done
4646

scripts/worker_node/download_images.sh

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,48 @@ HLF_VERSION=1.0.5 # TODO: should be the same with src/common/utils.py
2828

2929
echo_b "Downloading fabric images from DockerHub...with tag = ${IMG_TAG}... need a while"
3030
# TODO: we may need some checking on pulling result?
31-
docker pull hyperledger/fabric-peer:$ARCH-$IMG_TAG
32-
docker pull hyperledger/fabric-tools:$ARCH-$IMG_TAG
33-
docker pull hyperledger/fabric-orderer:$ARCH-$IMG_TAG
34-
docker pull hyperledger/fabric-ca:$ARCH-$IMG_TAG
35-
docker pull hyperledger/fabric-ccenv:$ARCH-$IMG_TAG
36-
docker pull hyperledger/fabric-baseimage:$ARCH-$BASEIMAGE_RELEASE
37-
docker pull hyperledger/fabric-baseos:$ARCH-$BASEIMAGE_RELEASE
31+
for IMG in peer tools orderer ca ccenv; do
32+
HLF_IMG=hyperledger/fabric-${IMG}:$ARCH-$IMG_TAG
33+
if [ -z "$(docker images -q ${HLF_IMG} 2> /dev/null)" ]; then # not exist
34+
docker pull ${HLF_IMG}
35+
else
36+
echo_g "${HLF_IMG} already exist locally"
37+
fi
38+
done
39+
40+
HLF_IMG=hyperledger/fabric-baseimage:$ARCH-$BASEIMAGE_RELEASE
41+
[ -z "$(docker images -q ${HLF_IMG} 2> /dev/null)" ] && docker pull ${HLF_IMG}
42+
HLF_IMG=hyperledger/fabric-baseos:$ARCH-$BASEIMAGE_RELEASE
43+
[ -z "$(docker images -q ${HLF_IMG} 2> /dev/null)" ] && docker pull ${HLF_IMG}
3844

3945
# Only useful for debugging
4046
# docker pull yeasy/hyperledger-fabric
4147

42-
echo_b "===Re-tagging images to *:${HLF_VERSION}* tag"
43-
docker tag hyperledger/fabric-peer:$ARCH-$IMG_TAG hyperledger/fabric-peer:${HLF_VERSION}
44-
docker tag hyperledger/fabric-tools:$ARCH-$IMG_TAG hyperledger/fabric-tools:${HLF_VERSION}
45-
docker tag hyperledger/fabric-orderer:$ARCH-$IMG_TAG hyperledger/fabric-orderer:${HLF_VERSION}
46-
docker tag hyperledger/fabric-ca:$ARCH-$IMG_TAG hyperledger/fabric-ca:${HLF_VERSION}
48+
echo_b "===Re-tagging fabric images to *:${HLF_VERSION}* tag"
49+
for IMG in peer tools orderer ca; do
50+
HLF_IMG=hyperledger/fabric-${IMG}
51+
docker tag ${HLF_IMG}:$ARCH-$IMG_TAG ${HLF_IMG}:${HLF_VERSION}
52+
done
53+
54+
echo_b "Downloading images for fabric explorer"
55+
for IMG in mysql:5.7 yeasy/blockchain-explorer:0.1.0-preview; do
56+
if [ -z "$(docker images -q ${IMG} 2> /dev/null)" ]; then # not exist
57+
docker pull ${IMG}
58+
else
59+
echo_g "${IMG} already exist locally"
60+
fi
61+
done
4762

48-
echo_g "Done, now worker node should have all images, use `docker images` to check"
63+
# TODO: fix this if there's official images
64+
IMG_TAG=1.0.4
65+
echo_b "Downloading and retag images for kafka/zookeeper separately, as they are still v1.0.4"
66+
for IMG in kafka zookeeper; do
67+
HLF_IMG=hyperledger/fabric-${IMG}
68+
if [ -z "$(docker images -q ${HLF_IMG}:${ARCH}-${HLF_VERSION} 2> /dev/null)" ]; then # not exist
69+
docker pull ${HLF_IMG}:$ARCH-$IMG_TAG
70+
docker tag ${HLF_IMG}:$ARCH-$IMG_TAG ${HLF_IMG}:${HLF_VERSION}
71+
else
72+
echo_g "${HLF_IMG}:$ARCH-$IMG_TAG already exist locally"
73+
fi
74+
done
75+
echo_g "Done, now worker node should have all required images, use 'docker images' to check"

0 commit comments

Comments
 (0)