Skip to content

Commit

Permalink
update marketplace UI
Browse files Browse the repository at this point in the history
  • Loading branch information
umeshkumhar committed Mar 8, 2024
1 parent 66ce36e commit 26c3c3e
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 70 deletions.
12 changes: 6 additions & 6 deletions applications/jupyter/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ data "google_project" "project" {
}

module "infra" {
source = "github.com/GoogleCloudPlatform/ai-on-gke//infrastructure?ref=infralocation"
source = "../../infrastructure"
count = var.create_cluster ? 1 : 0

project_id = var.project_id
Expand Down Expand Up @@ -58,7 +58,7 @@ locals {
}

locals {
workload_identity_service_account = var.goog_cm_deployment_name != "" ? "${var.goog_cm_deployment_name}-${var.workload_identity_service_account}" : var.workload_identity_service_account
workload_identity_service_account = var.goog_cm_deployment_name != "" ? "${var.goog_cm_deployment_name}-${var.workload_identity_service_account}" : var.workload_identity_service_account
}

provider "kubernetes" {
Expand Down Expand Up @@ -92,16 +92,16 @@ provider "helm" {
}

module "gcs" {
source = "github.com/GoogleCloudPlatform/ai-on-gke//modules/gcs"
source = "../../modules/gcs"
count = var.create_gcs_bucket ? 1 : 0
project_id = var.project_id
bucket_name = var.gcs_bucket
}

# create namespace
module "namespace" {
source = "github.com/GoogleCloudPlatform/ai-on-gke//modules/kubernetes-namespace"
providers = { helm = helm.jupyter}
source = "../../modules/kubernetes-namespace"
providers = { helm = helm.jupyter }
namespace = var.kubernetes_namespace
create_namespace = true
}
Expand All @@ -118,7 +118,7 @@ resource "google_project_service" "project_service" {

# Creates jupyterhub
module "jupyterhub" {
source = "github.com/GoogleCloudPlatform/ai-on-gke//modules/jupyter"
source = "../../modules/jupyter"
providers = { helm = helm.jupyter, kubernetes = kubernetes.jupyter }
project_id = var.project_id
namespace = var.kubernetes_namespace
Expand Down
18 changes: 9 additions & 9 deletions applications/jupyter/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ variable "gcs_bucket" {
variable "workload_identity_service_account" {
type = string
description = "workload identity service account"
default = "jupyter-service-account"
default = "jupyter-service-account"
}

variable "project_id" {
Expand Down Expand Up @@ -175,13 +175,13 @@ variable "cpu_pools" {
accelerator_count = optional(number, 0)
}))
default = [{
name = "cpu-pool"
machine_type = "n1-standard-16"
autoscaling = true
min_count = 1
max_count = 3
disk_size_gb = 100
disk_type = "pd-standard"
name = "cpu-pool"
machine_type = "n1-standard-16"
autoscaling = true
min_count = 1
max_count = 3
disk_size_gb = 100
disk_type = "pd-standard"
}]
}

Expand Down Expand Up @@ -214,6 +214,6 @@ variable "gpu_pools" {
}

variable "goog_cm_deployment_name" {
type = string
type = string
default = ""
}
25 changes: 12 additions & 13 deletions applications/rag/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ data "google_project" "project" {
}

module "infra" {
source = "github.com/GoogleCloudPlatform/ai-on-gke//infrastructure?ref=infralocation"
source = "../../infrastructure"
count = var.create_cluster ? 1 : 0

project_id = var.project_id
Expand Down Expand Up @@ -62,7 +62,7 @@ locals {
locals {
ray_service_account = var.goog_cm_deployment_name != "" ? "${var.goog_cm_deployment_name}-${var.ray_service_account}" : var.ray_service_account
jupyter_service_account = var.goog_cm_deployment_name != "" ? "${var.goog_cm_deployment_name}-${var.jupyter_service_account}" : var.jupyter_service_account
rag_service_account = var.goog_cm_deployment_name != "" ? "${var.goog_cm_deployment_name}-${var.rag_service_account}" : var.rag_service_account
rag_service_account = var.goog_cm_deployment_name != "" ? "${var.goog_cm_deployment_name}-${var.rag_service_account}" : var.rag_service_account
}


Expand Down Expand Up @@ -97,14 +97,14 @@ provider "helm" {
}

module "namespace" {
source = "github.com/GoogleCloudPlatform/ai-on-gke//modules/kubernetes-namespace"
providers = { helm = helm.rag}
source = "../../modules/kubernetes-namespace"
providers = { helm = helm.rag }
create_namespace = true
namespace = var.kubernetes_namespace
}

module "kuberay-operator" {
source = "github.com/GoogleCloudPlatform/ai-on-gke//modules/kuberay-operator?ref=mp-optimise"
source = "../../modules/kuberay-operator"
providers = { helm = helm.rag, kubernetes = kubernetes.rag }
name = "kuberay-operator"
project_id = var.project_id
Expand All @@ -116,7 +116,7 @@ module "kuberay-operator" {
}

module "gcs" {
source = "github.com/GoogleCloudPlatform/ai-on-gke//modules/gcs"
source = "../../modules/gcs"
count = var.create_gcs_bucket ? 1 : 0
project_id = var.project_id
bucket_name = var.gcs_bucket
Expand All @@ -143,7 +143,7 @@ resource "google_project_service" "project_service" {
}

module "jupyterhub" {
source = "github.com/GoogleCloudPlatform/ai-on-gke//modules/jupyter"
source = "../../modules/jupyter"
providers = { helm = helm.rag, kubernetes = kubernetes.rag }
namespace = var.kubernetes_namespace
project_id = var.project_id
Expand Down Expand Up @@ -171,18 +171,17 @@ module "jupyterhub" {
}

module "kuberay-logging" {
source = "github.com/GoogleCloudPlatform/ai-on-gke//modules/kuberay-logging"
source = "../../modules/kuberay-logging"
providers = { kubernetes = kubernetes.rag }
namespace = var.kubernetes_namespace
depends_on = [module.namespace]
}

module "kuberay-cluster" {
source = "github.com/GoogleCloudPlatform/ai-on-gke//modules/kuberay-cluster"
source = "../../modules/kuberay-cluster"
providers = { helm = helm.rag, kubernetes = kubernetes.rag }
project_id = var.project_id
namespace = var.kubernetes_namespace
create_namespace = true
enable_gpu = true
gcs_bucket = var.gcs_bucket
enable_tpu = local.enable_tpu
Expand All @@ -195,19 +194,19 @@ module "kuberay-cluster" {
}

module "kuberay-monitoring" {
source = "github.com/GoogleCloudPlatform/ai-on-gke//modules/kuberay-monitoring"
source = "../../modules/kuberay-monitoring"
providers = { helm = helm.rag, kubernetes = kubernetes.rag }
project_id = var.project_id
namespace = var.kubernetes_namespace
create_namespace = true
enable_grafana_on_ray_dashboard = var.enable_grafana_on_ray_dashboard
k8s_service_account = local.ray_service_account
# TODO(umeshkumhar): remove kuberay-operator depends, figure out service account dependency
depends_on = [module.namespace, module.kuberay-operator]
depends_on = [module.namespace, module.kuberay-operator]
}

module "inference-server" {
source = "github.com/GoogleCloudPlatform/ai-on-gke//tutorials/hf-tgi"
source = "../../tutorials/hf-tgi"
providers = { kubernetes = kubernetes.rag }
namespace = var.kubernetes_namespace
autopilot_cluster = local.enable_autopilot
Expand Down
16 changes: 8 additions & 8 deletions applications/rag/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -306,13 +306,13 @@ variable "cpu_pools" {
accelerator_count = optional(number, 0)
}))
default = [{
name = "cpu-pool"
machine_type = "n1-standard-16"
autoscaling = true
min_count = 1
max_count = 3
disk_size_gb = 100
disk_type = "pd-standard"
name = "cpu-pool"
machine_type = "n1-standard-16"
autoscaling = true
min_count = 1
max_count = 3
disk_size_gb = 100
disk_type = "pd-standard"
}]
}

Expand Down Expand Up @@ -369,6 +369,6 @@ variable "gpu_pools" {
}

variable "goog_cm_deployment_name" {
type = string
type = string
default = ""
}
29 changes: 14 additions & 15 deletions applications/ray/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ data "google_project" "project" {


module "infra" {
source = "github.com/GoogleCloudPlatform/ai-on-gke//infrastructure?ref=infralocation"
source = "../../infrastructure"
count = var.create_cluster ? 1 : 0

project_id = var.project_id
cluster_name = var.cluster_name
cluster_location = var.cluster_location
cluster_location = var.cluster_location
autopilot_cluster = var.autopilot_cluster
private_cluster = var.private_cluster
create_network = false
Expand Down Expand Up @@ -61,7 +61,7 @@ locals {
}

locals {
workload_identity_service_account = var.goog_cm_deployment_name != "" ? "${var.goog_cm_deployment_name}-${var.workload_identity_service_account}" : var.workload_identity_service_account
workload_identity_service_account = var.goog_cm_deployment_name != "" ? "${var.goog_cm_deployment_name}-${var.workload_identity_service_account}" : var.workload_identity_service_account
}

provider "kubernetes" {
Expand Down Expand Up @@ -95,15 +95,15 @@ provider "helm" {
}

module "namespace" {
source = "github.com/GoogleCloudPlatform/ai-on-gke//modules/kubernetes-namespace"
providers = { helm = helm.ray}
source = "../../modules/kubernetes-namespace"
providers = { helm = helm.ray }
create_namespace = true
namespace = var.kubernetes_namespace
}

module "kuberay-operator" {
source = "github.com/GoogleCloudPlatform/ai-on-gke//modules/kuberay-operator?ref=mp-optimise"
providers = { helm = helm.ray, kubernetes = kubernetes.ray}
source = "../../modules/kuberay-operator"
providers = { helm = helm.ray, kubernetes = kubernetes.ray }
name = "kuberay-operator"
create_namespace = true
namespace = var.kubernetes_namespace
Expand All @@ -114,17 +114,17 @@ module "kuberay-operator" {
}

module "kuberay-logging" {
source = "github.com/GoogleCloudPlatform/ai-on-gke//modules/kuberay-logging"
providers = { kubernetes = kubernetes.ray}
source = "../../modules/kuberay-logging"
providers = { kubernetes = kubernetes.ray }
namespace = var.kubernetes_namespace

depends_on = [module.namespace]
}

module "kuberay-monitoring" {
count = var.create_ray_cluster ? 1 : 0
source = "github.com/GoogleCloudPlatform/ai-on-gke//modules/kuberay-monitoring"
providers = { helm = helm.ray, kubernetes = kubernetes.ray}
source = "../../modules/kuberay-monitoring"
providers = { helm = helm.ray, kubernetes = kubernetes.ray }
project_id = var.project_id
namespace = var.kubernetes_namespace
create_namespace = true
Expand All @@ -134,18 +134,17 @@ module "kuberay-monitoring" {
}

module "gcs" {
source = "github.com/GoogleCloudPlatform/ai-on-gke//modules/gcs"
source = "../../modules/gcs"
count = var.create_gcs_bucket ? 1 : 0
project_id = var.project_id
bucket_name = var.gcs_bucket
}

module "kuberay-cluster" {
count = var.create_ray_cluster == true ? 1 : 0
source = "github.com/GoogleCloudPlatform/ai-on-gke//modules/kuberay-cluster"
providers = { helm = helm.ray, kubernetes = kubernetes.ray}
source = "../../modules/kuberay-cluster"
providers = { helm = helm.ray, kubernetes = kubernetes.ray }
namespace = var.kubernetes_namespace
create_namespace = true
project_id = var.project_id
enable_tpu = local.enable_tpu
enable_gpu = var.enable_gpu
Expand Down
19 changes: 10 additions & 9 deletions applications/ray/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ variable "create_service_account" {
variable "workload_identity_service_account" {
type = string
description = "Google Cloud IAM service account for authenticating with GCP services for GCS"
default = "ray-service-account"
}

variable "create_ray_cluster" {
Expand Down Expand Up @@ -119,13 +120,13 @@ variable "cpu_pools" {
accelerator_count = optional(number, 0)
}))
default = [{
name = "cpu-pool"
machine_type = "n1-standard-16"
autoscaling = true
min_count = 1
max_count = 3
disk_size_gb = 100
disk_type = "pd-standard"
name = "cpu-pool"
machine_type = "n1-standard-16"
autoscaling = true
min_count = 1
max_count = 3
disk_size_gb = 100
disk_type = "pd-standard"
}]
}

Expand Down Expand Up @@ -165,10 +166,10 @@ variable "gpu_pools" {
accelerator_count = 2
accelerator_type = "nvidia-tesla-t4"
gpu_driver_version = "DEFAULT"
}]
}]
}

variable "goog_cm_deployment_name" {
type = string
type = string
default = ""
}
4 changes: 2 additions & 2 deletions applications/ray/workloads.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ ray_namespace = "ml"

# Creates a google service account & k8s service account & configures workload identity with appropriate permissions.
# Set to false & update the variable `gcp_service_account` to use an existing IAM service account.
create_service_account = true
workload_identity_service_account = "ray-service-account"
create_service_account = true
workload_identity_service_account = "ray-service-account"

# Bucket name should be globally unique.
create_gcs_bucket = true
Expand Down
14 changes: 7 additions & 7 deletions infrastructure/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,13 @@ variable "cpu_pools" {
accelerator_count = optional(number, 0)
}))
default = [{
name = "cpu-pool"
machine_type = "n1-standard-16"
autoscaling = true
min_count = 1
max_count = 3
disk_size_gb = 100
disk_type = "pd-standard"
name = "cpu-pool"
machine_type = "n1-standard-16"
autoscaling = true
min_count = 1
max_count = 3
disk_size_gb = 100
disk_type = "pd-standard"
}]
}

Expand Down
2 changes: 1 addition & 1 deletion modules/kuberay-operator/kuberay.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module "kuberay-workload-identity" {
namespace = var.namespace
project_id = var.project_id
roles = ["roles/cloudsql.client", "roles/monitoring.viewer"]
depends_on = [helm_release.kuberay-operator]
depends_on = [helm_release.kuberay-operator]
}

resource "kubernetes_secret_v1" "service_account_token" {
Expand Down

0 comments on commit 26c3c3e

Please sign in to comment.