微服务脚手架生成器和工具包

Youtiao的Python项目详细描述


Youtiao是一个微服务脚手架生成项目,提供 一套相关的工具。


先决条件

youtiao要求python版本>;=3.6.0。如果你没有合适的 python版本安装在您的计算机上,我们建议您使用 pyenv准备一个。

安装

来自PYPI:

pip install -U Youtiao

源代码:

git clone git@github.com:Hujun/youtiao.git && cd Youtiao && python setup.py install

用法

在python环境中成功安装youtiao后,键入 youtiaoyoutiao —help在控制台中,您将看到以下内容 输出:

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)

如果键入:

youtiao [command] --help

项目初始化

通过命令创建新项目:

youtiao init --language=python [directory]

将启动服务名称和服务模式对话框 确认。如果一切顺利,项目框架将 生成。该命令不会在给定目录下生成任何文件 路径(如果进程中止或引发任何异常)。

现在提供的语言和服务模板:

Programming LanguageServcie Template
PythonHTTP
PythongRPC

Docker映像构建

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.

这个命令只是docker引擎http api的一个包装 docker python包。在某些CI/CD场景中,当 Docker本机shell命令不可用。

GRPC protobuf文件编译

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.

GRPCIO工具的包装。

牧场主部署(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.

您可以在您的 blog

关于“youtiao”

“Youtiao”是一个长 金棕色油炸面团条,在中国食用(由多种 在其他东亚和东南亚菜系中。 按惯例,鱼苗是用盐腌制的,这样它们就可以出生了。 纵向一分为二。油条通常在早餐时作为 搭配米粥、豆浆或普通牛奶 苏格。

youtiao

youtiao

支持项目

如果您发现项目有帮助,请捐赠eth:

0x7744F44ecB64ce24b09e1F924DD48a4Ada32A835

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java接口中的每个方法都是抽象的,但在抽象类中,我们也只能使用抽象方法   初始化Java中声明的、未初始化的变量会发生什么情况?   java BouncyCastle openPGP将字节[]数组加密为csv文件   在Java中将类A(和所有子类)映射到类B的实例的字典   RSA公钥编码,在Java和Android中,代码相同,结果不同   java在安卓中实现数字检测语音识别   java取消选择复选框   java如何在其他配置中重用Maven配置XML片段   java有没有一种有效的方法来检查HashMap是否包含映射到相同值的键?   spring处理程序调度失败;嵌套的例外是java。lang.NoClassDefFoundError:org/apache/http/client/HttpClient   带有ehcache的java多层缓存   java如何访问chromium(或任何其他浏览器)cookie   java通过将两个集合与spring data mongodb data中的条件合并来获取计数   安卓中R.java的语法错误