diff --git a/Makefile b/Makefile index 0283dcbff5c..5fc99a04da4 100644 --- a/Makefile +++ b/Makefile @@ -21,8 +21,13 @@ ALL_SRC := $(shell find . -name '*.go' \ # ALL_PKGS is used with 'go cover' and 'golint' ALL_PKGS := $(shell go list $(sort $(dir $(ALL_SRC)))) - -RACE=-race +UNAME := $(shell uname -m) +#Race flag is not supported on s390x architecture +ifeq ($(UNAME), s390x) + RACE= +else + RACE=-race +endif GOTEST=go test -v $(RACE) GOLINT=golint GOVET=go vet @@ -187,7 +192,11 @@ elasticsearch-mappings: .PHONY: build-examples build-examples: esc -pkg frontend -o examples/hotrod/services/frontend/gen_assets.go -prefix examples/hotrod/services/frontend/web_assets examples/hotrod/services/frontend/web_assets +ifeq ($(GOARCH), s390x) + CGO_ENABLED=0 installsuffix=cgo go build -o ./examples/hotrod/hotrod-$(GOOS)-$(GOARCH) ./examples/hotrod/main.go +else CGO_ENABLED=0 installsuffix=cgo go build -o ./examples/hotrod/hotrod-$(GOOS) ./examples/hotrod/main.go +endif .PHONE: docker-hotrod docker-hotrod: @@ -206,23 +215,43 @@ build-all-in-one-linux: build-ui .PHONY: build-all-in-one build-all-in-one: elasticsearch-mappings +ifeq ($(GOARCH), s390x) + CGO_ENABLED=0 installsuffix=cgo go build -tags ui -o ./cmd/all-in-one/all-in-one-$(GOOS)-$(GOARCH) $(BUILD_INFO) ./cmd/all-in-one/main.go +else CGO_ENABLED=0 installsuffix=cgo go build -tags ui -o ./cmd/all-in-one/all-in-one-$(GOOS) $(BUILD_INFO) ./cmd/all-in-one/main.go +endif .PHONY: build-agent build-agent: +ifeq ($(GOARCH), s390x) + CGO_ENABLED=0 installsuffix=cgo go build -o ./cmd/agent/agent-$(GOOS)-$(GOARCH) $(BUILD_INFO) ./cmd/agent/main.go +else CGO_ENABLED=0 installsuffix=cgo go build -o ./cmd/agent/agent-$(GOOS) $(BUILD_INFO) ./cmd/agent/main.go +endif .PHONY: build-query build-query: +ifeq ($(GOARCH), s390x) + CGO_ENABLED=0 installsuffix=cgo go build -tags ui -o ./cmd/query/query-$(GOOS)-$(GOARCH) $(BUILD_INFO) ./cmd/query/main.go +else CGO_ENABLED=0 installsuffix=cgo go build -tags ui -o ./cmd/query/query-$(GOOS) $(BUILD_INFO) ./cmd/query/main.go +endif .PHONY: build-collector build-collector: elasticsearch-mappings +ifeq ($(GOARCH), s390x) + CGO_ENABLED=0 installsuffix=cgo go build -o ./cmd/collector/collector-$(GOOS)-$(GOARCH) $(BUILD_INFO) ./cmd/collector/main.go +else CGO_ENABLED=0 installsuffix=cgo go build -o ./cmd/collector/collector-$(GOOS) $(BUILD_INFO) ./cmd/collector/main.go +endif .PHONY: build-ingester build-ingester: +ifeq ($(GOARCH), s390x) + CGO_ENABLED=0 installsuffix=cgo go build -o ./cmd/ingester/ingester-$(GOOS)-$(GOARCH) $(BUILD_INFO) ./cmd/ingester/main.go +else CGO_ENABLED=0 installsuffix=cgo go build -o ./cmd/ingester/ingester-$(GOOS) $(BUILD_INFO) ./cmd/ingester/main.go +endif .PHONY: docker docker: build-ui build-binaries-linux docker-images-only @@ -239,11 +268,15 @@ build-binaries-windows: build-binaries-darwin: GOOS=darwin $(MAKE) build-platform-binaries +.PHONY: build-binaries-s390x +build-binaries-s390x: + GOOS=linux GOARCH=s390x $(MAKE) build-platform-binaries + .PHONY: build-platform-binaries build-platform-binaries: build-agent build-collector build-query build-ingester build-all-in-one build-examples .PHONY: build-all-platforms -build-all-platforms: build-binaries-linux build-binaries-windows build-binaries-darwin +build-all-platforms: build-binaries-linux build-binaries-windows build-binaries-darwin build-binaries-s390x .PHONY: docker-images-cassandra docker-images-cassandra: diff --git a/plugin/storage/badger/stats_linux.go b/plugin/storage/badger/stats_linux.go index dc6fc632f3c..0310a3c553d 100644 --- a/plugin/storage/badger/stats_linux.go +++ b/plugin/storage/badger/stats_linux.go @@ -30,8 +30,8 @@ func (f *Factory) diskStatisticsUpdate() error { _ = unix.Statfs(f.Options.GetPrimary().ValueDirectory, &valDirStatfs) // Using Bavail instead of Bfree to get non-priviledged user space available - f.metrics.ValueLogSpaceAvailable.Update(int64(valDirStatfs.Bavail) * valDirStatfs.Bsize) - f.metrics.KeyLogSpaceAvailable.Update(int64(keyDirStatfs.Bavail) * keyDirStatfs.Bsize) + f.metrics.ValueLogSpaceAvailable.Update(int64(valDirStatfs.Bavail) * int64(valDirStatfs.Bsize)) + f.metrics.KeyLogSpaceAvailable.Update(int64(keyDirStatfs.Bavail) * int64(keyDirStatfs.Bsize)) /* TODO If we wanted to clean up oldest data to free up diskspace, we need at a minimum an index to the StartTime diff --git a/scripts/cover.sh b/scripts/cover.sh index 86ccbdadaff..7a9fcf44584 100755 --- a/scripts/cover.sh +++ b/scripts/cover.sh @@ -52,8 +52,13 @@ for pkg in "$@"; do args="-coverprofile $COVER/cover.${i}.out" # -coverpkg $coverpkg fi - echo go test $args -v -race "$pkg" - go test $args -v -race "$pkg" + if [[ $(uname -m) == 's390x' ]]; then + echo go test $args -v "$pkg" + go test $args -v "$pkg" + else + echo go test $args -v -race "$pkg" + go test $args -v -race "$pkg" + fi done gocovmerge "$COVER"/*.out > cover.out diff --git a/scripts/travis/package-deploy.sh b/scripts/travis/package-deploy.sh index 9eb0e1fb047..97f6e8e828c 100755 --- a/scripts/travis/package-deploy.sh +++ b/scripts/travis/package-deploy.sh @@ -33,8 +33,13 @@ function stage-platform-files { function package { local PLATFORM=$1 local FILE_EXTENSION=$2 - - local PACKAGE_STAGING_DIR=jaeger-$VERSION-$PLATFORM-amd64 + # script start + if [ "$PLATFORM" == "linux-s390x" ]; then + local PACKAGE_STAGING_DIR=jaeger-$VERSION-$PLATFORM + else + local PACKAGE_STAGING_DIR=jaeger-$VERSION-$PLATFORM-amd64 + fi + mkdir $PACKAGE_STAGING_DIR stage-platform-files $PLATFORM $PACKAGE_STAGING_DIR $FILE_EXTENSION @@ -64,3 +69,4 @@ mkdir $DEPLOY_STAGING_DIR package linux package darwin package windows .exe +package linux-s390x