Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement table view on Web UI #119

Merged
merged 20 commits into from
Mar 11, 2022

Conversation

196Ikuchil
Copy link
Contributor

@196Ikuchil 196Ikuchil commented Feb 23, 2022

What type of PR is this?

/kind feature

What this PR does / why we need it:

  • Reorganization of the directories of some current resources List components.
  • Implement DataTable on web UI. This table view is switchable to the current resources list view.
    • This is an alpha feature. It will be enabled if the ALPHA_TABLE_VIEWS environment value is 1.
  • simple searching.
  • sorting.
  • clickable to edit and delete.

Which issue(s) this PR fixes:

Fixes #96

Special notes for your reviewer:

Samples

スクリーンショット 2022-02-28 22 57 05

スクリーンショット 2022-02-28 22 57 16

スクリーンショット 2022-02-28 23 06 15

clickable

スクリーンショット 2022-02-28 22 58 12

/label tide/merge-method-squash

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. kind/feature Categorizes issue or PR as related to a new feature. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. labels Feb 23, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @196Ikuchil. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Feb 23, 2022
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. labels Feb 23, 2022
nstore.select(node, false);
};
const search = "";
const headers = [
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need help

We need to discuss which columns should be selected for display.
I think that displaying all parameters is not good.
The current columns of each data table are my randomly selected.

Copy link
Contributor Author

@196Ikuchil 196Ikuchil Feb 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In commit d225fbc, I changed some columns(headers).

These columns are displayed in each table.

  • name
  • namespace
  • capacity
  • status(phase)
  • condition
  • creation-time
  • update-time

And for other columns, I choose the unique values of each resource.

@sanposhiho
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 25, 2022
},
{
text: "Update-Time",
value: "metadata.managedFields[0].time",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currently, we display the managed field's timestamp as an update time.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that there is no way to get the updated time except this.
I also checked that this doesn't raise an error even if managedFields[0] is nil. (The cell becomes empty.)

@sanposhiho
Copy link
Member

/assign

@sanposhiho
Copy link
Member

sanposhiho commented Feb 28, 2022

@196Ikuchil

Some feedbacks.

For Pod table,

  • Status is not needed. (Because it's always pending).

For Node table,

  • Namespace is not needed. Node is not namespaced resource.
  • Conditions and Status is not needed.
  • Capacity should show each resource(CPU, memory, and pod)

For PV table,

  • Namespace is also not needed. not namespaced resource.
  • PVReclaimPolicy is not needed.

For PVC table,

  • Status is also not needed. same reason as Pod.

For SC table,

  • Namespace is not needed. same reason.
  • Parameters, Reclaim-Policy, and Volume-Binding-Mode are not needed.

For PC table,

  • Namespace is not needed. same reason.

And for all tables,

  • The length of the Search box should be the same for all tables.
  • change not to use -. Use the exact name instead. (like CreationTime, GlobalDefault...)

Others

  • Move "List, Table" switch to top bar.

@sanposhiho
Copy link
Member

And, in current implementation, Node on Pod table is not updated.
I raise it as another issue because this is not a problem specific to this feature.
#120

@196Ikuchil
Copy link
Contributor Author

Hi @sanposhiho
Thanks to the reviews. I generally understand.
I have two questions.

  1. Status
    On PVC, there are possibilities to take other values. Is status not needed?Ref:kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/
    (Note: On other resources, I have checked that the status parameter is Deprecated. For example, PodStatus. Therefore, I will remove it from the table.)

  2. Move "List, Table" switch to top bar.
    I think it shouldn't move. This is because the buttons should not be placed far from the table. Isn't it hard to tell what the switch is for?
    And also the button's component file should be placed under the ResourceViews directory.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 28, 2022
@sanposhiho
Copy link
Member

On PVC, there are possibilities to take other values. Is status not needed?

Yes. Not needed. This value is not much related to scheduling. (This is "scheduler" simulator, so columns that are not related to scheduling are not needed basically.)

This is because the buttons should not be placed far from the table. Isn't it hard to tell what the switch is for?

It's a fair point. But it is the same even in its current location. It is only when the user touches it that they realize it has something to do with how it is displayed.

How about removing the button and change the UI with env.
Like ALPHA__TABLE_VIEWS. If ALPHA__TABLE_VIEWS == true (or 1?), use the table to show resources.

@sanposhiho
Copy link
Member

sanposhiho commented Feb 28, 2022

I think one of the strengths of the current view is "It's easy to see where Pod is."

Conversely, if we can achieve this strength in this table view, I think we can replace the current UI with table view completely.

@sanposhiho
Copy link
Member

/retitle Implement table view on Web UI

@k8s-ci-robot k8s-ci-robot changed the title Implement DataTable on Web UI to be able to see many resources Implement table view on Web UI Feb 28, 2022
@sanposhiho
Copy link
Member

Conversely, if we can achieve this strength in this table view, I think we can replace the current UI with table view completely.

This does not mean that I want you to make changes that way in this PR. I think we can merge this PR first, and then make improvements for that. (Otherwise, this PR will become too big.)

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 28, 2022
@196Ikuchil
Copy link
Contributor Author

How about removing the button and change the UI with env.
Like ALPHA__TABLE_VIEWS. If ALPHA__TABLE_VIEWS == true (or 1?), use the table to show resources.

Understood. In this PR, we use env value.
And we expect that the current view will replace this table view in nearly future.

@196Ikuchil
Copy link
Contributor Author

@sanposhiho
Fixed it✋
I also updated the documentation and screenshots at the top of this PR.
#119 (comment)

@196Ikuchil
Copy link
Contributor Author

/unhold

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 28, 2022
type: Array,
default: () => [],
},
label: {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename to title or resourceName

Copy link
Member

@sanposhiho sanposhiho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make it clear that each row on table is clickable.

};
},
});
</script>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
</script>
</script>
<style>
.row-pointer > .v-data-table__wrapper > table > tbody > tr:hover {
cursor: pointer;
}
</style>

