notebooks/components/crud-web-apps/common/frontend/kubeflow-common-lib
Kimonas Sotirchos 08542ef8bc jwa: Rework the Storage API of the web app (kubeflow/kubeflow#6321)
* wa(back): Add helper for deserializing JSON obj

In some cases we might need to construct Python k8s lib objects from the
JSONs that are provided by clients. I.e. the UI will be sending a PVC
object in json format, so the backend will need to create the
corresponding client.V1PersistentVolumeClaim object and submit it.

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
Reviewed-by: Ilias Katsakioris <elikatsis@arrikto.com>

* wa(back): Serialization helper

Add helper function for converting a k8s-client object into a dict that
can be sent as an HTTP response.

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
Reviewed-by: Ilias Katsakioris <elikatsis@arrikto.com>

* wa(back): Add dry run to Notebooks and PVCs

The backend will need to be able to create objects with dry-run, in
order to ensure they are valid. The backend will need to check that both
the Notebook and the PVCs can be created beforehand.

This way we avoid the scenario where we create PVCs but the Notebook
fails to be created, and the PVCs are never garbage collected.

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
Reviewed-by: Ilias Katsakioris <elikatsis@arrikto.com>

* wa(back): Update kubernetes to 0.17

In order to support dry-run we must use the 0.17 version of the Python
k8s client.

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
Reviewed-by: Ilias Katsakioris <elikatsis@arrikto.com>

* wa(back): Extend api module to patch pvcs

The backend will need to be able to PATCH PVCs in order to set the
ownerReference to the Notebook that mounts the PVCs.

Ref: arrikto/dev/issues/386#issuecomment-856700392

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
Reviewed-by: Ilias Katsakioris <elikatsis@arrikto.com>

* jwa(back): Work with new Volumes API

The backend API should not add any more layers of abstractions on top of
the K8s API. The backend should expect the client/UI to be sending the
entire PVC spec of a new PVC.

Refs: arrikto/dev/issues/386

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
Reviewed-by: Ilias Katsakioris <elikatsis@arrikto.com>

* jwa(back): Add unittests for new volumes API

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
Reviewed-by: Ilias Katsakioris <elikatsis@arrikto.com>

* jwa(back): Extend the PVC info returned

We want to show both the access mode and size of the existing PVCs, when
a user clicks on the dropdown to select which PVC to mount.

The backend will need to provide this information to the frontend. We
don't want to send the K8s list of PVCs since this will result in a lot
of unnecessary data to be sent.

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
Reviewed-by: Ilias Katsakioris <elikatsis@arrikto.com>

* jwa(front): Add proxy config for Rok

When developing the Rok flavor locally we will need to be able to open
the Rok chooser. This can be done by using Angular/webpack proxy to
bring the exposed rok service and the app under the same domain.

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
Reviewed-by: Tasos Alexiou <tasos@arrikto.com>

* jwa(front): Remove card from form

The form of the app should not be a big card, but a normal form.

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
Reviewed-by: Tasos Alexiou <tasos@arrikto.com>

* jwa(front): Install AceModule for yaml editing

Install AceModule to allow users to edit yamls of objects.

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
Reviewed-by: Tasos Alexiou <tasos@arrikto.com>

* wa(front): Change the styling of form sections

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
Reviewed-by: Tasos Alexiou <tasos@arrikto.com>

* jwa(front): Create common volume components

Component for:
* New PVC and configuring its spec
* Attaching an existing PVC in a Notebook

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
Reviewed-by: Tasos Alexiou <tasos@arrikto.com>

* jwa(front): Update Rok form for new Volume API

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
Reviewed-by: Tasos Alexiou <tasos@arrikto.com>

* jwa(front): Mark inputs as dirty when restoring Lab

When the UI autofills the form with values from a JupyterLab snapshot
then it should mark the touched fields as dirty. This way if a field has
errors the UI will make that input red.

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
Reviewed-by: Tasos Alexiou <tasos@arrikto.com>

* jwa: Update ConfigMap in manifests

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

* jwa(front): Fix format errors

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
2022-02-07 16:26:17 +00:00
..
projects/kubeflow jwa: Rework the Storage API of the web app (kubeflow/kubeflow#6321) 2022-02-07 16:26:17 +00:00
.editorconfig Create an Angular Library with common frontend code (kubeflow/kubeflow#5252) 2020-08-28 05:14:53 -07:00
.gitignore Create an Angular Library with common frontend code (kubeflow/kubeflow#5252) 2020-08-28 05:14:53 -07:00
README.md web-apps(front): Update the README (kubeflow/kubeflow#5481) 2020-12-23 02:42:28 -08:00
angular.json Update CRUD web apps from Angular 8 to Angular 12 (kubeflow/kubeflow#6004) 2021-07-21 02:35:50 -07:00
package-lock.json Bump log4js from 6.3.0 to 6.4.1 in /components/crud-web-apps/common/frontend/kubeflow-common-lib (kubeflow/kubeflow#6309) 2022-01-26 22:01:09 +00:00
package.json frontend: Use responsive tables instead of cards (kubeflow/kubeflow#6316) 2022-01-26 13:30:44 +00:00
tsconfig.json Update CRUD web apps from Angular 8 to Angular 12 (kubeflow/kubeflow#6004) 2021-07-21 02:35:50 -07:00
tslint.json Update CRUD web apps from Angular 8 to Angular 12 (kubeflow/kubeflow#6004) 2021-07-21 02:35:50 -07:00

README.md

Kubeflow Common Frontend Library

This code provides a common library of reusable Angular Components that can be used from our different Kubeflow web apps. This library aims to:

  • Enforce a common UX throughout the different apps
  • Reduce the development effort required to propagate changes to all the web apps
  • Minimize the code duplication between our Kubeflow web apps

This project was generated with Angular CLI version 8.3.20, which is required to build and run the unit tests.

Local development

In order to use this library while developing locally your Angular app you will need to:

  1. Build the kubeflow node module from this source code
  2. Link the produced module to your global npm modules
  3. Link the kubeflow module in the npm modules of you app

Building the library locally

# build the npm module
npm run build

# might need sudo, depending on where you global folder lives
# https://nodejs.dev/learn/where-does-npm-install-the-packages
npm link dist/kubeflow

Linking it to the app

cd ${APP_DIR}
npm install
npm link kubeflow

Running unit tests

Run ng test to execute the unit tests via Karma.

Contributor Guidelines

Unit tests

  1. Any new component added to this library should also include some basic unit tests
  2. The unit tests should be passing at any point of time

Git commits

Git commits that modify this code should be prefixed with web-apps(front).