Skip to content

Commit 0115291

Browse files
committed
Add makefile and cloudbuild file to build and push lora-syncer
Signed-off-by: Kunjan <[email protected]>
1 parent 310c5a8 commit 0115291

File tree

3 files changed

+37
-17
lines changed

3 files changed

+37
-17
lines changed

Makefile

+29
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ IMAGE_NAME := epp
3131
IMAGE_REPO ?= $(IMAGE_REGISTRY)/$(IMAGE_NAME)
3232
IMAGE_TAG ?= $(IMAGE_REPO):$(GIT_TAG)
3333

34+
SYNCER_IMAGE_NAME := lora-syncer
35+
SYNCER_IMAGE_REPO ?= $(IMAGE_REGISTRY)/$(IMAGE_NAME)
36+
SYNCER_IMAGE_TAG ?= $(IMAGE_REPO):$(GIT_TAG)
37+
3438
BASE_IMAGE ?= gcr.io/distroless/base-debian10
3539
BUILDER_IMAGE ?= golang:1.23-alpine
3640
ifdef GO_VERSION
@@ -154,6 +158,31 @@ image-build:
154158
image-push: PUSH=--push
155159
image-push: image-build
156160

161+
##@ Lora Syncer
162+
163+
.PHONY: syncer-image-local-build
164+
syncer-image-local-build:
165+
BUILDER=$(shell $(DOCKER_BUILDX_CMD) create --use)
166+
$(MAKE) image-build PUSH=$(PUSH)
167+
$(DOCKER_BUILDX_CMD) rm $$BUILDER
168+
169+
.PHONY: syncer-image-local-push
170+
syncer-image-local-push: PUSH=--push
171+
syncer-image-local-push: syncer-image-local-build
172+
173+
.PHONY: syncer-image-build
174+
syncer-image-build:
175+
$ cd $(CURDIR)/tools/dynamic-lora-sidecar && $(IMAGE_BUILD_CMD) -t $(SYNCER_IMAGE_TAG) \
176+
--platform=$(PLATFORMS) \
177+
--build-arg BASE_IMAGE=$(BASE_IMAGE) \
178+
--build-arg BUILDER_IMAGE=$(BUILDER_IMAGE) \
179+
$(PUSH) \
180+
$(IMAGE_BUILD_EXTRA_OPTS) ./
181+
182+
.PHONY: syncer-image-push
183+
syncer-image-push: PUSH=--push
184+
syncer-image-push: syncer-image-build
185+
157186
##@ Docs
158187

159188
.PHONY: build-docs

cloudbuild.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ steps:
1212
- GIT_TAG=$_GIT_TAG
1313
- EXTRA_TAG=$_PULL_BASE_REF
1414
- DOCKER_BUILDX_CMD=/buildx-entrypoint
15+
- name: lora-adapter-syncer
16+
entrypoint: make
17+
args:
18+
- syncer-image-push
19+
env:
20+
- GIT_TAG=$_GIT_TAG
21+
- EXTRA_TAG=$_PULL_BASE_REF
22+
- DOCKER_BUILDX_CMD=/buildx-entrypoint
1523
substitutions:
1624
# _GIT_TAG will be filled with a git-based tag for the image, of the form vYYYYMMDD-hash, and
1725
# can be used as a substitution

tools/dynamic-lora-sidecar/cloudbuild.yaml

-17
This file was deleted.

0 commit comments

Comments
 (0)