lablup / lablup/backend.ai

manager/api/resource.py/check_presets doesn't work well

Open
#1,031 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
670
Forks
183
Avg merge
17h 7m
Merged PRs (30d)
358

Description

### What Operating System(s) are you seeing this problem on?

Linux (x86-64)

### Backend.AI version

23.03

### Describe the bug

![https://user-images.githubusercontent.com/110564003/217772377-08fb8325-50e2-4e17-91b4-2fde24c2f427.png](https://user-images.githubusercontent.com/110564003/217772377-08fb8325-50e2-4e17-91b4-2fde24c2f427.png)![https://user-images.githubusercontent.com/110564003/217772407-b93e4c01-ab4d-49df-83d4-80dea0daaadf.png](https://user-images.githubusercontent.com/110564003/217772407-b93e4c01-ab4d-49df-83d4-80dea0daaadf.png)

If we make session in http://127.0.0.1:9081/ this bug happens.The first picture above CPU process bar prints 0/3, but if we make a session that uses one CPU the process bar works wrong: It prints 1/2 not 1/3.

The superficial reason for this is that the code is implemented to calculate total number of CPU as sum of 'using' CPU and 'remaining' CPU. Under this condition, 'using' CPU always zero and problem occured.

Then, why 'using' CPU always counts zero as you can see below picture?![https://user-images.githubusercontent.com/110564003/217776534-34527a15-86b9-4535-a45c-d391ee66bedd.png](https://user-images.githubusercontent.com/110564003/217776534-34527a15-86b9-4535-a45c-d391ee66bedd.png)

That is because manager/api/resource.py/check_presets doesn't do its work properly.We expect that function 'check_presets' makes 'response' value( used in backend.ai-webui/src/components/backend-ai-resource-broker.ts ) that include information of resources correctly but it doesn't.

![https://user-images.githubusercontent.com/110564003/217775418-a7ad78d1-77c5-48fb-a031-6a3a95d7fa5e.png](https://user-images.githubusercontent.com/110564003/217775418-a7ad78d1-77c5-48fb-a031-6a3a95d7fa5e.png)![https://user-images.githubusercontent.com/110564003/217775528-c8f0fb6e-b10a-46fc-8628-11eeaf07975a.png](https://user-images.githubusercontent.com/110564003/217775528-c8f0fb6e-b10a-46fc-8628-11eeaf07975a.png)This is my debugging code for 'check_presets' and result. As you can see, the code doesn't enter the part that sets 'using' CPU: It doesn't print '2'.

I don't know the reason why this problem occur.

This phenomenon are also occurring in RAM.(maybe GPU either)

### To Reproduce

make session in http://127.0.0.1:9081/

### Expected Behavior

I mentioned this above.

### Anything else?

_No response_

JIRA Issue: BA-222

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.