-
Notifications
You must be signed in to change notification settings - Fork 48
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
Adjust state logic and prune implementation #894
base: master
Are you sure you want to change the base?
Conversation
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 skimmed through your code and that's really good work @giggsoff. I believe we need to do it. I think it's a nice way to solve it right now, but we need to think about more sustainable solution : making adam more useful, because eden was initially designed as testing utility and now it's slowly growing to become simple stateful cloud. IMO adam should be turned into something like EVE controller SDK and a lot of eden functionality should migrate there. Let me know your thoughts on this
P.S. will do more thorough review next week :)
@@ -117,7 +118,7 @@ func getPortMapping(appConfig *config.AppInstanceConfig, qemuPorts map[string]st | |||
} | |||
|
|||
func (ctx *State) initApplications(ctrl controller.Cloud, dev *device.Ctx) error { | |||
ctx.applications = make(map[string]*AppInstState) | |||
ctx.Applications = make(map[string]*AppInstState) |
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 do you need to export Applications?
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 want to store the state in file (using json functions), which requires to export fields
Agree with you, it would be great. But I can see several problems here:
|
f1b4581
to
523cad4
Compare
@@ -188,16 +210,23 @@ func (ctx *State) processApplicationsByInfo(im *info.ZInfoMsg) { | |||
app.EVEState = fmt.Sprintf("%s (%d%%)", info.ZSwState_DOWNLOAD_STARTED.String(), int(percent)/len(app.Volumes)) | |||
} | |||
} | |||
case info.ZInfoTypes_ZiAppInstMetaData: |
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.
Additional thanks for AppInstMetaData
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
13844e3
to
1b681f8
Compare
@giggsoff I see you force push commits, is this PR mergable? |
I hope so... |
Seems we have quite outdated format for several files Signed-off-by: Petr Fedchenkov <[email protected]>
We try to calculate state of EdgeNode and objects inside of it. We construct the state based on info and metric messages from the controller. Info and metric messages are great for debugging, but in case of long time work we may hit the problem where state calculation consume more and more time. Let's slightly refactor the state logic to be able to store it locally and reuse. Signed-off-by: Petr Fedchenkov <[email protected]>
In case of state store and load functions implemented we may prune objects in Adam to keep the logic to be as fast as possible. Signed-off-by: Petr Fedchenkov <[email protected]>
We want to use check-new option to check options after transition, thus the next state after initial Signed-off-by: Petr Fedchenkov <[email protected]>
1b681f8
to
4130e0a
Compare
We try to calculate state of EdgeNode and objects inside of it. We construct the state based on info and metric messages from the controller. Info and metric messages are great for debugging, but in case of long time work we may hit the problem where state calculation consume more and more time.
Let's slightly refactor the state logic to be able to store it locally and reuse. We may prune objects in Adam (using novel
eden prune
) to keep the logic to be as fast as possible.