Skip to content

Commit 03b2741

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

File tree

3 files changed

+37
-17
lines changed

3 files changed

+37
-17
lines changed

Makefile

Lines changed: 29 additions & 0 deletions
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
@@ -163,6 +167,31 @@ image-build: ## Build the EPP image using Docker Buildx.
163167
image-push: PUSH=--push ## Build the EPP image and push it to $IMAGE_REPO.
164168
image-push: image-build
165169

170+
##@ Lora Syncer
171+
172+
.PHONY: syncer-image-local-build
173+
syncer-image-local-build:
174+
BUILDER=$(shell $(DOCKER_BUILDX_CMD) create --use)
175+
$(MAKE) image-build PUSH=$(PUSH)
176+
$(DOCKER_BUILDX_CMD) rm $$BUILDER
177+
178+
.PHONY: syncer-image-local-push
179+
syncer-image-local-push: PUSH=--push
180+
syncer-image-local-push: syncer-image-local-build
181+
182+
.PHONY: syncer-image-build
183+
syncer-image-build:
184+
$ cd $(CURDIR)/tools/dynamic-lora-sidecar && $(IMAGE_BUILD_CMD) -t $(SYNCER_IMAGE_TAG) \
185+
--platform=$(PLATFORMS) \
186+
--build-arg BASE_IMAGE=$(BASE_IMAGE) \
187+
--build-arg BUILDER_IMAGE=$(BUILDER_IMAGE) \
188+
$(PUSH) \
189+
$(IMAGE_BUILD_EXTRA_OPTS) ./
190+
191+
.PHONY: syncer-image-push
192+
syncer-image-push: PUSH=--push
193+
syncer-image-push: syncer-image-build
194+
166195
.PHONY: image-load
167196
image-load: LOAD=--load ## Build the EPP image and load it in the local Docker registry.
168197
image-load: image-build

cloudbuild.yaml

Lines changed: 8 additions & 0 deletions
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

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)