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