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

T7069: Add function to get available cpus #4334

Open
wants to merge 1 commit into
base: current
Choose a base branch
from

Conversation

natali-rs1985
Copy link
Contributor

Change summary

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

Related PR(s)

vyos/vyos-vpp#8

How to test / Smoketest result

>>> from vyos.utils.cpu import get_available_cpus
>>> get_available_cpus()
[{'cpu': 0, 'node': 0, 'socket': 0, 'core': 0, 'l1d:l1i:l2:l3': '0:0:0:0', 'online': True}, {'cpu': 1, 'node': 0, 'socket': 0, 'core': 1, 'l1d:l1i:l2:l3': '1:1:1:0', 'online': True}, {'cpu': 2, 'node': 0, 'socket': 0, 'core': 2, 'l1d:l1i:l2:l3': '2:2:2:0', 'online': True}, {'cpu': 4, 'node': 0, 'socket': 0, 'core': 3, 'l1d:l1i:l2:l3': '4:4:4:0', 'online': True}]

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

Copy link

github-actions bot commented Feb 5, 2025

👍
No issues in PR Title / Commit Title

Copy link
Member

@dmbaturin dmbaturin left a comment

Choose a reason for hiding this comment

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

We may change it to read and process /proc/cpuinfo at a later point. For now, I'm not against an external command call, since it's not done especially often.

Copy link

github-actions bot commented Feb 5, 2025

CI integration ❌ failed!

Details

CI logs

  • CLI Smoketests (no interfaces) ❌ failed
  • CLI Smoketests (interfaces only) 👍 passed
  • Config tests 👍 passed
  • RAID1 tests 👍 passed
  • TPM tests 👍 passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

3 participants