Skip to content

Commit

Permalink
[CE-258] Fix service names
Browse files Browse the repository at this point in the history
Fix following service names, to make it easier to understand:
* dashboard --> operator-dashboard
* restserver --> engine

Change-Id: I6a563bc89cfe6e2c89d1d12cd0c3fd218361589b
Signed-off-by: Baohua Yang <yangbaohua@gmail.com>
  • Loading branch information
yeasy committed Feb 4, 2018
1 parent f79f349 commit e5880a7
Show file tree
Hide file tree
Showing 16 changed files with 123 additions and 162 deletions.
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# - clean: Cleans the build area
# - doc: Start a local web service to explore the documentation
# - docker[-clean]: Build/clean docker images locally
# - license: checks sourrce files for Apache license header
# - license: checks sourrce files for Apache license header
# - help: Output the help instructions for each command
# - log: Check the recent log output of all services
# - restart: Stop the cello service and then start
Expand Down Expand Up @@ -94,7 +94,6 @@ else
START_OPTIONS = initial-env $(BUILD_JS)
endif


all: check

build/docker/baseimage/$(DUMMY): build/docker/baseimage/$(DUMMY)
Expand Down
166 changes: 85 additions & 81 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,52 @@
# SPDX-License-Identifier: Apache-2.0
#
# Local `/opt/cello/mongo` will be used for the db storage.
# dashboard: dashboard service of cello, listen on 8080
# app: app service of cello, listen on 80
# nginx: front end
# mongo: mongo db

# cello-nginx: proxy to access operator dashboard service, listen on 8080
# cello-operator-dashboard: dashboard service for operators
# cello-user-dashboard: user service of cello, listen on 8081
# engine: engine service of cello to provide RESTful APIs, listen on 80
# cello-mongo: mongo db

version: '3.2'
services:
# cello dashboard service
dashboard:
build:
# nginx as front end for the operator dashboard
nginx:
image: hyperledger/cello-nginx
hostname: cello-nginx
container_name: cello-nginx
restart: always
deploy:
resources:
limits:
cpus: '0.50'
memory: 2048M
reservations:
cpus: '0.10'
memory: 256M
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.default.conf
#- /opt/cello/nginx/log/:/var/log/nginx/
ports:
- "80:80"
- "8080:8080"
environment:
- BACKEND=cello-operator-dashboard
- PORT=8080
- USERNAME=admin
- PASSWORD=pass

# cello dashboard service for network operator
operator-dashboard:
build: # Remove soon
context: src
dockerfile: Dockerfile-dashboard
image: hyperledger/cello-dashboard
container_name: dashboard
hostname: cello-dashboard
image: hyperledger/cello-operator-dashboard
container_name: cello-operator-dashboard
hostname: cello-operator-dashboard
restart: unless-stopped
environment:
- MONGO_URL=mongodb://mongo:27017
- MONGO_URL=mongodb://cello-mongo:27017
- MONGO_DB=dev
- DEBUG=True # in debug mode, service will auto-restart
- LOG_LEVEL=DEBUG # what level log will be output
Expand All @@ -34,17 +62,49 @@ services:
volumes: # This should be removed in product env
- ./src:/app

# cello restserver service
restserver:
#TODO: need to follow other images to put at dockerhub
user-dashboard:
build: # Remove soon
context: user-dashboard
image: hyperledger/cello-user-dashboard
container_name: cello-user-dashboard
hostname: cello-user-dashboard
links:
- mongo:dashboard_mongo
- dashboard_mongo
- operator-dashboard
ports:
- "8081:8080"
environment:
- SV_BaseURL=http://operator-dashboard:8080/api/
- RESTful_Server=operator-dashboard:8080
- RESTful_BaseURL=/api/
- DEBUG=node:*
- DEV=$DEV
- ENABLE_EMAIL_ACTIVE=$ENABLE_EMAIL_ACTIVE
- SMTP_SERVER=$SMTP_SERVER
- SMTP_PORT=$SMTP_PORT
- SMTP_AUTH_USERNAME=$SMTP_AUTH_USERNAME
- SMTP_AUTH_PASSWORD=$SMTP_AUTH_PASSWORD
- FROM_EMAIL=$FROM_EMAIL
- WEBROOT=$WEBROOT
- FABRIC_CFG_PATH=/etc/hyperledger/fabric
volumes:
- ./user-dashboard:/usr/app/src
- /opt/cello/baas:/opt/data
command: bash -c "cd /usr/app/src && [ "$DEV" = True ] && npm run dev || npm start"

# cello engine service
engine:
build:
context: src
dockerfile: Dockerfile-restserver
image: hyperledger/cello-restserver
container_name: restserver
hostname: cello-restserver
dockerfile: Dockerfile-restserver # Remove soon
image: hyperledger/cello-engine
container_name: cello-engine
hostname: cello-engine
restart: unless-stopped
environment:
- MONGO_URL=mongodb://mongo:27017
- MONGO_URL=mongodb://cello-mongo:27017
- MONGO_DB=dev
- DEBUG=True # in debug mode, service will auto-restart
- LOG_LEVEL=DEBUG # what level log will be output
Expand All @@ -55,15 +115,15 @@ services:

# cello watchdog service
watchdog:
build:
build: # Remove soon
context: src
dockerfile: Dockerfile-watchdog
image: hyperledger/cello-watchdog
container_name: watchdog
container_name: cello-watchdog
hostname: cello-watchdog
restart: unless-stopped
environment:
- MONGO_URL=mongodb://mongo:27017
- MONGO_URL=mongodb://cello-mongo:27017
- MONGO_DB=dev
- DEBUG=True # in debug mode, service will auto-restart
- LOG_LEVEL=DEBUG # what level log will be output
Expand All @@ -73,8 +133,8 @@ services:
# mongo database, may use others in future
mongo:
image: hyperledger/cello-mongo
hostname: mongo
container_name: mongo
hostname: cello-mongo
container_name: cello-mongo
restart: unless-stopped
deploy:
resources:
Expand All @@ -93,67 +153,11 @@ services:
volumes:
- /opt/cello/mongo:/data/db

