Skip to content

Commit

Permalink
Fix project service dependency (#497)
Browse files Browse the repository at this point in the history
* fix project service dependency

* fix project service dependency
  • Loading branch information
umeshkumhar authored and kfswain committed Apr 15, 2024
1 parent 92394d3 commit 9296daa
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 13 deletions.
8 changes: 5 additions & 3 deletions applications/jupyter/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,14 @@ module "infra" {
subnetwork_name = "default"
cpu_pools = var.cpu_pools
enable_gpu = false
depends_on = [module.project-services]
}

data "google_container_cluster" "default" {
count = var.create_cluster ? 0 : 1
name = var.cluster_name
location = var.cluster_location
count = var.create_cluster ? 0 : 1
name = var.cluster_name
location = var.cluster_location
depends_on = [module.project-services]
}

locals {
Expand Down
8 changes: 5 additions & 3 deletions applications/rag/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,14 @@ module "infra" {
enable_gpu = true
gpu_pools = var.gpu_pools
kubernetes_version = var.kubernetes_version
depends_on = [module.project-services]
}

data "google_container_cluster" "default" {
count = var.create_cluster ? 0 : 1
name = var.cluster_name
location = var.cluster_location
count = var.create_cluster ? 0 : 1
name = var.cluster_name
location = var.cluster_location
depends_on = [module.project-services]
}

locals {
Expand Down
8 changes: 5 additions & 3 deletions applications/ray/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,14 @@ module "infra" {
cpu_pools = var.cpu_pools
enable_gpu = var.enable_gpu
gpu_pools = var.gpu_pools
depends_on = [module.project-services]
}

data "google_container_cluster" "default" {
count = var.create_cluster ? 0 : 1
name = var.cluster_name
location = var.cluster_location
count = var.create_cluster ? 0 : 1
name = var.cluster_name
location = var.cluster_location
depends_on = [module.project-services]
}

locals {
Expand Down
8 changes: 6 additions & 2 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ steps:
terraform apply \
-var-file=tfvars_tests/standard-gke-public.platform.tfvars \
-var=project_id=$PROJECT_ID \
-var=network_name=ml-$SHORT_SHA-$_PR_NUMBER-$_BUILD_ID-$_AUTOPILOT_CLUSTER \
-var=subnetwork_name=ml-$SHORT_SHA-$_PR_NUMBER-$_BUILD_ID-$_AUTOPILOT_CLUSTER \
-var=cluster_name=ml-$SHORT_SHA-$_PR_NUMBER-$_BUILD_ID-cluster \
-var=autopilot_cluster=$_AUTOPILOT_CLUSTER \
-var=cluster_location=$_REGION \
Expand Down Expand Up @@ -202,7 +204,7 @@ steps:
cd /workspace/applications/rag/
terraform apply \
-var-file=workloads.tfvars \
-var=network_name=default \
-var=network_name=ml-$SHORT_SHA-$_PR_NUMBER-$_BUILD_ID-$_AUTOPILOT_CLUSTER \
-var=create_cluster=false \
-var=jupyter_add_auth=false \
-var=frontend_add_auth=false \
Expand Down Expand Up @@ -261,7 +263,7 @@ steps:
cd /workspace/applications/rag/
terraform destroy \
-var-file=workloads.tfvars \
-var=network_name=default \
-var=network_name=ml-$SHORT_SHA-$_PR_NUMBER-$_BUILD_ID-$_AUTOPILOT_CLUSTER \
-var=create_cluster=false \
-var=jupyter_add_auth=false \
-var=frontend_add_auth=false \
Expand Down Expand Up @@ -289,6 +291,8 @@ steps:
cd /workspace/infrastructure
terraform destroy -var-file=tfvars_tests/standard-gke-public.platform.tfvars -var=project_id=$PROJECT_ID \
-var=cluster_name=ml-$SHORT_SHA-$_PR_NUMBER-$_BUILD_ID-cluster \
-var=network_name=ml-$SHORT_SHA-$_PR_NUMBER-$_BUILD_ID-$_AUTOPILOT_CLUSTER \
-var=subnetwork_name=ml-$SHORT_SHA-$_PR_NUMBER-$_BUILD_ID-$_AUTOPILOT_CLUSTER \
-var=autopilot_cluster=$_AUTOPILOT_CLUSTER \
-var=cluster_location=$_REGION -auto-approve -no-color
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ project_id = "<project-id>"
# subnetwork_cidr = "10.100.0.0/16"
# subnetwork_region = "us-central1"

create_network = false
create_network = true
network_name = "default"
subnetwork_name = "default"
subnetwork_region = "us-central1"
Expand Down
3 changes: 2 additions & 1 deletion modules/kuberay-monitoring/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@

# Temporary workaround to ensure the GMP webhook is installed before applying PodMonitorings.
resource "time_sleep" "wait_for_gmp_operator" {
count = var.autopilot_cluster ? 1 : 0
## Temporary workaroud, This is impacting for the standard cluster dependency graph
#count = var.autopilot_cluster ? 1 : 0
create_duration = "30s"
}

Expand Down

0 comments on commit 9296daa

Please sign in to comment.