Skip to content

Commit

Permalink
[CE-61] Add docker image pull script
Browse files Browse the repository at this point in the history
Add script to pull down images at worker nodes.

Also update the documentation.

Change-Id: I911d2499d8adf53137cccd075ea765b08825516b
Signed-off-by: Baohua Yang <[email protected]>
  • Loading branch information
yeasy committed Jun 23, 2017
1 parent 44631ff commit df3c834
Show file tree
Hide file tree
Showing 7 changed files with 90 additions and 4 deletions.
12 changes: 11 additions & 1 deletion docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,17 @@ At last, run the follow test at Master node and get OK response, to make sure it
```

### Docker Images Pulling
Pulling the following images.
Pulling the necessary images.

#### Fabric v1.0

```bash
$ cd scripts/worker_node_setup && bash download_images.sh
```

#### Fabric v0.6 (TODO: deprecated soon)

For fabric v0.6, need to run the following command.

```bash
$ docker pull hyperledger/fabric-peer:x86_64-0.6.1-preview \
Expand Down
7 changes: 7 additions & 0 deletions scripts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Scripts

Here we collect scripts to help setup and manage the lifecycle of cello service.

Most of them are needed by the master node.

Those under [worker_node_setup](worker_node_setup) directory should be put at the worker node to help setup.
44 changes: 44 additions & 0 deletions scripts/worker_node_setup/download_images.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/usr/bin/env bash


# Detecting whether can import the header file to render colorful cli output
if [ -f ./header.sh ]; then
source ./header.sh
elif [ -f worker_node_setup/header.sh ]; then
source worker_node_setup/header.sh
else
alias echo_r="echo"
alias echo_g="echo"
alias echo_b="echo"
fi

ARCH=x86_64
BASEIMAGE_RELEASE=0.3.1
BASE_VERSION=1.0.0
PROJECT_VERSION=1.0.0-preview

IMG_VERSION=0.9.6
# Only For testing latest images
IMG_VERSION=latest

echo_b "Downloading images from DockerHub... need a while"

# TODO: we may need some checking on pulling result?
docker pull yeasy/hyperledger-fabric-base:$IMG_VERSION \
&& docker pull yeasy/hyperledger-fabric-peer:$IMG_VERSION \
&& docker pull yeasy/hyperledger-fabric-orderer:$IMG_VERSION \
&& docker pull yeasy/hyperledger-fabric-ca:$IMG_VERSION

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

echo_b "Rename images with official tags ... fabric-peer, fabric-orderer, fabric-tools, fabric-ca, fabric-ccenv, fabric-bareos, fabric-baseimage"
docker tag yeasy/hyperledger-fabric-peer:$IMG_VERSION hyperledger/fabric-peer \
&& docker tag yeasy/hyperledger-fabric-peer:$IMG_VERSION hyperledger/fabric-tools \
&& docker tag yeasy/hyperledger-fabric-orderer:$IMG_VERSION hyperledger/fabric-orderer \
&& docker tag yeasy/hyperledger-fabric-ca:$IMG_VERSION hyperledger/fabric-ca \
&& docker tag yeasy/hyperledger-fabric-base:$IMG_VERSION hyperledger/fabric-ccenv:$ARCH-$PROJECT_VERSION \
&& docker tag yeasy/hyperledger-fabric-base:$IMG_VERSION hyperledger/fabric-baseos:$ARCH-$BASE_VERSION \
&& docker tag yeasy/hyperledger-fabric-base:$IMG_VERSION hyperledger/fabric-baseimage:$ARCH-$BASEIMAGE_RELEASE

echo_g "Done, now worker node should have all images, use `docker images` to check"
19 changes: 19 additions & 0 deletions scripts/worker_node_setup/header.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

## DO NOT MODIFY THE FOLLOWING PART, UNLESS YOU KNOW WHAT IT MEANS ##
echo_r () {
[ $# -ne 1 ] && return 0
echo -e "\033[31m$1\033[0m"
}
echo_g () {
[ $# -ne 1 ] && return 0
echo -e "\033[32m$1\033[0m"
}
echo_y () {
[ $# -ne 1 ] && return 0
echo -e "\033[33m$1\033[0m"
}
echo_b () {
[ $# -ne 1 ] && return 0
echo -e "\033[34m$1\033[0m"
}
4 changes: 3 additions & 1 deletion scripts/worker_node_setup/setup_docker_worker_node.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#!/usr/bin/env bash

# Copyright IBM Corp, All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#

# This script will help setup Docker at a server, then the server can be used as a worker node.

# TODO:
# TODO:
4 changes: 3 additions & 1 deletion scripts/worker_node_setup/setup_k8s_worker_node.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#!/usr/bin/env bash

# Copyright IBM Corp, All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#

# This script will help setup a Kubernetes cluster at servers, then the cluster can be used as a worker node.

# TODO:
# TODO:
4 changes: 3 additions & 1 deletion scripts/worker_node_setup/setup_swarm_worker_node.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#!/usr/bin/env bash

# Copyright IBM Corp, All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#

# This script will help setup a Swarm cluster at servers, then the cluster can be used as a worker node.

# TODO:
# TODO:

0 comments on commit df3c834

Please sign in to comment.