Skip to main content

Vines Python 训练项目 SDK (供内部使用)

Project description

Vines Python 训练项目 SDK (供内部使用)

这个项目希望解决的问题,将开发一个新的训练项目中的很多重复性工作进行统一封装:

  1. 每次开一个新训练项目都需要起 HTTP Server
  2. 里面有可能会用到很多通用能力,比如上传、下载文件、以及一些基础方法等,这些都应该封装好。
  3. 错误日志推送逻辑
  4. 运行时日志逻辑
  5. api 入参、出参统一格式封装
  6. 统一的日志格式、日志收集

安装

pip install vines-worker-sdk

使用示例

作为 conductor 客户端

详情见 exampels/example_conductor.py 文件中的内容。

使用 flask http server

lib.server 引入 create_server 方法,初始化 flask app,参数:

  • sentry_dsn: sentry dsn, 如果配置,会自动收集异常推送到 sentry
  • log_redis_queue_url: 如果配置,在调用 request.logger 方法的时候,会自动推送到消息队列,从而给前端展示。

打印日志的方法:直接使用 request.logger 实例的方法。

详情见 exampels/example_server.py 文件中的内容。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vines_worker_sdk-0.0.21.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

vines_worker_sdk-0.0.21-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file vines_worker_sdk-0.0.21.tar.gz.

File metadata

  • Download URL: vines_worker_sdk-0.0.21.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for vines_worker_sdk-0.0.21.tar.gz
Algorithm Hash digest
SHA256 72e8a36592827c5b3c56828a9f7b3bbbf671b2f423a602069c89cd9283b251ed
MD5 fbb86d32c9a88e99e5ddeaac5c85232e
BLAKE2b-256 1de02e33b3b1767e25930cd6f8ce1d08d1fffb1af0d03865f8509fff9e6d679e

See more details on using hashes here.

File details

Details for the file vines_worker_sdk-0.0.21-py3-none-any.whl.

File metadata

File hashes

Hashes for vines_worker_sdk-0.0.21-py3-none-any.whl
Algorithm Hash digest
SHA256 83b27e0726808295ae7b6f548cfa6d20c7a4509c415d6fd1d8f259b32a01c966
MD5 a95e9322886d515b581980d2f88567c5
BLAKE2b-256 5c98556f0542d157ac9633f5ab5f8e8c588297816259b0e0580c321b6e2bb279

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page