Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from kubeflow:master #9

Merged
merged 8 commits into from
Mar 24, 2022
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ commonLabels:
images:
- name: public.ecr.aws/j1r0q0g6/notebooks/admission-webhook
newName: public.ecr.aws/j1r0q0g6/notebooks/admission-webhook
newTag: v1.5.0-rc.0
newTag: v1.5.0
namespace: kubeflow
generatorOptions:
disableNameSuffixHash: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,12 @@ data:
{
"text": "MiniKF",
"desc": "A fast and easy way to deploy Kubeflow locally",
"link": "https://www.kubeflow.org/docs/started/getting-started-minikf/"
"link": "https://www.kubeflow.org/docs/distributions/minikf/"
},
{
"text": "Microk8s for Kubeflow",
"desc": "Quickly get Kubeflow running locally on native hypervisors",
"link": "https://www.kubeflow.org/docs/started/getting-started-multipass/"
},
{
"text": "Minikube for Kubeflow",
"desc": "Quickly get Kubeflow running locally",
"link": "https://www.kubeflow.org/docs/started/getting-started-minikube/"
"link": "https://www.kubeflow.org/docs/distributions/microk8s/kubeflow-on-microk8s/"
},
{
"text": "Kubeflow on GCP",
Expand Down
9 changes: 2 additions & 7 deletions components/centraldashboard/manifests/base/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,12 @@ data:
{
"text": "MiniKF",
"desc": "A fast and easy way to deploy Kubeflow locally",
"link": "https://www.kubeflow.org/docs/started/getting-started-minikf/"
"link": "https://www.kubeflow.org/docs/distributions/minikf/"
},
{
"text": "Microk8s for Kubeflow",
"desc": "Quickly get Kubeflow running locally on native hypervisors",
"link": "https://www.kubeflow.org/docs/started/getting-started-multipass/"
},
{
"text": "Minikube for Kubeflow",
"desc": "Quickly get Kubeflow running locally",
"link": "https://www.kubeflow.org/docs/started/getting-started-minikube/"
"link": "https://www.kubeflow.org/docs/distributions/microk8s/kubeflow-on-microk8s/"
},
{
"text": "Kubeflow on GCP",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ commonLabels:
images:
- name: public.ecr.aws/j1r0q0g6/notebooks/central-dashboard
newName: public.ecr.aws/j1r0q0g6/notebooks/central-dashboard
newTag: v1.5.0-rc.0
newTag: v1.5.0
configMapGenerator:
- envs:
- params.env
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../istio

commonLabels:
kustomize.component: centraldashboard
app: centraldashboard
app.kubernetes.io/component: centraldashboard
app.kubernetes.io/name: centraldashboard

patchesStrategicMerge:
- patches/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
apiVersion: v1
data:
settings: |-
{
"DASHBOARD_FORCE_IFRAME": true
}
links: |-
{
"menuLinks": [
{
"type": "item",
"link": "/jupyter/",
"text": "Notebooks",
"icon": "book"
},
{
"type": "item",
"link": "/tensorboards/",
"text": "Tensorboards",
"icon": "assessment"
},
{
"type": "item",
"link": "/volumes/",
"text": "Volumes",
"icon": "device:storage"
},
{
"type": "item",
"link": "/kserve-endpoints/",
"text": "Models",
"icon": "kubeflow:models"
},
{
"type": "item",
"link": "/katib/",
"text": "Experiments (AutoML)",
"icon": "kubeflow:katib"
},
{
"type": "item",
"text": "Experiments (KFP)",
"link": "/pipeline/#/experiments",
"icon": "done-all"
},
{
"type": "item",
"link": "/pipeline/#/pipelines",
"text": "Pipelines",
"icon": "kubeflow:pipeline-centered"
},
{
"type": "item",
"link": "/pipeline/#/runs",
"text": "Runs",
"icon": "maps:directions-run"
},
{
"type": "item",
"link": "/pipeline/#/recurringruns",
"text": "Recurring Runs",
"icon": "device:access-alarm"
},
{
"type": "item",
"link": "/pipeline/#/artifacts",
"text": "Artifacts",
"icon": "editor:bubble-chart"
},
{
"type": "item",
"link": "/pipeline/#/executions",
"text": "Executions",
"icon": "av:play-arrow"
}
],
"externalLinks": [ ],
"quickLinks": [
{
"text": "Upload a pipeline",
"desc": "Pipelines",
"link": "/pipeline/"
},
{
"text": "View all pipeline runs",
"desc": "Pipelines",
"link": "/pipeline/#/runs"
},
{
"text": "Create a new Notebook server",
"desc": "Notebook Servers",
"link": "/jupyter/new?namespace=kubeflow"
},
{
"text": "View Katib Experiments",
"desc": "Katib",
"link": "/katib/"
}
],
"documentationItems": [
{
"text": "Getting Started with Kubeflow",
"desc": "Get your machine-learning workflow up and running on Kubeflow",
"link": "https://www.kubeflow.org/docs/started/getting-started/"
},
{
"text": "MiniKF",
"desc": "A fast and easy way to deploy Kubeflow locally",
"link": "https://www.kubeflow.org/docs/distributions/minikf/"
},
{
"text": "Microk8s for Kubeflow",
"desc": "Quickly get Kubeflow running locally on native hypervisors",
"link": "https://www.kubeflow.org/docs/distributions/microk8s/kubeflow-on-microk8s/"
},
{
"text": "Kubeflow on GCP",
"desc": "Running Kubeflow on Kubernetes Engine and Google Cloud Platform",
"link": "https://www.kubeflow.org/docs/gke/"
},
{
"text": "Kubeflow on AWS",
"desc": "Running Kubeflow on Elastic Container Service and Amazon Web Services",
"link": "https://www.kubeflow.org/docs/aws/"
},
{
"text": "Requirements for Kubeflow",
"desc": "Get more detailed information about using Kubeflow and its components",
"link": "https://www.kubeflow.org/docs/started/requirements/"
}
]
}
kind: ConfigMap
metadata:
name: centraldashboard-config
4 changes: 2 additions & 2 deletions components/common/reconcilehelper/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ func CopyStatefulSetFields(from, to *appsv1.StatefulSet) bool {
}
to.Annotations = from.Annotations

if from.Spec.Replicas != to.Spec.Replicas {
to.Spec.Replicas = from.Spec.Replicas
if *from.Spec.Replicas != *to.Spec.Replicas {
*to.Spec.Replicas = *from.Spec.Replicas
requireUpdate = true
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@
spawnerFormDefaults:
image:
# The container Image for the user's Jupyter Notebook
value: public.ecr.aws/j1r0q0g6/notebooks/notebook-servers/jupyter-scipy:v1.5.0-rc.0
value: public.ecr.aws/j1r0q0g6/notebooks/notebook-servers/jupyter-scipy:v1.5.0
# The list of available standard container Images
options:
- public.ecr.aws/j1r0q0g6/notebooks/notebook-servers/jupyter-scipy:v1.5.0-rc.0
- public.ecr.aws/j1r0q0g6/notebooks/notebook-servers/jupyter-pytorch-full:v1.5.0-rc.0
- public.ecr.aws/j1r0q0g6/notebooks/notebook-servers/jupyter-pytorch-cuda-full:v1.5.0-rc.0
- public.ecr.aws/j1r0q0g6/notebooks/notebook-servers/jupyter-tensorflow-full:v1.5.0-rc.0
- public.ecr.aws/j1r0q0g6/notebooks/notebook-servers/jupyter-tensorflow-cuda-full:v1.5.0-rc.0
- public.ecr.aws/j1r0q0g6/notebooks/notebook-servers/jupyter-scipy:v1.5.0
- public.ecr.aws/j1r0q0g6/notebooks/notebook-servers/jupyter-pytorch-full:v1.5.0
- public.ecr.aws/j1r0q0g6/notebooks/notebook-servers/jupyter-pytorch-cuda-full:v1.5.0
- public.ecr.aws/j1r0q0g6/notebooks/notebook-servers/jupyter-tensorflow-full:v1.5.0
- public.ecr.aws/j1r0q0g6/notebooks/notebook-servers/jupyter-tensorflow-cuda-full:v1.5.0
imageGroupOne:
# The container Image for the user's Group One Server
# The annotation `notebooks.kubeflow.org/http-rewrite-uri: /`
# is applied to notebook in this group, configuring
# the Istio rewrite for containers that host their web UI at `/`
value: public.ecr.aws/j1r0q0g6/notebooks/notebook-servers/codeserver-python:v1.5.0-rc.0
value: public.ecr.aws/j1r0q0g6/notebooks/notebook-servers/codeserver-python:v1.5.0
# The list of available standard container Images
options:
- public.ecr.aws/j1r0q0g6/notebooks/notebook-servers/codeserver-python:v1.5.0-rc.0
- public.ecr.aws/j1r0q0g6/notebooks/notebook-servers/codeserver-python:v1.5.0
imageGroupTwo:
# The container Image for the user's Group Two Server
# The annotation `notebooks.kubeflow.org/http-rewrite-uri: /`
Expand All @@ -42,10 +42,10 @@ spawnerFormDefaults:
# The annotation `notebooks.kubeflow.org/http-headers-request-set`
# is applied to notebook in this group, configuring Istio
# to add the `X-RStudio-Root-Path` header to requests
value: public.ecr.aws/j1r0q0g6/notebooks/notebook-servers/rstudio-tidyverse:v1.5.0-rc.0
value: public.ecr.aws/j1r0q0g6/notebooks/notebook-servers/rstudio-tidyverse:v1.5.0
# The list of available standard container Images
options:
- public.ecr.aws/j1r0q0g6/notebooks/notebook-servers/rstudio-tidyverse:v1.5.0-rc.0
- public.ecr.aws/j1r0q0g6/notebooks/notebook-servers/rstudio-tidyverse:v1.5.0
# If true, hide registry and/or tag name in the image selection dropdown
hideRegistry: true
hideTag: false
Expand Down Expand Up @@ -86,7 +86,7 @@ spawnerFormDefaults:
requests:
storage: 10Gi
accessModes:
- ReadWriteOnce
- ReadWriteOnce
readOnly: false
dataVolumes:
# List of additional Data Volumes to be attached to the user's Notebook
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ commonLabels:
images:
- name: public.ecr.aws/j1r0q0g6/notebooks/jupyter-web-app
newName: public.ecr.aws/j1r0q0g6/notebooks/jupyter-web-app
newTag: v1.5.0-rc.0
newTag: v1.5.0
# We need the name to be unique without the suffix because the original name is what
# gets used with patches
configMapGenerator:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ commonLabels:
images:
- name: public.ecr.aws/j1r0q0g6/notebooks/tensorboards-web-app
newName: public.ecr.aws/j1r0q0g6/notebooks/tensorboards-web-app
newTag: v1.5.0-rc.0
newTag: v1.5.0
# We need the name to be unique without the suffix because the original name is what
# gets used with patches
configMapGenerator:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ commonLabels:
images:
- name: public.ecr.aws/j1r0q0g6/notebooks/volumes-web-app
newName: public.ecr.aws/j1r0q0g6/notebooks/volumes-web-app
newTag: v1.5.0-rc.0
newTag: v1.5.0
# We need the name to be unique without the suffix because the original name is what
# gets used with patches
configMapGenerator:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ resources:
images:
- name: public.ecr.aws/j1r0q0g6/notebooks/notebook-controller
newName: public.ecr.aws/j1r0q0g6/notebooks/notebook-controller
newTag: v1.5.0-rc.0
newTag: v1.5.0
39 changes: 29 additions & 10 deletions components/notebook-controller/controllers/notebook_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ const DefaultServingPort = 80
const AnnotationRewriteURI = "notebooks.kubeflow.org/http-rewrite-uri"
const AnnotationHeadersRequestSet = "notebooks.kubeflow.org/http-headers-request-set"

const PrefixEnvVar = "NB_PREFIX"

// The default fsGroup of PodSecurityContext.
// https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.11/#podsecuritycontext-v1-core
const DefaultFSGroup = int64(100)
Expand Down Expand Up @@ -286,11 +288,11 @@ func (r *NotebookReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) {
// Pod is found
// Check if the Notebook needs to be stopped
// Update the LAST_ACTIVITY_ANNOTATION
culler.UpdateNotebookLastActivityAnnotation(&instance.ObjectMeta)

err = r.Update(ctx, instance)
if err != nil {
return ctrl.Result{}, err
if culler.UpdateNotebookLastActivityAnnotation(&instance.ObjectMeta) {
err = r.Update(ctx, instance)
if err != nil {
return ctrl.Result{}, err
}
}

// Check if the Notebook needs to be stopped
Expand Down Expand Up @@ -341,6 +343,22 @@ func getNextCondition(cs corev1.ContainerState) v1beta1.NotebookCondition {
return newCondition
}

func setPrefixEnvVar(instance *v1beta1.Notebook, container *corev1.Container) {
prefix := "/notebook/" + instance.Namespace + "/" + instance.Name

for _, envVar := range container.Env {
if envVar.Name == PrefixEnvVar {
envVar.Value = prefix
return
}
}

container.Env = append(container.Env, corev1.EnvVar{
Name: PrefixEnvVar,
Value: prefix,
})
}

func generateStatefulSet(instance *v1beta1.Notebook) *appsv1.StatefulSet {
replicas := int32(1)
if culler.StopAnnotationIsSet(instance.ObjectMeta) {
Expand All @@ -364,7 +382,7 @@ func generateStatefulSet(instance *v1beta1.Notebook) *appsv1.StatefulSet {
"statefulset": instance.Name,
"notebook-name": instance.Name,
}},
Spec: instance.Spec.Template.Spec,
Spec: *instance.Spec.Template.Spec.DeepCopy(),
},
},
}
Expand All @@ -388,10 +406,8 @@ func generateStatefulSet(instance *v1beta1.Notebook) *appsv1.StatefulSet {
},
}
}
container.Env = append(container.Env, corev1.EnvVar{
Name: "NB_PREFIX",
Value: "/notebook/" + instance.Namespace + "/" + instance.Name,
})

setPrefixEnvVar(instance, container)

// For some platforms (like OpenShift), adding fsGroup: 100 is troublesome.
// This allows for those platforms to bypass the automatic addition of the fsGroup
Expand Down Expand Up @@ -694,6 +710,9 @@ func (r *NotebookReconciler) SetupWithManager(mgr ctrl.Manager) error {
CreateFunc: func(e event.CreateEvent) bool {
return checkEvent(e.Object, e.Meta)
},
DeleteFunc: func(e event.DeleteEvent) bool {
return false
},
GenericFunc: func(e event.GenericEvent) bool {
return checkEvent(e.Object, e.Meta)
},
Expand Down
Loading