Skip to content
Merged
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
16 changes: 13 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ EPP_TAG ?= dev
IMG = $(IMAGE_TAG_BASE):$(EPP_TAG)
NAMESPACE ?= hc4ai-operator

ifeq ($(TARGETOS),darwin)
ifeq ($(TARGETARCH),amd64)
TOKENIZER_ARCH = x86_64
else
TOKENIZER_ARCH = $(TARGETARCH)
endif
else
TOKENIZER_ARCH = $(TARGETARCH)
endif

CONTAINER_TOOL := $(shell { command -v docker >/dev/null 2>&1 && echo docker; } || { command -v podman >/dev/null 2>&1 && echo podman; } || echo "")
BUILDER := $(shell command -v buildah >/dev/null 2>&1 && echo buildah || echo $(CONTAINER_TOOL))
PLATFORMS ?= linux/amd64 # linux/arm64 # linux/s390x,linux/ppc64le
Expand Down Expand Up @@ -41,7 +51,7 @@ $(TOKENIZER_LIB):
## Download the HuggingFace tokenizer bindings.
@echo "Downloading HuggingFace tokenizer bindings for version $(TOKENIZER_VERSION)..."
mkdir -p lib
curl -L https://github.com/daulet/tokenizers/releases/download/$(TOKENIZER_VERSION)/libtokenizers.$(TARGETOS)-$(TARGETARCH).tar.gz | tar -xz -C lib
curl -L https://github.com/daulet/tokenizers/releases/download/$(TOKENIZER_VERSION)/libtokenizers.$(TARGETOS)-$(TOKENIZER_ARCH).tar.gz | tar -xz -C lib
ranlib lib/*.a

##@ Development
Expand Down Expand Up @@ -93,8 +103,8 @@ build: check-go download-zmq download-tokenizer ## Build the project
image-build: check-container-tool ## Build Docker image ## Build Docker image using $(CONTAINER_TOOL)
@printf "\033[33;1m==== Building Docker image $(IMG) ====\033[0m\n"
$(CONTAINER_TOOL) build \
--platform $(TARGETOS)/$(TARGETARCH) \
--build-arg TARGETOS=$(TARGETOS) \
--platform linux/$(TARGETARCH) \
--build-arg TARGETOS=linux \
--build-arg TARGETARCH=$(TARGETARCH) \
--build-arg COMMIT_SHA=${GIT_COMMIT_SHA} \
--build-arg BUILD_REF=${BUILD_REF} \
Expand Down