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

Support ARM64 build binary and images #514

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
4 changes: 4 additions & 0 deletions .github/workflows/publish-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ jobs:
run: |
GOOS=windows GOARCH=amd64 make -C banyand banyand-server-static
GOOS=windows GOARCH=amd64 make -C bydbctl build
- name: Build OSX binaries
run: |
GOOS=darwin GOARCH=arm64 make -C banyand banyand-server-static
GOOS=darwin GOARCH=arm64 make -C bydbctl build
Comment on lines +82 to +85
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this AARM or ARM? The CI name seems a little tricky.

- name: Build docker image
if: github.ref != 'refs/heads/main' # Only build docker image on PR(Push image when pushed to main branch)
run: |
Expand Down
14 changes: 7 additions & 7 deletions banyand/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@
# under the License.
#

NAME := banyand
SERVER := $(NAME)-server
BINARIES := $(SERVER)
DEBUG_BINARIES := $(SERVER)-debug
release:
$(MAKE) -f Makefile.x86 release
$(MAKE) -f Makefile.arm release

IMG_NAME := skywalking-banyandb

include Makefile.x86
include Makefile.arm

include ../scripts/build/version.mk
include ../scripts/build/base.mk
include ../scripts/build/generate_go.mk
include ../scripts/build/build.mk
include ../scripts/build/test.mk
include ../scripts/build/lint.mk
include ../scripts/build/vendor.mk
include ../scripts/build/help.mk
include ../scripts/build/help.mk
27 changes: 27 additions & 0 deletions banyand/Makefile.arm
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Licensed to Apache Software Foundation (ASF) under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Apache Software Foundation (ASF) licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#

NAME := banyand
SERVER := $(NAME)-server
BINARIES := $(SERVER)-arm
DEBUG_BINARIES := $(SERVER)-debug

GOOS := linux
GOARCH := arm64

include ../scripts/build/build.mk
27 changes: 27 additions & 0 deletions banyand/Makefile.x86
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Licensed to Apache Software Foundation (ASF) under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Apache Software Foundation (ASF) licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#

NAME := banyand
SERVER := $(NAME)-server
BINARIES := $(SERVER)
DEBUG_BINARIES := $(SERVER)-debug

GOOS := linux
GOARCH := amd64

include ../scripts/build/build.mk
3 changes: 2 additions & 1 deletion docs/installation/binaries.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,5 @@ $ ls bydbctl/build/bin
bydbctl bydbctl--darwin-amd64 bydbctl--darwin-arm64 bydbctl--linux-386 bydbctl--linux-amd64 bydbctl--linux-arm64 bydbctl--windows-386 bydbctl--windows-amd64
```

> The build script now checks if the binary file exists before rebuilding. If you want to rebuild, please remove the binary file manually.
> 1. The build script now checks if the binary file exists before rebuilding. If you want to rebuild, please remove the binary file manually.
> 2. `make -C banyand release` will automatically match your OS and platform. If you run it on macOS, you will get the `banyand-server-static` binary for `darwin-arm64`.
2 changes: 1 addition & 1 deletion scripts/build/build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ $(addprefix $(BUILD_DIR)/,$(STATIC_BINARIES)): $(BUILD_DIR)/$(NAME)-%-static:
CGO_ENABLED=0 GOOS=$(GOOS) GOARCH=$(GOARCH) go build \
-buildvcs=false \
-a --ldflags '${GO_LINK_VERSION} -extldflags "-static"' -tags "netgo $(BUILD_TAGS)" -installsuffix netgo \
-o $(BUILD_DIR)/$(NAME)-$*-static github.com/apache/skywalking-banyandb/$(SOURCE_DIR)/cmd/$*
-o $(BUILD_DIR)/$(NAME)-$*-static github.com/apache/skywalking-banyandb/$(SOURCE_DIR)/cmd/server
chmod +x $(BUILD_DIR)/$(NAME)-$*-static
@echo "Done building static $(NAME) $*"

Expand Down
Loading