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

Sensu Agent AIX Support ? #2944

Open
troglas opened this issue May 13, 2019 · 8 comments
Open

Sensu Agent AIX Support ? #2944

troglas opened this issue May 13, 2019 · 8 comments
Labels
component:agent Sensu Agent improvements component:packaging Sensu packaging improvements question

Comments

@troglas
Copy link

troglas commented May 13, 2019

Hello Sensu Team,
Is Sensu Agent Go planned to support AIX systems?
It was probably asked bazillion times but I can't find the information anywhere.

@palourde
Copy link
Contributor

Hi @troglas

Theoretically Go supports AIX >= 7.2 on Power8 & Power9 architectures. That being said, we did not do any kind of testing and I can't say if and when it will be supported.

However, we are more than happy to assist anyone interesting in bringing support to AIX for Sensu Go!

@cwjohnston
Copy link
Contributor

I checked out tag 5.11.1 and ran GOOS=aix GOARCH=ppc64 ./build.sh build_agent to test. The build failed with the following messages:

Building agent for aix-ppc64
# github.com/sensu/sensu-go/vendor/github.com/jbenet/go-reuseport
vendor/github.com/jbenet/go-reuseport/interface.go:33:9: undefined: available
vendor/github.com/jbenet/go-reuseport/interface.go:50:6: undefined: available
vendor/github.com/jbenet/go-reuseport/interface.go:54:9: undefined: listenStream
vendor/github.com/jbenet/go-reuseport/interface.go:61:6: undefined: available
vendor/github.com/jbenet/go-reuseport/interface.go:65:9: undefined: listenPacket
vendor/github.com/jbenet/go-reuseport/interface.go:72:6: undefined: available
vendor/github.com/jbenet/go-reuseport/interface.go:102:6: undefined: available
vendor/github.com/jbenet/go-reuseport/interface.go:106:9: undefined: dial
# github.com/sensu/sensu-go/vendor/github.com/sirupsen/logrus
vendor/github.com/sirupsen/logrus/terminal_check_notappengine.go:15:10: undefined: terminal.IsTerminal
# github.com/sensu/sensu-go/vendor/go.etcd.io/bbolt
vendor/go.etcd.io/bbolt/bolt_unix.go:27:10: undefined: syscall.Flock
vendor/go.etcd.io/bbolt/bolt_unix.go:46:9: undefined: syscall.Flock
vendor/go.etcd.io/bbolt/bolt_unix.go:88:30: undefined: syscall.SYS_MADVISE
# github.com/sensu/sensu-go/vendor/github.com/spf13/afero
vendor/github.com/spf13/afero/const_win_unix.go:25:15: undefined: syscall.EBADFD
cp: target/aix-ppc64/sensu-agent: No such file or directory

@liudasbk
Copy link

liudasbk commented Sep 6, 2019

You can build agent on AIX, however there are few things to take care before.

go.etcd.io/bbolt
flock is implemented using syscall.Flock which is removed for AIX (https://golang.org/cl/152557). However bbolt uses different flock implementation for Solaris, which works on AIX as well (basically cp bolt_unix_solaris.go bolt_unix_aix.go)

github.com/sirupsen/logrus
requires following patch sirupsen/logrus#841

github.com/jbenet/go-reuseport
newer version of x/sys is required for go-reuseport to work on AIX

github.com/spf13/afero
constant BADFD is not defined anywhere for AIX, however it is the same as for BSDs. Workaround is to add aix to build constraints in const_bsds.go.

github.com/spf13/viper
This one is tricky. viper package have feature where you can watch for configuration file changes. It uses github.com/fsnotify/fsnotify package which does not implement anything for AIX and there are no plans for that. I'm not aware about any easy facility to use for fsnotify except AIX Event Infrastructure which is more for command line or scripting usage.

However, Sensu agent does not use viper watch and re-read feature. To build agent separate viper.go implementation for AIX can be made without WatchConfig method.

After these workarounds agent builds successfully, however I have not tested functionality. ./buid.sh build_agent builds target/aix-ppc64/sensu-agent binary, which at leasts shows version when running ./sensu-agent version

@amdprophet
Copy link
Member

amdprophet commented Nov 22, 2019

I've verified that these changes allow sensu-agent to build for aix/ppc64.

We're currently waiting on the following PRs to be merged:

Once fsnotify/fsnotify#314 is merged, we will need to wait on https://github.com/spf13/viper to update to the latest fsnotify.

@calebhailey
Copy link

@amdprophet looks like another one of the three blocking PRs have been merged! spf13/afero#210 🎉

Perhaps we can bump this issue fsnotify/fsnotify#314 ??? can we offer to help with the review in any way?

@calebhailey calebhailey added component:agent Sensu Agent improvements component:packaging Sensu packaging improvements labels May 6, 2020
@amdprophet
Copy link
Member

We can use our fork of the project if need be. The only thing holding us back from completing our work is the need to bump the version of gostatsd we're using. @echlebek and I were discussing that we need to bump it for another reason unrelated to this work. We may be able to attempt bumping gostatsd soon.

@amdprophet amdprophet mentioned this issue Jun 4, 2020
@stale
Copy link

stale bot commented Nov 2, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Nov 2, 2020
@echlebek echlebek removed the wontfix label Nov 2, 2020
@echlebek
Copy link
Contributor

echlebek commented Nov 2, 2020

This is still a long term goal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:agent Sensu Agent improvements component:packaging Sensu packaging improvements question
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants