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

WIP: New UI #438

Closed
wants to merge 40 commits into from
Closed

WIP: New UI #438

wants to merge 40 commits into from

Conversation

Akado2009
Copy link
Contributor

@Akado2009 Akado2009 commented Mar 26, 2019

This PR introduces new UI built with React. You can submit/monitor both NAS and HP jobs as well as templates.

Fixes: #373

Work still in progress, but all the functionality works. There is a lot of code duplication, i am gonna refactor it asap.

Youtube link with the demo: https://www.youtube.com/watch?v=WAK37UW7spo


This change is Reviewable

pkg/types.go Outdated
@@ -10,7 +10,8 @@ const (
VizierServiceNamespaceEnvName = "VIZIER_CORE_NAMESPACE"
VizierService = "vizier-core"
VizierPort = "6789"
ManagerAddr = VizierService + ":" + VizierPort
// ManagerAddr = "10.111.12.89:6789"

Choose a reason for hiding this comment

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

if not using this then it can be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@@ -0,0 +1,15 @@
{
"short_name": "React App",

Choose a reason for hiding this comment

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

You can rename these for mobile web use when added to the spring board

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

</div>
</div>
)
}

Choose a reason for hiding this comment

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

may be useful to add type checking on the props to components https://reactjs.org/docs/typechecking-with-proptypes.html

Copy link
Contributor Author

@Akado2009 Akado2009 Apr 23, 2019

Choose a reason for hiding this comment

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

Nice call, doing it right now. After it is merged we might add some validation (e.g. warning for different forms).


const mapStateToProps = (state) => {
return {
filteredJobsList: state[module].filteredJobsList,

Choose a reason for hiding this comment

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

Why not just pass this from the parent where the data is fetched? I find a lot of value in using a container-component approach. Here's a good article on it: https://medium.com/@learnreact/container-components-c0e67432e005
It's just much easier to follow the flow of data when data is passed down to children. Someone reading this may have a hard time seeing that in order for this to display anything, somewhere at some point someone needs to fetch the data using fetchHPJobs() and it may not be clear where that happens - or it could even be multiple places.

theme="tomorrow"
value={props.yaml}
onChange={onYamlChange}
name="UNIQUE_ID_OF_DIV"

Choose a reason for hiding this comment

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

why name this UNIQUE_ID_OF_DIV?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed


const styles = theme => ({
running: {
color: '#8b8ffb',

Choose a reason for hiding this comment

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

These could be added to the theme definition for reuse

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

<Typography variant={"h6"}>
Architecture
</Typography>
<div id={id} style={{textAlign: "center !important", margin: '0 auto'}} />

Choose a reason for hiding this comment

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

this inline style can be pulled out into the style definition. Also, instead of using !important if there's a way to use multiple stringed class declaration, I'd use that. css in js is relatively new (in alpha actually), so not sure if it's possible so if not then !important is fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

requestNumber: action.number,
}
case actions.ADD_METRICS_HP:
let metricsName = state.metricsName.slice()

Choose a reason for hiding this comment

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

let's stay consistent and use semicolons

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Gonna add them everywhere.

<Route path="/katib/nas_monitor/:id" component={NASJobInfo} />
<Route path="/katib/worker" component={Worker} />
<Route path="/katib/collector" component={Collector} />
{/* <Route exact path="/" component={GenerateFromYaml} />

Choose a reason for hiding this comment

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

can this be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@richardsliu richardsliu mentioned this pull request Apr 16, 2019
15 tasks
@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

This reverts commit f4cd554.
@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@andreyvelich
Copy link
Member

@MattSich @richardsliu @YujiOshima We fixed all commentaries, please check it again. Will update README for the UI later.

restartPolicy: Never
suggestionSpec:
suggestionAlgorithm: "nasrl"
requestNumber: 3
requestNumber: 1
suggestionParameters:
- name: "lstm_num_cells"
value: "64"
Copy link
Member

Choose a reason for hiding this comment

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

Please, remove changes in the yaml files.

@k8s-ci-robot
Copy link

@Akado2009: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
kubeflow-katib-presubmit a3955c3 link /test kubeflow-katib-presubmit

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

@codebreach
Copy link

Is there a plan to merge this?

Alternatively can the code here be build (and deployed) separately...?

@gaocegege
Copy link
Member

/close

I think we have merged the new UI in other PRs. Now katib has the react-based UI. Thanks for your work!

@codebreach Sorry for the late reply. Now katib already has the UI based on react.

@k8s-ci-robot
Copy link

@gaocegege: Closed this PR.

In response to this:

/close

I think we have merged the new UI in other PRs. Now katib has the react-based UI. Thanks for your work!

@codebreach Sorry for the late reply. Now katib already has the UI based on react.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UI for Katib-NAS system
7 participants