Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[flake8]
max-line-length = 100
2 changes: 1 addition & 1 deletion .github/workflows/nb_controller_unit_test.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run Notebook Controller unit tests
name: Notebook Controller unit tests
on:
pull_request:
paths:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pvcviewer_controller_unit_test.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run PVCViewer Controller unit tests
name: PVCViewer Controller unit tests
on:
pull_request:
paths:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tb_controller_unit_test.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run TensorBoard Controller unit tests
name: TensorBoard Controller unit tests
on:
pull_request:
paths:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ spawnerFormDefaults:

# the list of available container images in the dropdown
options:
- ghcr.io/kubeflow/kubeflow/notebook-servers/jupyter-scipy:latest
- ghcr.io/kubeflow/kubeflow/notebook-servers/jupyter-pytorch-full:latest
- ghcr.io/kubeflow/kubeflow/notebook-servers/jupyter-pytorch-cuda-full:latest
- ghcr.io/kubeflow/kubeflow/notebook-servers/jupyter-pytorch-gaudi-full:latest
- ghcr.io/kubeflow/kubeflow/notebook-servers/jupyter-tensorflow-full:latest
- ghcr.io/kubeflow/kubeflow/notebook-servers/jupyter-tensorflow-cuda-full:latest
- ghcr.io/kubeflow/kubeflow/notebook-servers/jupyter-scipy:latest
- ghcr.io/kubeflow/kubeflow/notebook-servers/jupyter-pytorch-full:latest
- ghcr.io/kubeflow/kubeflow/notebook-servers/jupyter-pytorch-cuda-full:latest
- ghcr.io/kubeflow/kubeflow/notebook-servers/jupyter-pytorch-gaudi-full:latest
- ghcr.io/kubeflow/kubeflow/notebook-servers/jupyter-tensorflow-full:latest
- ghcr.io/kubeflow/kubeflow/notebook-servers/jupyter-tensorflow-cuda-full:latest

################################################################
# VSCode-like Container Images (Group 1)
Expand All @@ -65,7 +65,7 @@ spawnerFormDefaults:

# the list of available container images in the dropdown
options:
- ghcr.io/kubeflow/kubeflow/notebook-servers/codeserver-python:latest
- ghcr.io/kubeflow/kubeflow/notebook-servers/codeserver-python:latest

################################################################
# RStudio-like Container Images (Group 2)
Expand All @@ -86,7 +86,7 @@ spawnerFormDefaults:

# the list of available container images in the dropdown
options:
- ghcr.io/kubeflow/kubeflow/notebook-servers/rstudio-tidyverse:latest
- ghcr.io/kubeflow/kubeflow/notebook-servers/rstudio-tidyverse:latest

################################################################
# CPU Resources
Expand Down Expand Up @@ -131,12 +131,12 @@ spawnerFormDefaults:
# `limitsKey` - what will be set as the actual limit
# `uiName` - what will be displayed in the dropdown UI
vendors:
- limitsKey: "nvidia.com/gpu"
uiName: "NVIDIA"
- limitsKey: "amd.com/gpu"
uiName: "AMD"
- limitsKey: "habana.ai/gaudi"
uiName: "Intel Gaudi"
- limitsKey: "nvidia.com/gpu"
uiName: "NVIDIA"
- limitsKey: "amd.com/gpu"
uiName: "AMD"
- limitsKey: "habana.ai/gaudi"
uiName: "Intel Gaudi"

# the default value of the limit
# (possible values: "none", "1", "2", "4", "8")
Expand Down Expand Up @@ -165,7 +165,7 @@ spawnerFormDefaults:
requests:
storage: 5Gi
accessModes:
- ReadWriteOnce
- ReadWriteOnce

################################################################
# Data Volumes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spec:
spec:
containers:
- name: tensorboards-web-app
image: ghcr.io/kubeflow/kubeflow/tensorboards-web-app
image: ghcr.io/kubeflow/notebooks/tensorboards-web-app
ports:
- containerPort: 5000
env:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ commonLabels:
app: tensorboards-web-app
kustomize.component: tensorboards-web-app
images:
- name: ghcr.io/kubeflow/kubeflow/tensorboards-web-app
newName: ghcr.io/kubeflow/kubeflow/tensorboards-web-app
- name: ghcr.io/kubeflow/notebooks/tensorboards-web-app
newName: ghcr.io/kubeflow/notebooks/tensorboards-web-app
newTag: latest
# We need the name to be unique without the suffix because the original name is what
# gets used with patches
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spec:
spec:
containers:
- name: volumes-web-app
image: ghcr.io/kubeflow/kubeflow/volumes-web-app
image: ghcr.io/kubeflow/notebooks/volumes-web-app
ports:
- containerPort: 5000
env:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ commonLabels:
app: volumes-web-app
kustomize.component: volumes-web-app
images:
- name: ghcr.io/kubeflow/kubeflow/volumes-web-app
newName: ghcr.io/kubeflow/kubeflow/volumes-web-app
- name: ghcr.io/kubeflow/notebooks/volumes-web-app
newName: ghcr.io/kubeflow/notebooks/volumes-web-app
newTag: latest
# We need the name to be unique without the suffix because the original name is what
# gets used with patches
Expand Down
14 changes: 13 additions & 1 deletion components/notebook-controller/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,19 @@ RUN cd /workspace/notebook-controller && go mod download
# Force download and extract all HashiCorp modules so they exist under /go/pkg/mod
RUN set -e; cd /workspace/notebook-controller; \
for m in $(go list -m all | awk '/^github.com\/hashicorp\// {print $1 "@" $2}'); do \
go mod download "$m"; \
# download with retry (these downloads are flakey) \
for i in $(seq 1 5); do \
if go mod download "$m"; then \
echo "INFO: Successfully downloaded $m"; \
break; \
fi; \
if [ $i -eq 5 ]; then \
echo "ERROR: Failed to download $m after $i attempts"; \
exit 1; \
fi; \
echo "WARN: Retrying download of $m (attempt $i)"; \
sleep $((i * 2)); \
done; \
pkg="${m%@*}"; \
go list "$pkg/..." >/dev/null 2>&1 || true; \
done
Expand Down
74 changes: 45 additions & 29 deletions components/notebook-controller/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ ARCH ?= linux/amd64
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
CRD_OPTIONS ?= "crd"