# nginx to forward front request, may split it out in future
nginx:
image: hyperledger/cello-nginx
hostname: nginx
container_name: nginx
restart: always
deploy:
resources:
limits:
cpus: '0.50'
memory: 2048M
reservations:
cpus: '0.10'
memory: 256M
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.default.conf
#- /opt/cello/nginx/log/:/var/log/nginx/
ports:
- "80:80"
- "8080:8080"
environment:
- BACKEND=dashboard
- PORT=8080
- USERNAME=admin
- PASSWORD=pass

# TODO: we may keep only one mongo instance, that should be enough
dashboard_mongo:
image: hyperledger/cello-mongo
restart: unless-stopped
environment:
- NO_USED=0
volumes:
- /opt/cello/dashboard_mongo:/data/db

#TODO: need to follow other images to put at dockerhub
user-dashboard:
build:
context: user-dashboard
image: hyperledger/cello-user-dashboard
container_name: user-dashboard
links:
- mongo:dashboard_mongo
- dashboard_mongo
- dashboard
ports:
- "8081:8080"
environment:
- SV_BaseURL=http://dashboard:8080/api/
- RESTful_Server=dashboard:8080
- RESTful_BaseURL=/api/
- DEBUG=node:*
- DEV=$DEV
- ENABLE_EMAIL_ACTIVE=$ENABLE_EMAIL_ACTIVE
- SMTP_SERVER=$SMTP_SERVER
- SMTP_PORT=$SMTP_PORT
- SMTP_AUTH_USERNAME=$SMTP_AUTH_USERNAME
- SMTP_AUTH_PASSWORD=$SMTP_AUTH_PASSWORD
- FROM_EMAIL=$FROM_EMAIL
- WEBROOT=$WEBROOT
- FABRIC_CFG_PATH=/etc/hyperledger/fabric
volumes:
- ./user-dashboard:/usr/app/src
- /opt/cello/baas:/opt/data
command: bash -c "cd /usr/app/src && [ "$DEV" = True ] && npm run dev || npm start"
- /opt/cello/dashboard_mongo:/data/db
18 changes: 9 additions & 9 deletions dockerhub/nginx/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ http {
server BACKEND:PORT;
}

upstream restserver {
server restserver:80;
upstream cello-engine {
server cello-engine:80;
}

server {
Expand Down Expand Up @@ -98,13 +98,13 @@ http {
listen 80;

location / {
if ($request_method !~ ^(GET|DELETE|POST|PUT)$ ) {
return 444;
}
proxy_pass http://restserver;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
if ($request_method !~ ^(GET|DELETE|POST|PUT)$ ) {
return 444;
}
proxy_pass http://cello-engine;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
}

error_page 500 502 503 504 /50x.html;
Expand Down
18 changes: 9 additions & 9 deletions dockerhub/v0.8.0-alpha/nginx/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ http {
server BACKEND:PORT;
}

upstream restserver {
server restserver:80;
upstream cello-engine {
server cello-engine:80;
}

server {
Expand Down Expand Up @@ -98,13 +98,13 @@ http {
listen 80;

location / {
if ($request_method !~ ^(GET|DELETE|POST|PUT)$ ) {
return 444;
}
proxy_pass http://restserver;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
if ($request_method !~ ^(GET|DELETE|POST|PUT)$ ) {
return 444;
}
proxy_pass http://cello-engine;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
}

error_page 500 502 503 504 /50x.html;
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/api/restserver_v2.md → docs/api/rest_api_v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Each url should have the `/v2` prefix, e.g., `/cluster_op` should be `/v2/cluste
## Rest Server
These APIs will be called by front web services.

Latest version please see [restserver.yaml](restserver.yaml).
Latest version please see [rest_api_v2.yaml](rest_api_v2.yaml).

### Cluster

Expand Down
43 changes: 0 additions & 43 deletions docs/api/restserver_v1.md

This file was deleted.

4 changes: 2 additions & 2 deletions docs/arch.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ Each layer should maintain stable APIs for upper layers, to achieve pluggability

![Architecture Overview](imgs/architecture.png)

* `dashboard`: Provide the dashboard for the pool administrator, also the core engine to automatically maintain everything.
* `restserver`: Provide the restful api for other system to apply/release/list chains.
* `operator dashboard`: Provide the dashboard for the pool administrator, also the core engine to automatically maintain everything.
* `engine`: Provide the restful api for other system to apply/release/list chains.
* `watchdog`: Timely checking system status, keep everything healthy and clean.

## Implementation
Expand Down
4 changes: 2 additions & 2 deletions docs/dashboard.md → docs/dashboard_operator.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dashboard
# Dashboard for Operator

By default, the dashboard will listen on port `8080` at the Master Node, and operators can login in with default `admin:pass` credential.
By default, the operator dashboard will listen on port `8080` at the Master Node, and operators can login in with default `admin:pass` credential.

The left panel gives quick link to various functions, including `overview`, `system status`, `Hosts`, `Active Clusters`, `Inused Clusters`, `Release History` and `About`.

Expand Down
2 changes: 1 addition & 1 deletion docs/user_dashboard.md → docs/dashboard_user.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# User Dashboard
# Dashboard for User

By default, the user dashboard will listen on port `8081` at the Master Node, and operators can login in with default `admin:pass` credential.

Expand Down
Loading

0 comments on commit e5880a7

Please sign in to comment.