Building a collector-sidecar package

(Patrick Cable) #1

I’ve been trying to figure out how to build a collector-sidecar package, since I’ve had some changes merged in and would like to deploy to my environment. It looks like it uses fpm-cook to build the package, per the Makefile but when i try make package-linux I get:

===> Copying ../../build/0.1.0/linux/amd64/graylog-collector-sidecar to cache
/home/gitlab-runner/.rbenv/versions/2.3.3/lib/ruby/2.3.0/fileutils.rb:1387:in `copy': unknown file type: ../../build/0.1.0/linux/amd64/graylog-collector-sidecar (RuntimeError)

This suggests to me that i should be running make package-linux from a different directory, but there aren’t any directions. If i move the build directory to a location it wants, then it fails because there’s an issue finding …/…/collectors/filebeat/linux/x86_64/filebeat

How is the collector-sidecar package built usually?

(Jochen) #2

It’s being built using make and the provided Makefile.

You can also check the Travis CI configuration for this project:

(Patrick Cable) #3

Thanks for your response. I did have some problems initially with building the binary because I was using “go build” without any flags, but then did look at the .travis.yml like you mentioned and got a working binary.

What I was actually asking was how the package was built – as in the deb/rpm itself. There is a package-build step in the Makefile, but like I mentioned this seems to require being run from a certain path?

(Jochen) #4

You can try it as follows:

$ cd /path/to/collector-sidecar
$ ln -s `pwd` $GOPATH/src/
$ cd $GOPATH/src/
$ glide install
$ make test
$ make build-linux
$ make build-linux32
$ make build-windows
$ make build-windows32
$ make package-all

(marius) #5

@patcable I have just released 0.1.1 with all latest changes:

Feedback welcome!

(Patrick Cable) #6

Thanks @marius! I appreciate it. We probably still want to host this locally so we don’t have to have all our hosts reach out to github to install the package - but we did get the package bit figured out.

@jochen the issue was that running make package-linux doesn’t run the prepare-package step that puts everything into the right place so that fpm-cook works as expected.

I may do a PR on documentation to mention this for other people. Thanks everyone.