Skip to content

Commit

Permalink
Revert "silicon/design/main: add vm based notebook"
Browse files Browse the repository at this point in the history
This reverts commit 1f0d3abd45539eb89ae23efabe449b2019b391f9.
  • Loading branch information
proppy committed Oct 18, 2022
1 parent 6fa151e commit b4eb216
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 46 deletions.
47 changes: 2 additions & 45 deletions modules/silicon_design/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,10 @@ resource "google_project_iam_member" "ai_notebook_user_role2" {
role = "roles/viewer"
}

resource "google_notebooks_instance" "ai_notebook_container" {
resource "google_notebooks_instance" "ai_notebook" {
count = var.notebook_count
project = local.project.project_id
name = "${local.notebook_names[count.index]}-container"
name = local.notebook_names[count.index]
location = var.zone
machine_type = var.machine_type

Expand Down Expand Up @@ -305,49 +305,6 @@ resource "google_notebooks_instance" "ai_notebook_container" {
]
}

resource "google_notebooks_instance" "ai_notebook_vm" {
count = var.notebook_count
project = local.project.project_id
name = "${local.notebook_names[count.index]}-vm"
location = var.zone
machine_type = var.machine_type

vm_image {
project = local.project.project_id
image_name = "${var.image_name}-${local.image_tag}"
}

service_account = google_service_account.sa_p_notebook.email

install_gpu_driver = false
boot_disk_type = var.boot_disk_type
boot_disk_size_gb = var.boot_disk_size_gb
data_disk_type = var.data_disk_type
data_disk_size_gb = var.data_disk_size_gb
no_remove_data_disk = true

no_public_ip = false
no_proxy_access = false

network = local.network.self_link
subnet = local.subnet.self_link

post_startup_script = "gs://${google_storage_bucket.staging_bucket.name}/copy-notebooks.sh"

labels = {
module = "silicon-design"
}

metadata = {
terraform = "true"
proxy-mode = "service_account"
}
depends_on = [
time_sleep.wait_120_seconds,
null_resource.build_and_push_image,
]
}

resource "null_resource" "ai_notebook_provisioning_state" {
for_each = toset(google_notebooks_instance.ai_notebook[*].name)
provisioner "local-exec" {
Expand Down
2 changes: 1 addition & 1 deletion modules/silicon_design/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ output "notebook_container_image" {

output "notebook_instance_names" {
description = "Notebook Instance Names"
value = join(", ", concat(google_notebooks_instance.ai_notebook_container[*].name, google_notebooks_instance.ai_notebook_vm[*].name))
value = join(", ", google_notebooks_instance.ai_notebook[*].name)
}

output "artifact_registry_repository_id" {
Expand Down

0 comments on commit b4eb216

Please sign in to comment.