TensorFlow Serving on Ceph(S3)
TensorFlow 支持读写 Ceph(S3) 上的数据,TensorFlow Serving 在 CreateSavedModelBundle
时,会使用 TensorFlow 的 LoadSessionBundleOrSavedModelBundle
方法,因此 TensorFlow Serving 可以使用存储在 Ceph(S3) 上的模型。
配置
TensorFlow 想要读写 Ceph(S3) 上的数据,需要配置以下环境变量:
- AWS_ACCESS_KEY_ID # access key.
- AWS_SECRET_ACCESS_KEY # secret key.
- S3_ENDPOINT # S3 API endpoint to connect to.
- S3_USE_HTTPS # Whether or not to use https
- S3_VERIFY_SSL # If HTTPS is used, controls if SSL should be enabled.
- AWS_LOG_LEVEL
使用
冒烟测试
为了测试访问 Ceph(S3) 是否正常,使用如下代码 stat 一个文件:
from tensorflow.python.lib.io import file_io
print file_io.stat('s3://bucketname/path/')
如果访问正常,输出如下:
<