Skip to content

Commit f6c57c5

Browse files
shmuelknirrozenbaumirar2david-martinelevran
authored
fix: Cleanup build and kind development environment (#156)
* Removed unused make targets and set default tag to dev Signed-off-by: Shmuel Kallner <kallner@il.ibm.com> * Changed kind development deployer to use dev tag for EPP and Simulator Signed-off-by: Shmuel Kallner <kallner@il.ibm.com> * Updated documentation to reflect changes Signed-off-by: Shmuel Kallner <kallner@il.ibm.com> * Removed local change Signed-off-by: Shmuel Kallner <kallner@il.ibm.com> * Use correct variable in the Makefile Signed-off-by: Shmuel Kallner <kallner@il.ibm.com> * Mention the vLLM simulator in the kind environment documentation Signed-off-by: Shmuel Kallner <kallner@il.ibm.com> * update GIE upstream version + code adaptations (#135) * update GIE upstream version + code adaptations Signed-off-by: Nir Rozenbaum <nirro@il.ibm.com> * addressed code review comments Signed-off-by: Nir Rozenbaum <nirro@il.ibm.com> --------- Signed-off-by: Nir Rozenbaum <nirro@il.ibm.com> * test: Improve scheduler test (#139) * Check headers, more tests for pd scheduler Signed-off-by: Ira <IRAR@il.ibm.com> * Moved config and context out of the loop, added logger to the context Signed-off-by: Ira <IRAR@il.ibm.com> * Removed comment and debug prints Signed-off-by: Ira <IRAR@il.ibm.com> --------- Signed-off-by: Ira <IRAR@il.ibm.com> * Wait for storage pods to exist before moving on (#138) Signed-off-by: David Martin <davmarti@redhat.com> * dependabot configuration for Go, GH acions and Docker Signed-off-by: Etai Lev Ran <elevran@gmail.com> * link checker - fails PR if links are broken (#130) * link checker - fails PR if links are broken Signed-off-by: Andy Anderson <andy@clubanderson.com> * replace markdown-link-check tool with lychee * remove markdown-link-check tool custom action * make README links relative * increase timeouts and ignore gnu's website since it throttles by timeouts Signed-off-by: Etai Lev Ran <elevran@gmail.com> --------- Signed-off-by: Etai Lev Ran <elevran@gmail.com> Co-authored-by: Etai Lev Ran <elevran@gmail.com> * Corrected name of vLLM simulator Signed-off-by: Shmuel Kallner <kallner@il.ibm.com> --------- Signed-off-by: Shmuel Kallner <kallner@il.ibm.com> Signed-off-by: Nir Rozenbaum <nirro@il.ibm.com> Signed-off-by: Ira <IRAR@il.ibm.com> Signed-off-by: David Martin <davmarti@redhat.com> Signed-off-by: Etai Lev Ran <elevran@gmail.com> Co-authored-by: Nir Rozenbaum <nirro@il.ibm.com> Co-authored-by: Ira Rosen <irar@il.ibm.com> Co-authored-by: David Martin <david-martin@users.noreply.github.com> Co-authored-by: Etai Lev Ran <elevran@gmail.com> Co-authored-by: Andy Anderson <andy@clubanderson.com>
1 parent 70afea8 commit f6c57c5

File tree

3 files changed

+16
-107
lines changed

3 files changed

+16
-107
lines changed

DEVELOPMENT.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,15 @@ make env-dev-kind
9292
```
9393

9494
This will build images with your recent changes and load the new images to the
95-
cluster. Note that built image tag should be specified via the `EPP_TAG` environment variable so it is used in the deployment. For example:
95+
cluster. By default the image tag will be `dev`. It will also load llm-d-inference-sim, using a tag of `dev` by default.
96+
97+
**NOTE:** The built image tag can be specified via the `EPP_TAG` environment variable so it is used in the deployment. For example:
9698

9799
```console
98100
EPP_TAG=0.0.4 make env-dev-kind
101+
```
102+
103+
**NOTE:** If you want to load a different tag of llm-d-inference-sim, you can use the environment variable `VLLM_SIMULATOR_TAG` to specify it.
99104

100105
**NOTE**: If you are working on a MacOS with Apple Silicon, it is required to add
101106
the environment variable `GOOS=linux`.

Makefile

Lines changed: 8 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ SHELL := /usr/bin/env bash
44
TARGETOS ?= $(shell go env GOOS)
55
TARGETARCH ?= $(shell go env GOARCH)
66
PROJECT_NAME ?= llm-d-inference-scheduler
7-
DEV_VERSION ?= 0.0.3
8-
PROD_VERSION ?= 0.0.2
97
IMAGE_REGISTRY ?= ghcr.io/llm-d
108
IMAGE_TAG_BASE ?= $(IMAGE_REGISTRY)/$(PROJECT_NAME)
11-
IMG = $(IMAGE_TAG_BASE):$(DEV_VERSION)
9+
EPP_TAG ?= dev
10+
IMG = $(IMAGE_TAG_BASE):$(EPP_TAG)
1211
NAMESPACE ?= hc4ai-operator
1312

1413
CONTAINER_TOOL := $(shell { command -v docker >/dev/null 2>&1 && echo docker; } || { command -v podman >/dev/null 2>&1 && echo podman; } || echo "")
@@ -82,50 +81,8 @@ build: check-go download-tokenizer ##
8281

8382
##@ Container Build/Push
8483

85-
.PHONY: buildah-build
86-
@if [ "$(BUILDER)" = "buildah" ]; then \
87-
echo "🔧 Buildah detected: Performing multi-arch build..."; \
88-
FINAL_TAG=$(IMG); \
89-
for arch in amd64; do \
90-
ARCH_TAG=$$FINAL_TAG-$$arch; \
91-
echo "📦 Building for architecture: $$arch"; \
92-
buildah build \
93-
--arch=$$arch \
94-
--os=linux \
95-
--layers -t $(IMG)-$$arch . || exit 1; \
96-
echo "🚀 Pushing image: $(IMG)-$$arch"; \
97-
buildah push $(IMG)-$$arch docker://$(IMG)-$$arch || exit 1; \
98-
done; \
99-
echo "🧼 Removing existing manifest (if any)..."; \
100-
buildah manifest rm $$FINAL_TAG || true; \
101-
echo "🧱 Creating and pushing manifest list: $(IMG)"; \
102-
buildah manifest create $(IMG); \
103-
for arch in amd64; do \
104-
ARCH_TAG=$$FINAL_TAG-$$arch; \
105-
buildah manifest add $$FINAL_TAG $$ARCH_TAG; \
106-
done; \
107-
buildah manifest push --all $(IMG) docker://$(IMG); \
108-
elif [ "$(BUILDER)" = "docker" ]; then \
109-
echo "🐳 Docker detected: Building with buildx..."; \
110-
sed -e '1 s/\(^FROM\)/FROM --platform=$${BUILDPLATFORM}/' Dockerfile > Dockerfile.cross; \
111-
- docker buildx create --use --name image-builder || true; \
112-
docker buildx use image-builder; \
113-
docker buildx build --push \
114-
--platform=$(PLATFORMS) \
115-
--tag $(IMG) -f Dockerfile.cross . || exit 1; \
116-
docker buildx rm image-builder || true; \
117-
rm Dockerfile.cross; \
118-
elif [ "$(BUILDER)" = "podman" ]; then \
119-
echo "⚠️ Podman detected: Building single-arch image..."; \
120-
podman build -t $(IMG) . || exit 1; \
121-
podman push $(IMG) || exit 1; \
122-
else \
123-
echo "❌ No supported container tool available."; \
124-
exit 1; \
125-
fi
126-
12784
.PHONY: image-build
128-
image-build: check-container-tool load-version-json ## Build Docker image ## Build Docker image using $(CONTAINER_TOOL)
85+
image-build: check-container-tool ## Build Docker image ## Build Docker image using $(CONTAINER_TOOL)
12986
@printf "\033[33;1m==== Building Docker image $(IMG) ====\033[0m\n"
13087
$(CONTAINER_TOOL) build \
13188
--platform $(TARGETOS)/$(TARGETARCH) \
@@ -134,7 +91,7 @@ image-build: check-container-tool load-version-json ## Build Docker image ## Bui
13491
-t $(IMG) .
13592

13693
.PHONY: image-push
137-
image-push: check-container-tool load-version-json ## Push Docker image $(IMG) to registry
94+
image-push: check-container-tool ## Push Docker image $(IMG) to registry
13895
@printf "\033[33;1m==== Pushing Docker image $(IMG) ====\033[0m\n"
13996
$(CONTAINER_TOOL) push $(IMG)
14097

@@ -236,50 +193,10 @@ uninstall-rbac: check-kubectl check-kustomize check-envsubst ## Uninstall RBAC
236193

237194

238195
##@ Version Extraction
239-
.PHONY: version dev-registry prod-registry extract-version-info
240-
241-
dev-version: check-jq
242-
@jq -r '.dev-version' .version.json
243-
244-
prod-version: check-jq
245-
@jq -r '.prod-version' .version.json
246-
247-
dev-registry: check-jq
248-
@jq -r '."dev-registry"' .version.json
249-
250-
prod-registry: check-jq
251-
@jq -r '."prod-registry"' .version.json
252-
253-
extract-version-info: check-jq
254-
@echo "DEV_VERSION=$$(jq -r '."dev-version"' .version.json)"
255-
@echo "PROD_VERSION=$$(jq -r '."prod-version"' .version.json)"
256-
@echo "DEV_IMAGE_TAG_BASE=$$(jq -r '."dev-registry"' .version.json)"
257-
@echo "PROD_IMAGE_TAG_BASE=$$(jq -r '."prod-registry"' .version.json)"
258-
259-
##@ Load Version JSON
260-
261-
.PHONY: load-version-json
262-
load-version-json: check-jq
263-
@if [ "$(DEV_VERSION)" = "0.0.1" ]; then \
264-
DEV_VERSION=$$(jq -r '."dev-version"' .version.json); \
265-
PROD_VERSION=$$(jq -r '."prod-version"' .version.json); \
266-
echo "✔ Loaded DEV_VERSION from .version.json: $$DEV_VERSION"; \
267-
echo "✔ Loaded PROD_VERSION from .version.json: $$PROD_VERSION"; \
268-
export DEV_VERSION; \
269-
export PROD_VERSION; \
270-
fi && \
271-
CURRENT_DEFAULT="ghcr.io/llm-d/$(PROJECT_NAME)"; \
272-
if [ "$(IMAGE_TAG_BASE)" = "$$CURRENT_DEFAULT" ]; then \
273-
IMAGE_TAG_BASE=$$(jq -r '."dev-registry"' .version.json); \
274-
echo "✔ Loaded IMAGE_TAG_BASE from .version.json: $$IMAGE_TAG_BASE"; \
275-
export IMAGE_TAG_BASE; \
276-
fi && \
277-
echo "🛠 Final values: DEV_VERSION=$$DEV_VERSION, PROD_VERSION=$$PROD_VERSION, IMAGE_TAG_BASE=$$IMAGE_TAG_BASE"
196+
.PHONY: version extract-version-info
278197

279198
.PHONY: env
280-
env: load-version-json ## Print environment variables
281-
@echo "DEV_VERSION=$(DEV_VERSION)"
282-
@echo "PROD_VERSION=$(PROD_VERSION)"
199+
env: ## Print environment variables
283200
@echo "IMAGE_TAG_BASE=$(IMAGE_TAG_BASE)"
284201
@echo "IMG=$(IMG)"
285202
@echo "CONTAINER_TOOL=$(CONTAINER_TOOL)"
@@ -292,13 +209,11 @@ check-tools: \
292209
check-go \
293210
check-ginkgo \
294211
check-golangci-lint \
295-
check-jq \
296212
check-kustomize \
297213
check-envsubst \
298214
check-container-tool \
299215
check-kubectl \
300-
check-buildah \
301-
check-podman
216+
check-buildah
302217
@echo "✅ All required tools are installed."
303218

304219
.PHONY: check-go
@@ -316,11 +231,6 @@ check-golangci-lint:
316231
@command -v golangci-lint >/dev/null 2>&1 || { \
317232
echo "❌ golangci-lint is not installed. Install from https://golangci-lint.run/usage/install/"; exit 1; }
318233

319-
.PHONY: check-jq
320-
check-jq:
321-
@command -v jq >/dev/null 2>&1 || { \
322-
echo "❌ jq is not installed. Install it from https://stedolan.github.io/jq/download/"; exit 1; }
323-
324234
.PHONY: check-kustomize
325235
check-kustomize:
326236
@command -v kustomize >/dev/null 2>&1 || { \
@@ -352,12 +262,6 @@ check-builder:
352262
echo "✅ Using builder: $(BUILDER)"; \
353263
fi
354264

355-
.PHONY: check-podman
356-
check-podman:
357-
@command -v podman >/dev/null 2>&1 || { \
358-
echo "⚠️ Podman is not installed. You can install it with:"; \
359-
echo "🔧 sudo apt install podman OR brew install podman"; exit 1; }
360-
361265
##@ Alias checking
362266
.PHONY: check-alias
363267
check-alias: check-container-tool
@@ -391,5 +295,5 @@ env-dev-kind: image-build
391295
CLUSTER_NAME=$(KIND_CLUSTER_NAME) \
392296
GATEWAY_HOST_PORT=$(KIND_GATEWAY_HOST_PORT) \
393297
IMAGE_REGISTRY=$(IMAGE_REGISTRY) \
394-
EPP_TAG=$(DEV_VERSION) \
298+
EPP_TAG=$(EPP_TAG) \
395299
./scripts/kind-dev-env.sh

scripts/kind-dev-env.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
2626
: "${VLLM_SIMULATOR_IMAGE:=llm-d-inference-sim}"
2727

2828
# Set a default VLLM_SIMULATOR_TAG if not provided
29-
export VLLM_SIMULATOR_TAG="${VLLM_SIMULATOR_TAG:-0.0.6}"
29+
export VLLM_SIMULATOR_TAG="${VLLM_SIMULATOR_TAG:-dev}"
3030

3131
# Set a default EPP_IMAGE if not provided
3232
: "${EPP_IMAGE:=llm-d-inference-scheduler}"
3333

3434
# Set a default EPP_TAG if not provided
35-
export EPP_TAG="${EPP_TAG:-0.0.4}"
35+
export EPP_TAG="${EPP_TAG:-dev}"
3636

3737
# Set the default routing side car image tag
3838
export ROUTING_SIDECAR_TAG="${ROUTING_SIDECAR_TAG:-0.0.6}"

0 commit comments

Comments
 (0)