8000 fix: show allocated resources in TaskStatus by nikonov1101 · Pull Request #1368 · sonm-io/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: show allocated resources in TaskStatus #1368

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

Merged
merged 2 commits into from
Aug 31, 2018

Conversation

nikonov1101
Copy link
Member
@nikonov1101 nikonov1101 commented Aug 30, 2018

This commit fills the AllocatedResources field from the deal's ask-plan.
Actual resources info gives an ability to show what part of deal's resources are acquired by task, at least what GPUs is used.

@nikonov1101 nikonov1101 requested review from 3Hren, antmat, zavgorodnii and a team as code owners August 30, 2018 13:22
@nikonov1101 nikonov1101 force-pushed the fix/worker/fill-allocated-resources branch 4 times, most recently from 8076289 to 67e8110 Compare August 30, 2018 18:00
defer m.mu.Unlock()
res, ok := m.pool.used[id]
if !ok {
return nil, fmt.Errorf("failed to get resources")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return nil, fmt.Errorf("failed to get resources for task %s: no such task", id)

func (m *Scheduler) ResourceByTask(id string) (*sonm.AskPlanResources, error) {
m.mu.Lock()
defer m.mu.Unlock()
res, ok := m.pool.used[id]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one is global pool for ask plans. You need to do smth like

ask, ok := m.taskToAskPlan[id]
//check ok
pool, ok := m.askPlanPools[ask.GetId()]
//check ok
res, ok := pool.used[id]

ALex Nikonov added 2 commits August 31, 2018 13:54
This commit fills the `AllocatedResources` field from the deal's ask-plan.
Actual resources info gives an ability to show what part of deal's resources are acquired by task, at least what GPUs is used.
@nikonov1101 nikonov1101 force-pushed the fix/worker/fill-allocated-resources branch from 4ba0a49 to 062919b Compare August 31, 2018 10:54
@antmat antmat merged commit 37fd898 into master Aug 31, 2018
@antmat antmat deleted the fix/worker/fill-allocated-resources branch August 31, 2018 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0