Node Args
A Cloud TPU instance. To get more information about Node, see:
How-to Guides
Example Usage
Tpu Node Basic
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.tpu.TpuFunctions;
import com.pulumi.gcp.tpu.inputs.GetTensorflowVersionsArgs;
import com.pulumi.gcp.tpu.Node;
import com.pulumi.gcp.tpu.NodeArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var available = TpuFunctions.getTensorflowVersions();
var tpu = new Node("tpu", NodeArgs.builder()
.zone("us-central1-b")
.acceleratorType("v3-8")
.tensorflowVersion(available.applyValue(getTensorflowVersionsResult -> getTensorflowVersionsResult.versions()[0]))
.cidrBlock("10.2.0.0/29")
.build());
}
}
Tpu Node Full
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.tpu.TpuFunctions;
import com.pulumi.gcp.tpu.inputs.GetTensorflowVersionsArgs;
import com.pulumi.gcp.compute.ComputeFunctions;
import com.pulumi.gcp.compute.inputs.GetNetworkArgs;
import com.pulumi.gcp.compute.GlobalAddress;
import com.pulumi.gcp.compute.GlobalAddressArgs;
import com.pulumi.gcp.servicenetworking.Connection;
import com.pulumi.gcp.servicenetworking.ConnectionArgs;
import com.pulumi.gcp.tpu.Node;
import com.pulumi.gcp.tpu.NodeArgs;
import com.pulumi.gcp.tpu.inputs.NodeSchedulingConfigArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var available = TpuFunctions.getTensorflowVersions();
final var network = ComputeFunctions.getNetwork(GetNetworkArgs.builder()
.name("default")
.build());
var serviceRange = new GlobalAddress("serviceRange", GlobalAddressArgs.builder()
.purpose("VPC_PEERING")
.addressType("INTERNAL")
.prefixLength(16)
.network(network.applyValue(getNetworkResult -> getNetworkResult.id()))
.build());
var privateServiceConnection = new Connection("privateServiceConnection", ConnectionArgs.builder()
.network(network.applyValue(getNetworkResult -> getNetworkResult.id()))
.service("servicenetworking.googleapis.com")
.reservedPeeringRanges(serviceRange.name())
.build());
var tpu = new Node("tpu", NodeArgs.builder()
.zone("us-central1-b")
.acceleratorType("v3-8")
.tensorflowVersion(available.applyValue(getTensorflowVersionsResult -> getTensorflowVersionsResult.versions()[0]))
.description("Google Provider test TPU")
.useServiceNetworking(true)
.network(privateServiceConnection.network())
.labels(Map.of("foo", "bar"))
.schedulingConfig(NodeSchedulingConfigArgs.builder()
.preemptible(true)
.build())
.build());
}
}
Import
Node can be imported using any of these accepted formats
$ pulumi import gcp:tpu/node:Node default projects/{{project}}/locations/{{zone}}/nodes/{{name}}
$ pulumi import gcp:tpu/node:Node default {{project}}/{{zone}}/{{name}}
$ pulumi import gcp:tpu/node:Node default {{zone}}/{{name}}
$ pulumi import gcp:tpu/node:Node default {{name}}
Constructors
Properties
The type of hardware accelerators associated with this node.
The CIDR block that the TPU node will use when selecting an IP address. This CIDR block must be a /29 block; the Compute Engine networks API forbids a smaller block, and using a larger block would be wasteful (a node can only consume one IP address). Errors will occur if the CIDR block has already been used for a currently existing TPU node, the CIDR block conflicts with any subnetworks in the user's provided network, or the provided network is peered with another network that is using that CIDR block.
The user-supplied description of the TPU. Maximum of 512 characters.
Sets the scheduling options for this TPU instance. Structure is documented below.
The version of Tensorflow running in the Node.
Whether the VPC peering for the node is set up through Service Networking API. The VPC Peering should be set up before provisioning the node. If this field is set, cidr_block field should not be specified. If the network that you want to peer the TPU Node to is a Shared VPC network, the node must be created with this this field enabled.