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

Add ARM64 binary and package builds #480

Merged
merged 10 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ test: ## Run tests
build: ## Build sidecar binary for local target system
$(GO) build $(BUILD_OPTS) -v -o graylog-sidecar

build-all: build-linux-armv7 build-linux build-linux32 build-windows build-windows32 build-darwin build-darwin-arm64 build-freebsd
build-all: build-linux-armv7 build-linux-arm64 build-linux build-linux32 build-windows build-windows32 build-darwin build-darwin-arm64 build-freebsd

build-linux: ## Build sidecar binary for Linux
bernd marked this conversation as resolved.
Show resolved Hide resolved
@mkdir -p build/$(COLLECTOR_VERSION)/linux/amd64
Expand All @@ -55,6 +55,10 @@ build-linux-armv7: ## Build sidecar binary for linux-armv7
@mkdir -p build/$(COLLECTOR_VERSION)/linux/armv7
GOOS=linux GOARCH=arm GOARM=7 $(GO) build $(BUILD_OPTS) -pkgdir $(GOPATH)/go_linux-armv7 -v -o build/$(COLLECTOR_VERSION)/linux/armv7/graylog-sidecar

build-linux-arm64: ## Build sidecar binary for linux-arm64
@mkdir -p build/$(COLLECTOR_VERSION)/linux/arm64
GOOS=linux GOARCH=arm64 $(GO) build $(BUILD_OPTS) -pkgdir $(GOPATH)/go_linux-arm64 -v -o build/$(COLLECTOR_VERSION)/linux/arm64/graylog-sidecar

build-solaris: solaris-sigar-patch ## Build sidecar binary for Solaris/OmniOS/Illumos
@mkdir -p build/$(COLLECTOR_VERSION)/solaris/amd64
GOOS=solaris GOARCH=amd64 $(GO) build $(BUILD_OPTS) -v -o build/$(COLLECTOR_VERSION)/solaris/amd64/graylog-sidecar
Expand Down Expand Up @@ -99,7 +103,7 @@ sign-binary-windows-386:
install-goversioninfo:
go install github.com/josephspurrier/goversioninfo/cmd/goversioninfo@latest

package-all: prepare-package package-linux-armv7 package-linux package-linux32 package-windows package-tar
package-all: prepare-package package-linux-armv7 package-linux-arm64 package-linux package-linux32 package-windows package-tar

prepare-package:
dist/fetch_collectors.sh
Expand All @@ -110,6 +114,12 @@ package-linux-armv7: ## Create Linux ARMv7 system package
fpm-cook -t deb package dist/recipearmv7.rb
fpm-cook -t rpm package dist/recipearmv7.rb

package-linux-arm64: ## Create Linux ARM64 system package
fpm-cook clean dist/recipearm64.rb
rm -rf dist/cache dist/tmp-build dist/tmp-dest
fpm-cook -t deb package dist/recipearm64.rb
fpm-cook -t rpm package dist/recipearm64.rb

package-linux: ## Create Linux amd64 system package
fpm-cook clean dist/recipe.rb
rm -rf dist/cache dist/tmp-build dist/tmp-dest
Expand Down Expand Up @@ -144,7 +154,15 @@ push-chocolatey: ## Push Chocolatey .nupkg file

package-tar: ## Create tar archive for all platforms
@mkdir -p dist/pkg
@tar --transform="s|/build|/graylog-sidecar|" -Pczf dist/pkg/graylog-sidecar-$(COLLECTOR_VERSION)$(COLLECTOR_VERSION_SUFFIX).tar.gz ./build ./sidecar-example.yml ./sidecar-windows-example.yml
@tar --transform="s|/build|/graylog-sidecar|" --transform="s|/dist|/graylog-sidecar|" \
-Pczf dist/pkg/graylog-sidecar-$(COLLECTOR_VERSION)$(COLLECTOR_VERSION_SUFFIX).tar.gz \
./build \
./dist/collectors/auditbeat/linux/arm64/auditbeat \
./dist/collectors/auditbeat/linux/x86_64/auditbeat \
./dist/collectors/filebeat/linux/arm64/filebeat \
./dist/collectors/filebeat/linux/x86_64/filebeat \
./sidecar-example.yml \
./sidecar-windows-example.yml

help:
@grep -hE '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | $(AWK) 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
Expand Down
4 changes: 4 additions & 0 deletions changelog/unreleased/pr-480.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
type = "a"
message = "Add operating system packages for ARM64."
bernd marked this conversation as resolved.
Show resolved Hide resolved

pulls = ["480"]
2 changes: 2 additions & 0 deletions dist/fetch_collectors.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@ download_beat()

download_beat "filebeat" "linux" ${FILEBEAT_VERSION} x86_64
download_beat "filebeat" "linux" ${FILEBEAT_VERSION_32} x86
download_beat "filebeat" "linux" ${FILEBEAT_VERSION_32} arm64

download_beat "auditbeat" "linux" ${FILEBEAT_VERSION} x86_64
download_beat "auditbeat" "linux" ${AUDITBEAT_VERSION_32} x86
download_beat "auditbeat" "linux" ${AUDITBEAT_VERSION_32} arm64

download_beat "filebeat" "windows" ${FILEBEAT_VERSION} x86_64
download_beat "filebeat" "windows" ${FILEBEAT_VERSION_32} x86
Expand Down
34 changes: 34 additions & 0 deletions dist/recipearm64.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
require_relative 'tools'

class GraylogSidecar < FPM::Cookery::Recipe
description 'Graylog collector sidecar'

name 'graylog-sidecar'
version data.version
revision data.revision
homepage 'https://graylog.org'
arch 'arm64'

source "file:../../build/#{version}/linux/arm64/graylog-sidecar"

maintainer 'Graylog, Inc. <[email protected]>'
vendor 'graylog'
license 'SSPL'

config_files '/etc/graylog/sidecar/sidecar.yml'

fpm_attributes rpm_os: 'linux'

def build
end

def install
bin.install 'graylog-sidecar'
lib('graylog-sidecar').install '../../collectors/filebeat/linux/arm64/filebeat'
lib('graylog-sidecar').install '../../collectors/auditbeat/linux/arm64/auditbeat'
etc('graylog/sidecar').install '../../../sidecar-example.yml', 'sidecar.yml'
var('lib/graylog-sidecar/generated').mkdir
var('log/graylog-sidecar').mkdir
var('run/graylog-sidecar').mkdir
end
end
Loading