:items="items"
:items-per-page="5"
:search="search"
multi-sort
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
multi-sort
multi-sort
class="row-pointer"

Copy link
Member

@sanposhiho sanposhiho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @196Ikuchil 👍
/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 11, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 196Ikuchil, sanposhiho

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 11, 2022
@k8s-ci-robot k8s-ci-robot merged commit 9b1f680 into kubernetes-sigs:master Mar 11, 2022
matthewygf pushed a commit to matthewygf/kube-scheduler-simulator that referenced this pull request Mar 28, 2022
* refactor:move resource view components to under the ResourceViews/List/ directory

* refactor:create ResourcesViewPanel component and replace it on index.vue

* add: ResourcesViewPanel & RadioButton to select view

* add:DataTable template

* fix:typo

* add:basic data tables for each resources

* fix:import PodList on UnscheduledPodList

* fix:change display columns

* fix:declare of Array type

* fix:remove debug comment

* fix:change show columns

* fix:change columns name

* typo:lang

* style:adjust search text field of tables

* feat:add ALPHA_TABLE_VIEWS env

* fix:show datatable if ALPHA_TABLE_VIEWS env val is "1"

* fix:column name

* refactor:separated into new component

* refactor:change label to title

* style:make it clear that each row on table is clickable
matthewygf pushed a commit to matthewygf/kube-scheduler-simulator that referenced this pull request Apr 18, 2022
* refactor:move resource view components to under the ResourceViews/List/ directory

* refactor:create ResourcesViewPanel component and replace it on index.vue

* add: ResourcesViewPanel & RadioButton to select view

* add:DataTable template

* fix:typo

* add:basic data tables for each resources

* fix:import PodList on UnscheduledPodList

* fix:change display columns

