Skip to content

Commit

Permalink
[CE-312] Add separate tag for fabric ca
Browse files Browse the repository at this point in the history
Ansible agent uses two images tags to setup fabric
network. one tag for fabric images such as peer,
orderer, ccenv, tools and ca.  one tag for kafka,
zookeeper, couchdb etc.

The issue is that in test env, when cello sets up
fabric network, testers may want to use snapshot
images for fabric peer, orderer, ccenv, tools,
these snapshot images won't be available from ca
since ca images get built in its own repo and there
won't be match ca snapshot images. This patch will
add a new parameter for ca tag. It will also upgrade
default tags to the latest available.

Change-Id: Ibfb2b085f0bc3e6a0d5b0eef493d173d87a1cca6
Signed-off-by: Tong Li <litong01@us.ibm.com>
  • Loading branch information
Tong Li committed Mar 19, 2018
1 parent fbf1da8 commit 833d2c0
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@
command: "docker pull {{ fabric.repo.url }}{{ item.name }}"
when: item.flag | length > 0 and fabric.baseimage_tag | length > 0
with_items:
- { name: "fabric-ca:{{ helpertag }}", flag: "{{ cas }}" }
- { name: "fabric-ca:{{ fabric.ca.image_tag | default(thetag) }}", flag: "{{ cas }}" }
- { name: "fabric-zookeeper:{{ helpertag }}", flag: "{{ zookeepers }}" }
- { name: "fabric-kafka:{{ helpertag }}", flag: "{{ kafkas }}" }
- { name: "fabric-couchdb:{{ helpertag }}", flag: "{{ peers }}" }
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: {{ fabric.repo.url }}fabric-ca:{{ helpertag | default(thetag) }}
image: {{ fabric.repo.url }}fabric-ca:{{ fabric.ca.image_tag | default(thetag) }}
network_mode: bridge
hostname: {{ ca.name}}
environment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@
command: "docker pull {{ fabric.repo.url }}{{ item.name }}"
when: item.flag | length > 0 and fabric.baseimage_tag | length > 0
with_items:
- { name: "fabric-ca:{{ helpertag }}", flag: "{{ cas }}" }
- { name: "fabric-ca:{{ fabric.ca.image_tag | default(thetag) }}", flag: "{{ cas }}" }
- { name: "fabric-zookeeper:{{ helpertag }}", flag: "{{ zookeepers }}" }
- { name: "fabric-kafka:{{ helpertag }}", flag: "{{ kafkas }}" }
- { name: "fabric-couchdb:{{ helpertag }}", flag: "{{ peers }}" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ spec:
path: {{ fabricworkdir }}/run/keyfiles/{{ ca.org }}
containers:
- name: {{ ca.name }}
image: {{ fabric.repo.url }}fabric-ca:{{ helpertag }}
image: {{ fabric.repo.url }}fabric-ca:{{ fabric.ca.image_tag | default(thetag) }}
imagePullPolicy: IfNotPresent
env:
- { name: "FABRIC_CA_HOME", value: "/etc/hyperledger/fabric-ca-server-config/ca" }
Expand Down
6 changes: 3 additions & 3 deletions src/agent/ansible/vars/bc1st.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ fabric: {
# s390x-0.4.2 # release 0.4.2 for s390x
# 048c91eb47812582f36665fbea3d7e0e68e396bf # commit build
# x86_64-1.0.0-snapshot-8d3275f # snapshot build
baseimage_tag: "x86_64-1.1.0-alpha",
baseimage_tag: "x86_64-1.1.0",

# The container tag for accessory fabric components such as ca, kafka,
# zookeeper and couchdb. It has to be the full tag just like the
# baseimage_tag
helper_tag: "x86_64-1.1.0-preview",
ca: { admin: "admin", adminpw: "adminpw" },
helper_tag: "x86_64-0.4.6",
ca: { admin: "admin", adminpw: "adminpw", image_tag: "x86_64-1.1.0" },

# Only use this field when you have a docker repository.
repo: {
Expand Down
6 changes: 3 additions & 3 deletions src/agent/ansible/vars/bc2nd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ fabric: {
# s390x-0.4.2 # release 0.4.2 for s390x
# 048c91eb47812582f36665fbea3d7e0e68e396bf # commit build
# x86_64-1.0.0-snapshot-8d3275f # snapshot build
baseimage_tag: "x86_64-1.1.0-alpha",
baseimage_tag: "x86_64-1.1.0",

# The container tag for accessory fabric components such as ca, kafka,
# zookeeper and couchdb. It has to be the full tag just like the
# baseimage_tag
helper_tag: "x86_64-1.1.0-preview",
ca: { admin: "admin", adminpw: "adminpw" },
helper_tag: "x86_64-0.4.6",
ca: { admin: "admin", adminpw: "adminpw", image_tag: "x86_64-1.1.0" },

# Only use this field when you have a docker repository.
repo: {
Expand Down
18 changes: 9 additions & 9 deletions src/agent/ansible/vars/vb1st.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ fabric: {
ssh_user: "ubuntu",

# options are "goleveldb", "CouchDB", default is goleveldb
peer_db: "CouchDB",
tls: false,
peer_db: "goleveldb",
tls: true,
logging_level: "ERROR",

# The following section defines how the fabric network is going to be made up
Expand All @@ -31,14 +31,14 @@ fabric: {
fabric001: {
cas: [],
peers: ["anchor@peer1st.orga", "anchor@peer1st.orgb"],
orderers: ["orderer1st.orgc", "orderer1st.orgd"],
orderers: ["orderer1st.orgc"],
zookeepers: ["zookeeper1st"],
kafkas: ["kafka1st"]
},
fabric002: {
cas: [],
cas: ["ca1st.orga", "ca1st.orgb", "ca1st.orgc"],
peers: ["worker@peer2nd.orga", "worker@peer2nd.orgb"],
orderers: ["orderer2nd.orgc", "orderer2nd.orgd"],
orderers: ["orderer2nd.orgc"],
zookeepers: [],
kafkas: []
}
Expand All @@ -55,13 +55,13 @@ fabric: {
# s390x-0.4.2 # release 0.4.2 for s390x
# 048c91eb47812582f36665fbea3d7e0e68e396bf # commit build
# x86_64-1.0.0-snapshot-8d3275f # snapshot build
baseimage_tag: "x86_64-1.1.0-alpha",
baseimage_tag: "x86_64-1.1.0",

# The container tag for accessory fabric components such as ca, kafka,
# zookeeper and couchdb. It has to be the full tag just like the
# baseimage_tag
helper_tag: "x86_64-1.1.0-preview",
ca: { admin: "admin", adminpw: "adminpw" },
helper_tag: "x86_64-0.4.6",
ca: { admin: "admin", adminpw: "adminpw", image_tag: "x86_64-1.1.0" },

# Only use this field when you have a docker repository.
repo: {
Expand All @@ -73,6 +73,6 @@ fabric: {
# locations to download fabric binaries. This url should point to a
# compressed such as tar or zip file which contains necessary binaries
# such as configtxgen, configtxlator, cryptogen etc.
bin: "https://nexus.hyperledger.org/content/repositories/releases/org/hyperledger/fabric/hyperledger-fabric-build/linux-amd64-ff6f6dbffed57efb9f7d8886b4a47949ce2d4396/hyperledger-fabric-build-linux-amd64-ff6f6dbffed57efb9f7d8886b4a47949ce2d4396.tar.gz"
bin: "https://nexus.hyperledger.org/content/repositories/releases/org/hyperledger/fabric/hyperledger-fabric/linux-amd64-1.1.0/hyperledger-fabric-linux-amd64-1.1.0.tar.gz"
}
}

0 comments on commit 833d2c0

Please sign in to comment.