Path: blob/master/site/zh-cn/federated/gcp_setup.md
25115 views
在 GCP 上运行 TFF 模拟
本教程介绍如何在 GCP 上运行 TFF 模拟。
在单个运行时容器上运行模拟
1. 安装并初始化 Cloud SDK。
2. 克隆 TensorFlow Federated 仓库。
3. 运行单个运行时容器。
构建运行时容器。
发布运行时容器。
创建 Compute Engine 实例
在 Cloud Console 中,转到 VM Instances 页面。
点击 Create instance。
在 Firewall 部分,选择 Allow HTTP traffic 和 Allow HTTPS traffic。
点击 Create 以创建实例。
使用
ssh
连接到实例。在后台运行运行时容器。
退出实例。
获取实例的内部 IP 地址。
此信息稍后将用作我们测试脚本的参数。
4. 在客户端容器上运行模拟。
构建客户端容器。
发布客户端容器。
创建 Compute Engine 实例
在 Cloud Console 中,转到 VM Instances 页面。
点击 Create instance。
在 Firewall 部分,选择 Allow HTTP traffic 和 Allow HTTPS traffic。
点击 Create 以创建实例。
将实验复制到 Compute Engine 实例中。
使用
ssh
连接到实例。以交互方式运行客户端容器。
随即会在终端打印出字符串“Hello World”。
运行 Python 脚本。
使用运行运行时容器的实例的内部 IP 地址。
退出容器。
退出实例。