containers / podman-desktop-extension-ai-lab

Work with LLMs on a local environment using containers
https://podman-desktop.io/extensions/ai-lab
Apache License 2.0
145 stars 23 forks source link

feat: dedicated page for starting recipe #1227

Open axel7083 opened 2 weeks ago

axel7083 commented 2 weeks ago

What does this PR do?

For the recipe details revamp, this PR improve the consistency of the application, by making a dedicated page for starting a recipe. This new page is similar to the Service and Playground creation page.

Notable change

Future work

Screenshot / video of UI

Full workflow

https://github.com/containers/podman-desktop-extension-ai-lab/assets/42176370/3d5bb168-ef7e-46b5-93aa-87d3fa80ce25

Error handling

https://github.com/containers/podman-desktop-extension-ai-lab/assets/42176370/a5ab9de3-c2a2-49ab-b8a2-269ba9f3fdb8

What issues does this PR fix or reference?

Fixes https://github.com/containers/podman-desktop-extension-ai-lab/issues/1126

How to test this PR?

cdrage commented 2 weeks ago

Big 👍 from me as this makes it a lot more readable and more intuitive.

I keep Podman Desktop at the "default size" and with this change, it looks a lot better.

Each time I had to use AI Lab, I had to increase the size of the PD application, and with this, I no longer need to.

Amazing work 💯

slemeur commented 2 weeks ago

Nice work on this, great improvement.

A couple of feedback:

axel7083 commented 2 weeks ago
  • The first inputbox is not necessarily clear to the end user.

It is not an inputbox, it is a card showing the selected recipe. This page is not design to navigate from the recipes list, but from a recipe page. it is here to inform the user which recipe he is going to start.

While for the choice of the model, we have a tooltip that explains what to do. It's not clear that I'll be doing a clone and I can choose where to make this clone. Having a tooltip or a description label could nicely improve the experience and better explain the experience.

There are two things here: the cloning aspect (1) and the directory used (2).

But all of this are improvements, I would rather have dedicated issues later to work on, as this is already a large change.

  • The other point is more about the way we show the status; I acknowledge we are doing it this way in other screens of podman desktop - but with so many items appearing during the process, it looks strange that they are added at the top of the screen, before the form, which cause the screen to show a lot of "moving effects".

I would rather keep focus on functionality in this PR, and iterate later on potential improvement. I have a Future work on this PR, we can have a meeting later so discuss those issues more in details. But for now I think it is better to stick with the current design used in other pages.

axel7083 commented 1 week ago
  • Using the podman-desktop api, we need to be able to come back to the start recipe page

@lstocchi as it is written in Future work section Using the podman-desktop api, we need to be able to come back to the start recipe page By this I mean, it would be possible to use the task manager of podman desktop to add a link to this page.

So for now, yes it is not possible if you leave the page, you we can add that support in a future PR

lstocchi commented 1 week ago
  • Using the podman-desktop api, we need to be able to come back to the start recipe page

@lstocchi as it is written in Future work section Using the podman-desktop api, we need to be able to come back to the start recipe page By this I mean, it would be possible to use the task manager of podman desktop to add a link to this page.

So for now, yes it is not possible if you leave the page, you we can add that support in a future PR

For me it's a step back for what we have now and i would prefer to have that as well.

feloy commented 1 week ago

When the user restarts an app (IMO it is a very common operation, as the user will modify the sources to adapt the sample app, and will want to rebuild/restart the app), this should be done from the "Running AI Apps" page, but the steps (and the potential errors) are not visible anymore.

axel7083 commented 1 week ago

When the user restarts an app (IMO it is a very common operation, as the user will modify the sources to adapt the sample app, and will want to rebuild/restart the app), this should be done from the "Running AI Apps" page, but the steps (and the potential errors) are not visible anymore.

We could probably in another PR redirect to the StartRecipe page when we want to rebuild the recipe

axel7083 commented 1 week ago

For me it's a step back for what we have now and i would prefer to have that as well.

@lstocchi I was hopping I could set a goto link in the task manager of podman desktop, however it is not yet supported. The best I can do for now is to save the trackingId in the router queries, therefore allowing to restore the page status when leaving the webview.

https://github.com/containers/podman-desktop-extension-ai-lab/assets/42176370/8734a2bd-c785-4403-ade1-d468a714d92e

I opened https://github.com/containers/podman-desktop/issues/7709 to enhance Tasks to let extension define custom actions.

axel7083 commented 1 week ago

@lstocchi @feloy PR rebased ✅

lstocchi commented 1 week ago

Tried again and i think i didn't built with the last commit last time bc now it works fine

feloy commented 1 week ago

When the user restarts an app (IMO it is a very common operation, as the user will modify the sources to adapt the sample app, and will want to rebuild/restart the app), this should be done from the "Running AI Apps" page, but the steps (and the potential errors) are not visible anymore.

We could probably in another PR redirect to the StartRecipe page when we want to rebuild the recipe

I probably worked too much on odo to be objective, but it seems to me that we are decreasing a lot the experience when iterating the inner loop. Even by being redirected to the StartRecipe page, that will be multiple clicks, instead of a single click in the previous UX.

I would prefer that @slemeur or @jeffmaury validates the change

axel7083 commented 1 week ago

but it seems to me that we are decreasing a lot the experience

The current user experience is terrible for the following reason

that will be multiple clicks, instead of a single click

This is bad, because user lost controls of what they can do, having a single magic button doing everything prevent the user of doing basic actions. Maybe he want just to clone the recipe ?

Personal Opinion

feloy commented 1 week ago

but it seems to me that we are decreasing a lot the experience

The current user experience is terrible for the following reason

  • Selecting a model in a different page than the starting button
  • The RecipeModelDetails not being the same table as the one in the Models page
  • The tasks only appear if you select the right models: people get lost
  • This will not scale with a lot of models

that will be multiple clicks, instead of a single click

This is bad, because user lost controls of what they can do, having a single magic button doing everything prevent the user of doing basic actions. Maybe he want just to clone the recipe ?

Personal Opinion

  • We improve the consistency of our design in AI Lab by having this page
  • We simplify our codebase by cleaning the RecipeDetails code
  • We make a dedicated page where we can easily redirect in the future using the Podman-desktop tasks action (when it will be supported)

Yes, I agree that the experience for starting a recipe (which happens once) is much better with your changes, but to the detriment of the experience for restarting the recipe every time the user changes the source (which can happen a lot of time if the developer wants to develop an app using AI Lab).

axel7083 commented 1 week ago

Yes, I agree that the experience for starting a recipe (which happens once) is much better with your changes, but to the detriment of the experience for restarting the recipe every time the user changes the source (which can happen a lot of time if the developer wants to develop an app using AI Lab).

This can be done from the Running page ?

image

Seems UI is inconsistent to me: when starting a recipe, I have to explicitely select a model but when I click on the select box, it seems a default model is selected

@jeffmaury I added a default value (took from recommended) for the select. I also added unit tests for this change.

https://github.com/containers/podman-desktop-extension-ai-lab/assets/42176370/079d9069-a82b-4635-b368-0f83e4be6fd2

feloy commented 1 week ago

This can be done from the Running page ?

Yes, but what I explain in https://github.com/containers/podman-desktop-extension-ai-lab/pull/1227#issuecomment-2175946785 is that from this page, it is not possible anymore to see the steps, and more importantly the potential errors, that the user were seeing from the Recipe page.

axel7083 commented 1 week ago

This can be done from the Running page ?

Yes, but what I explain in #1227 (comment) is that from this page, it is not possible anymore to see the steps, and more importantly the potential errors, that the user were seeing from the Recipe page.

IMO this is a temporary issue, since we said we wanted to get a details page for the running recipes, but I agree in the current situation this is not ideal.

We may want to expose the building process inside the recipe details page, we would for examples have a section with building logic (list image being build, and some actions) what do you think ?

Edit

I made a quick mockup of what I would imagine

image

I still think the building process should be separate from the running process, treating recipes as container file, their built step would be the image created.

Today we have no places where we could redirect the std of the building process, we could add a Logs or Build log or anything, to the Recipes details page, and place inside the logs of the building process, which would correspond to the tasks developer would be interested to explore when editing the source code.

i also added a Inspect tab, to see the recipe information, as it is IMO very important

feloy commented 1 week ago

This can be done from the Running page ?

Yes, but what I explain in #1227 (comment) is that from this page, it is not possible anymore to see the steps, and more importantly the potential errors, that the user were seeing from the Recipe page.

IMO this is a temporary issue, since we said we wanted to get a details page for the running recipes, but I agree in the current situation this is not ideal.

We may want to expose the building process inside the recipe details page, we would for examples have a section with building logic (list image being build, and some actions) what do you think ?

Edit

I made a quick mockup of what I would imagine

image

I still think the building process should be separate from the running process, treating recipes as container file, their built step would be the image created.

Today we have no places where we could redirect the std of the building process, we could add a Logs or Build log or anything, to the Recipes details page, and place inside the logs of the building process, which would correspond to the tasks developer would be interested to explore when editing the source code.

i also added a Inspect tab, to see the recipe information, as it is IMO very important

Yes, displaying the steps with the logs in a dedicated page seems a very good idea. I can imagine something similar to CI/CD pages displaying the steps of a pipeline, with their logs.

We have to take care to not mix up again a recipe with a couple (recipe, model).

jeffmaury commented 6 days ago

Seems to me the state of the recipe is lost as I was able to start several time the same recipe and if I go back to the recipe catalog before the recipe is fully started seems the processus is cancelled

axel7083 commented 6 days ago

Seems to me the state of the recipe is lost as I was able to start several time the same recipe

@jeffmaury the goal, would be to have the link back to the creation task, and being to cancel it through the tasks in Podman Desktop.

image

However, currently this is not possible, and would be addressed by https://github.com/containers/podman-desktop/issues/7709

if I go back to the recipe catalog before the recipe is fully started seems the processus is cancelled

See the recipes as container images, if you go in podman desktop and start an image, go back to the image, you don't see the container, but it is still running.

Commited solution

In the same way downloading models display at the top of the catalog I added a task banner cc @lstocchi @jeffmaury

https://github.com/containers/podman-desktop-extension-ai-lab/assets/42176370/d9dcd9af-14e8-404d-af53-83de4b5ce1c8

axel7083 commented 7 hours ago

@jeffmaury I have good hope to make this merge this week :)