# The version of Kubernetes to use for envtest.
ENVTEST_K8S_VERSION = 1.31.0

# Based on recommendation https://sdk.operatorframework.io/docs/building-operators/golang/references/envtest-setup/
ENVTEST_ASSETS_DIR=$(shell pwd)/testbin

Expand Down Expand Up @@ -44,10 +47,6 @@ help: ## Display this help.

##@ Development

.PHONY: check-license
check-license: ## Check third-party license
./third_party/check-license.sh

.PHONY: manifests
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) rbac:roleName=role crd:maxDescLen=0 webhook paths="./..." output:crd:artifacts:config=config/crd/bases
Expand Down Expand Up @@ -100,15 +99,10 @@ docker-push: ## Push docker image with the manager.
docker-build-multi-arch: ## Build multi-arch docker images with docker buildx
cd .. && docker buildx build --load --platform ${ARCH} --tag ${IMG}:${TAG} -f ./notebook-controller/Dockerfile .


.PHONY: docker-build-push-multi-arch
docker-build-push-multi-arch: ## Build multi-arch docker images with docker buildx and push to docker registry
cd .. && docker buildx build --platform ${ARCH} --tag ${IMG}:${TAG} --push -f ./notebook-controller/Dockerfile .


.PHONY: image
image: docker-build docker-push ## Build and push docker image with the manager.

##@ Deployment

ifndef ignore-not-found
Expand All @@ -133,29 +127,51 @@ deploy: docker-build docker-push manifests kustomize ## Deploy controller to the
undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
$(KUSTOMIZE) build config/base | kubectl delete --ignore-not-found=$(ignore-not-found) -f -

CONTROLLER_GEN = $(shell pwd)/bin/controller-gen
.PHONY: controller-gen
controller-gen: ## Download controller-gen locally if necessary.
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.14.0)
##@ Dependencies

## Location to install dependencies to
LOCALBIN ?= $(shell pwd)/bin
$(LOCALBIN):
mkdir -p $(LOCALBIN)

## Tool Binaries
KUBECTL ?= kubectl
KUSTOMIZE ?= $(LOCALBIN)/kustomize
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
ENVTEST ?= $(LOCALBIN)/setup-envtest

## Tool Versions
KUSTOMIZE_VERSION ?= v5.5.0
CONTROLLER_TOOLS_VERSION ?= v0.16.4
ENVTEST_VERSION ?= release-0.19

KUSTOMIZE = $(shell pwd)/bin/kustomize
.PHONY: kustomize
kustomize: ## Download kustomize locally if necessary.
$(call go-get-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/v3/cmd/kustomize@v3.2.0)
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
$(KUSTOMIZE): $(LOCALBIN)
$(call go-install-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/v5,$(KUSTOMIZE_VERSION))

ENVTEST = $(shell pwd)/bin/setup-envtest
ENVTEST_VERSION?=release-0.14
.PHONY: controller-gen
controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary.
$(CONTROLLER_GEN): $(LOCALBIN)
$(call go-install-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen,$(CONTROLLER_TOOLS_VERSION))

.PHONY: envtest
envtest: ## Download envtest-setup locally if necessary.
$(call go-get-tool,$(ENVTEST),sigs.k8s.io/controller-runtime/tools/setup-envtest@$(ENVTEST_VERSION))

# go-get-tool will 'go get' any package $2 and install it to $1.
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
define go-get-tool
@[ -f $(1) ] || { \
set -e ;\
echo "Downloading $(2)" ;\
GOBIN=$(PROJECT_DIR)/bin go install $(2) ;\
}
envtest: $(ENVTEST) ## Download setup-envtest locally if necessary.
$(ENVTEST): $(LOCALBIN)
$(call go-install-tool,$(ENVTEST),sigs.k8s.io/controller-runtime/tools/setup-envtest,$(ENVTEST_VERSION))

# go-install-tool will 'go install' any package with custom target and name of binary, if it doesn't exist
# $1 - target path with name of binary
# $2 - package url which can be installed
# $3 - specific version of package
define go-install-tool
@[ -f "$(1)-$(3)" ] || { \
set -e; \
package=$(2)@$(3) ;\
echo "Downloading $${package}" ;\
rm -f $(1) || true ;\
GOBIN=$(LOCALBIN) go install $${package} ;\
mv $(1) $(1)-$(3) ;\
} ;\
ln -sf $(1)-$(3) $(1)
endef
4 changes: 2 additions & 2 deletions components/notebook-controller/config/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ kind: Kustomization
resources:
- ../default
images:
- name: ghcr.io/kubeflow/kubeflow/notebook-controller
newName: ghcr.io/kubeflow/kubeflow/notebook-controller
- name: ghcr.io/kubeflow/notebooks/notebook-controller
newName: ghcr.io/kubeflow/notebooks/notebook-controller
newTag: latest
Loading
Loading