Skip to content

Commit

Permalink
[CE-185][CE-191] Fix build target change errors
Browse files Browse the repository at this point in the history
Fabric build target docker has been reduced not to build
zookeeper, kafka and couchdb images. This change breaks
the ansible agent when deployer wants to use ansible agent
to build fabric off of the latest code, since the build
now does not produce these images, during the deployment
process, these docker images will be missing. This change
will allow a deployer to specify image tags for zookeeper,
kafka, couchdb and fabric-ca.

This change will also upgrade the default fabric release
to 1.0.5 which was described in [CE-185]

Change-Id: Idbb93c73a2d187591be598b13b704ac48f59dcba
Signed-off-by: tongliofcary <litong01@us.ibm.com>
  • Loading branch information
tongliofcary authored and yeasy committed Dec 13, 2017
1 parent c0cefd0 commit 3bcb3e3
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 23 deletions.
8 changes: 4 additions & 4 deletions scripts/worker_node/download_images.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ fi

# pull fabric images
ARCH=`uname -m | sed 's|i686|x86|' | sed 's|x86_64|x64|'`
BASEIMAGE_RELEASE=0.3.1
BASE_VERSION=1.0.0
PROJECT_VERSION=1.0.0
IMG_TAG=1.0.0
BASEIMAGE_RELEASE=0.3.2
BASE_VERSION=1.0.5
PROJECT_VERSION=1.0.5
IMG_TAG=1.0.5

echo_b "Downloading fabric images from DockerHub...with tag = ${IMG_TAG}... need a while"
# TODO: we may need some checking on pulling result?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
clihost: ""
filterstr: ""
thetag: "{{ rawarch.stdout + '-' + fabric.baseimage_tag }}"
catag: "{{ rawarch.stdout + '-' + fabric.ca.tag }}"
helpertag: "{{ rawarch.stdout + '-' + fabric.helper_tag }}"

