Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
107 lines (73 sloc) 2.14 KB

Oriole-Service

【Chinese readme】

【English readme】

【Code】

The Zen of oriole: speed defines the winner.

Prerequisites

  1. Install following packages
  • python >= 3.6
  • mongodb
  • mysql
  • rabbitmq
  • redis
  1. Install oriole-service
  pip install oriole-service

Add services.cfg

services.cfg

AMQP_URI:      ${RABBIT:pyamqp://test:test@127.0.0.1}                    
database:      ${MYSQL:mysql://test:test@127.0.0.1/test?charset=utf8}
test_database: ${TEST_MYSQL:mysql://test:test@127.0.0.1/test?charset=utf8}
datasets:      ${REDIS:redis://127.0.0.1/0}

Add orm

dao/__init__.py

from oriole_service.db import *

class Eric(Base):
    __tablename__ = 'eric_table'
    uid = Column(types.Integer(), primary_key=True, autoincrement=True)
    param = Column(types.Unicode(255), unique=None, default='')

Add services/log.py

services/log.py

from oriole_service.app import *

class LogService(App):
    name = service_name(__file__)
    ver = "1.0.0"

    @rpc
    def add(self, params={"param": "eric"}):
        self.log.debug("# %s(%s)" % ("add", params))
        return self._o(params)

Run log service

  o r log

Run console

  o s

Halt log service

  o h log

Create documents.

  o d

Check online services

 You can run o s to do the same thing.

Create docker image.

Don't use it if you don't know docker at all before.

Create log_service image.

  o b log

OK, now you can deploy it into kubernetes.