-
Notifications
You must be signed in to change notification settings - Fork 91
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
all: add AIX provider #77
Conversation
4c0255b
to
c5c07ec
Compare
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.
Due to the security restrictions on Metricbeat, which this is used by, We can't exec to other binaries, so this won't work:
out, err := exec.Command("/usr/bin/svmon", "-G").Output()
Isn't seccomp only available on Linux ? I don't think there is any way to achieve a similar behavior on AIX and I'm sure we aren't the only one. Does Windows, Macos and BSD have something similar ? Anyway, I can reworked the whole patch, in order to avoid exec syscalls. But it's using cgo, which I was trying to avoid here, and external C libraries. I've done something similar for elastic/gosigar (I haven't created the PR yet). Do you prefer to have something like that ? |
Despite not having a seccomp on AIX, I still think a native approach would be better. Usually the native approach is less CPU intensive and less prone to breakage over time (or at least we are quicker to detect the breakage when an API changes vs when the output of a command changes). The biggest concern I have about adding an AIX provider is that we have no way to test it. So we have very limited ability to maintain it. For my own education, what version of AIX does Go support? Is it AIX 7.2 on power8? And is this done with GOOS=aix GOARCH=ppc64? |
Actually, AIX has a real strict compatibility behavior and therefore commands' outputs won't change. However, I understand your point of view and I'll move to a CGO version as soon as I can.
Sadly, that's the case for every Go packages. My opinion is that if anything ever go wrong, the AIX community will be able to send PRs to fix it.
Yes, the Go toolchain is available only for AIX 7.2 on Power8 and Power9 (but I haven't try on P9). As you said, we are using GOOS=aix and GOARCH=ppc64. |
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.
We're making progress! We still need some standardization of the names to make the linters happy, and tests.
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.
We still need to make the linter happy and deal with some standardization issues.
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.
Almost done from my perspective. I'd like @andrewkroh to sign off on the PR too. We can save testing for later, but we're gonna eventually need to set up environments in AIX.
Not sure what @andrewkroh thinks, but I'd like to avoid cutting a release until we have an AIX environment setup so we can at least do manual testing.
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.
I made a suggestion for one simple test that can be executed outside of AIX. If there are any other unit tests you can add that would be great. Even if we can't execute them today on CI they will still be helpful to anyone that's maintaining the AIX code.
Overall it LGTM. Can you please
- update the README.md with a column for AIX/ppc64.
- run the tests and paste the output into a comment
The two other unit tests which can be made are For the test output, you wish to have the result of "go test -v" that's it ? Even for all processes running on my local machines, or just a sample will be enough ? |
Hey @Helflym sorry for the long silence. We've been waiting until Elastic has access to a proper AIX environment before we go any further. That took...longer than anticipated. A few things:
|
Yeah don't worry. I was warned by the IBM team for that.
|
@Helflym thanks. Hopefully close to getting this merged. Sorry to change my mind, would it be possible to get these tests after all?
Assuming everything is green, we should be good to merge after that. |
Actually, it's a bit more complicated than I thought. I either need to change the way I'm retrieving "/proc" information or I need to check the test process but it seems to unstable for me. |
@Helflym We can add them them later if it takes too much effort. I'd like to get this in a state where it can be merged. |
a8b20c1
to
e729806
Compare
Add a implementation with CGO for AIX. Process information are retrieved by /proc folder or with libperfstat, getprocs syscalls.
Add a implementation without CGO for AIX.
Host information are retrieved using AIX commands (uname, oslevel)
Process information are retrieved by /proc folder.
A CGO implementation could be added to more accurate syscalls and libraries
(getprocs, libperfstat, etc). But github.com/elastic/gosigar provides such
things.
A few features are still missing: