Skip to content

Commit

Permalink
[CE-227] Enable fabric kafka mode
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
yeasy committed Jan 12, 2018
1 parent 36bcd57 commit fe39bbc
Show file tree
Hide file tree
Showing 10 changed files with 532 additions and 34 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ test-case: ##@Code Run test case for flask server

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

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

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

stop: ##@Service Stop service
Expand Down
12 changes: 6 additions & 6 deletions scripts/master_node/download_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ ARCH=$(uname -m)
VERSION=latest

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

Expand Down
53 changes: 40 additions & 13 deletions scripts/worker_node/download_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,48 @@ HLF_VERSION=1.0.5 # TODO: should be the same with src/common/utils.py

echo_b "Downloading fabric images from DockerHub...with tag = ${IMG_TAG}... need a while"
# TODO: we may need some checking on pulling result?
docker pull hyperledger/fabric-peer:$ARCH-$IMG_TAG
docker pull hyperledger/fabric-tools:$ARCH-$IMG_TAG
docker pull hyperledger/fabric-orderer:$ARCH-$IMG_TAG
docker pull hyperledger/fabric-ca:$ARCH-$IMG_TAG
docker pull hyperledger/fabric-ccenv:$ARCH-$IMG_TAG
docker pull hyperledger/fabric-baseimage:$ARCH-$BASEIMAGE_RELEASE
docker pull hyperledger/fabric-baseos:$ARCH-$BASEIMAGE_RELEASE
for IMG in peer tools orderer ca ccenv; do
HLF_IMG=hyperledger/fabric-${IMG}:$ARCH-$IMG_TAG
if [ -z "$(docker images -q ${HLF_IMG} 2> /dev/null)" ]; then # not exist
docker pull ${HLF_IMG}
else
echo_g "${HLF_IMG} already exist locally"
fi
done

HLF_IMG=hyperledger/fabric-baseimage:$ARCH-$BASEIMAGE_RELEASE
[ -z "$(docker images -q ${HLF_IMG} 2> /dev/null)" ] && docker pull ${HLF_IMG}
HLF_IMG=hyperledger/fabric-baseos:$ARCH-$BASEIMAGE_RELEASE
[ -z "$(docker images -q ${HLF_IMG} 2> /dev/null)" ] && docker pull ${HLF_IMG}

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

echo_b "===Re-tagging images to *:${HLF_VERSION}* tag"
docker tag hyperledger/fabric-peer:$ARCH-$IMG_TAG hyperledger/fabric-peer:${HLF_VERSION}
docker tag hyperledger/fabric-tools:$ARCH-$IMG_TAG hyperledger/fabric-tools:${HLF_VERSION}
docker tag hyperledger/fabric-orderer:$ARCH-$IMG_TAG hyperledger/fabric-orderer:${HLF_VERSION}
docker tag hyperledger/fabric-ca:$ARCH-$IMG_TAG hyperledger/fabric-ca:${HLF_VERSION}
echo_b "===Re-tagging fabric images to *:${HLF_VERSION}* tag"
for IMG in peer tools orderer ca; do
HLF_IMG=hyperledger/fabric-${IMG}
docker tag ${HLF_IMG}:$ARCH-$IMG_TAG ${HLF_IMG}:${HLF_VERSION}
done

echo_b "Downloading images for fabric explorer"
for IMG in mysql:5.7 yeasy/blockchain-explorer:0.1.0-preview; do
if [ -z "$(docker images -q ${IMG} 2> /dev/null)" ]; then # not exist
docker pull ${IMG}
else
echo_g "${IMG} already exist locally"
fi
done

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

0 comments on commit fe39bbc

Please sign in to comment.