-
Notifications
You must be signed in to change notification settings - Fork 22
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
feat: async creation of playground #616
feat: async creation of playground #616
Conversation
a55c74e
to
c372e0c
Compare
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.
Why don't we switch to the playground once it is created (as it was before) ?
.then((playgroundId: string) => { | ||
this.taskRegistry.updateTask({ |
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.
Why not using await ?
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.
You mean await this.createPlayground(name, model)
?
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.
Yes as it is the pattern we use in general
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.
Because in this request*
method, we want to return the trackingId asap, and run the long-running operation (createPlayground) asynchronously.
I think that it is done the same way in the other request* methods.
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.
I don't see why it has an impact
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.
If we use await createPlayground
here, it will wait for this function to resolve before to return trackingId
. But this createPlayground can be long to be resolved (the time the inference server image is downloaded, the container started, etc)
I have been tempted to do the same as for the Inference server, but let's revert to the previous behaviour, which is more efficient for the user |
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.
LGTM with a little comment on code style
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.
@@ -72,7 +110,15 @@ export class PlaygroundV2Manager extends Publisher<PlaygroundV2[]> implements Di | |||
} else if (server.status === 'stopped') { | |||
await this.inferenceManager.startInferenceServer(server.container.containerId); | |||
} | |||
|
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.
You should propagate the trackingId you created to the InferenceServer to see all the tasks related to the inference server creation.
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.
ah yes, thanks, I was looking at how to do this
Signed-off-by: Philippe Martin <phmartin@redhat.com>
Signed-off-by: Philippe Martin <phmartin@redhat.com>
Signed-off-by: Philippe Martin <phmartin@redhat.com>
Signed-off-by: Philippe Martin <phmartin@redhat.com>
db8ee53
to
291e2f4
Compare
Signed-off-by: Philippe Martin <phmartin@redhat.com>
Signed-off-by: Philippe Martin <phmartin@redhat.com>
bf132e4
to
895ad27
Compare
Co-authored-by: Florent BENOIT <fbenoit@redhat.com> Signed-off-by: Philippe Martin <feloy1@gmail.com>
What does this PR do?
Creates the playground async, and use tasks to display to the user the advancement
Out of scope for this PR:
Screenshot / video of UI
What issues does this PR fix or reference?
Part of #525
Fixes #615
How to test this PR?
Delete inference servers and related image, and create a new playground.
The creation page should display a task 'Creating...'
When the playground is created, a button should be available to go to the Playground page