Skip to content

Commit

Permalink
Update notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
JMGaljaard committed Sep 4, 2022
1 parent cc00faa commit 4087807
Show file tree
Hide file tree
Showing 10 changed files with 566 additions and 974 deletions.
37 changes: 37 additions & 0 deletions jupyter/terraform-dependencies/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

data "google_client_config" "default" {}

data "google_container_cluster" "testbed_cluster" {
name = var.cluster_name
location = var.project_region
}

data "kustomization_build" "training-operator" {
path = "github.com/kubeflow/manifests.git/apps/training-operator/upstream/overlays/standalone?ref=${var.kubeflow_version}"
}


resource "kustomization_resource" "training-operator" {
for_each = data.kustomization_build.training-operator.ids
manifest = data.kustomization_build.training-operator.manifests[each.value]
}

# Create NFS resource
resource "helm_release" "nfs_client_provisioner" {
name = var.nfs_provider_information.release_name
repository = var.nfs_provisioner_repo_url
chart = var.nfs_provider_information.chart_name

namespace = var.nfs_provider_information.namespace
create_namespace = true

values = [
templatefile("${path.module}/values.nfs.yaml.tpl", {
nfs_server_path = var.nfs_provider_information.server_path
image_repository = var.nfs_provider_information.image_repository
image_tag = var.nfs_provider_information.image_tag
image_policy = var.nfs_provider_information.pull_policy
nfs_size = var.nfs_provider_information.storage_size
})
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,14 @@ provider "kubernetes" {
data.google_container_cluster.fltk_cluster.master_auth[0].cluster_ca_certificate,
)
}


provider "helm" {
kubernetes {
host = "https://${data.google_container_cluster.testbed_cluster.endpoint}"
token = data.google_client_config.provider.access_token # Provided by Google data object
cluster_ca_certificate = base64decode(
data.google_container_cluster.fltk_cluster.master_auth[0].cluster_ca_certificate,
)
}
}
98 changes: 98 additions & 0 deletions jupyter/terraform-dependencies/values.nfs.yaml.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
Default values for nfs-provisioner.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

replicaCount: 1

# imagePullSecrets:

image:
repository: ${image_repository}
tag: ${image_tag}
pullPolicy: ${pull_policy}

# For a list of available arguments
# Please see https://github.com/kubernetes-incubator/external-storage/blob/master/nfs/docs/deployment.md#arguments
extraArgs: {}
# device-based-fsids: false

service:
type: ClusterIP

nfsPort: 2049
nlockmgrPort: 32803
mountdPort: 20048
rquotadPort: 875
rpcbindPort: 111
statdPort: 662
# nfsNodePort:
# nlockmgrNodePort:
# mountdNodePort:
# rquotadNodePort:
# rpcbindNodePort:
# statdNodePort:

externalIPs: []

persistence:
enabled: true

## Persistent Volume Storage Class
## If defined, storageClassName: <storageClass>
## If set to "-", storageClassName: "", which disables dynamic provisioning
## If undefined (the default) or set to null, no storageClassName spec is
## set, choosing the default provisioner. (gp2 on AWS, standard on
## GKE, AWS & OpenStack)
##
storageClass: "default"

accessMode: ReadWriteOnce
size: ${nfs_size}

## For creating the StorageClass automatically:
storageClass:
create: true

## Set a provisioner name. If unset, a name will be generated.
# provisionerName:

## Set StorageClass as the default StorageClass
## Ignored if storageClass.create is false
defaultClass: false

## Set a StorageClass name
## Ignored if storageClass.create is false
name: nfs

# set to null to prevent expansion
allowVolumeExpansion: true
## StorageClass parameters
parameters: {}

mountOptions:
- vers=3

## ReclaimPolicy field of the class, which can be either Delete or Retain
reclaimPolicy: Delete

## For RBAC support:
rbac:
create: true

## Ignored if rbac.create is true
##
serviceAccountName: default

resources: {}
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi

nodeSelector: {}

tolerations: []

affinity: {}
68 changes: 68 additions & 0 deletions jupyter/terraform-dependencies/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
variable "kubernetes_config_path" {
description = "Path of Kubernetes configuration file (change for non-default kubectl setup)"
default = "~/.kube/config"
}

variable "project_id" {
type = string
default = "qpecs-fltk-2022"
description = "Google Cloud project name to create cluster in."
}

variable "cluster_name" {
type = string
default = "fltk-testbed-cluster"
description = "Name of the GKE cluster to be deployed in project <project_id>."
}

variable "project_region" {
type = string
default = "us-central1"
description = "GKE region to deploy cluster in."
}

variable "description" {
type = string
default = "Managed by terraform FLTK testbed deployment"
}

variable "account_id" {
type = string
description = "The service account Identifier to be used to interact with Google cloud."
default = "terraform-iam-service-account"
}

variable "kubeflow_version" {
type = string
description = "Kubeflow (training operator) to install."
default = "v1.5.0"
}

variable "nfs_provider_information" {
type = object({
release_name = string
chart_name = string
namespace = string
server_path = string
image_repository = string
image_tag = string
pull_policy = string
storage_size = string
})
default = {
release_name = "nfs-client-provisioner"
chart_name = "nfs-client-provisioner"
namespace = "test"
server_path = "/mnt/kubernetes"
image_repository = "quay.io/external_storage/nfs-client-provisioner"
image_tag = "v3.1.0-k8s1.11"
pull_policy = "IfNotPresent"
storage_size = "50"
}
}

variable "nfs_provisioner_repo_url" {
description = "Repository URL to locate the utilized helm charts"
type = string
default = "https://kvaps.github.io/charts"
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ terraform {
source = "hashicorp/kubernetes"
version = ">= 1.13.1"
}

helm = {
source = "hashicorp/helm"
version = ""
}
}
required_version = "~> 1.1"
}
File renamed without changes.
2 changes: 1 addition & 1 deletion jupyter/terraform-gke/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ variable "project_id" {

variable "cluster_name" {
type = string
default = "freddie-testbed-cluster"
default = "fltk-testbed-cluster"
description = "Name of the GKE cluster to be deployed in project <project_id>."
}

Expand Down
18 changes: 0 additions & 18 deletions jupyter/terraform-kubeflow/main.tf

This file was deleted.

45 changes: 0 additions & 45 deletions jupyter/terraform-kubeflow/variables.tf

This file was deleted.

Loading

0 comments on commit 4087807

Please sign in to comment.