-
Notifications
You must be signed in to change notification settings - Fork 9
Add daemon routers #89
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
base: master
Are you sure you want to change the base?
Conversation
This PR migrate the daemon routers from aiida-gui to here. - get_daemon_worker - increase_daemon_worker - decrease_daemon_worker
| class WorkerInfo(BaseModel): | ||
| """Details for a single daemon worker (per PID).""" | ||
|
|
||
| mem_info1: str = Field(..., description='Resident memory.') | ||
| mem_info2: str = Field(..., description='Virtual memory.') | ||
| cpu: float = Field(..., description='CPU usage percent.') | ||
| mem: float = Field(..., description='Memory usage percent.') | ||
| ctime: str = Field(..., description='CPU time as string.') | ||
| pid: int | ||
| username: str | ||
| nice: int | ||
| create_time: float = Field(..., description='Process creation time.') | ||
| age: float = Field(..., description='Process age in seconds.') | ||
| cmdline: str | ||
| children: t.List[t.Union[int, str]] = Field(default_factory=list, description='Child PIDs.') | ||
| started: float = Field(..., description='Worker start time.') | ||
| wid: int = Field(..., description='AiiDA worker id.') |
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.
In the spirit of providing schemas for AiiDA-things, I would consider defining this model somewhere in aiida-core. Not sure where though. Also, if we drop the engine, we will also drop daemon endpoints from this package, so let's wait.
| return {} | ||
|
|
||
| response = client.get_worker_info() | ||
| print(response['info']) |
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.
Was this print for debugging? I suggest removing it.
| response = client.get_worker_info() | ||
| print(response['info']) | ||
|
|
||
| return response['info'] |
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.
If response['info'] returns a dict[str, WorkerInfo], what is the key? The worker id?
edan-bainglass
left a comment
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.
Hi @superstar54. Sorry for the delay on this. I left some comments. Also, can you address the failing tests? 🙏
This PR migrate the daemon routers from aiida-gui to here.