* fix:declare of Array type

* fix:remove debug comment

* fix:change show columns

* fix:change columns name

* typo:lang

* style:adjust search text field of tables

* feat:add ALPHA_TABLE_VIEWS env

* fix:show datatable if ALPHA_TABLE_VIEWS env val is "1"

* fix:column name

* refactor:separated into new component

* refactor:change label to title

* style:make it clear that each row on table is clickable
k8s-ci-robot pushed a commit that referenced this pull request Apr 18, 2022
…in (#121)

* Able to configure API server and port, thus expose it is possible via compose

* linters

* update property name to be more descriptive

* change the parameter arg to be more descriptive

* WIP - use create server chain to start k8s api server.

* WIP - remove unecessary shutdown fn

* setup annoymoususer for insecure testing

* update go mod sum

* instead of building kube-api , only do openapi-gen

* add vendor files into repo and keep existing openapi gen

* forgot to add openapi

* remove not needed generated api

* refactor due to linters

* change makefile to what it was for github action

* refactor due to cyclomatic complexity

* use original dockerfile step

* unnecessary if

* remove openapi step before test

* disable admission plugins to for node taints and service account checks

* Added docs to describe our kube-apiserver creation process and env var

* add permission doc

* Import from existing cluster (#111)

* feat:add ignoreRestart Option to Import on ExportService

* add:impl ReplicateExistingClusterService

* add:ExternalKubeClientCfg to config

* add:impl interface of ReplicateExistingClusterService

* feat:impl replicate existing cluster's resources logic if ExternalImportEnabled is enabled

* test:add Import with ignoreRestart test

* refactor:add interface of ExportService

* add:create mock of ExportService(run go generate)

* Update config/config.go

Co-authored-by: Kensei Nakada <handbomusic@gmail.com>

* Update export/export.go

Co-authored-by: Kensei Nakada <handbomusic@gmail.com>

* Update export/export.go

Co-authored-by: Kensei Nakada <handbomusic@gmail.com>

* Update replicateexistingcluster/replicateexistingcluster.go

Co-authored-by: Kensei Nakada <handbomusic@gmail.com>

* Update replicateexistingcluster/replicateexistingcluster.go

Co-authored-by: Kensei Nakada <handbomusic@gmail.com>

* Update server/di/di.go

Co-authored-by: Kensei Nakada <handbomusic@gmail.com>

* Update server/di/di.go

Co-authored-by: Kensei Nakada <handbomusic@gmail.com>

* Update replicateexistingcluster/replicateexistingcluster.go

Co-authored-by: Kensei Nakada <handbomusic@gmail.com>

* Update replicateexistingcluster/replicateexistingcluster.go

Co-authored-by: Kensei Nakada <handbomusic@gmail.com>

* Update replicateexistingcluster/replicateexistingcluster.go

Co-authored-by: Kensei Nakada <handbomusic@gmail.com>

* refactor:rename IgnoreRestart option to IgnoreSchedulerConfiguration

* refactor:rename _exportService to exportService

* refactor:rename to replicateExistingClusterService

* refactor:change convert logic of resources

* refactor:move private functions to utils.go of export package

* test:export utils test

* test:add test for replicateexistingcluster

* fix:return value of ConvertToResourcesForImportFromResourcesForExport

* fix:get a context in arg of ImportFromExistingCluster

* fix:remove comment

* fix:rename to ConvertResourcesForImportToResourcesForExport

* fix:do import before API server starting

Co-authored-by: Kensei Nakada <handbomusic@gmail.com>

* support reset feature on web ui (#114)

* fix nil pointer reference

* update delete collection method to force delete

* fix conflict

* delete debug print

* fix lint

* fix

* update factory method

* add provider

* fix reset button

* fix format

* Rename simulatorPlugin to wrappedPlugin (#126)

* refactor:rename simulatorPlugin to wrappedPlugin

* fix:prefix word

* test:fix

* refactor:receiver name

* Implement table view on Web UI (#119)

* refactor:move resource view components to under the ResourceViews/List/ directory

* refactor:create ResourcesViewPanel component and replace it on index.vue

* add: ResourcesViewPanel & RadioButton to select view

* add:DataTable template

* fix:typo

* add:basic data tables for each resources

* fix:import PodList on UnscheduledPodList

* fix:change display columns

* fix:declare of Array type

* fix:remove debug comment

* fix:change show columns

* fix:change columns name

* typo:lang

* style:adjust search text field of tables

* feat:add ALPHA_TABLE_VIEWS env

* fix:show datatable if ALPHA_TABLE_VIEWS env val is "1"

* fix:column name

* refactor:separated into new component

* refactor:change label to title

* style:make it clear that each row on table is clickable

* Display the kind/apiVersion in the scheduler configuration yaml (#129)

* Display the kind/apiVersion in the scheduler configuration yaml

* Add kind/apiVersion to the yaml as you might expect
* For "APPLY" keep the profiles only so that ignored edits
  (e.g. apiVersion) are not displayed next time.
* The editor still allows unsupported/ignored edits, but at least
  it is clear what was set when you revisit.

Signed-off-by: Mark Sturdevant <mark.sturdevant@ibm.com>

* Ensure only profiles get updated in ApplySchedulerConfig

* Also don't yarn lint/format coverage directory

* WIP - remove unecessary shutdown fn

* fix rebase issue

* merge master

* Request kube apiserver directly from frontend (#115)

* Request kube apiserver directly from frontend

* Show axios errors on page

* Add axios error judge

* Change default kubeAPIserver port

* Add simple cause err message, Fix typo

* Delete comments

* Fix err message

* change kube apiserver request header

* tmp

* Delete pods when delete node

* delete managed field before apply

* Update web/components/ResourceBar/ResourceBar.vue

Co-authored-by: Kensei Nakada <handbomusic@gmail.com>

Co-authored-by: Kensei Nakada <handbomusic@gmail.com>

* Add deprecate description (#127)

* Add deprecate comment lines

* change some docs description

* fix indent and move not-deprecate APIs

* fix linter err

* setup annoymoususer for insecure testing

* Request kube apiserver directly from frontend (#115)

* Request kube apiserver directly from frontend

* Show axios errors on page

* Add axios error judge

* Change default kubeAPIserver port

* Add simple cause err message, Fix typo

* Delete comments

* Fix err message

* change kube apiserver request header

* tmp

* Delete pods when delete node

* delete managed field before apply

* Update web/components/ResourceBar/ResourceBar.vue

Co-authored-by: Kensei Nakada <handbomusic@gmail.com>

Co-authored-by: Kensei Nakada <handbomusic@gmail.com>

* Able to configure API server and port, thus expose it is possible via compose

* refactor due to linters

* remove unecessary error channel

* log the error return from prepared aggregator server

* add temp cert directory

* remote unnecessary changes.

* update md to reflect default api behavior

* remove unnecessary flag

* Enable Priority Plugin for admission

Co-authored-by: Kensei Nakada <handbomusic@gmail.com>

* Change the order of logging to ensure url is correct.

Co-authored-by: Kensei Nakada <handbomusic@gmail.com>

* pass cleanupFunc all the way to shutdown

* attemp to fix useragent issue

* Revert "attemp to fix useragent issue"

This reverts commit b06408a.

Co-authored-by: 196Ikuchil <22634362+196Ikuchil@users.noreply.github.com>
Co-authored-by: Kensei Nakada <handbomusic@gmail.com>
Co-authored-by: sivchari <shibuuuu5@gmail.com>
Co-authored-by: Mark Sturdevant <mark.sturdevant@ibm.com>
Co-authored-by: momom-i <51011095+momom-i@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

improve Web UI to be able to see many resources for large cluster
3 participants