Skip to content

Commit 9f30e90

Browse files
Brett Loganjt-nti
authored andcommitted
Use Official CouchDB 3.1 Image (#180)
Fabric 2.2 removes official support for CouchDB 2.x. The migration to 3.1 was to address fsync issues in the underlying storage implementation in Couch. This change moves to CouchDB 3.1 which requires the user to now set an admin identity at startup. Node 12.18.2 is the latest LTS Signed-off-by: Brett Logan <[email protected]>
1 parent eeca625 commit 9f30e90

File tree

3 files changed

+28
-50
lines changed

3 files changed

+28
-50
lines changed

ci/azure-pipelines.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ variables:
4141
- name: pipeline
4242
value: ci
4343
- name: node_version_spec
44-
value: '12.16.1'
44+
value: '12.18.2'
45+
- name: FABRIC_VERSION
46+
value: 2.2
4547

4648
# Build on Ubuntu
4749
pool:

tools/getEdgeDocker.sh

Lines changed: 18 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,22 @@
1-
#!/bin/bash -e
1+
#!/bin/bash
2+
#
3+
# Copyright IBM Corp. All Rights Reserved.
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
#
27
set -euo pipefail
38

4-
echo "======== PULL DOCKER IMAGES ========"
9+
version=${FABRIC_VERSION:-2.2}
10+
artifactory_url=hyperledger-fabric.jfrog.io
511

6-
###############################################################
7-
# Pull and Tag the fabric and fabric-ca images from Artifactory
8-
###############################################################
9-
echo "Fetching images from Artifactory"
10-
ARTIFACTORY_URL=hyperledger-fabric.jfrog.io
11-
ORG_NAME="hyperledger"
12+
for image in peer orderer ca baseos ccenv tools; do
13+
artifactory_image="${artifactory_url}/fabric-${image}:amd64-${version}-stable"
14+
docker pull -q "${artifactory_image}"
15+
docker tag "${artifactory_image}" "hyperledger/fabric-${image}"
16+
docker rmi -f "${artifactory_image}" >/dev/null
17+
done
1218

13-
VERSION=2.1
14-
CA_VERSION=1.4
15-
ARCH="amd64"
16-
MASTER_TAG=$ARCH-master
17-
18-
# Specifically not pulling down javaenv nodeenv
19-
# javaenv not needed and we've just rebuilt the nodeenv
20-
21-
dockerTag() {
22-
for IMAGES in peer orderer ca baseos ccenv tools; do
23-
echo "Images: $IMAGES"
24-
echo
25-
26-
if [ "${IMAGES}" = "ca" ]; then
27-
STABLE_TAG=$ARCH-$CA_VERSION-stable
28-
else
29-
STABLE_TAG=$ARCH-$VERSION-stable
30-
fi
31-
echo "---------> STABLE_TAG:" $STABLE_TAG
32-
echo
33-
34-
docker pull $ARTIFACTORY_URL/fabric-$IMAGES:$STABLE_TAG
35-
if [[ $? != 0 ]]; then
36-
echo "FAILED: Docker Pull Failed on $IMAGES"
37-
exit 1
38-
fi
39-
40-
docker tag $ARTIFACTORY_URL/fabric-$IMAGES:$STABLE_TAG $ORG_NAME/fabric-$IMAGES
41-
docker tag $ARTIFACTORY_URL/fabric-$IMAGES:$STABLE_TAG $ORG_NAME/fabric-$IMAGES:$MASTER_TAG
42-
echo "$ORG_NAME/fabric-$IMAGES:$MASTER_TAG"
43-
echo "Deleting Artifactory docker images: $IMAGES"
44-
docker rmi -f $ARTIFACTORY_URL/fabric-$IMAGES:$STABLE_TAG
45-
done
46-
}
47-
48-
dockerTag
49-
50-
echo
51-
docker images | grep "hyperledger"
52-
echo
19+
docker pull -q couchdb:3.1
20+
docker pull -q hyperledger/fabric-ca:1.4
21+
docker tag hyperledger/fabric-ca:1.4 hyperledger/fabric-ca
22+
docker rmi hyperledger/fabric-ca:1.4 >/dev/null

tools/toolchain/network/docker-compose/docker-compose-base.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ services:
9595
- CORE_CHAINCODE_NODE_RUNTIME=hyperledger/fabric-nodeenv:2.1.5-unstable
9696
# Allow more time for chaincode container to build on install.
9797
- CORE_CHAINCODE_EXECUTETIMEOUT=300s
98+
99+
- CORE_LEDGER_STATE_COUCHDBCONFIG_USERNAME=admin
100+
- CORE_LEDGER_STATE_COUCHDBCONFIG_PASSWORD=adminpw
98101
working_dir: /opt/gopath/src/github.com/hyperledger/fabric
99102
command: peer node start --peer-chaincodedev=${DOCKER_DEVMODE}
100103
volumes:
@@ -129,4 +132,7 @@ services:
129132

130133
couchdb:
131134
container_name: couchdb
132-
image: hyperledger/fabric-couchdb${THIRDPARTY_IMG_TAG}
135+
image: couchdb:3.1
136+
environment:
137+
- COUCHDB_USER=admin
138+
- COUCHDB_PASSWORD=adminpw

0 commit comments

Comments
 (0)