Skip to content

Commit

Permalink
[CE-452] Remove nfs container from master service
Browse files Browse the repository at this point in the history
Move all docker-compose files into docker-compose-files directory.
Add rabbitmq environments in env.tmpl.
Remove unused svg files in root path.

Change-Id: Icd2afa21e5806af79bdff59f5f5fcad3edd986f5
Signed-off-by: Haitao Yue <hightall@me.com>
  • Loading branch information
hightall committed Aug 31, 2018
1 parent 2b35193 commit 182ee45
Show file tree
Hide file tree
Showing 19 changed files with 72 additions and 1,172 deletions.
4 changes: 2 additions & 2 deletions .makerc/operator-dashboard
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ NPM_REGISTRY_REPLACE=$(subst $(SLASH),$(REPLACE_SLASH),$(NPM_REGISTRY))

ifeq (${DEV}, True)
export LOG_LEVEL:=DEBUG
DEPLOY_COMPOSE_FILE:=docker-compose-dev.yml
DEPLOY_COMPOSE_FILE:=docker-compose-files/docker-compose-dev.yml
else
export LOG_LEVEL:=INFO
DEPLOY_COMPOSE_FILE:=docker-compose.yml
DEPLOY_COMPOSE_FILE:=docker-compose-files/docker-compose.yml
endif
15 changes: 12 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
# - setup-worker: Setup the host as a worker node, install pkg and download docker images
# - start: Start the cello service
# - stop: Stop the cello service, and remove all service containers
# - start-nfs: Start the cello nfs service
# - stop-nfs: Stop the cello nfs service

GREEN := $(shell tput -Txterm setaf 2)
WHITE := $(shell tput -Txterm setaf 7)
Expand Down Expand Up @@ -105,9 +107,9 @@ WORKER_TYPE ?= docker
# Specify the running mode, prod or dev
MODE ?= prod
ifeq ($(MODE),prod)
COMPOSE_FILE=docker-compose.yml
COMPOSE_FILE=docker-compose-files/docker-compose.yml
else
COMPOSE_FILE=docker-compose-dev.yml
COMPOSE_FILE=docker-compose-files/docker-compose-dev.yml
endif


Expand Down Expand Up @@ -172,7 +174,7 @@ license:
install: $(patsubst %,build/docker/%/.push,$(DOCKER_IMAGES))

check-js: ##@Code Check check js code format
docker-compose -f docker-compose-check-js.yaml up
docker-compose -f docker-compose-files/docker-compose-check-js.yaml up

check: setup-master docker-operator-dashboard ##@Code Check code format
@$(MAKE) license
Expand Down Expand Up @@ -221,6 +223,7 @@ start: ##@Service Start service
fi
docker-compose -f ${COMPOSE_FILE} up -d --no-recreate
echo "Now you can visit operator-dashboard at localhost:8080, or user-dashboard at localhost:8081"
@$(MAKE) start-nfs

stop: ##@Service Stop service
echo "Stop all services with ${COMPOSE_FILE}..."
Expand Down Expand Up @@ -253,6 +256,12 @@ npm-install: ##@Nodejs Install modules with npm package management
help: ##@other Show this help.
@perl -e '$(HELP_FUN)' $(MAKEFILE_LIST)

start-nfs: ##@Service start nfs service
docker-compose -f docker-compose-files/docker-compose-nfs.yml up -d --no-recreate

stop-nfs: ##@Service stop nfs service
docker-compose -f docker-compose-files/docker-compose-nfs.yml down

