Skip to content

Commit c326f9b

Browse files
committed
Address review comments.
Signed-off-by: Revital Sur <eres@il.ibm.com>
1 parent a1e58d2 commit c326f9b

7 files changed

Lines changed: 17 additions & 3 deletions

File tree

.github/actions/docker-build-and-push/action.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ inputs:
3333
required: false
3434
description: Git commit SHA to embed via COMMIT_SHA build arg
3535
default: ''
36+
build-ref:
37+
required: false
38+
description: Human-readable build ref embedded via BUILD_REF build arg. Falls back to tag when unset.
39+
default: ''
3640
additional-tags:
3741
required: false
3842
description: Additional image tags to push
@@ -66,6 +70,6 @@ runs:
6670
build-args: |
6771
LDFLAGS=-s -w
6872
COMMIT_SHA=${{ inputs.commit-sha || 'unknown' }}
69-
BUILD_REF=${{ inputs.tag || 'unknown' }}
73+
BUILD_REF=${{ inputs.build-ref || inputs.tag || 'unknown' }}
7074
cache-from: type=gha,scope=${{ inputs.image-name }}
7175
cache-to: type=gha,mode=max,scope=${{ inputs.image-name }}

.github/workflows/ci-coordinator.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ jobs:
4242
- scripts/**
4343
- hack/**
4444
- test/**
45+
- config/coordinator/**
4546
- .github/actions/docker-build-and-push/action.yml
4647
- .github/actions/e2e-runner-setup/action.yml
4748
- .github/workflows/ci-coordinator.yaml
@@ -133,6 +134,7 @@ jobs:
133134
push: 'false'
134135
buildx-outputs: type=docker,dest=${{ runner.temp }}/${{ matrix.image.archive }}.tar
135136
commit-sha: ${{ github.sha }}
137+
build-ref: ${{ github.head_ref || github.ref_name }}
136138

137139
- name: Pull ${{ matrix.image.name }} image
138140
if: ${{ matrix.image.source == 'pull' }}

.github/workflows/ci-pr-checks.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ jobs:
259259
push: 'false'
260260
buildx-outputs: type=docker,dest=${{ runner.temp }}/${{ matrix.image.archive }}.tar
261261
commit-sha: ${{ github.sha }}
262+
build-ref: ${{ github.head_ref || github.ref_name }}
262263

263264
- name: Pull ${{ matrix.image.name }} image
264265
if: ${{ matrix.image.source == 'pull' }}
@@ -322,6 +323,7 @@ jobs:
322323
push: 'false'
323324
buildx-outputs: type=docker,dest=${{ runner.temp }}/${{ matrix.image.archive }}.tar
324325
commit-sha: ${{ github.sha }}
326+
build-ref: ${{ github.head_ref || github.ref_name }}
325327

326328
- name: Pull ${{ matrix.image.name }} image
327329
if: ${{ matrix.image.source == 'pull' }}

Dockerfile.coordinator

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ RUN go mod download
2525
# Copy the go source
2626
COPY cmd/ cmd/
2727
COPY pkg/ pkg/
28+
COPY version/ version/
2829
COPY config/coordinator/ config/coordinator/
2930

3031
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build \
31-
-ldflags="${LDFLAGS}" \
32+
-ldflags="${LDFLAGS} -X github.com/llm-d/llm-d-router/version.CommitSHA=${COMMIT_SHA} -X github.com/llm-d/llm-d-router/version.BuildRef=${BUILD_REF}" \
3233
-o bin/coordinator ./cmd/coordinator/...
3334

3435
# Runtime stage

Makefile.coord.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ test-unit: image-build-builder
196196
$(BUILDER_RUN) "go test -v -race $(TEST_PACKAGES)"
197197

198198
.PHONY: test-e2e-coordinator-run
199-
test-e2e-coordinator-run: image-pull ## Ensure images are present, then run coordinator e2e tests
199+
test-e2e-coordinator-run: image-pull ## Run coordinator e2e tests against pre-loaded builder/coordinator/epp images (CI entry point; use test-e2e-coordinator locally)
200200
@printf "\033[33;1m==== Running Coordinator End to End Tests ====\033[0m\n"
201201
$(CONTAINER_RUNTIME) run $(BUILDER_RUN_FLAGS) $(BUILDER_E2E_FLAGS) \
202202
$(BUILDER_IMAGE) test/coordinator/scripts/run_e2e_coordinator.sh

README.coord.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,8 @@ make -f Makefile.coord.mk test-e2e-coordinator
307307

308308
This creates a temporary Kind cluster named `e2e-coordinator-tests`, runs the coordinator e2e suite against it, and deletes the cluster on completion.
309309

310+
`test-e2e-coordinator` is the local entry point: it builds the builder, coordinator, and epp images first. CI invokes `test-e2e-coordinator-run` instead, which expects those images to be already built and loaded into the container daemon (`image-pull` fetches only the simulator). Running `test-e2e-coordinator-run` directly without prebuilt images will use stale or missing ones.
311+
310312
**Keeping the cluster on failure**
311313

312314
Set `E2E_KEEP_CLUSTER_ON_FAILURE=true` to preserve the cluster when any test fails. This is useful for inspecting pod logs, events, or cluster state after a failure.

cmd/coordinator/main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import (
2929
ctrl "sigs.k8s.io/controller-runtime"
3030

3131
logutil "github.com/llm-d/llm-d-router/pkg/common/observability/logging"
32+
"github.com/llm-d/llm-d-router/version"
3233

3334
"github.com/llm-d/llm-d-router/pkg/coordinator/config"
3435
"github.com/llm-d/llm-d-router/pkg/coordinator/gateway"
@@ -48,6 +49,8 @@ func main() {
4849
logutil.InitSetupLogging()
4950
log := ctrl.Log.WithName("coordinator")
5051

52+
log.Info("coordinator build", "commit-sha", version.CommitSHA, "build-ref", version.BuildRef)
53+
5154
cfg, err := config.Load(*configPath)
5255
if err != nil {
5356
log.Error(err, "failed to load config")

0 commit comments

Comments
 (0)