Commit Graph

17 Commits

Author SHA1 Message Date
James Liu 83d7e719d0
fix(frontend): Introduce ALLOWED_ARTIFACT_DOMAIN_REGEX flag to prevent accessing undesired domains. Remove user input string from server response. (#9844)
* fix(frontend): Introduce ALLOWED_ARTIFACT_DOMAIN_REGEX flag to prevent accessing undesired domains. Remove user input string from server response.

1. Remove user query parameter string from server response.
2. Introduce ALLOWED_ARTIFACT_DOMAIN_REGEX to allow configuration of allowed domains querying.
3. By default, ALLOWED_ARTIFACT_DOMAIN_REGEX is match all. Default configuration is meant to be demo purpose and not for production.
4. Users can provide ALLOWED_ARTIFACT_DOMAIN_REGEX environment variable to restrict object storage endpoint querying domains.

* add test
2023-08-11 18:44:33 +00:00
Yihong Wang bb9dc67572
feat(frontend): make container name configurable (#9433)
* feat(frontend): make container name configurable

Add an UIConfig param to specify the container name in a pod
where logs are retrieved. The default container name for
the Argo is `main`. However, in Tekton, the main container name
contains the `step-` prefix. Make this configurable to support
other orchestrations.

Signed-off-by: Yihong Wang <yh.wang@ibm.com>

* fix test case error

add `undefined` as the expected `logContainerName` param

Signed-off-by: Yihong Wang <yh.wang@ibm.com>

* address the comment

use default value `main` in `getPodLogsStreamFromK8s`
same as `getPodLogs`

Signed-off-by: Yihong Wang <yh.wang@ibm.com>

* only pass podLogContainerName

Signed-off-by: Yihong Wang <yh.wang@ibm.com>

---------

Signed-off-by: Yihong Wang <yh.wang@ibm.com>
2023-05-17 23:37:06 +00:00
Joe Li d4e45cc2a4
chore(frontend): Support v1 and v2 API request simultaneously in the frontend server (#8862)
* Add apiVersion2 and apiVersion2Prefix in configs.ts
Support v2 request in frontend server.

* Fix incorrect prefix for v2.

* Fix incorrect reference for apiVersion2Prefix
Add v2 healthz handler().

* Add v2 pod / logs handler
Add v2 conditions for sending 403 to endpoints.
Add proxyMiddleware for v2 prefix.
2023-02-23 03:53:23 +00:00
Alexey Volkov cc83e1089b
Assigned copyright to the project authors (#5587) 2021-05-05 13:53:22 +08:00
Rafał Bigaj 678ae0fe08
feat(backend): new server API to read run log. Fixes #4468 (#4493)
* New server API: read run log

- The new server API endpoint (/apis/v1beta1/runs/{run_id}/nodes/{node_id}/log) to fetch run log
- `ARCHIVE_LOG_FILE_NAME` and `ARCHIVE_LOG_PATH_PREFIX` options allows to control archive log path
- UI Server fetches logs from server API or directly from k8s depending on `STREAM_LOGS_FROM_SERVER_API` option

* New server API: read run log

- ml-pipeline rbac update: allow for access to log

* Read run log: enhanced error handling

- log message on Pod access errors

* Read run log: enhanced log archive options

* Code format

* Test update after getPodLogs signature change

* Updated comments after review

* `follow` query parameter in GET /apis/v1beta1/runs/{run_id}/nodes/{node_id}/log

* Env variable friendly config names & comments

- Config options: ARCHIVE_CONFIG_LOG_FILE_NAME, ARCHIVE_CONFIG_LOG_PATH_PREFIX
- Copyright message update
- New endpoint as `v1alpha1`

* Licence updates

- fluent-bit licence inlined
- copyright message updates

* Master merge

- dependency conflicts
2020-11-11 00:37:50 -08:00
Yuan (Bob) Gong e3992faf83
feat(frontend): UX change to support downloading directory artifacts. Fixes #3667 (#4696)
* feat(frontend): change artifact link to download without extracting. Fixes #3667

* update artifact preview UX

* Fix tests

* add frontend unit tests

* fix

* move artifact integration tests to its own file

* fixed flaky aws-helper test

* refactor and add ui server integration tests

* Update UX according to feedback

* update snapshots

* Update minio-helper.ts

* update
2020-11-03 05:36:15 -08:00
Yuan (Bob) Gong c7300c343c
fix: all big enough ui proxy requests fail with error proxying with partial data (#4266)
* fix: all big enough ui proxy requests fail with error proxying with partial data

* Fix naming
2020-07-23 21:16:22 -07:00
Yuan (Bob) Gong 5435e8724f
[UI Server] Refactor for configurable auth header (#3753)
* [UI] Make auth header configurable

* Refactor authorizeFn to move side effects out

* Refactor tests to reduce duplication
2020-05-12 22:06:25 -07:00
Yuan (Bob) Gong cb71eed5f9
[UI] authorize tensorboard actions (#3639)
* Authorization service proto

* implement auth service

* Add unit tests

* Generate auth api client

* Authorization checks for tensorboard apis

* UI Server authorization checks

* Clean up error parsing

* Revert changes

* Fix portable-fetch not found bug

* Fix unit test

* Include portable-fetch required by api client

* Fix portable-fetch module import error

* Fix portable-fetch again

* Add unit tests

* Address CR comments

* add unit test for header

* Update readme
2020-04-28 15:26:24 -07:00
Yuan (Bob) Gong b7706c0134
[UI Server] Enable strict type checking and fix errors (#3593)
* wip

* Fix typing

* Fix build error

* Add type checking to tests

* Fix server typing

* Clean up

* Fix server typing
2020-04-23 09:25:11 -07:00
Yuan (Bob) Gong 09b506fc1a
[UI] Multi user permission separation for artifact api (#3522)
* [UI Server] Proxy /namespaces/:namespace/artifacts/get requests to namespace specific artifact services

* [UI] Show artifacts by namespace

* Fix minio artifact link tests

* Fix DetailsTable tests

* Fix OutputArtifactLoader.test

* Change artifact proxy to use query param instead

* Add integration tests for artifact proxy

* Fix unit tests

* Rename service name

* Add comment

* add more comments

* Fix import

* Refactored how to spy on internal methods from tests
2020-04-22 22:31:45 -07:00
Yuan (Bob) Gong 0ef074239d
[UI Server] Blocks non public KFP report APIs (#3334)
* [UI Server] Blocks reportMetrics KFP api

* Also reject report workflow endpoint

* Also block report swf endpoint
2020-03-23 23:34:47 -07:00
Yuan (Bob) Gong f882f361cc
[UI] Show step pod yaml and events in RunDetails page (#3304)
* [UI Server] Pod info handler

* [UI] Pod info tab in run details page

* Change pod info preview to use yaml editor

* Fix namespace

* Adds error handling for PodInfo

* Adjust to warning message

* [UI] Pod events in RunDetails page

* Adjust error message

* Refactor k8s helper to get rid of in cluster limit

* Tests for pod info handler

* Tests for pod event list handler

* Move pod yaml viewer related components to separate file.

* Unit tests for PodYaml component

* Fix react unit tests

* Fix error message

* Address CR comments

* Add permission to ui role
2020-03-20 02:42:38 -07:00
Rafael Barreto 23fb4618ae
Parametrize the image used for the Tensorboard viewer (#3235)
* Parametrize the image used for the Tensorboard viewer

Right now, the image is hard-coded and it's not possible to override it.
This is a problem when running Kubeflow Pipelines in a cluster without
access to the internet or public repositories (e.g.
https://github.com/kubeflow/pipelines/issues/3232). This solves the
issue by parametrizing the image name through an environment
variable.

* Fix formatting issues

* Address review comments
2020-03-15 20:36:35 -07:00
Yuan (Bob) Gong 3b072b2ff7
[UIServer] Add DISABLE_GKE_METADATA env flag to skip metadata retrieval. (#3118)
* Add DISABLE_GKE_METADATA env flag to skip metadata retrieval.

* node server build step fix and cleanup

* Update frontend dockerfile to use npm ci
2020-02-20 03:35:02 -08:00
Yuan (Bob) Gong 842b0cec7f
[Visualization] Clean up full.tpl to improve vis loading time (#3116)
* Remove @jupyter/html-manager from full.tpl

* Include visualization server cloudbuild yaml to facilitate local dev

* Stop fallback behavior of KFP UI to improve dev experience
2020-02-19 04:56:25 -08:00
Eterna2 2ec2fd23c5 [Frontend] unit tests for node server (#2745)
* Add unit tests for aws-helper and minio-helper.

* Break up server.ts into app.ts and handlers/*.ts so that unit test can be written more easily.

* update @types/node because of https://github.com/microsoft/TypeScript/issues/32333

* upgrade kubernete-client version to be compatible with new @types/node version

* fix bug: AWSInstanceProfileCredentials.profile() returns a promise not a string

* remove I prefix from interfaces. minor fixes on lint errors.

* fix format errors

* Added more unit tests, and minor fixes.

* Fix comment: GKS should be GKE

* use jest.resetAllMocks instead of reset each mock individually

* fix format for helper test
2020-01-05 20:43:40 -08:00