From 437156e7bfef09056ce350fe64c20926d1eb6ecc Mon Sep 17 00:00:00 2001 From: Wendy Gaultier Date: Mon, 16 Dec 2024 14:22:55 +0000 Subject: [PATCH] kf1.9(centraldash): general --- components/centraldashboard/.dockerignore | 2 + components/centraldashboard/Dockerfile | 25 +- components/centraldashboard/Makefile | 6 +- components/centraldashboard/OWNERS | 10 +- components/centraldashboard/README.md | 45 ++-- .../config/centraldashboard-config.yaml | 4 +- .../manifests/base/configmap.yaml | 225 ++++++++--------- .../manifests/base/deployment.yaml | 16 +- .../manifests/base/kustomization.yaml | 87 ++++--- .../overlays/istio/kustomization.yaml | 49 +++- .../overlays/istio/virtual-service.yaml | 2 +- .../overlays/kserve/kustomization.yaml | 19 +- .../overlays/kserve/patches/configmap.yaml | 231 +++++++++--------- components/centraldashboard/package.json | 32 ++- components/centraldashboard/webpack.config.js | 51 ++-- 15 files changed, 412 insertions(+), 392 deletions(-) create mode 100644 components/centraldashboard/.dockerignore diff --git a/components/centraldashboard/.dockerignore b/components/centraldashboard/.dockerignore new file mode 100644 index 00000000000..763301fc002 --- /dev/null +++ b/components/centraldashboard/.dockerignore @@ -0,0 +1,2 @@ +dist/ +node_modules/ \ No newline at end of file diff --git a/components/centraldashboard/Dockerfile b/components/centraldashboard/Dockerfile index 35927c453e8..685d43971bf 100644 --- a/components/centraldashboard/Dockerfile +++ b/components/centraldashboard/Dockerfile @@ -3,32 +3,29 @@ FROM node:16.20.2-bullseye AS build ARG kubeflowversion ARG commit + ENV BUILD_VERSION=$kubeflowversion ENV BUILD_COMMIT=$commit ENV CHROME_BIN=/usr/bin/chromium ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true -RUN apt update -qq && apt install -qq -y gnulib - COPY . /centraldashboard WORKDIR /centraldashboard -RUN BUILDARCH="$(dpkg --print-architecture)" && npm rebuild && \ - if [ "$BUILDARCH" = "arm64" ] || \ - [ "$BUILDARCH" = "armhf" ]; then \ - export CFLAGS=-Wno-error && \ - export CXXFLAGS=-Wno-error; \ - fi && \ - npm install && \ - npm run build && \ - npm prune --production +RUN npm ci \ + && npm run build \ + && npm prune --production # Step 2: Packages assets for serving FROM node:16.20.2-alpine AS serve +RUN apk add --no-cache tini + +USER node + ENV NODE_ENV=production -WORKDIR /app -COPY --from=build /centraldashboard . +WORKDIR /usr/src/app +COPY --from=build --chown=node:node /centraldashboard . EXPOSE 8082 -ENTRYPOINT ["npm", "start"] +ENTRYPOINT ["/sbin/tini", "--" , "npm", "start"] diff --git a/components/centraldashboard/Makefile b/components/centraldashboard/Makefile index daff45dd36c..4d4e49659f5 100644 --- a/components/centraldashboard/Makefile +++ b/components/centraldashboard/Makefile @@ -24,7 +24,7 @@ docker-build: docker build ${DOCKER_BUILD_OPTS} -t $(IMG):$(TAG) . \ --build-arg kubeflowversion=$(shell git describe --abbrev=0 --tags) \ --build-arg commit=$(COMMIT) \ - --label=git-verions=$(TAG) + --label=git-version=$(TAG) @echo Built $(IMG):$(TAG) docker-push: @@ -32,12 +32,12 @@ docker-push: .PHONY: docker-build-multi-arch docker-build-multi-arch: ## Build multi-arch docker images with docker buildx - docker buildx build --load --platform ${ARCH} --tag ${IMG}:${TAG} -f ${DOCKERFILE} . + docker buildx build --load --platform ${ARCH} --tag ${IMG}:${TAG} -f ${DOCKERFILE} . --build-arg kubeflowversion=$(shell git describe --abbrev=0 --tags) --build-arg commit=$(COMMIT) --label=git-version=$(TAG) .PHONY: docker-build-push-multi-arch docker-build-push-multi-arch: ## Build multi-arch docker images with docker buildx and push to docker registry - docker buildx build --platform ${ARCH} --tag ${IMG}:${TAG} --push -f ${DOCKERFILE} . + docker buildx build --platform ${ARCH} --tag ${IMG}:${TAG} --push -f ${DOCKERFILE} . --build-arg kubeflowversion=$(shell git describe --abbrev=0 --tags) --build-arg commit=$(COMMIT) --label=git-version=$(TAG) # Build but don't attach the latest tag. This allows manual testing/inspection of the image # first. diff --git a/components/centraldashboard/OWNERS b/components/centraldashboard/OWNERS index 86b51fd29bc..e276df98a84 100644 --- a/components/centraldashboard/OWNERS +++ b/components/centraldashboard/OWNERS @@ -1,9 +1,7 @@ approvers: - - elikatsis - kimwnasptd - - StefanoFioravanzo - thesuperzapper - - yanniszark -reviewers: - - avdaredevil - - SachinVarghese \ No newline at end of file +emeritus_approvers: + - elikatsis + - StefanoFioravanzo + - yanniszark \ No newline at end of file diff --git a/components/centraldashboard/README.md b/components/centraldashboard/README.md index 24d6e1cd193..feeaff10e5f 100644 --- a/components/centraldashboard/README.md +++ b/components/centraldashboard/README.md @@ -32,24 +32,35 @@ kubectl --record deployment.apps/centraldashboard \ ### Getting Started Make sure you have `node v16` installed along with `npm`. - +Initial setup 1. Clone the repository and change directories to `components/centraldashboard` 2. Run `make build-local`. This will install all of the project dependencies and prepare your system for development. -3. To start a development environment, run `npm run dev`. It can then be accessed at `localhost:8080`. - - This runs [webpack](https://webpack.js.org/) over the front-end code in - the [public](./public) folder and starts the - [webpack-dev-server](https://webpack.js.org/configuration/dev-server/) at - http://localhost:8081. - - You will also need to run `kubectl port-forward services/profiles-kfam -n kubeflow 8081`. This is to access the KFAM component. - - It also starts the Express API server at http://localhost:8082. Requests - from the front-end starting with `/api` are proxied to the Express - server. All other requests are handled by the front-end server which - mirrors the production configuration. -4. - To access the Jupyter Web App run: `kubectl port-forward -n kubeflow svc/jupyter-web-app-service 8085:80`. - - To access Pipeline Web App run: `kubectl port-forward -n kubeflow svc/ml-pipeline-ui 8087:80`.` - - This forwards requests to Kubernetes services from `http://localhost:service-proxy-port`. See the [webpack config file](https://github.com/kubeflow/kubeflow/blob/master/components/centraldashboard/webpack.config.js) for more details. + +Steps +1. We STRONGLY recommend using [nvm](https://github.com/nvm-sh/nvm): + - Uninstall any Homebrew versions with `brew uninstall node` (or `node@XX`) + - Install `nvm` with `curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash` + - Install node `16` with `nvm install 16` + - Use node `16` with `nvm use 16` + - Set node `16` as the default with `nvm alias default 16` +2. Run `cd components/centraldashboard` +3. Run `npm install` to install npm dependencies +4. Run `npm run dev` to start the development server, this will: + - Run [webpack](https://webpack.js.org/) over the front-end code in the [public](./public) folder + - Run [webpack-dev-server](https://webpack.js.org/configuration/dev-server/) at http://localhost:8081 + - Run the Express API server at http://localhost:8082 + - Proxy requests from the front-end starting with `/api` to the Express server. + - All other requests are handled by the front-end server which mirrors the production configuration. +5. Run port-forwards: + - Kubeflow Access Management API: `kubectl port-forward -n kubeflow svc/profiles-kfam 8081:8081` + - Kubeflow Notebooks: `kubectl port-forward -n kubeflow svc/jupyter-web-app-service 8085:80` + - Kubeflow Pipelines: `kubectl port-forward -n kubeflow svc/ml-pipeline-ui 8087:80` + - See [`webpack.config.js`](https://github.com/kubeflow/kubeflow/blob/master/components/centraldashboard/webpack.config.js) for more details. +6. Open your browser to `http://localhost:8080` to see the dashboard: + - You will need to inject your requests with a `kubeflow-userid` header + - You can do this in Chrome by using the [Header Editor](https://chromewebstore.google.com/detail/eningockdidmgiojffjmkdblpjocbhgh) extension + - For example, set the `kubeflow-userid` header to `user@example.com` ### Server Components @@ -61,8 +72,8 @@ Server side code resides in the [app](./app) directory. The server uses Client side code resides in the [public](./public) directory. Client components are written using the [Polymer 3](https://polymer-library.polymer-project.org/3.0/docs/about_30) web components library. All Polymer components should be written under the -[public/components](./public/components) directory. You may use the [inline style](https://polymer-library.polymer-project.org/3.0/docs/first-element/step-2) for creating your Shadow DOM, or seperate your -CSS and HTML in seperate files. We currently support [Pug](https://pugjs.org/api/getting-started.html) +[public/components](./public/components) directory. You may use the [inline style](https://polymer-library.polymer-project.org/3.0/docs/first-element/step-2) for creating your Shadow DOM, or separate your +CSS and HTML in separate files. We currently support [Pug](https://pugjs.org/api/getting-started.html) templating for external markup. See [main-page.js](public/components/main-page.js) for an example. diff --git a/components/centraldashboard/config/centraldashboard-config.yaml b/components/centraldashboard/config/centraldashboard-config.yaml index 97964a504b9..49e53b2a530 100644 --- a/components/centraldashboard/config/centraldashboard-config.yaml +++ b/components/centraldashboard/config/centraldashboard-config.yaml @@ -3,7 +3,7 @@ data: defaultLanguage: "en" settings: |- { - DASHBOARD_FORCE_IFRAME: true + "DASHBOARD_FORCE_IFRAME": true } links: |- { @@ -101,4 +101,4 @@ data: kind: ConfigMap metadata: name: centraldashboard-config - namespace: kubeflow \ No newline at end of file + namespace: kubeflow diff --git a/components/centraldashboard/manifests/base/configmap.yaml b/components/centraldashboard/manifests/base/configmap.yaml index 62f4e3beccc..387be4e15fe 100644 --- a/components/centraldashboard/manifests/base/configmap.yaml +++ b/components/centraldashboard/manifests/base/configmap.yaml @@ -6,128 +6,113 @@ data: } 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": "/models/", - "text": "Endpoints", - "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/" - } + "menuLinks": [ + { + "icon": "book", + "link": "/jupyter/", + "text": "Notebooks", + "type": "item" + }, + { + "icon": "assessment", + "link": "/tensorboards/", + "text": "TensorBoards", + "type": "item" + }, + { + "icon": "device:storage", + "link": "/volumes/", + "text": "Volumes", + "type": "item" + }, + { + "icon": "kubeflow:katib", + "link": "/katib/", + "text": "Katib Experiments", + "type": "item" + }, + { + "icon": "kubeflow:pipeline-centered", + "items": [ + { + "link": "/pipeline/#/pipelines", + "text": "Pipelines", + "type": "item" + }, + { + "link": "/pipeline/#/experiments", + "text": "Experiments", + "type": "item" + }, + { + "link": "/pipeline/#/runs", + "text": "Runs", + "type": "item" + }, + { + "link": "/pipeline/#/recurringruns", + "text": "Recurring Runs", + "type": "item" + }, + { + "link": "/pipeline/#/artifacts", + "text": "Artifacts", + "type": "item" + }, + { + "link": "/pipeline/#/executions", + "text": "Executions", + "type": "item" + } + ], + "text": "Pipelines", + "type": "section" + } ], + "externalLinks": [], "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/" - } + { + "desc": "The Kubeflow website", + "link": "https://www.kubeflow.org/", + "text": "Kubeflow Website" + }, + { + "desc": "Documentation for Kubeflow Pipelines", + "link": "https://www.kubeflow.org/docs/components/pipelines/", + "text": "Kubeflow Pipelines Documentation" + }, + { + "desc": "Documentation for Kubeflow Notebooks", + "link": "https://www.kubeflow.org/docs/components/notebooks/", + "text": "Kubeflow Notebooks Documentation" + }, + { + "desc": "Documentation for Kubeflow Training Operator", + "link": "https://www.kubeflow.org/docs/components/training/", + "text": "Kubeflow Training Operator Documentation" + }, + { + "desc": "Documentation for Katib", + "link": "https://www.kubeflow.org/docs/components/katib/", + "text": "Katib Documentation" + } + ], + "quickLinks": [ + { + "desc": "Kubeflow Notebooks", + "link": "/jupyter/new", + "text": "Create a new Notebook" + }, + { + "desc": "Kubeflow Pipelines", + "link": "/pipeline/#/pipelines", + "text": "Upload a Pipeline" + }, + { + "desc": "Pipelines", + "link": "/pipeline/#/runs", + "text": "View Pipeline Runs" + } ] } kind: ConfigMap diff --git a/components/centraldashboard/manifests/base/deployment.yaml b/components/centraldashboard/manifests/base/deployment.yaml index a6fef6a03d6..1b376906e6a 100644 --- a/components/centraldashboard/manifests/base/deployment.yaml +++ b/components/centraldashboard/manifests/base/deployment.yaml @@ -31,15 +31,19 @@ spec: protocol: TCP env: - name: USERID_HEADER - value: $(CD_USERID_HEADER) + value: CD_USERID_HEADER_PLACEHOLDER - name: USERID_PREFIX - value: $(CD_USERID_PREFIX) + value: CD_USERID_PREFIX_PLACEHOLDER - name: PROFILES_KFAM_SERVICE_HOST value: profiles-kfam.kubeflow - name: REGISTRATION_FLOW - value: $(CD_REGISTRATION_FLOW) - - name: DASHBOARD_LINKS_CONFIGMAP - value: $(CD_CONFIGMAP_NAME) + value: CD_REGISTRATION_FLOW_PLACEHOLDER + - name: DASHBOARD_CONFIGMAP + value: CD_CONFIGMAP_NAME_PLACEHOLDER - name: LOGOUT_URL - value: '/authservice/logout' + value: '/oauth2/sign_out' + - name: POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace serviceAccountName: centraldashboard diff --git a/components/centraldashboard/manifests/base/kustomization.yaml b/components/centraldashboard/manifests/base/kustomization.yaml index 95654c08062..391f4cf1111 100644 --- a/components/centraldashboard/manifests/base/kustomization.yaml +++ b/components/centraldashboard/manifests/base/kustomization.yaml @@ -10,61 +10,74 @@ resources: - service-account.yaml - service.yaml - configmap.yaml -commonLabels: - kustomize.component: centraldashboard - app: centraldashboard - app.kubernetes.io/component: centraldashboard - app.kubernetes.io/name: centraldashboard images: - name: docker.io/kubeflownotebookswg/centraldashboard newName: docker.io/kubeflownotebookswg/centraldashboard - newTag: v1.7.0 + newTag: v1.9.2 configMapGenerator: - envs: - params.env name: centraldashboard-parameters generatorOptions: disableNameSuffixHash: true -vars: -- fieldref: - fieldPath: metadata.namespace - name: CD_NAMESPACE - objref: - apiVersion: v1 - kind: Service - name: centraldashboard -- fieldref: - fieldPath: data.CD_CLUSTER_DOMAIN - name: CD_CLUSTER_DOMAIN - objref: - apiVersion: v1 - kind: ConfigMap - name: centraldashboard-parameters -- fieldref: +labels: +- includeSelectors: true + pairs: + app: centraldashboard + app.kubernetes.io/component: centraldashboard + app.kubernetes.io/name: centraldashboard + kustomize.component: centraldashboard + +replacements: +- source: fieldPath: data.CD_USERID_HEADER - name: CD_USERID_HEADER - objref: - apiVersion: v1 kind: ConfigMap name: centraldashboard-parameters -- fieldref: + version: v1 + targets: + - fieldPaths: + - spec.template.spec.containers.0.env.0.value + select: + group: apps + kind: Deployment + name: centraldashboard + version: v1 +- source: fieldPath: data.CD_USERID_PREFIX - name: CD_USERID_PREFIX - objref: - apiVersion: v1 kind: ConfigMap name: centraldashboard-parameters -- fieldref: + version: v1 + targets: + - fieldPaths: + - spec.template.spec.containers.0.env.1.value + select: + group: apps + kind: Deployment + name: centraldashboard + version: v1 +- source: fieldPath: data.CD_REGISTRATION_FLOW - name: CD_REGISTRATION_FLOW - objref: - apiVersion: v1 kind: ConfigMap name: centraldashboard-parameters -- fieldref: + version: v1 + targets: + - fieldPaths: + - spec.template.spec.containers.0.env.3.value + select: + group: apps + kind: Deployment + name: centraldashboard + version: v1 +- source: fieldPath: metadata.name - name: CD_CONFIGMAP_NAME - objref: - apiVersion: v1 kind: ConfigMap name: centraldashboard-config + version: v1 + targets: + - fieldPaths: + - spec.template.spec.containers.0.env.4.value + select: + group: apps + kind: Deployment + name: centraldashboard + version: v1 diff --git a/components/centraldashboard/manifests/overlays/istio/kustomization.yaml b/components/centraldashboard/manifests/overlays/istio/kustomization.yaml index 701c5cd71d7..c2d2eb6f1ed 100644 --- a/components/centraldashboard/manifests/overlays/istio/kustomization.yaml +++ b/components/centraldashboard/manifests/overlays/istio/kustomization.yaml @@ -1,18 +1,49 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization - resources: - ../../base - virtual-service.yaml - authorizationpolicy.yaml - namespace: kubeflow - -commonLabels: - kustomize.component: centraldashboard - app: centraldashboard - app.kubernetes.io/component: centraldashboard - app.kubernetes.io/name: centraldashboard - +replacements: +- source: + fieldPath: metadata.namespace + kind: Service + name: centraldashboard + version: v1 + targets: + - fieldPaths: + - spec.http.0.route.0.destination.host + options: + delimiter: . + index: 1 + select: + group: networking.istio.io + kind: VirtualService + name: centraldashboard + version: v1alpha3 +- source: + fieldPath: data.CD_CLUSTER_DOMAIN + kind: ConfigMap + name: centraldashboard-parameters + version: v1 + targets: + - fieldPaths: + - spec.http.0.route.0.destination.host + options: + delimiter: . + index: 3 + select: + group: networking.istio.io + kind: VirtualService + name: centraldashboard + version: v1alpha3 configurations: - params.yaml +labels: +- includeSelectors: true + pairs: + app: centraldashboard + app.kubernetes.io/component: centraldashboard + app.kubernetes.io/name: centraldashboard + kustomize.component: centraldashboard diff --git a/components/centraldashboard/manifests/overlays/istio/virtual-service.yaml b/components/centraldashboard/manifests/overlays/istio/virtual-service.yaml index 0792aff153a..30f98018a93 100644 --- a/components/centraldashboard/manifests/overlays/istio/virtual-service.yaml +++ b/components/centraldashboard/manifests/overlays/istio/virtual-service.yaml @@ -15,6 +15,6 @@ spec: uri: / route: - destination: - host: centraldashboard.$(CD_NAMESPACE).svc.$(CD_CLUSTER_DOMAIN) + host: centraldashboard.CD_NAMESPACE_PLACEHOLDER.svc.CD_CLUSTER_DOMAIN_PLACEHOLDER port: number: 80 diff --git a/components/centraldashboard/manifests/overlays/kserve/kustomization.yaml b/components/centraldashboard/manifests/overlays/kserve/kustomization.yaml index 32945dc1d6b..821bd921190 100644 --- a/components/centraldashboard/manifests/overlays/kserve/kustomization.yaml +++ b/components/centraldashboard/manifests/overlays/kserve/kustomization.yaml @@ -1,14 +1,13 @@ 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 +labels: +- includeSelectors: true + pairs: + app: centraldashboard + app.kubernetes.io/component: centraldashboard + app.kubernetes.io/name: centraldashboard + kustomize.component: centraldashboard +patches: +- path: patches/configmap.yaml diff --git a/components/centraldashboard/manifests/overlays/kserve/patches/configmap.yaml b/components/centraldashboard/manifests/overlays/kserve/patches/configmap.yaml index f4c43c1104d..a845820475e 100644 --- a/components/centraldashboard/manifests/overlays/kserve/patches/configmap.yaml +++ b/components/centraldashboard/manifests/overlays/kserve/patches/configmap.yaml @@ -6,128 +6,119 @@ data: } 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": "Endpoints", - "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/" - } + "menuLinks": [ + { + "icon": "book", + "link": "/jupyter/", + "text": "Notebooks", + "type": "item" + }, + { + "icon": "assessment", + "link": "/tensorboards/", + "text": "TensorBoards", + "type": "item" + }, + { + "icon": "device:storage", + "link": "/volumes/", + "text": "Volumes", + "type": "item" + }, + { + "icon": "kubeflow:katib", + "link": "/katib/", + "text": "Katib Experiments", + "type": "item" + }, + { + "type": "item", + "link": "/kserve-endpoints/", + "text": "KServe Endpoints", + "icon": "kubeflow:models" + }, + { + "icon": "kubeflow:pipeline-centered", + "items": [ + { + "link": "/pipeline/#/pipelines", + "text": "Pipelines", + "type": "item" + }, + { + "link": "/pipeline/#/experiments", + "text": "Experiments", + "type": "item" + }, + { + "link": "/pipeline/#/runs", + "text": "Runs", + "type": "item" + }, + { + "link": "/pipeline/#/recurringruns", + "text": "Recurring Runs", + "type": "item" + }, + { + "link": "/pipeline/#/artifacts", + "text": "Artifacts", + "type": "item" + }, + { + "link": "/pipeline/#/executions", + "text": "Executions", + "type": "item" + } + ], + "text": "Pipelines", + "type": "section" + } ], + "externalLinks": [], "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/" - } + { + "desc": "The Kubeflow website", + "link": "https://www.kubeflow.org/", + "text": "Kubeflow Website" + }, + { + "desc": "Documentation for Kubeflow Pipelines", + "link": "https://www.kubeflow.org/docs/components/pipelines/", + "text": "Kubeflow Pipelines Documentation" + }, + { + "desc": "Documentation for Kubeflow Notebooks", + "link": "https://www.kubeflow.org/docs/components/notebooks/", + "text": "Kubeflow Notebooks Documentation" + }, + { + "desc": "Documentation for Kubeflow Training Operator", + "link": "https://www.kubeflow.org/docs/components/training/", + "text": "Kubeflow Training Operator Documentation" + }, + { + "desc": "Documentation for Katib", + "link": "https://www.kubeflow.org/docs/components/katib/", + "text": "Katib Documentation" + } + ], + "quickLinks": [ + { + "desc": "Kubeflow Notebooks", + "link": "/jupyter/new", + "text": "Create a new Notebook" + }, + { + "desc": "Kubeflow Pipelines", + "link": "/pipeline/#/pipelines", + "text": "Upload a Pipeline" + }, + { + "desc": "Pipelines", + "link": "/pipeline/#/runs", + "text": "View Pipeline Runs" + } ] } kind: ConfigMap diff --git a/components/centraldashboard/package.json b/components/centraldashboard/package.json index 97d2c64a3cf..306f60afd0c 100644 --- a/components/centraldashboard/package.json +++ b/components/centraldashboard/package.json @@ -43,7 +43,8 @@ "dependencies": { "@babel/polyfill": "^7.6.0", "@google-cloud/monitoring": "^2.3.5", - "@kubernetes/client-node": "^0.12.3", + "@grpc/grpc-js": "^1.10.8", + "@kubernetes/client-node": "^0.19.0", "@polymer/app-layout": "^3.1.0", "@polymer/app-localize-behavior": "^3.0.1", "@polymer/app-route": "^3.0.0", @@ -75,9 +76,10 @@ "@webcomponents/webcomponentsjs": "^2.3.0", "chart.js": "^2.9.4", "chartjs-plugin-crosshair": "^1.1.4", - "express": "^4.17.1", + "express": "^4.19.2", "lodash": "^4.17.21", "node-fetch": "^2.6.7", + "prometheus-query": "^3.3.2", "web-animations-js": "^2.3.2" }, "devDependencies": { @@ -86,15 +88,17 @@ "@babel/preset-env": "^7.6.2", "@babel/runtime": "^7.6.2", "@polymer/test-fixture": "^4.0.2", - "@types/express": "^4.17.1", + "@types/express": "^4.17.21", + "@types/express-serve-static-core": "^4.19.0", "@types/gapi.client.monitoring": "^3.0.1", "@types/jasmine": "^3.4.2", "@types/node-fetch": "^2.5.2", "@types/puppeteer": "^2.0.0", + "@types/serve-static": "^1.15.5", "babel-loader": "^8.0.6", - "clean-webpack-plugin": "^1.0.1", + "clean-webpack-plugin": "^4.0.0", "concurrently": "^5.0.1", - "copy-webpack-plugin": "^5.1.2", + "copy-webpack-plugin": "^6.4.1", "core-js": "^2.6.9", "cross-env": "^5.2.1", "css-loader": "^2.1.1", @@ -106,7 +110,7 @@ "exports-loader": "^0.7.0", "file-loader": "^3.0.1", "google-auth-library": "^6.0.0", - "html-webpack-plugin": "^4.0.0", + "html-webpack-plugin": "^4.5.2", "istanbul-instrumenter-loader": "^3.0.1", "jasmine": "^3.5.0", "jasmine-ajax": "^3.4.0", @@ -121,20 +125,19 @@ "mini-css-extract-plugin": "^0.5.0", "nodemon": "^2.0.22", "nyc": "^14.1.1", - "pug": "^2.0.4", + "pug": "^3.0.1", "pug-loader": "^2.4.0", "puppeteer": "^1.20.0", "raw-loader": "^2.0.0", - "script-ext-html-webpack-plugin": "^2.1.4", - "terser-webpack-plugin": "^1.4.4", + "terser-webpack-plugin": "^4.2.3", "ts-node": "^10.4.0", "tslint": "^6.1.3", - "typescript": "^4.5.3", + "typescript": "^4.9.5", "url-loader": "^1.1.2", "wait-on": "^7.0.1", - "webpack": "^4.46.0", - "webpack-cli": "^3.3.9", - "webpack-dev-server": "^3.8.2" + "webpack": "^4.47.0", + "webpack-cli": "^4.10.0", + "webpack-dev-server": "^4.15.2" }, "overrides": { "ajv": "6.12.6", @@ -159,6 +162,9 @@ "dns-packet": "1.3.2", "http-proxy": "1.18.1", "moment": "2.29.4", + "pug-loader": { + "pug": "^3.0.1" + }, "ini": "1.3.6", "json5": "2.2.2", "kind-of": "6.0.3", diff --git a/components/centraldashboard/webpack.config.js b/components/centraldashboard/webpack.config.js index 9162397cc77..f417def5d59 100644 --- a/components/centraldashboard/webpack.config.js +++ b/components/centraldashboard/webpack.config.js @@ -2,12 +2,11 @@ const {resolve} = require('path'); const {execSync} = require('child_process'); -const CleanWebpackPlugin = require('clean-webpack-plugin'); +const { CleanWebpackPlugin } = require('clean-webpack-plugin'); const CopyWebpackPlugin = require('copy-webpack-plugin'); const DefinePlugin = require('webpack').DefinePlugin; const HtmlWebpackPlugin = require('html-webpack-plugin'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); -const ScriptExtHtmlWebpackPlugin = require('script-ext-html-webpack-plugin'); const TerserPlugin = require('terser-webpack-plugin'); let commit = process.env.BUILD_COMMIT || ''; @@ -142,29 +141,22 @@ module.exports = { ]), }, optimization: { - minimizer: [new TerserPlugin({ + minimizer: [ + new TerserPlugin({ cache: true, parallel: true, sourceMap: true, extractComments: true, - })], - splitChunks: { - cacheGroups: { - vendor: { - test: NODE_MODULES, - chunks: 'all', - name: 'vendor', - priority: 10, - enforce: true, - }, - }, - }, + }) + ], }, plugins: [ - new CleanWebpackPlugin([DESTINATION]), - new CopyWebpackPlugin(POLYFILLS.concat([ - {from: resolve(SRC, 'kubeflow-palette.css'), to: DESTINATION}, - ])), + new CleanWebpackPlugin(), + new CopyWebpackPlugin({ + patterns: POLYFILLS.concat( + [{from: resolve(SRC, 'kubeflow-palette.css'), to: DESTINATION}] + ) + }), new DefinePlugin({ BUILD_VERSION: JSON.stringify(BUILD_VERSION), VERSION: JSON.stringify(PKG_VERSION), @@ -172,8 +164,9 @@ module.exports = { new HtmlWebpackPlugin({ filename: resolve(DESTINATION, 'index.html'), template: resolve(SRC, 'index.html'), - excludeChunks: ['lib'], inject: true, + scriptLoading: 'defer', + excludeChunks: ['dashboard_lib'], minify: ENV == 'development' ? false : { collapseWhitespace: true, removeComments: true, @@ -187,38 +180,28 @@ module.exports = { filename: '[name].css', chunkFilename: '[id].css', }), - new ScriptExtHtmlWebpackPlugin({ - defaultAttribute: 'defer', - }), ], devServer: { port: 8080, proxy: { - '/api': 'http://localhost:8082', + '/api': { + target: 'http://localhost:8082', + }, '/jupyter': { target: 'http://localhost:8085', pathRewrite: {'^/jupyter': ''}, - headers: { - 'kubeflow-userid': 'user', - }, }, - // Requests at /notebook currently fail with a 504 error + // NOTE: this makes `/notebook` requests fail with a 504 error '/notebook': { target: 'http://localhost:8086', pathRewrite: { '^/notebook/(.*?)/(.*?)/(.*)': '/$1/services/$2/proxy/notebook/$1/$2/$3', }, - headers: { - 'kubeflow-userid': 'user', - }, }, '/pipeline': { target: 'http://localhost:8087', pathRewrite: {'^/pipeline': ''}, - headers: { - 'kubeflow-userid': 'user', - }, }, }, historyApiFallback: {