Code Monkey home page Code Monkey logo

servicecomb-company-workshop's Introduction

ServiceComb Demo - Company Build StatusCoverage Status

Purpose

In order for users to better understand how to develop microservices using ServiceComb, an easy to understand demo is provided.

Architecture of Company

  • Manager (API gateway)
  • Doorman (authentication service)
  • Worker (computing service)
  • Beekeeper (computing service)
  • Bulletin board (service registry)
  • Project archive (request cache)
  • Human resource (service governance)

Please read the blog post on the detailed explanation of this project.

Prerequisites

You will need:

  1. Oracle JDK 1.8+
  2. Maven 3.x
  3. Docker
  4. Docker compose(optional)
  5. Docker machine(optional)
  6. curl
  7. MySQL

Run Services

A docker-compose.yaml file is provided to start all services and their dependencies as docker containers.

  1. Build all service images using command mvn package -Pdocker
  2. Run all service images using command docker-compose up

If you are using Docker Toolbox, please add an extra profile -Pdocker-machine.

mvn package -Pdocker -Pdocker-machine

Run Integration Tests

mvn verify -Pdocker -Pdocker-machine

Verify services

You can verify the services using curl by the following steps:

  1. Retrieve manager's ip address
  • If you use docker compose:
    export HOST="127.0.0.1:8083"
  • If you use docker machine(supposed your docker machine name is default):
    export HOST=$(docker-machine ip default):8083
  1. Log in and retrieve token from Authorization section
    curl -v -H "Content-Type: application/x-www-form-urlencoded" -d "username=jordan&password=password" -XPOST "http://$HOST/doorman/rest/login"
    Then you can copy the token from the Authorization section and use it to replace the Authorization header in the following requests.
  2. Get the sixth fibonacci number from the worker service
    curl -H "Authorization: replace_with_the_authorization_token" -XGET "http://$HOST/worker/fibonacci/term?n=6"
  3. Get the number of drone's ancestors at the 30th generation from the beekeeper service
    curl -H "Authorization: replace_with_the_authorization_token" -XGET "http://$HOST/beekeeper/rest/drone/ancestors/30"
  4. Get the number of queen's ancestors at the 30th generation from the beekeeper service
    curl -H "Authorization: replace_with_the_authorization_token" -XGET "http://$HOST/beekeeper/rest/queen/ancestors/30"

Auto deploy on Huawei Cloud

To auto compile, build, deploy and run this workshop demo on Huawei Cloud's Service Stage Platform, you need the following steps:

  1. A registered Service Stage account.
  2. Auto build and publish your docker image to Huawei's Image Warehouse, details can refer to auto publish guide.
  3. Auto deploy using Huawei Cloud's orchestration feature, details can refer to orchestration guide.

Auto deploy on kubernetes cluster

To auto pull images from servicecomb in docker hub, run on kubernetes cluster whether on gce or bare-metal.
Reference to Run Company on Kubernetes Cluster

在华为云上自动部署

本章节介绍基于华为微服务云应用平台Service Stage ,实现自动编译、构建、部署和运行的步骤。

  1. 一个已注册的Service Stage帐号。
  2. 自动编译、构建和发布Docker镜像到华为的镜像仓库,详情可见自动发布指南
  3. 使用华为云的编排功能自动部署微服务,详情可见自动部署指南

servicecomb-company-workshop's People

Contributors

seanyinx avatar eric-lee-ltk avatar willemjiang avatar zenlint avatar mabingo avatar tmtank avatar sunming0213 avatar whang94 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.