instance.proto 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. // Copyright 2020 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. import "google/api/annotations.proto";
  21. option csharp_namespace = "Google.Cloud.Notebooks.V1Beta1";
  22. option go_package = "google.golang.org/genproto/googleapis/cloud/notebooks/v1beta1;notebooks";
  23. option php_namespace = "Google\\Cloud\\Notebooks\\V1beta1";
  24. option ruby_package = "Google::Cloud::Notebooks::V1beta1";
  25. option java_multiple_files = true;
  26. option java_outer_classname = "InstanceProto";
  27. option java_package = "com.google.cloud.notebooks.v1beta1";
  28. // The definition of a notebook instance.
  29. message Instance {
  30. option (google.api.resource) = {
  31. type: "notebooks.googleapis.com/Instance"
  32. pattern: "projects/{project}/instances/{instance}"
  33. };
  34. // Definition of a hardware accelerator. Note that not all combinations
  35. // of `type` and `core_count` are valid. Check [GPUs on
  36. // Compute Engine](/compute/docs/gpus/#gpus-list) to find a valid
  37. // combination. TPUs are not supported.
  38. message AcceleratorConfig {
  39. // Type of this accelerator.
  40. AcceleratorType type = 1;
  41. // Count of cores of this accelerator.
  42. int64 core_count = 2;
  43. }
  44. // Definition of the types of hardware accelerators that can be used on this
  45. // instance.
  46. enum AcceleratorType {
  47. // Accelerator type is not specified.
  48. ACCELERATOR_TYPE_UNSPECIFIED = 0;
  49. // Accelerator type is Nvidia Tesla K80.
  50. NVIDIA_TESLA_K80 = 1;
  51. // Accelerator type is Nvidia Tesla P100.
  52. NVIDIA_TESLA_P100 = 2;
  53. // Accelerator type is Nvidia Tesla V100.
  54. NVIDIA_TESLA_V100 = 3;
  55. // Accelerator type is Nvidia Tesla P_4.
  56. NVIDIA_TESLA_P4 = 4;
  57. // Accelerator type is Nvidia Tesla T4.
  58. NVIDIA_TESLA_T4 = 5;
  59. // Accelerator type is NVIDIA Tesla T4 Virtual Workstations.
  60. NVIDIA_TESLA_T4_VWS = 8;
  61. // Accelerator type is NVIDIA Tesla P100 Virtual Workstations.
  62. NVIDIA_TESLA_P100_VWS = 9;
  63. // Accelerator type is NVIDIA Tesla P_4 Virtual Workstations.
  64. NVIDIA_TESLA_P4_VWS = 10;
  65. // (Coming soon) Accelerator type is TPU V2.
  66. TPU_V2 = 6;
  67. // (Coming soon) Accelerator type is TPU V3.
  68. TPU_V3 = 7;
  69. }
  70. // The definition of the states of this instance.
  71. enum State {
  72. // State is not specified.
  73. STATE_UNSPECIFIED = 0;
  74. // The control logic is starting the instance.
  75. STARTING = 1;
  76. // The control logic is installing required frameworks and registering the
  77. // instance with notebook proxy
  78. PROVISIONING = 2;
  79. // The instance is running.
  80. ACTIVE = 3;
  81. // The control logic is stopping the instance.
  82. STOPPING = 4;
  83. // The instance is stopped.
  84. STOPPED = 5;
  85. // The instance is deleted.
  86. DELETED = 6;
  87. // The instance is upgrading.
  88. UPGRADING = 7;
  89. // The instance is being created.
  90. INITIALIZING = 8;
  91. // The instance is getting registered.
  92. REGISTERING = 9;
  93. }
  94. // Possible disk types for notebook instances.
  95. enum DiskType {
  96. // Disk type not set.
  97. DISK_TYPE_UNSPECIFIED = 0;
  98. // Standard persistent disk type.
  99. PD_STANDARD = 1;
  100. // SSD persistent disk type.
  101. PD_SSD = 2;
  102. // Balanced persistent disk type.
  103. PD_BALANCED = 3;
  104. }
  105. // Definition of the disk encryption options.
  106. enum DiskEncryption {
  107. // Disk encryption is not specified.
  108. DISK_ENCRYPTION_UNSPECIFIED = 0;
  109. // Use Google managed encryption keys to encrypt the boot disk.
  110. GMEK = 1;
  111. // Use customer managed encryption keys to encrypt the boot disk.
  112. CMEK = 2;
  113. }
  114. // Output only. The name of this notebook instance. Format:
  115. // `projects/{project_id}/locations/{location}/instances/{instance_id}`
  116. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  117. // Type of the environment; can be one of VM image, or container image.
  118. oneof environment {
  119. // Use a Compute Engine VM image to start the notebook instance.
  120. VmImage vm_image = 2;
  121. // Use a container image to start the notebook instance.
  122. ContainerImage container_image = 3;
  123. }
  124. // Path to a Bash script that automatically runs after a notebook instance
  125. // fully boots up. The path must be a URL or
  126. // Cloud Storage path (`gs://path-to-file/file-name`).
  127. string post_startup_script = 4;
  128. // Output only. The proxy endpoint that is used to access the Jupyter
  129. // notebook.
  130. string proxy_uri = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  131. // Input only. The owner of this instance after creation. Format:
  132. // `alias@example.com`
  133. //
  134. // Currently supports one owner only. If not specified, all of the service
  135. // account users of your VM instance's service account can use
  136. // the instance.
  137. repeated string instance_owners = 6
  138. [(google.api.field_behavior) = INPUT_ONLY];
  139. // The service account on this instance, giving access to other Google
  140. // Cloud services.
  141. // You can use any service account within the same project, but you
  142. // must have the service account user permission to use the instance.
  143. //
  144. // If not specified, the [Compute Engine default service
  145. // account](https://cloud.google.com/compute/docs/access/service-accounts#default_service_account)
  146. // is used.
  147. string service_account = 7;
  148. // Required. The [Compute Engine machine
  149. // type](https://cloud.google.com/compute/docs/machine-types) of this
  150. // instance.
  151. string machine_type = 8 [(google.api.field_behavior) = REQUIRED];
  152. // The hardware accelerator used on this instance. If you use
  153. // accelerators, make sure that your configuration has
  154. // [enough vCPUs and memory to support the `machine_type` you
  155. // have selected](https://cloud.google.com/compute/docs/gpus/#gpus-list).
  156. AcceleratorConfig accelerator_config = 9;
  157. // Output only. The state of this instance.
  158. State state = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
  159. // Whether the end user authorizes Google Cloud to install GPU driver
  160. // on this instance.
  161. // If this field is empty or set to false, the GPU driver won't be installed.
  162. // Only applicable to instances with GPUs.
  163. bool install_gpu_driver = 11;
  164. // Specify a custom Cloud Storage path where the GPU driver is stored.
  165. // If not specified, we'll automatically choose from official GPU drivers.
  166. string custom_gpu_driver_path = 12;
  167. // Input only. The type of the boot disk attached to this instance, defaults
  168. // to standard persistent disk (`PD_STANDARD`).
  169. DiskType boot_disk_type = 13 [(google.api.field_behavior) = INPUT_ONLY];
  170. // Input only. The size of the boot disk in GB attached to this instance, up
  171. // to a maximum of 64000 GB (64 TB). The minimum recommended value
  172. // is 100 GB. If not specified, this defaults to 100.
  173. int64 boot_disk_size_gb = 14 [(google.api.field_behavior) = INPUT_ONLY];
  174. // Input only. The type of the data disk attached to this instance, defaults
  175. // to standard persistent disk (`PD_STANDARD`).
  176. DiskType data_disk_type = 25 [(google.api.field_behavior) = INPUT_ONLY];
  177. // Input only. The size of the data disk in GB attached to this instance, up
  178. // to a maximum of 64000 GB (64 TB). You can choose the size of the
  179. // data disk based on how big your notebooks and data are. If not specified,
  180. // this defaults to 100.
  181. int64 data_disk_size_gb = 26 [(google.api.field_behavior) = INPUT_ONLY];
  182. // Input only. If true, the data disk will not be auto deleted when deleting
  183. // the instance.
  184. bool no_remove_data_disk = 27 [(google.api.field_behavior) = INPUT_ONLY];
  185. // Input only. Disk encryption method used on the boot and data disks,
  186. // defaults to GMEK.
  187. DiskEncryption disk_encryption = 15
  188. [(google.api.field_behavior) = INPUT_ONLY];
  189. // Input only. The KMS key used to encrypt the disks, only applicable if
  190. // disk_encryption is CMEK. Format:
  191. // `projects/{project_id}/locations/{location}/keyRings/{key_ring_id}/cryptoKeys/{key_id}`
  192. //
  193. // Learn more about [using your own encryption keys](
  194. // https://cloud.google.com/kms/docs/quickstart).
  195. string kms_key = 16 [(google.api.field_behavior) = INPUT_ONLY];
  196. // If true, no public IP will be assigned to this instance.
  197. bool no_public_ip = 17;
  198. // If true, the notebook instance will not register with the proxy.
  199. bool no_proxy_access = 18;
  200. // The name of the VPC that this instance is in.
  201. // Format:
  202. // `projects/{project_id}/global/networks/{network_id}`
  203. string network = 19;
  204. // The name of the subnet that this instance is in.
  205. // Format:
  206. // `projects/{project_id}/regions/{region}/subnetworks/{subnetwork_id}`
  207. string subnet = 20;
  208. // Labels to apply to this instance.
  209. // These can be later modified by the setLabels method.
  210. map<string, string> labels = 21;
  211. // Custom metadata to apply to this instance.
  212. map<string, string> metadata = 22;
  213. // Output only. Instance creation time.
  214. google.protobuf.Timestamp create_time = 23
  215. [(google.api.field_behavior) = OUTPUT_ONLY];
  216. // Output only. Instance update time.
  217. google.protobuf.Timestamp update_time = 24
  218. [(google.api.field_behavior) = OUTPUT_ONLY];
  219. }