Commit Graph

30 Commits

Author SHA1 Message Date
Yannis Zarkadas da3c7a6642 jupyter-web-app: Consolidate manifests (kubeflow/kubeflow#5721)
Signed-off-by: Yannis Zarkadas <yanniszark@arrikto.com>
2021-03-19 10:16:16 -07:00
Kimonas Sotirchos 08433d6394 web-apps: Extend common code for the apps to work in standalone mode (kubeflow/kubeflow#5710)
* web-apps(back): Introduce an APP_NO_AUTHNZ env var

The admin can use the APP_NO_AUTHNZ={True,False} to configure if the
application should perform authnz checks or not.

In case of False, then the app will not be expecting a logged in user, in the
`kubeflow-userid` header, and will not perform authorization checks using
SubjectAccessReviews.

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* web-apps(front): Expose if Dashboard is connected

The NamespaceService will also provide an observable that informs
different parts of the app if the CentralDashboard is present.

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* review: Use enumeration for Dashboard state

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* review: Move common vars to a settings module

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
2021-03-18 13:16:16 -07:00
Kimonas Sotirchos ebbd123359 Fixes in Tensorboard web app (kubeflow/kubeflow#5693)
* twa(front): Use correct base-href when building

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* web-apps(backend): Fix regex for parsing prefix

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* twa: Add git tag while building the image

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* twa: Fix dockerfile for buster-slim image

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* twa: Use common date-time component to show date

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* twa(back): Fetch the name directly from the CR

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* review: Remove unused npm script

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* twa: Don't override the app's config

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* twa: Use correct AWS image in Makefile

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* review: Use bash in Dockerfile entrypoint

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
2021-03-18 12:26:16 -07:00
Kimonas Sotirchos a63eff43ed Volumes Management UI (kubeflow/kubeflow#5684)
* vwa(back): first commit of volumes web app backend

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* vwa(front): init code for volumes web app frontend

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* vwa: {Make,Docker}files

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* vwa: gitignore

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* vwa: README

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* review: Rename Jupyter to Volumes in README

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* review: Rephrase comment in default flavor

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* review: Remove snapshot reference from default flavor

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
2021-03-18 01:07:16 -07:00
dependabot[bot] d110b9670c Bump lodash from 4.17.15 to 4.17.21 in /components/crud-web-apps/common/frontend/kubeflow-common-lib (kubeflow/kubeflow#5674)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.21)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-10 03:33:23 -08:00
dependabot[bot] 6dbf07487a Bump lodash-es from 4.17.11 to 4.17.14 in /components/crud-web-apps/common/frontend/kubeflow-common-lib (kubeflow/kubeflow#5475)
Bumps [lodash-es](https://github.com/lodash/lodash) from 4.17.11 to 4.17.14.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.11...4.17.14)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-10 03:32:23 -08:00
Yannis Zarkadas b0f13d6ef4 Jupyter Web App: Move manifests development upstream (kubeflow/kubeflow#5613)
As part of the work of wg-manifests for 1.3
(https://github.com/kubeflow/manifests/issues/1735), we are moving manifests
development in upstream repos. This gives the application developers full
ownership of their manifests, tracked in a single place.

This commit copies the manifests for application `Jupyter Web App`
from path `apps/jupyter/jupyter-web-app/upstream` of kubeflow/manifests to path
`components/crud-web-apps/jupyter/manifests` of the upstream repo (https://github.com/kubeflow/kubeflow).

Signed-off-by: Yannis Zarkadas <yanniszark@arrikto.com>
2021-03-04 14:31:48 -08:00
DavidSpek 738e438c98 Fix entrypoint of crud-jwa (kubeflow/kubeflow#5606)
* Fix entrypoint of crud-jwa

* remove APP_PREIX ENV variable from entrypoint
2021-03-02 04:31:47 -08:00
Kimonas Sotirchos 89f7784383 web-apps(front): Make the library tests run in CI (kubeflow/kubeflow#5564)
In order for the frontend tests to run in a CI system, which will be
using a container to run them, we will need to make some adjustments.

Namely, we will need to:
* Run a headless version of Chrome
* Run the `ng test` in non-watch mode, in order for the testing process
  to terminate and not watch for changes to the codebase.

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
2021-02-01 23:14:27 -08:00
Kimonas Sotirchos c38a706299 web-apps(back): Export package code for wheel (kubeflow/kubeflow#5569)
* web-apps(back): Export package code for wheel

When building the wheel we need to define Python packages

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* Don't include init in root dir

We don't want to have an init file in the setup directory

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
2021-01-29 08:25:40 -08:00
Kimonas Sotirchos b965467590 web-apps: Fixes to the common code (kubeflow/kubeflow#5567)
* web-apps(back): Fetch the correct default SC

The backend would only check for the annotation of the default
StorageClass but not if it's value would be true/false.

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* web-apps(back): Fetch Pod logs

Extend the common backend libraries to fetch pod logs

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* web-apps(front): Add global variables.scss

Since we will need the page padding in multiple places we'll create a
scss file to store these values.

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* web-apps(front): Export the Dialog module

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* web-apps(front): Rework the Toolbar component

* Add option to make button to be stroked
* Don't emit an event when a button is clicked. Expect a function which
  will be executed from this component.
* Put all the buttons on the right to mimic Pipelines UI

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* web-apps(front): Make the app's background white

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* web-apps(front): Export commonly used modules

The mat-divider and mat-icon modules are oftenly used so we could
include them in the exports of the KubeflowModule.

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* web-apps(front): Key-val should be on top in list

In the list that shows key-valu pairs in lines we want the key to remain
on top if the value has a big height. Previously the key-title would be
in the middle height of the value, which looked weird.

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* web-apps(front): Add a Comment component for forms

This is used to explain different sections in the form.

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* web-apps(front): Bar at the bottom for every form

We want our forms to have a bar on the bottom with CREATE CANCEL buttons
and the ability to view the yaml contents of a CR.

This component is only used for visualization. The logic component
should be handling this component via this component's inputs/outputs

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* web-apps(front): General purpose css

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* web-apps(front): Make k8s fields optional

We might need to instantiate a k8s objecti with only some of the
subfields, like only the spec and not metadata.

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* remove redundant link class

Co-authored-by: Tasos Alexiou <tasos@arrikto.com>

* support fit-content for firefox as well

Co-authored-by: Tasos Alexiou <tasos@arrikto.com>

* firefox fit-content support

Co-authored-by: Tasos Alexiou <tasos@arrikto.com>

* use button instead of span

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

Co-authored-by: Tasos Alexiou <tasos@arrikto.com>
2021-01-29 07:03:40 -08:00
DavidSpek 4ec593159f Move JWA python images to slim-buster (kubeflow/kubeflow#5555) 2021-01-27 10:37:07 -08:00
DavidSpek b9917b8507 Use node:12 as specified in the docs (kubeflow/kubeflow#5522)
* Use node:12 as specified in the docs

* Move to buster-slim

Move images that build the kubeflow library and frontend to buster-slim to reduce image size. Tested with the Jupyter Web App, assumed to also work for Tensorboards Web App once https://github.com/kubeflow/kubeflow/issues/5529 is solved.
2021-01-25 10:22:54 -08:00
Kimonas Sotirchos 879f3aaba5 web-apps(back): Change the string formatting (kubeflow/kubeflow#5495)
* web-apps(back): Change api routes formatting

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* web-apps(back): Use % substitution for strings

Remove the f"strings" and use % substitutions.

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* web-apps(back): Add subresource handling

Handle an optional subresource field when performing authorization
checks.

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
2021-01-20 06:07:59 -08:00
DavidSpek f804366b19 twa(front): Add missing dependencies for tensorboard web app (kubeflow/kubeflow#5528)
* Add missing dependencies for tensorboard web app

* add date-fns and lodash-es dependencies
2021-01-19 03:01:44 -08:00
Kimonas Sotirchos 5fa8b1e820 twa(front): Fix the type issue with table config (kubeflow/kubeflow#5531)
Fix the type of the variables for the table configuration object.

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
2021-01-19 02:43:45 -08:00
Kimonas Sotirchos 315e973ea4 twa: Update the build process and instructions for the Tensorboards web app (kubeflow/kubeflow#5498)
* web-apps(back): Helper config functions

Introduce helper function for creating the config object for an app.

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* twa: Update the build process

Update both the frontend and the backend of the Tensorboards web app to
follow the build/run process of the other web apps as well.

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* twa: Update the README

Restructure the README to look like the JWA one. Also update the
instructions with the latest process for running the web app.

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
2021-01-08 05:04:54 -08:00
Kimonas Sotirchos 7badb2b424 web-apps(back): Add CSRF protection mechanisms to the backends (kubeflow/kubeflow#5472)
* web-apps(back): Add CSRF protection to the backend

The server of each crud-web-app will be setting an XSRF-TOKEN cookie to
the frontend. On each unsafe method (POST, PATCH etc) the backend will
check to make sure that the request:
* Contains an XSRF-TOKEN cookie
* Contains an X-XSRF-TOKEN header
* The value of the above values are the same

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* web-apps(back): Document the CSRF_SAMESITE env var

Add a new table in the README of the common code to include the ENV vars
that a user can set in any web app. In the future we should also extend
the README of every app with the supported ENV vars.

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
2020-12-23 08:24:27 -08:00
Kimonas Sotirchos 5eb884bb3d web-apps(front): Update the README (kubeflow/kubeflow#5481)
* web-apps(front): Update the README

Update the readme with detailed commands on how to consume the library
as well as developer guidelines.

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* web-apps(front): Fix typo in README

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
2020-12-23 02:42:28 -08:00
Kimonas Sotirchos 9580c16791 web-apps(front): Update the common frontend library (kubeflow/kubeflow#5463)
* web-apps(front): Udate the common library

Add new components to the library. These components will enhance
* The current common table for visualizing objects
* The components we can use for a details-page for each object

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* web-apps(front): Add unit tests to common lib

Fix and introduce new unit tests for most of the components in the
library. We expect the developers to always run `ng test` before any PR
to ensure that the existing functionality is not broken.

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* jwa(front): Add required packages for common lib

The common library will expect extra npm modules to be installed in each
app that consumes it.

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
2020-12-21 05:06:25 -08:00
Mathew Wicks e9bbe43418 Add thesuperzapper to notebook OWNERS (kubeflow/kubeflow#5363) 2020-10-27 08:24:00 -07:00
Kimonas Sotirchos 9593da2cd3 Initialize the Jupyter web app frontend in crud-web-apps (kubeflow/kubeflow#5332)
* Update the backend

For the frontend to work properly we will need to add the following
changes to jupyter web app's backend as well as to the common backend
code:
* rename the references from `flask_rest_backend` to `crud_backend` in
  the web app's backend code
* add a route for exposing GPU info. This way the UI will block users
  from creating Notebooks with a GPU type that is not installed at all
  in the cluster

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* Update the common frontend library

New functionality added:
* An `Advanced Settings` button that can expand and shrink to
  expose/hide more options in the form
* All validators will have a debounce time to make the input of
  characters smoother
* Extend the Status types to allow start/stopped resources
* Extend the main table config to support a button [ ex CONNECT for
  jupyter web app ]
* The http services should use relative URLs

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* Update the frontend to utilize the common code

The bulk of the new frontend code. The folder structure is changed to
make it more clear what pages are used from the page.

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* {Make,Docker}files

Add Makefile and Dockerfiles. Note that GCB build process needs to be
updated.

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* README.md

Add a readme that explains how to build the app and have a development
environment.

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
2020-10-27 07:45:59 -07:00
Kimonas Sotirchos 5d84874fc4 Refactor the JWA backend to utilize common code (kubeflow/kubeflow#5316)
* WA: Backend common: update the library

Update the common python wheel wrt:
* How to distinguish between dev and prod mode
* Extra routes for handling Notebooks
* Serving the index.html for every non api route (SPA)
* Add a STOPPED state to the possible Status values

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* JWA: Add the refactored backend

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* JWA: Backend: Add support for Affinity/Tolerations

* Extend the configuration yaml with default form values for the
  affinity/tolerations
* Set them accordingly when the user submits a notebook

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
Reviewed-by: Ilias Katsakioris <elikatsis@arrikto.com>
2020-09-29 02:37:25 -07:00
Konstantinos Andriopoulos 531a428eff Add TWA frontend (kubeflow/kubeflow#5267)
* Add frontend for the Tensorboard Web-app

This commit contains the code for the frontend of the Tensorboard
web-app. It completes the GSoC 2020 project for building the
standalone TWA for Kubeflow.

The app is not yet fully integrated to the Kubeflow dashboard, so
the README.md file contains documentation on how to build, run and
use the web-app locally.

Also, a Dockerfile was added in order to build a playground image
of the web-app. The 'deploy' folder contains manifests that will
enable the TWA to properlly run on the cluster in the future.

* Update README.md
2020-08-31 09:32:21 -07:00
dependabot[bot] 8be6caebc5 Bump lodash from 4.17.15 to 4.17.20 in /components/crud-web-apps/common/frontend/kubeflow-common-lib (kubeflow/kubeflow#5256)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.20.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.20)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-08-31 07:08:20 -07:00
Konstantinos Andriopoulos e32222032c Tensorboard web-app: Add functionality to inform TWA frontend about the status of Tensorboard servers (kubeflow/kubeflow#5259)
* Extend Tensorboard CRD with status.readyReplicas field

The Tensorboard CRD didn't contain any information about the
Tensorboard server being ready or not. So, the status of the
Tensorboard resource is extended so that it contains a
readyReplicas field, similar to the status.readyReplicas of
the deployment of the Tensorboard server.

* Extend Tensorboard controller to update status of Tensorboard CR

The frontend of the Tensorboard web-app will need information
about whether the Tensorboard servers are ready to connect or not.
As a result, the Tensorboard controller now copies the value of the
status.readyReplicas field of the Tensorboard deployment to the
status.readyReplicas of the Tensorboard CR.

Also, a Deployment() function was added for applying and updating
Tensorboard server deployments.

* Update tensorboard.status.phase of TWA backend response

The frontend of the TWA will need information about the status
of the Tensorboard server, so that it can inform the user about
the server being ready being ready to connect or not.

As a result, the backend sets the status.phase field of the response
to "ready", if tensorboard.status.readyReplicas == 1. Otherwise, the
status.phase field of the response is set to "unavailable".

Also, the getPVCName() function was added, which extracts the name
of a given PVC object.

* Add GET route for PVCs

The Tensorboard web-app frontend will be using an autocomplete
drop-bar to show user the PVCs that live in a specific namespace.
These PVCs could be used as log storages for the Tensorboard server.

So, a PVC GET route was added to the Tensorboard web-app backend.

* Add message to Tensorboard response object in TWA backend

The frontend of the TWA will need to output a response message for
every Tensorboard object. This response message will inform the
user about the current state of the Tensorboard server.

* Use status.STATUS_PHASE for backend response

* Add requirements.txt to TWA backend

* Use status.create_status() for backend response
2020-08-30 05:08:20 -07:00
Kimonas Sotirchos b19054e75b Create an Angular Library with common frontend code (kubeflow/kubeflow#5252)
Create an Angular Library with common frontend code. Our crud web apps
should use this library to share common functionality like:

* Talking to Central Dashboard for the Namespace selection
* Making http calls
* Surfacing and showing error messages and warnings
* Form utilities
* Showing a table with entries and actions

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
2020-08-28 05:14:53 -07:00
Konstantinos Andriopoulos f55c0d77dc tensorboard web-app: Create Tensorboard web-app backend (kubeflow/kubeflow#5180)
* Create Tensorboard web-app backend

Create the code for the Tensorboard web-app backend which
includes routes for GET, POST and DELETE requests.

The backend is created with Python/Flask, so it also uses
the common code from 'kubeflow.kubeflow.crud_backend'.

* Add 'get_age(k8s_object)' function to 'crud_backend' common code

It would be useful for all web apps of the 'crud-web-apps' folder
to return age information to their frontends.

As a result, 'get_age(k8s_object)' was added to the common code,
so that all web apps can use it.
2020-08-20 03:25:22 -07:00
Kimonas Sotirchos 1db8a22ca9 Common code between the different python backends (kubeflow/kubeflow#5164)
Create a python module under the kubeflow.kubeflow package that will
be exposing common code and a base app the takes care of:

* Exceptions handling
* Common routes for serving static files and their cache control policy
* Authorization checks with SubjectAccessReview
* Authentication checks on the Kubeflow headers
* Common helper functions for dates, yaml parsing etc
* health/liveness probes

Backends that are written with Python/Flask should use this common code
in order for us to reduce code duplication and have our backends align
with our accepted practices.

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
2020-08-07 07:30:18 -07:00
Kimonas Sotirchos 40838253e4 Create a new directory in components for web apps (kubeflow/kubeflow#5184)
* Create a new directory in components for web apps

Since we want to also have some common code between our web apps we
should create a parent dir for any future web app we want to develop.
The code for the web apps, common or not, should be organized under this
directory.

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* remove the reviewers

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
2020-08-05 06:36:29 -07:00