instance.proto 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. // Copyright 2022 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.cloud.notebooks.v1beta1;
  16. import "google/api/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/cloud/notebooks/v1beta1/environment.proto";
  19. import "google/protobuf/timestamp.proto";
  20. option csharp_namespace = "Google.Cloud.Notebooks.V1Beta1";
  21. option go_package = "google.golang.org/genproto/googleapis/cloud/notebooks/v1beta1;notebooks";
  22. option java_multiple_files = true;
  23. option java_outer_classname = "InstanceProto";
  24. option java_package = "com.google.cloud.notebooks.v1beta1";
  25. option php_namespace = "Google\\Cloud\\Notebooks\\V1beta1";
  26. option ruby_package = "Google::Cloud::Notebooks::V1beta1";
  27. // Reservation Affinity for consuming Zonal reservation.
  28. message ReservationAffinity {
  29. // Indicates whether to consume capacity from an reservation or not.
  30. enum Type {
  31. // Default type.
  32. TYPE_UNSPECIFIED = 0;
  33. // Do not consume from any allocated capacity.
  34. NO_RESERVATION = 1;
  35. // Consume any reservation available.
  36. ANY_RESERVATION = 2;
  37. // Must consume from a specific reservation. Must specify key value fields
  38. // for specifying the reservations.
  39. SPECIFIC_RESERVATION = 3;
  40. }
  41. // Optional. Type of reservation to consume
  42. Type consume_reservation_type = 1 [(google.api.field_behavior) = OPTIONAL];
  43. // Optional. Corresponds to the label key of reservation resource.
  44. string key = 2 [(google.api.field_behavior) = OPTIONAL];
  45. // Optional. Corresponds to the label values of reservation resource.
  46. repeated string values = 3 [(google.api.field_behavior) = OPTIONAL];
  47. }
  48. // The definition of a notebook instance.
  49. message Instance {
  50. option (google.api.resource) = {
  51. type: "notebooks.googleapis.com/Instance"
  52. pattern: "projects/{project}/instances/{instance}"
  53. };
  54. // Definition of the types of hardware accelerators that can be used on this
  55. // instance.
  56. enum AcceleratorType {
  57. // Accelerator type is not specified.
  58. ACCELERATOR_TYPE_UNSPECIFIED = 0;
  59. // Accelerator type is Nvidia Tesla K80.
  60. NVIDIA_TESLA_K80 = 1;
  61. // Accelerator type is Nvidia Tesla P100.
  62. NVIDIA_TESLA_P100 = 2;
  63. // Accelerator type is Nvidia Tesla V100.
  64. NVIDIA_TESLA_V100 = 3;
  65. // Accelerator type is Nvidia Tesla P4.
  66. NVIDIA_TESLA_P4 = 4;
  67. // Accelerator type is Nvidia Tesla T4.
  68. NVIDIA_TESLA_T4 = 5;
  69. // Accelerator type is NVIDIA Tesla T4 Virtual Workstations.
  70. NVIDIA_TESLA_T4_VWS = 8;
  71. // Accelerator type is NVIDIA Tesla P100 Virtual Workstations.
  72. NVIDIA_TESLA_P100_VWS = 9;
  73. // Accelerator type is NVIDIA Tesla P4 Virtual Workstations.
  74. NVIDIA_TESLA_P4_VWS = 10;
  75. // (Coming soon) Accelerator type is TPU V2.
  76. TPU_V2 = 6;
  77. // (Coming soon) Accelerator type is TPU V3.
  78. TPU_V3 = 7;
  79. }
  80. // Definition of a hardware accelerator. Note that not all combinations
  81. // of `type` and `core_count` are valid. Check [GPUs on
  82. // Compute Engine](/compute/docs/gpus/#gpus-list) to find a valid
  83. // combination. TPUs are not supported.
  84. message AcceleratorConfig {
  85. // Type of this accelerator.
  86. AcceleratorType type = 1;
  87. // Count of cores of this accelerator.
  88. int64 core_count = 2;
  89. }
  90. // The definition of the states of this instance.
  91. enum State {
  92. // State is not specified.
  93. STATE_UNSPECIFIED = 0;
  94. // The control logic is starting the instance.
  95. STARTING = 1;
  96. // The control logic is installing required frameworks and registering the
  97. // instance with notebook proxy
  98. PROVISIONING = 2;
  99. // The instance is running.
  100. ACTIVE = 3;
  101. // The control logic is stopping the instance.
  102. STOPPING = 4;
  103. // The instance is stopped.
  104. STOPPED = 5;
  105. // The instance is deleted.
  106. DELETED = 6;
  107. // The instance is upgrading.
  108. UPGRADING = 7;
  109. // The instance is being created.
  110. INITIALIZING = 8;
  111. // The instance is getting registered.
  112. REGISTERING = 9;
  113. // The instance is suspending.
  114. SUSPENDING = 10;
  115. // The instance is suspended.
  116. SUSPENDED = 11;
  117. }
  118. // Possible disk types for notebook instances.
  119. enum DiskType {
  120. // Disk type not set.
  121. DISK_TYPE_UNSPECIFIED = 0;
  122. // Standard persistent disk type.
  123. PD_STANDARD = 1;
  124. // SSD persistent disk type.
  125. PD_SSD = 2;
  126. // Balanced persistent disk type.
  127. PD_BALANCED = 3;
  128. }
  129. // Definition of the disk encryption options.
  130. enum DiskEncryption {
  131. // Disk encryption is not specified.
  132. DISK_ENCRYPTION_UNSPECIFIED = 0;
  133. // Use Google managed encryption keys to encrypt the boot disk.
  134. GMEK = 1;
  135. // Use customer managed encryption keys to encrypt the boot disk.
  136. CMEK = 2;
  137. }
  138. // The type of vNIC driver.
  139. enum NicType {
  140. // No type specified. Default should be UNSPECIFIED_NIC_TYPE.
  141. UNSPECIFIED_NIC_TYPE = 0;
  142. // VIRTIO. Default in Notebooks DLVM.
  143. VIRTIO_NET = 1;
  144. // GVNIC. Alternative to VIRTIO.
  145. // https://github.com/GoogleCloudPlatform/compute-virtual-ethernet-linux
  146. GVNIC = 2;
  147. }
  148. // Output only. The name of this notebook instance. Format:
  149. // `projects/{project_id}/locations/{location}/instances/{instance_id}`
  150. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  151. // Type of the environment; can be one of VM image, or container image.
  152. oneof environment {
  153. // Use a Compute Engine VM image to start the notebook instance.
  154. VmImage vm_image = 2;
  155. // Use a container image to start the notebook instance.
  156. ContainerImage container_image = 3;
  157. }
  158. // Path to a Bash script that automatically runs after a notebook instance
  159. // fully boots up. The path must be a URL or
  160. // Cloud Storage path (gs://path-to-file/file-name).
  161. string post_startup_script = 4;
  162. // Output only. The proxy endpoint that is used to access the Jupyter notebook.
  163. string proxy_uri = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  164. // Input only. The owner of this instance after creation. Format: `alias@example.com`
  165. //
  166. // Currently supports one owner only. If not specified, all of the service
  167. // account users of your VM instance's service account can use
  168. // the instance.
  169. repeated string instance_owners = 6 [(google.api.field_behavior) = INPUT_ONLY];
  170. // The service account on this instance, giving access to other Google
  171. // Cloud services.
  172. // You can use any service account within the same project, but you
  173. // must have the service account user permission to use the instance.
  174. //
  175. // If not specified, the [Compute Engine default service
  176. // account](https://cloud.google.com/compute/docs/access/service-accounts#default_service_account)
  177. // is used.
  178. string service_account = 7;
  179. // Required. The [Compute Engine machine type](/compute/docs/machine-types) of this
  180. // instance.
  181. string machine_type = 8 [(google.api.field_behavior) = REQUIRED];
  182. // The hardware accelerator used on this instance. If you use
  183. // accelerators, make sure that your configuration has
  184. // [enough vCPUs and memory to support the `machine_type` you
  185. // have selected](/compute/docs/gpus/#gpus-list).
  186. AcceleratorConfig accelerator_config = 9;
  187. // Output only. The state of this instance.
  188. State state = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
  189. // Whether the end user authorizes Google Cloud to install GPU driver
  190. // on this instance.
  191. // If this field is empty or set to false, the GPU driver won't be installed.
  192. // Only applicable to instances with GPUs.
  193. bool install_gpu_driver = 11;
  194. // Specify a custom Cloud Storage path where the GPU driver is stored.
  195. // If not specified, we'll automatically choose from official GPU drivers.
  196. string custom_gpu_driver_path = 12;
  197. // Input only. The type of the boot disk attached to this instance, defaults to
  198. // standard persistent disk (`PD_STANDARD`).
  199. DiskType boot_disk_type = 13 [(google.api.field_behavior) = INPUT_ONLY];
  200. // Input only. The size of the boot disk in GB attached to this instance, up to a maximum
  201. // of 64000 GB (64 TB). The minimum recommended value is
  202. // 100 GB. If not specified, this defaults to 100.
  203. int64 boot_disk_size_gb = 14 [(google.api.field_behavior) = INPUT_ONLY];
  204. // Input only. The type of the data disk attached to this instance, defaults to
  205. // standard persistent disk (`PD_STANDARD`).
  206. DiskType data_disk_type = 25 [(google.api.field_behavior) = INPUT_ONLY];
  207. // Input only. The size of the data disk in GB attached to this instance, up to a maximum
  208. // of 64000 GB (64 TB). You can choose the size of the data disk
  209. // based on how big your notebooks and data are. If not specified, this
  210. // defaults to 100.
  211. int64 data_disk_size_gb = 26 [(google.api.field_behavior) = INPUT_ONLY];
  212. // Input only. If true, the data disk will not be auto deleted when deleting the instance.
  213. bool no_remove_data_disk = 27 [(google.api.field_behavior) = INPUT_ONLY];
  214. // Input only. Disk encryption method used on the boot and data disks, defaults to GMEK.
  215. DiskEncryption disk_encryption = 15 [(google.api.field_behavior) = INPUT_ONLY];
  216. // Input only. The KMS key used to encrypt the disks, only applicable if disk_encryption
  217. // is CMEK.
  218. // Format:
  219. // `projects/{project_id}/locations/{location}/keyRings/{key_ring_id}/cryptoKeys/{key_id}`
  220. //
  221. // Learn more about [using your own encryption keys](/kms/docs/quickstart).
  222. string kms_key = 16 [(google.api.field_behavior) = INPUT_ONLY];
  223. // If true, no public IP will be assigned to this instance.
  224. bool no_public_ip = 17;
  225. // If true, the notebook instance will not register with the proxy.
  226. bool no_proxy_access = 18;
  227. // The name of the VPC that this instance is in.
  228. // Format:
  229. // `projects/{project_id}/global/networks/{network_id}`
  230. string network = 19;
  231. // The name of the subnet that this instance is in.
  232. // Format:
  233. // `projects/{project_id}/regions/{region}/subnetworks/{subnetwork_id}`
  234. string subnet = 20;
  235. // Labels to apply to this instance.
  236. // These can be later modified by the setLabels method.
  237. map<string, string> labels = 21;
  238. // Custom metadata to apply to this instance.
  239. map<string, string> metadata = 22;
  240. // Optional. The type of vNIC to be used on this interface. This may be gVNIC or
  241. // VirtioNet.
  242. NicType nic_type = 28 [(google.api.field_behavior) = OPTIONAL];
  243. // Optional. The optional reservation affinity. Setting this field will apply
  244. // the specified [Zonal Compute
  245. // Reservation](https://cloud.google.com/compute/docs/instances/reserving-zonal-resources)
  246. // to this notebook instance.
  247. ReservationAffinity reservation_affinity = 29 [(google.api.field_behavior) = OPTIONAL];
  248. // Optional. Flag to enable ip forwarding or not, default false/off.
  249. // https://cloud.google.com/vpc/docs/using-routes#canipforward
  250. bool can_ip_forward = 31 [(google.api.field_behavior) = OPTIONAL];
  251. // Output only. Instance creation time.
  252. google.protobuf.Timestamp create_time = 23 [(google.api.field_behavior) = OUTPUT_ONLY];
  253. // Output only. Instance update time.
  254. google.protobuf.Timestamp update_time = 24 [(google.api.field_behavior) = OUTPUT_ONLY];
  255. }