HELP_FUN = \
%help; \
while(<>) { push @{$$help{$$2 // 'options'}}, [$$1, $$3] if /^([a-zA-Z\-]+)\s*:.*\#\#(?:@([a-zA-Z\-]+))?\s(.*)$$/ }; \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ services:
build:
context: $ROOT_PATH/src/static
volumes:
- ./src/static:/var/www
- ./src/templates:/templates
- $ROOT_PATH/src/static:/var/www
- $ROOT_PATH/src/templates:/templates
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ services:
build:
context: $ROOT_PATH/src/static
dockerfile: Dockerfile-check-js
container_name: cello-check-admin-js
volumes:
- ./src/static:/var/www
command: bash -c "ln -sf /node_modules /var/www/dashboard/node_modules && cd /var/www/dashboard && npm run lint && rm -rf node_modules"
- $ROOT_PATH/src/static:/var/www

check-user-dashboard:
build:
context: $ROOT_PATH/user-dashboard
dockerfile: Dockerfile-check-js
container_name: cello-check-user-dashboard-js
volumes:
- ./user-dashboard/src:/var/www
- $ROOT_PATH/user-dashboard/src:/var/www
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ services:
# image: redis
rabbitmq:
image: rabbitmq
restart: unless-stopped
container_name: cello-dashboard_rabbitmq
environment:
- RABBITMQ_DEFAULT_USER=$RABBITMQ_DEFAULT_USER
- RABBITMQ_DEFAULT_PASS=$RABBITMQ_DEFAULT_PASS
Expand Down Expand Up @@ -68,8 +70,8 @@ services:
ports:
- "8080:8080"
volumes: # This should be removed in product env
- ./src/agent/docker/_compose_files:/cello
- ./src:/app
- $ROOT_PATH/src/agent/docker/_compose_files:/cello
- $ROOT_PATH/src:/app

#TODO: need to follow other images to put at dockerhub
user-dashboard:
Expand Down Expand Up @@ -99,7 +101,7 @@ services:
- WEBROOT=$USER_DASHBOARD_WEBROOT
- FABRIC_CFG_PATH=/etc/hyperledger/fabric
volumes:
- ./user-dashboard/src:/var/www
- $ROOT_PATH/user-dashboard/src:/var/www
- /opt/cello/baas:/opt/data

# cello engine service
Expand All @@ -118,7 +120,7 @@ services:
ports:
- "80:80"
volumes:
- ./src:/app
- $ROOT_PATH/src:/app

# cello watchdog service
watchdog:
Expand All @@ -134,7 +136,7 @@ services:
- DEBUG=$DEV # in debug mode, service will auto-restart
- LOG_LEVEL=$LOG_LEVEL # what level log will be output
volumes: # This should be removed in product env
- ./src:/app
- $ROOT_PATH/src:/app

# mongo database, may use others in future
mongo:
Expand Down Expand Up @@ -169,13 +171,3 @@ services:
- NO_USED=0
volumes:
- /opt/cello/dashboard_mongo:/data/db

nfs:
image: itsthenetwork/nfs-server-alpine:9
restart: unless-stopped
environment:
- SHARED_DIRECTORY=/cello
volumes:
- ./src/agent/docker/_compose_files:/cello
privileged: true
network_mode: host
19 changes: 19 additions & 0 deletions docker-compose-files/docker-compose-nfs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# This compose file will deploy the services, and bootup a mongo server.

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

version: '3.2'
services:
nfs:
image: itsthenetwork/nfs-server-alpine:9
container_name: cello-nfs
restart: unless-stopped
environment:
- SHARED_DIRECTORY=/cello
volumes:
- $ROOT_PATH/src/agent/docker/_compose_files:/cello
privileged: true
network_mode: host
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ services:
npm-install:
image: node:9.3
volumes: # This should be removed in product env
- ./src/$STATIC_FOLDER:/app
- $ROOT_PATH/src/$STATIC_FOLDER:/app
environment:
- NPM_REGISTRY=$NPM_REGISTRY
command: bash -c "cd /app && npm install --loglevel http --registry $NPM_REGISTRY"
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ services:
image: hyperledger/cello-baseimage
container_name: watch-mode
volumes: # This should be removed in product env
- ./src/themes/react/static:/app
- $ROOT_PATH/src/themes/react/static:/app
command: bash -c "cd /app && npm run watch-mode"
14 changes: 3 additions & 11 deletions docker-compose.yml → docker-compose-files/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ services:
# - PASSWORD=pass
rabbitmq:
image: rabbitmq
restart: unless-stopped
container_name: cello-dashboard_rabbitmq
environment:
- RABBITMQ_DEFAULT_USER=$RABBITMQ_DEFAULT_USER
- RABBITMQ_DEFAULT_PASS=$RABBITMQ_DEFAULT_PASS
Expand All @@ -64,7 +66,7 @@ services:
ports:
- "8080:8080"
volumes:
- ./src/agent/docker/_compose_files:/cello
- $ROOT_PATH/src/agent/docker/_compose_files:/cello

#TODO: need to follow other images to put at dockerhub
user-dashboard:
Expand Down Expand Up @@ -159,13 +161,3 @@ services:
- NO_USED=0
volumes:
- /opt/cello/dashboard_mongo:/data/db

nfs:
image: itsthenetwork/nfs-server-alpine:9
restart: unless-stopped
environment:
- SHARED_DIRECTORY=/cello
volumes:
- ./src/agent/docker/_compose_files:/cello
privileged: true
network_mode: host
10 changes: 8 additions & 2 deletions docs/make_support.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ $ cd scripts/worker_node && bash setup.sh
Redeploys specified service(s). To redeploy `Dashboard` service, use: `make redeploy service=dashboard`.

### start
Starts all services. Runs following command for you.
Starts all services, include nfs server. Runs following command for you.

```bash
$ docker-compose up -d --no-recreate
Expand All @@ -88,4 +88,10 @@ Runs the following commands for you.
Runs watch mode with js files for react.

### npm-install
Installs modules with npm package management.
Installs modules with npm package management.

### start-nfs
Start NFS server manually.

### stop-nfs
Stop NFS Server manually.
3 changes: 3 additions & 0 deletions env.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ SMTP_AUTH_PASSWORD=$SMTP_AUTH_PASSWORD
FROM_EMAIL=$FROM_EMAIL
USER_DASHBOARD_WEBROOT=$USER_DASHBOARD_WEBROOT
THEME=$THEME
RABBITMQ_DEFAULT_USER=$RABBITMQ_DEFAULT_USER
RABBITMQ_DEFAULT_PASS=$RABBITMQ_DEFAULT_PASS
RABBITMQ_DEFAULT_VHOST=$RABBITMQ_DEFAULT_VHOST
1 change: 0 additions & 1 deletion logo-new.svg

This file was deleted.

Loading

0 comments on commit 182ee45

Please sign in to comment.