# 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:
```bash
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 operations
- `LookupFind`: For key-value retrieval
### Health Check
After deployment, you can check the service status:
```bash
# 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:
```bash
# 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](https://www.python.org/dev/peps/pep-0008/) 代码风格
- 新增功能需附带测试
- 详细描述你的更改
## License
[MIT](LICENSE)
Raw data
{
"_id": null,
"home_page": "https://github.com/lixiang-repo/GlideKV",
"name": "GlideKV",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "lixiang <183570397@qq.com>",
"keywords": "tensorflow, GlideKV, custom operations, machine learning",
"author": "lixiang",
"author_email": "lixiang <183570397@qq.com>",
"download_url": null,
"platform": null,
"description": "# GlideKV with TensorFlow Custom Operations\n\nA high-performance GlideKV library featuring custom TensorFlow operations, written in C++ and Python, and seamlessly integrated with Bazel for reproducible builds.\n\n## Features\n- \ud83d\ude80 **Custom TensorFlow Ops**: High-performance C++ ops for advanced GlideKV tasks\n- \ud83d\udee0\ufe0f **Bazel Build**: Reproducible, robust, and scalable build system\n- \ud83d\udd04 **Automatic Environment Detection**: Automatically finds and links your TensorFlow installation\n- \ud83d\udce6 **Wheel Packaging**: Easily build and distribute as a Python wheel\n- \ud83d\udd27 **TensorFlow Serving**: Production-ready model serving capabilities\n\n## TensorFlow Serving Deployment\n\n### Docker Deployment\n\nGlideKV supports deployment via TensorFlow Serving with Docker. The following command starts a TensorFlow Serving container with GlideKV custom operations:\n\n```bash\ndocker run -itd \\\n -p 8080:8080 \\ # Prometheus metrics port\n -p 8500:8500 \\ # gRPC API port\n -p 8501:8501 \\ # REST API port\n -e GLIDEKV_METRICS_ENABLED=1 \\\n -v /data:/data \\\n --privileged=true \\\n --network=host \\\n registry.cn-beijing.aliyuncs.com/bidops/bidops:GlideKV-v1 \\\n --file_system_poll_wait_seconds=10 \\\n --model_base_path=/data/model/dnn_winr_v1/export_dir/dense_model/\n```\n\n### Configuration Parameters\n\n| Parameter | Description | Default |\n|-----------|-------------|---------|\n| `-p 8080:8080` | Prometheus metrics port | 8080 |\n| `-p 8500:8500` | gRPC API port | 8500 |\n| `-p 8501:8501` | REST API port | 8501 |\n| `-e GLIDEKV_METRICS_ENABLED=1` | Enable GlideKV metrics collection | 0 |\n| `-v /data:/data` | Mount local data directory | - |\n| `--privileged=true` | Enable privileged mode | false |\n| `--network=host` | Use host network mode | bridge |\n| `--file_system_poll_wait_seconds=10` | Model polling interval | 10 |\n| `--model_base_path` | Path to the TensorFlow model | - |\n\n### Environment Variables\n\n- `GLIDEKV_METRICS_ENABLED=1`: Enables Prometheus metrics collection for monitoring\n\n### Model Requirements\n\nThe TensorFlow model must include GlideKV custom operations:\n- `HashTableOfTensors`: For vector lookup operations\n- `LookupFind`: For key-value retrieval\n\n### Health Check\n\nAfter deployment, you can check the service status:\n\n```bash\n# Check HTTP REST API\ncurl http://localhost:8501/v1/models\n\n# Check gRPC API (requires grpcurl installation)\ngrpcurl -plaintext localhost:8500 list\n\n# Check Prometheus metrics\ncurl http://localhost:8080/metrics\n```\n\n### Install grpcurl (Optional)\n\nIf you need to test gRPC API, install grpcurl:\n\n```bash\n# Ubuntu/Debian\nsudo apt-get update && sudo apt-get install -y grpcurl\n\n# CentOS/RHEL\nsudo yum install -y grpcurl\n\n# Or download from GitHub releases\nwget https://github.com/fullstorydev/grpcurl/releases/download/v1.8.7/grpcurl_1.8.7_linux_x86_64.tar.gz\ntar -xzf grpcurl_1.8.7_linux_x86_64.tar.gz\nsudo mv grpcurl /usr/local/bin/\nrm grpcurl_1.8.7_linux_x86_64.tar.gz\n```\n\n## \u5f00\u53d1\u4e0e\u6784\u5efa\u8bf4\u660e\n- **Bazel \u6784\u5efa**\uff1a\u6240\u6709 C++/TF \u81ea\u5b9a\u4e49\u7b97\u5b50\u901a\u8fc7 Bazel \u6784\u5efa\uff0c\u786e\u4fdd\u4e0e Python \u73af\u5883 TensorFlow \u7248\u672c\u4e00\u81f4\u3002\n- **\u73af\u5883\u53d8\u91cf**\uff1a\u9700\u8bbe\u7f6e `TF_SO_PATH` \u6307\u5411\u5f53\u524d Python \u73af\u5883\u4e0b\u7684 TensorFlow \u8def\u5f84\uff08`python configure.py` \u53ef\u81ea\u52a8\u5b8c\u6210\uff09\u3002\n- **.gitignore** \u5df2\u4f18\u5316\uff0c\u907f\u514d\u65e0\u5173\u6587\u4ef6\u5165\u5e93\u3002\n\n## \u8d21\u732e\u6307\u5357\n\u6b22\u8fce\u63d0\u4ea4 Issue \u548c PR\uff01\u8bf7\u786e\u4fdd\uff1a\n- \u9075\u5faa [PEP8](https://www.python.org/dev/peps/pep-0008/) \u4ee3\u7801\u98ce\u683c\n- \u65b0\u589e\u529f\u80fd\u9700\u9644\u5e26\u6d4b\u8bd5\n- \u8be6\u7ec6\u63cf\u8ff0\u4f60\u7684\u66f4\u6539\n\n## License\n\n[MIT](LICENSE)\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "GlideKV with TensorFlow custom operations",
"version": "4.6.4",
"project_urls": {
"Homepage": "https://github.com/lixiang-repo/GlideKV"
},
"split_keywords": [
"tensorflow",
" glidekv",
" custom operations",
" machine learning"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "b0dec9b6ec1ef6dd69bdb26eec1df5cfabfe8b99946d598461106a731b7e0ceb",
"md5": "3e518e0916462ba83a8d9b93165373f1",
"sha256": "22d0c9d3e79870770825c253c087ed4583d78f2164f6fe7cba1b65eb15721f6d"
},
"downloads": -1,
"filename": "glidekv-4.6.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3e518e0916462ba83a8d9b93165373f1",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 473681,
"upload_time": "2025-07-13T09:00:45",
"upload_time_iso_8601": "2025-07-13T09:00:45.641697Z",
"url": "https://files.pythonhosted.org/packages/b0/de/c9b6ec1ef6dd69bdb26eec1df5cfabfe8b99946d598461106a731b7e0ceb/glidekv-4.6.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-13 09:00:45",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "lixiang-repo",
"github_project": "GlideKV",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "tensorflow",
"specs": [
[
"==",
"v2.15.1"
]
]
},
{
"name": "tensorflow-recommenders-addons",
"specs": [
[
"==",
"0.7.0"
]
]
},
{
"name": "tensorflow_io",
"specs": [
[
"==",
"0.36.0"
]
]
},
{
"name": "tensorflow-serving-api",
"specs": [
[
"==",
"2.15.1"
]
]
},
{
"name": "aerospike",
"specs": []
},
{
"name": "pandas",
"specs": []
},
{
"name": "pyarrow",
"specs": []
},
{
"name": "tqdm",
"specs": []
},
{
"name": "scikit-learn",
"specs": []
},
{
"name": "numpy",
"specs": [
[
">=",
"1.19.0"
]
]
},
{
"name": "pytest",
"specs": [
[
">=",
"6.0.0"
]
]
},
{
"name": "pytest-cov",
"specs": [
[
">=",
"2.0.0"
]
]
},
{
"name": "black",
"specs": [
[
">=",
"22.0.0"
]
]
},
{
"name": "flake8",
"specs": [
[
">=",
"4.0.0"
]
]
},
{
"name": "grpcio",
"specs": [
[
">=",
"1.50.0"
]
]
},
{
"name": "protobuf",
"specs": [
[
">=",
"3.20.0"
]
]
}
],
"lcname": "glidekv"
}