Skip to content

Commit 618a79c

Browse files
committed
refactor: rhcl build is now cross-build with go
Signed-off-by: Paul Bastide <pbastide@us.ibm.com>
1 parent 29ddc92 commit 618a79c

File tree

4 files changed

+34
-24
lines changed

4 files changed

+34
-24
lines changed

.github/workflows/publish-llm-d-inference-sim.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,23 @@ jobs:
3434
- name: Checkout repository
3535
uses: actions/checkout@v6
3636

37+
- name: Setup Go 1.24.x
38+
uses: actions/setup-go@v6
39+
with:
40+
go-version: '1.26.x'
41+
42+
- name: Build the binaries
43+
run: |
44+
mkdir -p tmp/
45+
cd tmp/
46+
curl -O -L https://github.com/llm-d/llm-d-inference-sim/archive/refs/tags/v0.8.2.zip && \
47+
dnf install unzip -y && \
48+
unzip v0.8.2.zip
49+
cd llm-d-inference-sim-0.8.2
50+
cp cmd/llm-d-inference-sim/main.go cmd/cmd.go
51+
CGO_ENABLED=0 GOOS=linux GOARCH=ppc64le go build -o bin/llm-d-inference-sim ./cmd/cmd.go
52+
CGO_ENABLED=0 GOOS=linux GOARCH=s390x go build -o bin/llm-d-inference-sim ./cmd/cmd.go
53+
3754
# Install the cosign tool except on PR
3855
# https://github.com/sigstore/cosign-installer
3956
- name: Install cosign
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
**/tmp/*
Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,11 @@
1-
# Build Stage: using Go 1.25.0 image
2-
## Pure Go build, no CGO required
3-
FROM quay.io/projectquay/golang:1.25 AS builder
4-
5-
WORKDIR /workspace
6-
7-
RUN curl -O -L https://github.com/llm-d/llm-d-inference-sim/archive/refs/tags/v0.8.2.zip && \
8-
dnf install unzip -y && \
9-
unzip v0.8.2.zip
10-
11-
WORKDIR /workspace/llm-d-inference-sim-0.8.2
12-
13-
# cache deps before building and copying source so that we don't need to re-download as much
14-
# and so that source changes don't invalidate our downloaded layer
15-
RUN go mod download
16-
17-
RUN cp cmd/llm-d-inference-sim/main.go cmd/cmd.go
18-
19-
# Build simulator, no Python, no embedded tokenizer, no CGO for ZMQ, use pure Go
20-
# The default kv-cache build uses UDS tokenizer (//go:build !embedded_tokenizers)
21-
RUN CGO_ENABLED=0 GOOS=linux go build -o bin/llm-d-inference-sim ./cmd/cmd.go
22-
231
FROM registry.access.redhat.com/ubi10/ubi-micro:latest
242

253
WORKDIR /
264

27-
COPY --from=builder /workspace/llm-d-inference-sim-0.8.2/bin/llm-d-inference-sim /app/llm-d-inference-sim
5+
ADD tmp/llm-d-inference-sim-0.8.2/bin/llm-d-inference-sim-* /app/
6+
7+
RUN mv tmp/llm-d-inference-sim-0.8.2/bin/llm-d-inference-sim-$(arch) llm-d-inference-sim
288

299
USER 65532:65532
3010

31-
ENTRYPOINT ["/app/llm-d-inference-sim"]
11+
ENTRYPOINT ["/app/llm-d-inference-sim"]
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
mkdir -p tmp/
2+
cd tmp/
3+
4+
curl -O -L https://github.com/llm-d/llm-d-inference-sim/archive/refs/tags/v0.8.2.zip && \
5+
dnf install unzip -y && \
6+
unzip v0.8.2.zip
7+
8+
cd llm-d-inference-sim-0.8.2
9+
cp cmd/llm-d-inference-sim/main.go cmd/cmd.go
10+
11+
CGO_ENABLED=0 GOOS=linux GOARCH=ppc64le go build -o bin/llm-d-inference-sim ./cmd/cmd.go
12+
CGO_ENABLED=0 GOOS=linux GOARCH=s390x go build -o bin/llm-d-inference-sim ./cmd/cmd.go

0 commit comments

Comments
 (0)