Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

[odo] Add auto detection logic for binding odo application #1285

Closed
elsony opened this issue Nov 26, 2019 · 6 comments
Closed

[odo] Add auto detection logic for binding odo application #1285

elsony opened this issue Nov 26, 2019 · 6 comments
Assignees
Labels
area/iterative-dev Related to building and deploying applications (AKA "Turbine") kind/enhancement

Comments

@elsony
Copy link

elsony commented Nov 26, 2019

For odo applications that has been run on Codewind before, we know exactly the project style (odo) and the component ID of the project. During a bind of that application, we should be able to detect those so that the user does not have to provide the same information again.

To do that:

  1. Change our existing delete operation without the -a flag so that the .odo folder will be left behind to preserve the component id info
  2. On the project creation of odo project, we remove the .odo folder/config before calling create component (to allow user to give a different project name during the bind)
  3. Add detection logic to odo extension to return the correct odo sytle and component id by looking for the odo config in the .odo folder if it exists.
@elsony elsony added area/iterative-dev Related to building and deploying applications (AKA "Turbine") kind/enhancement labels Nov 26, 2019
@elsony
Copy link
Author

elsony commented Nov 26, 2019

@GeekArthur Can you take a look at this as discussed?

@GeekArthur
Copy link
Contributor

/assign

@GeekArthur
Copy link
Contributor

Bind case main issue is here: #450

@GeekArthur
Copy link
Contributor

Currently we only have forward files syncing from workspace PVC to PFE PVC, thus the .odo folder that is created by PFE can't sync back to workspace, then if user deletes and binds the odo project again, the auto detection won't work since we don't have .odo on IDE side which uses workspace PVC.

Workaround:
Easy: Let user manually add .odo folder if user uses Codewind odo extension before for their projects
Hard: Codewind suppots backward files syncing from PFE PVC to workspace PVC

@GeekArthur
Copy link
Contributor

I investigate more on this issue, the Hard workaround is not feasible because odo CLI generates odo-file-index.json which record file update metadata under .odo folder to imporve the odo build performance, that means odo-file-index.json can be updated with each file update, that can result in double build issue if we support backward files syncing from PFE PVC to workspace PVC.

I also try to only kubectl copy .odo folder to workspace PVC automatically during project create to ensure already binded odo project has the .odo folder, it works but downside is it increase ~ 10s for initial build.

@GeekArthur
Copy link
Contributor

All auto detection is working (eg. if user project directory has .odo folder we can detect the project type as odo) now, only issue is if user removes the project there is no .odo folder in the project directory, in order to avoid double build and performance issue, we decide to leave as it is and use the current code with the current behavior.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/iterative-dev Related to building and deploying applications (AKA "Turbine") kind/enhancement
Projects
None yet
Development

No branches or pull requests

2 participants