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

Planning to write detect / other functions? #4

Open
vsoch opened this issue Aug 28, 2021 · 14 comments
Open

Planning to write detect / other functions? #4

vsoch opened this issue Aug 28, 2021 · 14 comments
Assignees

Comments

@vsoch
Copy link
Contributor

vsoch commented Aug 28, 2021

Hey Archspec,

I noticed that there aren't functions here for detect, etc., is this something you are planning to write, to be akin to the Python module? Thanks!

@alalazo
Copy link
Member

alalazo commented Aug 30, 2021

Yes, this project currently is unfinished but the idea is to have feature parity with the Python API.

@alalazo alalazo self-assigned this Aug 30, 2021
@vsoch
Copy link
Contributor Author

vsoch commented Aug 30, 2021

Ah fantastic! I guess I'll subscribe for updates/notifications then. I'm working on a sibling library called containerspec that I'd like to use it with.

@vsoch
Copy link
Contributor Author

vsoch commented Apr 9, 2022

hey @alalazo I'd really like to use this, any updates / plans for working on it?

@alalazo
Copy link
Member

alalazo commented Apr 11, 2022

@vsoch Would you have time to help with implementing the command line tools? This has been since ever on my TODO list at very low priority... 😓

@vsoch
Copy link
Contributor Author

vsoch commented Apr 11, 2022

I think I tried last August (2021) but I didn't know how to go about it. E.g., I know you can look at runtime.GOOS == "linux" but I wasn't sure about your plan to actually match to a specific arch/architecture. Do you have a design document or similar somewhere?

@alalazo
Copy link
Member

alalazo commented Apr 11, 2022

Do you have a design document or similar somewhere?

Not really, and even if I had I think it would be outdated by now. For instance, at the time I started prototyping Go bindings I used statik to embed the JSON files in the Go package while reading around the best way to do it today is probably the embed package.

I think to discriminate among operating systems I would probably use runtime.GOOS as you said, but keep in mind my knowledge of Go only goes that far.

@vsoch
Copy link
Contributor Author

vsoch commented Apr 11, 2022

Ok so even if you don’t know details of the implementation, do you have a general design idea? I’m just not familiar with how archspec works (or is supposed to) beyond doing the detecting. Is that something that needs to be figured out too? How does it work in the Python version?

@vsoch
Copy link
Contributor Author

vsoch commented Apr 12, 2022

@alalazo
Copy link
Member

alalazo commented Apr 12, 2022

Detection in Python is coded in this module. It's based on inspecting /proc/cpuinfo on Linux, while on macOS we rely on sysctl info.

Have you seen https://chromium.googlesource.com/external/github.com/klauspost/cpuid/+/30e450625213468c7ec31fec6102dab6504adcc9/cpuid.go ?

No, I didn't. I guess it might be used instead of parsing the files/commands above directly.

@vsoch
Copy link
Contributor Author

vsoch commented Apr 12, 2022

Here is the repository (linked at the top there): https://github.com/klauspost/cpuid what are the main differences between the library there and archspec? Is it just that archspec has a comparison / dag thing going on? The question I'm interested in is if we can use that library - e.g., is it possible to match results between there and the json here, and if not, what would we do if we parse some unknown microarchitecture?

@alalazo
Copy link
Member

alalazo commented Apr 13, 2022

what are the main differences between the library there and archspec?

That library seems focused on hardware detection, so I'd expect it to give the same level of details as e.g. /proc/cpuinfo and to be unable to "reason" about architecture compatibility. archspec main focus is on binary compatibility, so it provides a few human-readable labels (e.g. bulldozer or graviton) and can "reason" about any of the architecture in the JSON file, while it can't distinguish two different chips that implement the same microarchitecture.

I think we can use the library you linked as an alternate method of detecting "raw" information on the current host and matching it to a known target in the JSON file.

@vsoch
Copy link
Contributor Author

vsoch commented Apr 13, 2022

Gotcha! Yeah I can mess around with that! I will make some time soon.

@ChristianKniep
Copy link

Any progress on that issue? I am wondering myself how to make use of this package? The archspec-feature-discovery tool seems to execute the python version.

@vsoch
Copy link
Contributor Author

vsoch commented Feb 4, 2023

I was interested for this tool I was working on https://github.com/vsoch/containerspec but I think I lost interest to work on it (August 2021!).

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

No branches or pull requests

3 participants