-
Notifications
You must be signed in to change notification settings - Fork 41
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: adding LocalRepositoryRegistry #298
feat: adding LocalRepositoryRegistry #298
Conversation
784e8c7
to
6ceac8b
Compare
I'm trying to figure out which is the final result for this. I looked at #250 but i didn't get the purpose. Let's say you know which recipe repos the user downloaded, what are you going to do with that info? Is there any new page/icon/message you're going to show? |
|
constructor(private webview: Webview) {} | ||
|
||
register(localRepository: LocalRepository): podmanDesktopApi.Disposable { | ||
this.repositories.set(localRepository.path, localRepository); |
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.
maybe using the recipe.id as key?
Now we use a static path but let's say the user could customize it you could end up with two values for the same recipe.
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 feel like it is easy to have multiple version of the same recipeId. Having the path as key ensure uniqueness, what if the user decide to clone twice the same recipe in different directory (two different branch let's say)
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 the point of having multiple cloned repo of the same recipe. If you are working on an edited version it's like you want to test it, if it gets broken you would update the code/reset it in your IDE.
If you open the recipe page you're targeting a specific version, so the open to vscode should be related to that one. If you have multiple instances of the same recipe in the store, how would you pick the one to use? Or everytime the user click on run application you make him decide which one to run?
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 see your point, but if you select a local repository which has no recipe id ?
For example, you are creating yourself a repository, and want to open in inside the IA-Studio, at some point you will only have a ai-studio.yaml
and it has no concept of recipe here.
See https://github.com/redhat-et/locallm/blob/main/chatbot/ai-studio.yaml
We want people to be able to use their own code/repo without forcing them to be inside the catalog. I mention #234 which is the use case
We can imagine in the future, the local repository (user configured) and then nothing to do with recipe, what would be their id then?
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.
For me, if you import a local/remote repo like the one mentioned (so the chatbot), it is going to create a new item in the recipe catalog page (maybe under a local section). By looking at the ai-studio.yaml you have all infos to make it work.
The model backend tells you which are the model type supported and we can use that one to fill the models tab. Then to run the application we have the ai-studio.yaml file.
BTW this is just the way i see it.
@jeffmaury WDYT? Any idea how it should work?
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 agree we could show the local projects/repository manually added by the user to the recipe page, under as mention some local
sections.
But they are not recipes, they are a local project/folder/repository, and what's unique about them, their path.
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 could use some fake id to differentiate them and use the same logic to keep 1-1 recipe-source.
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.
It's really a matter if we want to store multiple sources per recipe or not.
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 would we generate some fake ids, when we could have the path as id ?
at some point we will have to save the content of the LocalRepositoryRegistry
to a file, as the projects/folder/repositories imported by the user would have to be still their after a reboot, I would prefer avoiding generating some random values to use that as id, when we could avoid
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.
It's really a matter if we want to store multiple sources per recipe or not.
i would argue no, as you mention, this is probably not something expected, I am more worried about the behavior to adopt for external folder/projects/repositories
7f1e468
to
d551e48
Compare
|
||
constructor(private webview: Webview) {} | ||
|
||
register(localRepository: LocalRepository): Disposable { |
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.
This registry will be available the time you are in the same instance of the AI Studio app. But how will you build it again when you restart the app (either Podman Desktop or the extension?). Will you have the pair path/recipeId somewhere to be able to rebuild this "database"?
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.
@feloy yes this is the goal in the future. For now we do not support adding manually folder/projects/repositories provided by the user. But we would at some point, and we want a place to store that information see #234
Today this is simply in memory, but yes in the future we would have to store that information somewhere on disk. But this is not part of this PR
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 solution for the models on disk is to use the modelId as directory name and to rely on it, so we can rebuild this database by scanning the directories in the dedicated directory. Could it be applied here also?
If we don't want to handle the manually created repositories for now, we will have only one repository on disk for each recipe, right? Even if I switch the model, if I understand correctly.
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 solution for the models on disk is to use the modelId
I am not talking about the models id here, but folders containing ai-studio.yaml
file
If we don't want to handle the manually created repositories for now, we will have only one repository on disk for each recipe, right? Even if I switch the model, if I understand correctly.
Yes exactly, for now we will only have the cloned repository inside the LocalRepositoryRegistry
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 am not talking about the models id here, but folders containing ai-studio.yaml file
Yes, I understand, but for me the problem of getting the path of the model's directory is the same as getting the recipy/repository's directory. The reason why I'm comparing both
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 sure
Signed-off-by: axel7083 <[email protected]>
Signed-off-by: axel7083 <[email protected]>
Signed-off-by: axel7083 <[email protected]>
Signed-off-by: axel7083 <[email protected]>
Signed-off-by: axel7083 <[email protected]>
Signed-off-by: axel7083 <[email protected]>
Signed-off-by: axel7083 <[email protected]>
Signed-off-by: axel7083 <[email protected]>
Signed-off-by: axel7083 <[email protected]>
Signed-off-by: axel7083 <[email protected]>
Signed-off-by: axel7083 <[email protected]>
4197dbe
to
5f5d6e2
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.
lgtm
recipes: update descriptions
What does this PR do?
Simply add a store containing the information of where are stored the checkout repository. This store will be required to be able to have #27
What issues does this PR fix or reference?
Fixes #250
How to test this PR?