Micro Service Scaffold Generator and Toolkit
Project description
Youtiao is a project for Micro-Service scaffold generation and provides a set of related tools.
Prerequisites
Youtiao requires python version >= 3.6.0. If you don’t have appropriate python version installed on your computer, we recommand use pyenv to prepare one.
Installation
From pypi:
pip install -U Youtiao
From source code:
git clone git@github.com:Hujun/youtiao.git && cd Youtiao && python setup.py install
Usage
When you successfully installed youtiao in your python environment, type youtiao or youtiao —help in your console, you will see following outputs:
Usage: youtiao [OPTIONS] COMMAND [ARGS]... Micro Service Toolkit Options: --help Show this message and exit. Commands: build_image Build docker image init Generate Python service boilerplate protoc Shortcut of grpc_tools.protoc to compile... rancher_deploy Deploy using rancher (v1.6) API (v2.0 beta)
You can get detailed guide for each command if you type:
youtiao [command] --help
Project init
Create a new project by command:
youtiao init --language=python [directory]
A dialog will be launched for service name and service mode confirmation. If everything goes well, a project skeleton will be generated. The command will not generate any file under given directory path if the process is abort or any exception is raised.
Now available language and service templates:
Programming Language |
Servcie Template |
---|---|
Python |
HTTP |
Python |
gRPC |
Docker image build
Usage: youtiao build_image [OPTIONS] Build docker image Options: --project-name TEXT project name [required] --commit-ref-name TEXT name of git branch or tag [required] --commit-sha TEXT git commit hash [required] --workdir DIRECTORY [required] --registry-url TEXT Docker registry URL --help Show this message and exit.
This command is just a wrapper of docker engine HTTP API using official docker python package. You can use it in some CI/CD scenarios when docker native shell commands are not available.
gRPC protobuf file compile
Usage: youtiao protoc [OPTIONS] Shortcut of grpc_tools.protoc to compile .proto file. Options: --proto-path PATH path of protobuf file [required] --out DIRECTORY output files location --help Show this message and exit.
Wrapper of grpcio tool.
Rancher deployment (CI/CD)
Usage: youtiao rancher_deploy [OPTIONS] Deploy using rancher (v1.6) API (v2.0 beta) Options: --rancher-url TEXT rancher server API endpoint URL [required] --rancher-key TEXT rancher account or environment API access key [required] --rancher-secret TEXT rancher account or environment API secret corresponding to the access key [required] --rancher-env TEXT used to specify environemnt if account key is provided --stack TEXT stack name defined in rancher [required] --service TEXT service name defined in rancher [required] --batch-size INTEGER number of containers to upgrade at once --batch-interval INTEGER interval (in second) between upgrade batches --sidekicks / --no-sidekicks upgrade sidekicks services at the same time --start-before-stopping / --no-start-before-stopping start new containers before stopping the old ones --help Show this message and exit.
You can have more details about Rancher CI/CD in your blog.
About “Youtiao”
“Youtiao” is a long golden-brown deepfried strip of dough eaten in China and (by a variety of other names) in other East and Southeast Asian cuisines. Conventionally, youtiao are lightly salted and made so they can be born lengthwise in two. Youtiao are normally eaten at breakfast as an accompaniment for rice congee, soy milk or regular milk blended with suger.
Support the project
Donate ETH if you find the project is helpful:
0x7744F44ecB64ce24b09e1F924DD48a4Ada32A835
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for Youtiao-0.0.2.macosx-10.12-x86_64.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e78bd3ae629d21e620d64fabe9198832743dd955c80981a2a830d728fe81d06 |
|
MD5 | 364f374ede6600dbd762c18cccdca9af |
|
BLAKE2b-256 | 6a019e906d5e8e06dae82e6e523e45400943c94acfe1282d157ff076b682ec07 |
Hashes for Youtiao-0.0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 814a08ce9a3b80d104c9720f2e836e14e65b729ba5ccffb2652699809889facc |
|
MD5 | 88acc20e820b2912c04bff739e46e66e |
|
BLAKE2b-256 | 37ec038a39b96f6f7f5a173967136a0a7a515ff109770c3cebf7cfd771ae9137 |