Skip to content

Conversation

@annavik
Copy link
Member

@annavik annavik commented Jul 7, 2023

Some notes:

  • We render stages dynamically. It means stage list can have any size.
  • We render stage params dynamically. It means param list can have any size.
  • Some params are still missing value (see comments).
  • The job status and job progress is made up, but easy to replace with BE values (see comments).
  • We refetch both jobs and job details every 10 second. We show a loading text in UI when this happens.

Screenshots:

Screenshot 2023-07-07 at 12 38 08 Screenshot 2023-07-07 at 12 37 41

@netlify
Copy link

netlify bot commented Jul 7, 2023

Deploy Preview for ami-web ready!

Name Link
🔨 Latest commit cb6a39e
🔍 Latest deploy log https://app.netlify.com/sites/ami-web/deploys/64a875b61d79180008b28bf4
😎 Deploy Preview https://deploy-preview-191--ami-web.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@@ -0,0 +1,2 @@
export const COLLECTION = 'jobs'
export const REFETCH_INTERVAL = 10000 // Refetch every 10 second
Copy link
Member Author

Choose a reason for hiding this comment

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

@mihow here is the polling configured for jobs, you can tweak this value or set to undefined :)

@netlify
Copy link

netlify bot commented Jul 7, 2023

Deploy Preview for ami-storybook ready!

Name Link
🔨 Latest commit cb6a39e
🔍 Latest deploy log https://app.netlify.com/sites/ami-storybook/deploys/64a875b676b87e000897d6fb
😎 Deploy Preview https://deploy-preview-191--ami-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.


const COLLECTION = 'status/summary'
const REFETCH_INTERVAL = undefined // TODO: Refetch every 10 second
const REFETCH_INTERVAL = 10000 // Refetch every 10 second
Copy link
Member Author

Choose a reason for hiding this comment

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

Also added polling for status (numbers in header).

.get<ServerStatus>(fetchUrl)
.then((res) => convertServerRecord(res.data)),
refetchInterval: REFETCH_INTERVAL,
retry: 0,
Copy link
Member Author

Choose a reason for hiding this comment

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

I skipped fetch retry while status endpoint was gone. Adding back!


get statusDetails(): string {
return 'More details about the job status.'
// TODO: Return BE value here when available.
Copy link
Member Author

@annavik annavik Jul 7, 2023

Choose a reason for hiding this comment

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

BE could perhaps return something here? This label will show up here:

Screenshot 2023-07-07 at 12 48 39 Screenshot 2023-07-07 at 12 48 47


get statusValue(): number {
// TODO: Return BE value here when available (number between 0 and 1).
switch (this.status) {
Copy link
Member Author

@annavik annavik Jul 7, 2023

Choose a reason for hiding this comment

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

Mocked a value based on status for now. This value will control status bar size:

Screenshot 2023-07-07 at 12 57 16

Copy link
Collaborator

Choose a reason for hiding this comment

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

I added a summary section to the progress JSON with the overall progress & status

image

@annavik
Copy link
Member Author

annavik commented Jul 7, 2023

Project name and some params (more than shown here) are missing value in details view:

Screenshot 2023-07-07 at 12 51 48


const name = stage.name
const status = this.getStatus(progress.status)
const statusLabel = this.getStatusLabel(status)
Copy link
Member Author

Choose a reason for hiding this comment

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

This status label is basic, should probably include info about time remaining, but I was not fully sure about the logic here, so skipped for now. This is the place to tweak if needed :)

Screenshot 2023-07-07 at 13 02 41

Copy link
Collaborator

Choose a reason for hiding this comment

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

I added a new "status label" to the stages progress. So status is the ENUM key with the status value. progress is the float value of the progress (from 0-1) and status_label is a formatted text string.

image

@annavik annavik force-pushed the web-ui-hook-up-jobs branch from c45a402 to 9bb6dd2 Compare July 7, 2023 16:58
@mihow
Copy link
Collaborator

mihow commented Jul 7, 2023

Project name and some params (more than shown here) are missing value in details view:

Screenshot 2023-07-07 at 12 51 48

I added the missing project and some values for those params!

Also you can change the config & status JSON in the interactive HTML form now, if you want to test different values

image

@mihow
Copy link
Collaborator

mihow commented Jul 7, 2023

Project name and some params (more than shown here) are missing value in details view:

Oh!! Actually there isn't meant to be a value here. The config is just the static info needed to render the form fields. The progress object contains the actual value that is updated. Use the key from the field config to lookup the value from the progress.

image

@mihow
Copy link
Collaborator

mihow commented Jul 7, 2023

I guess we have two kinds of "fields" that look the same in the UI but get their values from different places

  1. Fields that are configuration for the job before it starts (Batch size, Model choice)
  2. Fields that show a detail about the current status of the running job

Maybe I should just remove the status fields from the config object?? Then the field name and the value with both only be in the progress object.

@annavik
Copy link
Member Author

annavik commented Jul 7, 2023

I guess we have two kinds of "fields" that look the same in the UI but get their values from different places

  1. Fields that are configuration for the job before it starts (Batch size, Model choice)
  2. Fields that show a detail about the current status of the running job

Maybe I should just remove the status fields from the config object?? Then the field name and the value with both only be in the progress object.

Oh I see! We can have as is, I just pushed a small update that will check if present in config, if not look in progress.

@mihow mihow merged commit 4942e38 into main Jul 7, 2023
@mihow mihow deleted the web-ui-hook-up-jobs branch November 17, 2023 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants