《云原生机密计算最佳实践白皮书》——07解决方案——Intel Confidential Computing Zoo: Intel机密计算开源解决方案——部署TensorFlow Serving在线推理服务(3) https://developer.aliyun.com/article/1230817?groupCode=aliyun_linux
步骤三:远端访问
1、切换到客户端
cd confifidential-computing-zoo/cczoo/tensorflflow-serving-cluster/tensorflflow-serving/docker /client/
2、获取client容器镜像
用户可以通过下面任意方式获取client镜像:
• a. 下载TensorFlow Serving镜像
sudo docker pull intelcczoo/tensorflflow_serving:anolis_client_latest
• b. 自行编译client镜像
sudo docker build -f client.dockerfifile . -t intelcczoo/tensorflflow_serving:anolis_client_latest
3、运行并进入client容器
sudo docker run -it --add-host="grpc.tf-serving.service.com:<tf_serving_service_ip_addr>" intelcczoo/tensorflflow_serving:anolis_client_latest bash
说明:如果client和TensorFlow Serving 部署在同一台机器,tf_serving_service_ip_addr 为TensorFlow Serving容器IP地址。
4、向TensorFlow Serving 发送远程访问请求
cd /client python3 ./resnet_client_grpc.py -batch 1 -cnum 1 -loop 50 -url grpc.tf-serving.service.com: 8500-ca `pwd -P`/ssl_confifigure/ca_cert.pem -crt `pwd -P`/ssl_confifigure/client/cert.pem -key `pwd -P`/ssl_confifigure/client/key.pem
请求成功后会打印传输数据,并输出性能数据。