GlideKV with TensorFlow custom operations
Project description
GlideKV with TensorFlow Custom Operations
A high-performance GlideKV library featuring custom TensorFlow operations, written in C++ and Python, and seamlessly integrated with Bazel for reproducible builds.
Features
- 🚀 Custom TensorFlow Ops: High-performance C++ ops for advanced GlideKV tasks
- 🛠️ Bazel Build: Reproducible, robust, and scalable build system
- 🔄 Automatic Environment Detection: Automatically finds and links your TensorFlow installation
- 📦 Wheel Packaging: Easily build and distribute as a Python wheel
- 🔧 TensorFlow Serving: Production-ready model serving capabilities
TensorFlow Serving Deployment
Docker Deployment
GlideKV supports deployment via TensorFlow Serving with Docker. The following command starts a TensorFlow Serving container with GlideKV custom operations:
docker run -itd \
-p 8080:8080 \ # Prometheus metrics port
-p 8500:8500 \ # gRPC API port
-p 8501:8501 \ # REST API port
-e GLIDEKV_METRICS_ENABLED=1 \
-v /data:/data \
--privileged=true \
--network=host \
registry.cn-beijing.aliyuncs.com/bidops/bidops:GlideKV-v1 \
--file_system_poll_wait_seconds=10 \
--model_base_path=/data/model/dnn_winr_v1/export_dir/dense_model/
Configuration Parameters
| Parameter | Description | Default |
|---|---|---|
-p 8080:8080 |
Prometheus metrics port | 8080 |
-p 8500:8500 |
gRPC API port | 8500 |
-p 8501:8501 |
REST API port | 8501 |
-e GLIDEKV_METRICS_ENABLED=1 |
Enable GlideKV metrics collection | 0 |
-v /data:/data |
Mount local data directory | - |
--privileged=true |
Enable privileged mode | false |
--network=host |
Use host network mode | bridge |
--file_system_poll_wait_seconds=10 |
Model polling interval | 10 |
--model_base_path |
Path to the TensorFlow model | - |
Environment Variables
GLIDEKV_METRICS_ENABLED=1: Enables Prometheus metrics collection for monitoring
Model Requirements
The TensorFlow model must include GlideKV custom operations:
HashTableOfTensors: For vector lookup operationsLookupFind: For key-value retrieval
Health Check
After deployment, you can check the service status:
# Check HTTP REST API
curl http://localhost:8501/v1/models
# Check gRPC API (requires grpcurl installation)
grpcurl -plaintext localhost:8500 list
# Check Prometheus metrics
curl http://localhost:8080/metrics
Install grpcurl (Optional)
If you need to test gRPC API, install grpcurl:
# Ubuntu/Debian
sudo apt-get update && sudo apt-get install -y grpcurl
# CentOS/RHEL
sudo yum install -y grpcurl
# Or download from GitHub releases
wget https://github.com/fullstorydev/grpcurl/releases/download/v1.8.7/grpcurl_1.8.7_linux_x86_64.tar.gz
tar -xzf grpcurl_1.8.7_linux_x86_64.tar.gz
sudo mv grpcurl /usr/local/bin/
rm grpcurl_1.8.7_linux_x86_64.tar.gz
开发与构建说明
- Bazel 构建:所有 C++/TF 自定义算子通过 Bazel 构建,确保与 Python 环境 TensorFlow 版本一致。
- 环境变量:需设置
TF_SO_PATH指向当前 Python 环境下的 TensorFlow 路径(python configure.py可自动完成)。 - .gitignore 已优化,避免无关文件入库。
贡献指南
欢迎提交 Issue 和 PR!请确保:
- 遵循 PEP8 代码风格
- 新增功能需附带测试
- 详细描述你的更改
License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file glidekv-4.6.9.3-py3-none-any.whl.
File metadata
- Download URL: glidekv-4.6.9.3-py3-none-any.whl
- Upload date:
- Size: 453.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
802fbbef51cd562826f936249e02234671356f28aa046b0944c313b5da3b2151
|
|
| MD5 |
a75a446c92765deb950d875ba1662caa
|
|
| BLAKE2b-256 |
4c6f12f48c9d206e7b9dfeadd604fc040f9b9545b7cc5390ac2376ce9adcbcf6
|