Skip to content

Commit af6dc14

Browse files
committed
[CE-198] Enable Docker Compose v3 support
Compose v3 support more powerful features like image tag from env. This enable us manupulate the docker images more flexibly. Change-Id: I6e0717ee9cd164e0437117365d0fa1ef9383e223 Signed-off-by: Baohua Yang <[email protected]>
1 parent 1b9f8ba commit af6dc14

File tree

11 files changed

+247
-271
lines changed

11 files changed

+247
-271
lines changed

.gitignore

-23
Original file line numberDiff line numberDiff line change
@@ -107,29 +107,6 @@ pip-selfcheck.json
107107

108108
# All .idea stuff:
109109
.idea/*
110-
.idea/
111-
112-
# User-specific stuff:
113-
.idea/workspace.xml
114-
.idea/tasks.xml
115-
.idea/dictionaries
116-
.idea/vcs.xml
117-
.idea/jsLibraryMappings.xml
118-
119-
# Sensitive or high-churn files:
120-
.idea/dataSources.ids
121-
.idea/dataSources.xml
122-
.idea/dataSources.local.xml
123-
.idea/sqlDataSources.xml
124-
.idea/dynamic.xml
125-
.idea/uiDesigner.xml
126-
127-
# Gradle:
128-
.idea/gradle.xml
129-
.idea/libraries
130-
131-
# Mongo Explorer plugin:
132-
.idea/mongoSettings.xml
133110

134111
## File-based project format:
135112
*.iws

docker-compose.yml

+17-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# nginx: front end
1111
# mongo: mongo db
1212

13-
version: '2'
13+
version: '3.2'
1414
services:
1515
# cello dashboard service
1616
dashboard:
@@ -75,7 +75,14 @@ services:
7575
hostname: mongo
7676
container_name: mongo
7777
restart: unless-stopped
78-
mem_limit: 2048m
78+
deploy:
79+
resources:
80+
limits:
81+
cpus: '0.50'
82+
memory: 2048M
83+
reservations:
84+
cpus: '0.10'
85+
memory: 256M
7986
ports:
8087
#- "27017:27017" # use follow line instead in production env
8188
- "127.0.0.1:27017:27017"
@@ -91,7 +98,14 @@ services:
9198
hostname: nginx
9299
container_name: nginx
93100
restart: always
94-
mem_limit: 2048m
101+
deploy:
102+
resources:
103+
limits:
104+
cpus: '0.50'
105+
memory: 2048M
106+
reservations:
107+
cpus: '0.10'
108+
memory: 256M
95109
volumes:
96110
- ./nginx/nginx.conf:/etc/nginx/nginx.default.conf
97111
#- /opt/cello/nginx/log/:/var/log/nginx/

scripts/master_node/setup.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ echo_b "Add existing user to docker group"
9494
sudo usermod -aG docker ${USER}
9595

9696
echo_b "Checking to install Docker-compose..."
97-
command -v docker-compose >/dev/null 2>&1 || { echo_r >&2 "No docker-compose found, try installing"; sudo pip install docker-compose; }
97+
command -v docker-compose >/dev/null 2>&1 || { echo_r >&2 "No docker-compose found, try installing"; sudo pip install 'docker-compose>=1.17.0'; }
9898

9999
[ `sudo docker ps -qa|wc -l` -gt 0 ] \
100100
&& echo_r "Warn: existing containers may cause unpredictable failure, suggest to clean them using docker rm"

scripts/worker_node/download_images.sh

+6-5
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ BASEIMAGE_RELEASE=0.3.2
1818
BASE_VERSION=1.0.5
1919
PROJECT_VERSION=1.0.5
2020
IMG_TAG=1.0.5
21+
HLF_VERSION=1.0.5 # TODO: should be the same with src/common/utils.py
2122

2223
echo_b "Downloading fabric images from DockerHub...with tag = ${IMG_TAG}... need a while"
2324
# TODO: we may need some checking on pulling result?
@@ -32,10 +33,10 @@ docker pull hyperledger/fabric-baseos:$ARCH-$BASEIMAGE_RELEASE
3233
# Only useful for debugging
3334
# docker pull yeasy/hyperledger-fabric
3435

35-
echo_b "===Re-tagging images to *latest* tag"
36-
docker tag hyperledger/fabric-peer:$ARCH-$IMG_TAG hyperledger/fabric-peer
37-
docker tag hyperledger/fabric-tools:$ARCH-$IMG_TAG hyperledger/fabric-tools
38-
docker tag hyperledger/fabric-orderer:$ARCH-$IMG_TAG hyperledger/fabric-orderer
39-
docker tag hyperledger/fabric-ca:$ARCH-$IMG_TAG hyperledger/fabric-ca
36+
echo_b "===Re-tagging images to *:${HLF_VERSION}* tag"
37+
docker tag hyperledger/fabric-peer:$ARCH-$IMG_TAG hyperledger/fabric-peer:${HLF_VERSION}
38+
docker tag hyperledger/fabric-tools:$ARCH-$IMG_TAG hyperledger/fabric-tools:${HLF_VERSION}
39+
docker tag hyperledger/fabric-orderer:$ARCH-$IMG_TAG hyperledger/fabric-orderer:${HLF_VERSION}
40+
docker tag hyperledger/fabric-ca:$ARCH-$IMG_TAG hyperledger/fabric-ca:${HLF_VERSION}
4041

4142
echo_g "Done, now worker node should have all images, use `docker images` to check"

src/agent/docker/_compose_files/fabric-1.0/local/docker-compose-base.yaml

-113
This file was deleted.

0 commit comments

Comments
 (0)