* 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>
* Update the releasing version tag
Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
* Run automated script for updating versions
Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
* wa(docker): Don't copy node_modules
To ensure Kaniko is not copying stale node_moduels folders, even though
we have a dockerignore file, we are explicitly only copying the source
code.
We have seen the build system with Kaniko to fail, due to NFS stale
instances with files in node_modules and expect that this is the root
cause.
Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
* twa: Update makefile to use global dockerignore
The dockerfile for TWA was copying over the local dockerignore. This was
overriding the global one we had for all the web apps.
This commit updates the Makefile of the app to use the global
dockerignore that all the apps should use.
Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
* jwa(front): Make ng lint work by ignoring e2e/tsconfig.json
Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
Reviewed-by: Tasos Alexiou <tasos@arrikto.com>
* web-apps(front): Make the table responsive
We introduced all of our changes in the underlying TableComponent. This
component can then be either used independently or inside a material
card.
The changes we did in that component are:
1. Create Output() emitters, since this component can be used directly
2. The config object for a Table row now supports a `style` prop for
defining the list of CSS styles to be applied
2. Remove the truncate classes (small, medium, large) and only have
a boolean value. The user can define the width directly now via the
`style` property in the row's config
3. Modify the classes for aligning contents right and left
Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
Reviewed-by: Tasos Alexiou <tasos@arrikto.com>
* web-apps(front): Add table paginator
Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
Reviewed-by: Tasos Alexiou <tasos@arrikto.com>
* web-apps(front): Add padding to titlebar text
Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
Reviewed-by: Tasos Alexiou <tasos@arrikto.com>
* web-apps(front): Use bigger font for toolbar title
Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
Reviewed-by: Tasos Alexiou <tasos@arrikto.com>
* jwa(front): Use responsive table and toolbar
We refactor both the index and form pages of the app to:
1. Add a top row toolbar with the title of the app and the button to
create a new Notebook
2. Replace the card with a responsive table that shows the items. The
component also has a paginator
Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
Reviewed-by: Tasos Alexiou <tasos@arrikto.com>
* vwa(front): Use responsive table and toolbar
This commit:
1. Adds a toolbar at the top of the index page with the title of the app
and the button to create a new volume
2. Replaces the card with a responsive table
Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
Reviewed-by: Tasos Alexiou <tasos@arrikto.com>
* twa(front): Use responsive table and toolbar
This commit:
1. Adds a toolbar at the top of the index page with the title of the app
and a button to create a new TensorBoard instance
2. Replaces the card with a resopnsive table
Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
Reviewed-by: Tasos Alexiou <tasos@arrikto.com>
* fix the format
Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
* wa(front): Add npm script for running unit tests in docker
Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
* fix unit tests failing
Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
JWA should not block users from selecting GPUs if the current cluster
nodes do not have any GPUs attached to them. We've seen users that have
autoscaled nodegroups for GPUs, so a GPU node will be added to the
cluster once a Pod has requested it.
Refs: arrikto/dev#1484
Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
* jwa(front): Don't allow NaN values in limits
The UI should always catch a NaN value and don't add it in the form.
Currently this is the case for the cpu/memory limits.
Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
* jwa(front): Limits should not be changed if dirty
If the user has manually edited the limits fields then the UI should not
try to automatically calculate them again, using the limitFactors.
Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
* [fix]: Make jupyter-web-app parse workspace volume MountPath
- workspace volume path was fixed with "/home/jovyan"
- it should be enable to parse from jupyter-web-app-config's data
* change parsing key correctly
* cwa(front): Ignore font files in assets
* feat(jupyter): add fonts as assets to service
* CRUD: fonts in common
* CWA: Remove link to css file
* jwa(front): Remove font assets from jupyter
Co-authored-by: Wendy Gaultier <wvgaultier@gmail.com>
* jwa(front): Add static logos in the app
The app does not contain the logos' svgs in its source code/static
files. This results in the icons to not show when developing locally.
This commit adds the svgs found in the logos ConfigMap to the static
files of the app as well.
Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
* jwa(front): Change logos fetch url
Change the URLs of the logos from `static/assets/*` to
`static/assets/logos`.
Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
* jwa(manifests): Don't override assets with logos
Mount the ConfigMap under the `static/assets/logos` directory to not
override the contents of the entire assets dir.
Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
* vwa(front): Add npm script to check the formatting
Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
* vwa(front): Update the package-lock.json
Run `npm install` to bring the package-lock.json up to date
Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
* vwa(front): Fix formatting
Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
* vwa(back): Fix formatting
Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
* vwa(docker): Remove unused dockerignore file
We have created a global dockerignore file for all the web apps in the
parent dir.
Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
* vwa(docker): Don't copy node_modules in dockerfile
Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
* vwa(make): Don't include dockerignore
Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
* ci(vwa): Add format check tasks
Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
* jwa(docker): Copy only necessary files for build
Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
* review: Use docker context instead of cd ..
Don't use a `cd ..` and copy dockerignore files back and forth. Instead
we should use the Docker context and the global dockerignore file we
have for all the web apps.
Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
* Make notebook limits configurable with a multiplication factor
* Make limits configurable under advanced section
* run prettier to format frontend code
* fix formatting and add rounding in backend
* Return error if limit is smaller than request
* Allow disabling limitFactor by setting it to none
* review: remove camelCase in python backend
* fix: update spawner_ui_config.yaml in manifests directory
* review: fix setting limits backend
* review: remove unnecessary check from backend
* rebase: Make logos configurable in configmap and remove trademark references
Rebased to remove the changes to the package-lock.json
* review: add suggested changes and add image group section to README
* web-apps(back): Introduce APP_SECURE_COOKIES var
Expose a new APP_SECURE_COOKIES env variable that will configure whether
the web apps should set Secure cookies or not.
This will allow the admins to configure the web apps to work when
Kubeflow is exposed over localhost/http.
Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
* web-apps(back): Switch CSRF checks order
The order the backend makes the CSRF checks should be the following:
1. check if the CSRF cookie is present
2. check if the CSRF header is present
3. check if the CSRF cookie and header have the same value
Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
* web-apps: Set APP_SECURE_COOKIES to false in dev
When running the web apps via the makefiles in dev mode we will need to
explicitly set the APP_SECURE_COOKIES env var to False, since the app
will be served over http.
Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
* Add RStudio trademark statement
* move tooltip position to the right of the RStudio button
* fix labels of icons
* RStudio trademark tooltip on index page, remove title jupyter-icon
* jwa(back): ability to setting annotations on NB resource
* jwa(back): update spanwer yaml, dump logo from yaml if file doesn't exist
* jwa(front): add annotations and VSCode/RStudio image types/config
* jwa(front): add server type toggle to UI
* jwa(front): set annotations in notebook request based on server-type
* jwa(front): add server type column to index page
* review: improve button toggle formatting
* jwa(back): set rstudio-tidyverse image in spawner_ui_config
* review: move rewrite and headers to backend
* review: add logo SVGs and set them in environment*.ts
* review: fix how allowing custom images works
* review: add server type logo to index
* 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>