Skip to main content

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 文件中的内容。

Release files for vines-worker-sdk 0.0.21

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vines-worker-sdk 0.0.21
File Size Uploaded
vines_worker_sdk-0.0.21.tar.gz 13.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for vines-worker-sdk 0.0.21
File Interpreter ABI Platform
vines_worker_sdk-0.0.21-py3-none-any.whl Python 3 none any Details

Total release size: 29.0 kB

Release files / vines_worker_sdk-0.0.21.tar.gz

Download URL vines_worker_sdk-0.0.21.tar.gz
Size 13.2 kB
Tags Source
SHA-256 checksum
How to use checksums
72e8a36592827c5b3c56828a9f7b3bbbf671b2f423a602069c89cd9283b251ed
BLAKE2b-256 checksum
How to use checksums
1de02e33b3b1767e25930cd6f8ce1d08d1fffb1af0d03865f8509fff9e6d679e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.2

Release files / vines_worker_sdk-0.0.21-py3-none-any.whl

Download URL vines_worker_sdk-0.0.21-py3-none-any.whl
Size 15.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
83b27e0726808295ae7b6f548cfa6d20c7a4509c415d6fd1d8f259b32a01c966
BLAKE2b-256 checksum
How to use checksums
5c98556f0542d157ac9633f5ab5f8e8c588297816259b0e0580c321b6e2bb279
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.2

Release history Release notifications | RSS feed

This release

0.0.21 This release

2 release files

0.0.20

2 release files

0.0.15

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page