- name: Make sure that working directory is clean
become: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
{% for ca in cas %}
{{ ca.name }}:
container_name: {{ ca.name}}
image: hyperledger/fabric-ca:{{ catag }}
image: hyperledger/fabric-ca:{{ (fabric.helper_tag == "") | ternary(thetag, helpertag) }}
network_mode: bridge
hostname: {{ ca.name}}
environment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
{% for kafka in kafkas %}
{{ kafka }}:
container_name: {{ kafka }}
image: hyperledger/fabric-kafka:{{ thetag }}
image: hyperledger/fabric-kafka:{{ (fabric.helper_tag == "") | ternary(thetag, helpertag) }}
restart: always
network_mode: bridge
hostname: {{ kafka }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ services:
{% if fabric.peer_db == 'CouchDB' %}
couchdb-{{ peer.name }}:
container_name: couchdb-{{ peer.name }}
image: hyperledger/fabric-couchdb:{{ thetag }}
image: hyperledger/fabric-couchdb:{{ (fabric.helper_tag == "") | ternary(thetag, helpertag) }}
network_mode: bridge
hostname: couchdb-{{ peer.name }}
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
{% for zookeeper in zookeepers %}
{{ zookeeper }}:
container_name: {{ zookeeper }}
image: hyperledger/fabric-zookeeper:{{ thetag }}
image: hyperledger/fabric-zookeeper:{{ (fabric.helper_tag == "") | ternary(thetag, helpertag) }}
network_mode: bridge
hostname: {{ zookeeper }}
restart: always
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
allpeers: "{{ [] }}"
clihost: ""
thetag: "{{ rawarch.stdout + '-' + fabric.baseimage_tag }}"
catag: "{{ rawarch.stdout + '-' + fabric.ca.tag }}"
helpertag: "{{ rawarch.stdout + '-' + fabric.helper_tag }}"
filterstr: ""
k8s_server: "{{ hostvars[groups['allnodes'][0]].private_ip }}"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spec:
restartPolicy: Always
containers:
- name: {{ zookeeper }}
image: hyperledger/fabric-zookeeper:{{ thetag }}
image: hyperledger/fabric-zookeeper:{{ (fabric.helper_tag == "") | ternary(thetag, helpertag) }}
imagePullPolicy: IfNotPresent
env:
- { name: "ZOO_MY_ID", value: "{{ zoo_ids[zookeeper] }}" }
Expand Down Expand Up @@ -53,7 +53,7 @@ spec:
restartPolicy: Always
containers:
- name: {{ kafka }}
image: hyperledger/fabric-kafka:{{ thetag }}
image: hyperledger/fabric-kafka:{{ (fabric.helper_tag == "") | ternary(thetag, helpertag) }}
imagePullPolicy: IfNotPresent
env:
- { name: "KAFKA_MESSAGE_MAX_BYTES", value: "103809024" }
Expand Down Expand Up @@ -96,7 +96,7 @@ spec:
path: {{ fabricworkdir }}/run/keyfiles/{{ ca.org }}
containers:
- name: {{ ca.name }}
image: hyperledger/fabric-ca:{{ catag }}
image: hyperledger/fabric-ca:{{ (fabric.helper_tag == "") | ternary(thetag, helpertag) }}
imagePullPolicy: IfNotPresent
env:
- { name: "FABRIC_CA_HOME", value: "/etc/hyperledger/fabric-ca-server-config/ca" }
Expand Down Expand Up @@ -152,7 +152,7 @@ spec:
containers:
{% if fabric.peer_db == 'CouchDB' %}
- name: couchdb-{{ peer.name }}
image: hyperledger/fabric-couchdb:{{ thetag }}
image: hyperledger/fabric-couchdb:{{ (fabric.helper_tag == "") | ternary(thetag, helpertag) }}
imagePullPolicy: IfNotPresent
securityContext:
privileged: true
Expand Down
10 changes: 7 additions & 3 deletions src/agent/ansible/vars/bc1st.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ GIT_URL: "http://gerrit.hyperledger.org/r/fabric"
# The gerrit patch set reference, should be automatically set by gerrit
# GERRIT_REFSPEC: "refs/changes/23/11523/3" # 1.0.0
# GERRIT_REFSPEC: "refs/changes/47/12047/3" # 1.0.1
GERRIT_REFSPEC: "refs/changes/13/13113/1"
# GERRIT_REFSPEC: "refs/changes/13/13113/1"
# GERRIT_REFSPEC: "refs/tags/v1.0.4" # 1.0.4
GERRIT_REFSPEC: "refs/tags/v1.0.5" # 1.0.5

# This variable defines fabric network attributes
fabric: {
Expand Down Expand Up @@ -48,6 +50,8 @@ fabric: {
}
},

baseimage_tag: "1.0.2",
ca: { tag: "1.0.2", admin: "admin", adminpw: "adminpw" }
baseimage_tag: "1.0.5",
# This tag defines image tag for containers such as kafka, zookeeper and couchdb
helper_tag: "",
ca: { admin: "admin", adminpw: "adminpw" }
}
8 changes: 5 additions & 3 deletions src/agent/ansible/vars/bc2nd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ fabric: {
network: {
fabric001: {
peers: ["leader@peer1st.mad","anchor@peer2nd.mad"],
orderers: ["1storderer.sin"],
orderers: ["orderer1st.sin"],
zookeepers: ["zookeeper1st"],
kafkas: ["kafka1st"]
}
},

baseimage_tag: "1.0.2",
ca: { tag: "1.0.2", admin: "admin", adminpw: "adminpw" }
baseimage_tag: "1.0.5",
# This tag defines image tag for containers such as kafka, zookeeper and couchdb
helper_tag: "",
ca: { admin: "admin", adminpw: "adminpw" }
}
Empty file modified src/agent/ansible/vars/vb.yml
100644 → 100755
Empty file.
10 changes: 7 additions & 3 deletions src/agent/ansible/vars/vb1st.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ GIT_URL: "http://gerrit.hyperledger.org/r/fabric"
# The gerrit patch set reference, should be automatically set by gerrit
# GERRIT_REFSPEC: "refs/changes/23/11523/3" # 1.0.0
# GERRIT_REFSPEC: "refs/changes/47/12047/3" # 1.0.1
GERRIT_REFSPEC: "refs/changes/13/13113/1"
# GERRIT_REFSPEC: "refs/changes/13/13113/1"
# GERRIT_REFSPEC: "refs/tags/v1.0.4" # 1.0.4
GERRIT_REFSPEC: "refs/tags/v1.0.5" # 1.0.5

# This variable defines fabric network attributes
fabric: {
Expand Down Expand Up @@ -41,6 +43,8 @@ fabric: {
}
},

baseimage_tag: "1.0.2",
ca: { tag: "1.0.2", admin: "admin", adminpw: "adminpw" }
baseimage_tag: "1.0.5",
# This tag defines image tag for containers such as kafka, zookeeper and couchdb
helper_tag: "",
ca: { admin: "admin", adminpw: "adminpw" }
}

0 comments on commit 3bcb3e3

Please sign in to comment.