-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[Frontend] Node detail view now can show workflow input/output artifacts #2305
[Frontend] Node detail view now can show workflow input/output artifacts #2305
Conversation
Hi @eterna2. Thanks for your PR. I'm waiting for a kubeflow member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the 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. |
It should probably also support partial download with |
There are some frontend unit test errors: |
ok. updated the snapshot to match the current PR. |
question. for ui-metadata it is not an issue, as the data type is specified. However, for generic artifacts, there is no easy way to know what is the content? other than try/catch with a few possible choices? But probably doable, do a quick scan for number of commas, or common delimiters to differeniate between csv, json, or plain text. |
dcd8b15
to
bda3152
Compare
This PR will make the type information available to Frontend: #2323
I think that's out of scope for this PR. Here we just want to restore the existing functionality. Initially we just want to show short strings. We can truncate the string to, say, 300 bytes and show something like |
/ok-to-test |
Note: I was talking about the Frontend server functionality. This partial download feature should not be exposed to the user. |
Are the artifact links in "clickable" - result in showing/downloading the artifact data? |
Yup. It opens a new window and shows the data in plain text. I am just using the original get artifact API in the node backend as a HREF link in this PR (just a new window with a GET request). However to trigger download instead of a new window, I need to add a Probably, can add a new query string flag |
I'll review this today. |
It's OK. People can always right-click the URL and use "Save as". |
Thank you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eterna2 thanks for the contribution!
LGTM to the overall implementation, added some nit comments.
@@ -68,7 +68,7 @@ export function _populateInfoFromTemplate(info: SelectedNodeInfo, template?: Tem | |||
|
|||
if (template.inputs) { | |||
info.inputs = | |||
(template.inputs.parameters || []).map(p => [p.name, p.value || '']); | |||
(template.inputs.parameters || []).map(p => [p.name, p.value || ''] as [string, string]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Can you give [string, string] a proper type/interface
name and avoid casting here? Avoiding type casting helps with long term maintenance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated typescript to 3.6.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed issues introduced by the stricter typing by typescript >=3.5.
updated node to LTS 10 - because I notice a few peculiarity:
-
the grpc packages are not found in
package-lock.json
even thou it specified inpackage.json
(I think is subsequently installed in the post-install step, but I am not sure if it is used in any other places) - so whenever I do anpm i
they get included into the lock file. And this result in some issues for node 9.4, as some dependent packages seems to be missing (does not support node 9)? So I have to upgrade the docker images to node 10. -
Some of packages are not following the semantic versioning faithfully - I have to freeze a couple of packages, as the latest ones breaks the app (when
package-lock.json
is updated when I upgradedtypescript
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the grpc packages are not found in package-lock.json even thou it specified in package.json (I think is subsequently installed in the post-install step, but I am not sure if it is used in any other places) - so whenever I do a npm i they get included into the lock file. And this result in some issues for node 9.4, as some dependent packages seems to be missing (does not support node 9)? So I have to upgrade the docker images to node 10.
Thanks for the catch. I think the last committer forgot to update package-lock.json last time, let's just commit them so they are in sync. Besides upgrading to node 10 LTS is definitely a good choice.
Some of packages are not following the semantic versioning faithfully - I have to freeze a couple of packages, as the latest ones breaks the app (when package-lock.json is updated when I upgraded typescript.
Thanks for finding them, the solution sounds good to me.
/** | ||
* A component that renders an artifact link. | ||
*/ | ||
const S3ArtifactLink: React.FC<S3Artifact> = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May I ask for a really simple test for this component?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added 3 simple test case:
- invalid artifact (empty bucket or key)
- s3 artifact
- minio artifact
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! LGTM
Also, for convenience, can you record a video about how this looks like? |
List of changes:
video can be found at https://drive.google.com/file/d/1GmNrJum20AdW3Bo0xDQJFIOvvMhCF7C_/view |
/retest |
Hi @eterna2, this is awesome! Thanks a lot for the quick change. I hope I said this earlier because I didn't expect you to finish the upgrade so fast (which is awesome), but can you separate the following to a separate PR?
Because this PR is getting too large and upgrading typescript brought too many side effects. I would recommend finishing this PR without upgrading typescript (just use the pattern I introduced to avoid type casts).
Feel free to talk about your opinions because I can see you've already put a lot of efforts into this. I'm just giving suggestions that can give us more confidence of merging each of your PRs, and maybe sometimes I'm asking too much. |
…o extract artifacts. Update view to render artifacts.
e28dec7
to
8b6c56a
Compare
2b7e57f
to
b6dd275
Compare
b6dd275
to
c0f4202
Compare
ok. fixed most of the minor stuff. wonders whether do u want to setup an auto-formatter like will fix the unit test and output later. |
Thanks for suggestion, I am also planning on making a standard prettier config. |
@Bobgy Just a minor feedback, the unit test fails on node 9 (travis is running node 11, while dockerfile is using node 9) - might want to sync them up, cuz was puzzled by my failing unit tests until I went and look at travis and swapped to 11 (the errors are all datetime format diff with the snapshots). But this can be specific to my machine thou. I am using wsl in windows. |
@Bobgy Which version should we standardize on: 9 ,10, 11 or 12 (In a different PR)? The NodeJS website lists 10 and 12 as LTS releases. Should we try to go with 12? |
@Ark-kun Choosing latest LTS (12) is definitely the best option. I agree we should do it in a separate PR. I will create an issue for it. |
@eterna2, thanks so much for this! This is awesome. /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Bobgy 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 |
/area front-end |
This is part 1 of the PR with reference to #2172 - to show workflow input/output artifacts in the front-end.
cc: @Ark-kun
This PR:
S3ArtifactLink
which renders a<a href>
link (supports only s3:// and minio://)DetailsTable
:valueComponent
prop: will wrap the value if providedstring[][]
toArray<[string?, any?]>
so that the value need not be a string.StaticNodeDetails
to include 2 additional fields: Input Artifacts and Output Artifacts.The next PR will:
It should probably also support partial download with size/length (and maybe offset/start), so that it's possible to visualize the beginning of large table.
(@Ark-kun )Video can be seen here:
https://drive.google.com/file/d/1GmNrJum20AdW3Bo0xDQJFIOvvMhCF7C_/view
This change is