Skip to content

Commit

Permalink
test(ws): add e2e tests (#30)
Browse files Browse the repository at this point in the history
* test(ws): add e2e tests

Signed-off-by: Adem Baccara <71262172+Adembc@users.noreply.github.com>

* mathew updates 1

Signed-off-by: Mathew Wicks <5735406+thesuperzapper@users.noreply.github.com>

* mathew updates 2

Signed-off-by: Mathew Wicks <5735406+thesuperzapper@users.noreply.github.com>

---------

Signed-off-by: Adem Baccara <71262172+Adembc@users.noreply.github.com>
Signed-off-by: Mathew Wicks <5735406+thesuperzapper@users.noreply.github.com>
Co-authored-by: Mathew Wicks <5735406+thesuperzapper@users.noreply.github.com>
  • Loading branch information
Adembc and thesuperzapper authored Aug 6, 2024
1 parent 50fda65 commit 12610f0
Show file tree
Hide file tree
Showing 16 changed files with 425 additions and 174 deletions.
2 changes: 0 additions & 2 deletions workspaces/controller/api/v1beta1/workspacekind_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,6 @@ type ImageConfigValue struct {
Redirect *OptionRedirect `json:"redirect,omitempty"`

// the spec of the image config
//+kubebuilder:validation:XValidation:rule="self == oldSelf",message="ImageConfig 'spec' is immutable"
Spec ImageConfigSpec `json:"spec"`
}

Expand Down Expand Up @@ -396,7 +395,6 @@ type PodConfigValue struct {
Redirect *OptionRedirect `json:"redirect,omitempty"`

// the spec of the pod config
//+kubebuilder:validation:XValidation:rule="self == oldSelf",message="PodConfig 'spec' is immutable"
Spec PodConfigSpec `json:"spec"`
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2368,9 +2368,6 @@ spec:
- image
- ports
type: object
x-kubernetes-validations:
- message: ImageConfig 'spec' is immutable
rule: self == oldSelf
required:
- id
- spawner
Expand Down Expand Up @@ -3532,9 +3529,6 @@ spec:
type: object
type: array
type: object
x-kubernetes-validations:
- message: PodConfig 'spec' is immutable
rule: self == oldSelf
required:
- id
- spawner
Expand Down
6 changes: 6 additions & 0 deletions workspaces/controller/config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- manager.yaml
images:
- name: controller
newName: ghcr.io/kubeflow/notebooks/workspace-controller
newTag: latest
1 change: 1 addition & 0 deletions workspaces/controller/config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ spec:
- --health-probe-bind-address=:8081
- --metrics-bind-address=0
image: controller:latest
imagePullPolicy: IfNotPresent
name: manager
securityContext:
allowPrivilegeEscalation: false
Expand Down
8 changes: 8 additions & 0 deletions workspaces/controller/config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ rules:
- get
- list
- watch
- apiGroups:
- ""
resources:
- events
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
resources:
- workspace_data_pvc.yaml
- workspace_home_pvc.yaml
- workspace_service_account.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: workspace-data-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: workspace-home-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: default-editor
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
apiVersion: kubeflow.org/v1beta1
kind: Workspace
metadata:
name: my-workspace
namespace: default
name: jupyterlab-workspace
spec:
## if the workspace is paused (no pods running)
paused: false
Expand Down Expand Up @@ -42,7 +41,7 @@ spec:
## - the mount path is defined in the WorkspaceKind under
## `spec.podTemplate.volumeMounts.home`
##
home: "my-home-pvc"
home: "workspace-home-pvc"

## additional PVCs to mount
## - these PVC must already exist in the Namespace
Expand All @@ -51,7 +50,7 @@ spec:
## - if `readOnly` is true, the PVC must be ReadOnlyMany
##
data:
- pvcName: "my-data-pvc"
- pvcName: "workspace-data-pvc"
mountPath: "/data/my-data"
readOnly: false

Expand All @@ -65,7 +64,7 @@ spec:
## - options are defined in WorkspaceKind under
## `spec.podTemplate.options.imageConfig.values[]`
##
imageConfig: "jupyterlab_scipy_180"
imageConfig: "jupyterlab_scipy_190"

## the id of a podConfig option
## - options are defined in WorkspaceKind under
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,21 @@ spec:
## https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#probe-v1-core
##
probes:
startupProbe: {}
livenessProbe: {}
readinessProbe: {}

## startup probe for the "main" container
##
#startupProbe:
# ...

## liveness probe for the "main" container
##
#livenessProbe:
# ...

## readiness probe for the "main" container
##
#readinessProbe:
# ...

## volume mount paths
##
Expand Down Expand Up @@ -158,7 +170,7 @@ spec:
## https://github.com/kubeflow/kubeflow/blob/v1.8.0/components/example-notebook-servers/jupyter/s6/services.d/jupyterlab/run#L12
- name: "NB_PREFIX"
value: |-
{{ httpPathPrefix "juptyerlab" }}
{{ httpPathPrefix "jupyterlab" }}
## extra volume mounts for Workspace Pods (MUTABLE)
## - spec for VolumeMount:
Expand Down
9 changes: 5 additions & 4 deletions workspaces/controller/config/samples/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## Append samples of your project ##
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- v1beta1_workspace.yaml
- v1beta1_workspacekind.yaml
#+kubebuilder:scaffold:manifestskustomizesamples
- ./common
- jupyterlab_v1beta1_workspace.yaml
- jupyterlab_v1beta1_workspacekind.yaml
Loading

0 comments on commit 12610f0

Please sign in to comment.