Skip to content

Commit

Permalink
change from IPython.lib to notebook.auth
Browse files Browse the repository at this point in the history
  • Loading branch information
tanawatpan authored May 30, 2023
1 parent 857659b commit 93d680d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 21 deletions.
2 changes: 1 addition & 1 deletion docker/jupyter.tf
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ resource "local_file" "jupyter_entrypoint" {
source /home/$HADOOP_USER/config.sh
HASHED_PASSWORD=$(python3 -c "from IPython.lib import passwd; print(passwd('$JUPYTER_PASSWORD'))")
HASHED_PASSWORD=$(python3 -c "from notebook.auth import passwd; print(passwd('$JUPYTER_PASSWORD'))")
function config_jupyter {
# Config Jupyter Lab
Expand Down
3 changes: 2 additions & 1 deletion docker/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ locals {
"findspark",
"pymongo",
"tensorflow==2.12.*",
"transformers"
"transformers",
"notebook"
]
}
}
Expand Down
24 changes: 5 additions & 19 deletions kubernetes/jupyter.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,6 @@ resource "kubectl_manifest" "nvidia_driver_installer" {
wait_for_rollout = true
}

resource "kubernetes_persistent_volume_claim" "jupyter_notebooks" {
wait_until_bound = false

metadata {
name = "jupyter-notebooks"
namespace = kubernetes_namespace.hadoop.metadata.0.name
}

spec {
storage_class_name = "standard-rwo"
access_modes = ["ReadWriteOnce"]
resources {
requests = {
storage = "1Gi"
}
}
}
}

resource "kubernetes_stateful_set_v1" "jupyter" {
metadata {
name = "jupyter"
Expand Down Expand Up @@ -103,6 +84,11 @@ resource "kubernetes_stateful_set_v1" "jupyter" {
name = "jupyter"
image = "${local.jupyter.image_name}:${local.jupyter.version}"

env {
name = "JUPYTER_PASSWORD"
value = var.jupyter_password
}

env {
name = "SPARK_DRIVER_MEMORY"
value = "4g"
Expand Down
6 changes: 6 additions & 0 deletions kubernetes/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,9 @@ variable "hive_metastore_mysql_password" {
sensitive = true
description = "Hive Metastore Mysql Password"
}

variable "jupyter_password" {
type = string
sensitive = true
description = "Jupyter password"
}

0 comments on commit 93d680d

Please sign in to comment.