Skip to content
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

replace has gpu with num gpu #211

Merged
merged 1 commit into from
Jun 21, 2023
Merged

Conversation

alichaddad
Copy link
Contributor

Changes

  • return 1 as gpu count if node has gpu
  • Count number of nodes with gpu and add it to the stats endpoint

Related Issues

#210

Checklist

  • Tests included
  • Build pass
  • Documentation
  • Code format and docstring

@@ -70,7 +80,7 @@ func nodeFromDBNode(info db.Node) types.Node {
RentedByTwinID: uint(info.RentedByTwinID),
SerialNumber: info.SerialNumber,
Power: types.NodePower(info.Power),
HasGPU: info.HasGPU,
NumGPUs: getNumGPUs(info.HasGPU),
Copy link
Contributor

Choose a reason for hiding this comment

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

should be NumGPU not NumGPUs similar to runtime.NumCPU https://pkg.go.dev/runtime#NumCPU

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the field will be num_gpus right? I'd rather keep them consistent

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree, let's stay indeed consistent with the field in tfchain, i updated the title to make it num_gpu
threefoldtech/tfchain#756

@alichaddad alichaddad merged commit 0f4324a into development Jun 21, 2023
@alichaddad alichaddad deleted the development_num_gpus branch June 21, 2023 11:53
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