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

fix: fallback to reading cpus.yaml relative to current dir #1572

Merged
merged 1 commit into from
Jul 1, 2024

Conversation

sthaha
Copy link
Collaborator

@sthaha sthaha commented Jun 27, 2024

This commit fixes the issue of having to copy cpus.yaml to /var/lib/kepler (the hardcoded path for the cpus.yaml) by reading the cpus.yaml file relative to the project root.

Thus the following now works fine.

make build
sudo ./_output/bin/kepler

This commit fixes the issue of having to copy cpus.yaml to
/var/lib/kepler (the hardcoded path for the cpus.yaml) by
reading the cpus.yaml file relative to the project root.

Thus the following now works fine.
```
make build
sudo ./_output/bin/kepler
```

Signed-off-by: Sunil Thaha <[email protected]>
Copy link
Contributor

github-actions bot commented Jun 27, 2024

🤖 SeineSailor

Here is a concise summary of the pull request changes:

Summary: This pull request introduces a fix to allow reading the cpus.yaml file relative to the project root, eliminating the need for a hardcoded path. Key modifications include:

  • Introduction of a new readCPUModelData() function to read the file from CPUModelDataPath or ./data/cpus.yaml as a fallback.
  • Updated getCPUMicroArchitecture function signature to accept family, model, and stepping strings as arguments.
  • Replacement of os.ReadFile(CPUModelDataPath) with readCPUModelData().

Impact: These changes do not affect the external interface or behavior of the code, but improve flexibility and maintainability by allowing the cpus.yaml file to be read from a relative path.

Observations: The changes are well-contained and do not introduce any breaking changes. However, it would be beneficial to consider adding tests to ensure the new readCPUModelData() function behaves as expected in different scenarios.

@sthaha sthaha requested review from dave-tucker and rootfs June 27, 2024 08:20
@gdozortsev
Copy link

Tried this locally and it works now

@rootfs rootfs merged commit a2289d2 into sustainable-computing-io:main Jul 1, 2024
22 checks passed
@sthaha sthaha mentioned this pull request Jul 3, 2024
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.

4 participants