Skip to content

Commit cd47fab

Browse files
committed
Merge remote-tracking branch 'origin/dev'
2 parents 1bc7583 + 634133f commit cd47fab

File tree

91 files changed

+24226
-191
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+24226
-191
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
*.dll
88
*.so
99
*.dylib
10+
*.a
11+
main
12+
bin/
1013

1114
# Test binary, built with `go test -c`
1215
*.test
@@ -21,4 +24,6 @@
2124
go.work
2225
go.work.sum
2326

27+
# Environment Files
2428
.DS_Store
29+
.env

.golangci.yml

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,33 @@
1-
# Refer to golangci-lint's example config file for more options and information:
2-
# https://github.com/golangci/golangci-lint/blob/master/.golangci.reference.yml
31
version: "2"
42

53
run:
64
timeout: 5m
7-
modules-download-mode: readonly
5+
allow-parallel-runners: true
86

9-
linters:
7+
formatters:
108
enable:
11-
- errcheck
12-
- govet
13-
- staticcheck
9+
- goimports
10+
- gofmt
1411

15-
issues:
16-
exclude-use-default: false
17-
max-issues-per-linter: 0
18-
max-same-issues: 0
12+
linters:
13+
enable:
14+
- copyloopvar
15+
- dupword
16+
- durationcheck
17+
- fatcontext
18+
- ginkgolinter
19+
- gocritic
20+
- govet
21+
- loggercheck
22+
- misspell
23+
- perfsprint
24+
- revive
25+
- unconvert
26+
- makezero
27+
- errcheck
28+
- goconst
29+
- ineffassign
30+
- nakedret
31+
- prealloc
32+
- unparam
33+
- unused

.tekton/buildah-build.yaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ spec:
1616
- name: registry
1717
- name: container-storage
1818
mountPath: /var/lib/containers
19+
- name: git-auth
1920
steps:
2021
- name: build
2122
image: quay.io/buildah/stable:latest
@@ -34,7 +35,22 @@ spec:
3435
echo "🔧 IMAGE_TAG_BASE: $(params.image_tag_base)"
3536
3637
echo "📦 Installing dependencies: make, jq..."
37-
dnf install -y make jq && dnf clean all
38+
dnf install -y make git jq && dnf clean all
39+
40+
echo "🔐 Extracting Git credentials from workspace..."
41+
GIT_USER=$(cat /workspace/git-auth/username)
42+
GIT_TOKEN=$(cat /workspace/git-auth/token)
43+
44+
if [ -z "$GIT_USER" ] || [ -z "$GIT_TOKEN" ]; then
45+
echo "❌ Error: Missing git-auth credentials"
46+
exit 1
47+
fi
48+
49+
echo "🔐 Configuring Git..."
50+
git config --global user.email "ci-tag-bot@example.com"
51+
git config --global user.name "ci-tag-bot"
52+
git config --global url."https://${GIT_USER}:${GIT_TOKEN}@github.com".insteadOf "https://github.com"
53+
git config --global --add safe.directory "$(pwd)"
3854
3955
echo "📁 Setting up registry credentials..."
4056
mkdir -p /root/.docker

.tekton/go-build-task.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,24 @@ spec:
1212
script: |
1313
#!/bin/bash
1414
cd $(workspaces.source.path)
15+
16+
echo "🔐 Extracting Git credentials from workspace..."
17+
GIT_USER=$(cat /workspace/git-auth/username)
18+
GIT_TOKEN=$(cat /workspace/git-auth/token)
19+
20+
if [ -z "$GIT_USER" ] || [ -z "$GIT_TOKEN" ]; then
21+
echo "❌ Error: Missing git-auth credentials"
22+
exit 1
23+
fi
24+
25+
echo "🔐 Configuring Git..."
26+
git config --global user.email "ci-tag-bot@example.com"
27+
git config --global user.name "ci-tag-bot"
28+
git config --global url."https://${GIT_USER}:${GIT_TOKEN}@github.com".insteadOf "https://github.com"
29+
git config --global --add safe.directory "$(pwd)"
30+
31+
# required for go build with tokenizer lib linking
32+
dnf install -y gcc-c++ libstdc++ libstdc++-devel && dnf clean all
33+
1534
go env -w GOFLAGS=-buildvcs=false
1635
make build

.tekton/go-lint-task.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,21 @@ spec:
1919
echo "Running golangci-lint..."
2020
cd $(workspaces.source.path)
2121
22+
echo "🔐 Extracting Git credentials from workspace..."
23+
GIT_USER=$(cat /workspace/git-auth/username)
24+
GIT_TOKEN=$(cat /workspace/git-auth/token)
25+
26+
if [ -z "$GIT_USER" ] || [ -z "$GIT_TOKEN" ]; then
27+
echo "❌ Error: Missing git-auth credentials"
28+
exit 1
29+
fi
30+
31+
echo "🔐 Configuring Git..."
32+
git config --global user.email "ci-tag-bot@example.com"
33+
git config --global user.name "ci-tag-bot"
34+
git config --global url."https://${GIT_USER}:${GIT_TOKEN}@github.com".insteadOf "https://github.com"
35+
git config --global --add safe.directory "$(pwd)"
36+
2237
# Verify config file exists
2338
if [ -f .golangci.yml ] || [ -f .golangci.yaml ] || [ -f .golangci.toml ]; then
2439
echo "✅ Found golangci-lint config file"

.tekton/go-test-task.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,24 @@ spec:
1818
ginkgo version
1919
cd $(workspaces.source.path)
2020
echo "Running tests with Ginkgo..."
21+
22+
echo "🔐 Extracting Git credentials from workspace..."
23+
GIT_USER=$(cat /workspace/git-auth/username)
24+
GIT_TOKEN=$(cat /workspace/git-auth/token)
25+
26+
if [ -z "$GIT_USER" ] || [ -z "$GIT_TOKEN" ]; then
27+
echo "❌ Error: Missing git-auth credentials"
28+
exit 1
29+
fi
30+
31+
echo "🔐 Configuring Git..."
32+
git config --global user.email "ci-tag-bot@example.com"
33+
git config --global user.name "ci-tag-bot"
34+
git config --global url."https://${GIT_USER}:${GIT_TOKEN}@github.com".insteadOf "https://github.com"
35+
git config --global --add safe.directory "$(pwd)"
36+
37+
# required for go build with tokenizer lib linking
38+
dnf install -y gcc-c++ libstdc++ libstdc++-devel && dnf clean all
39+
2140
go env -w GOFLAGS=-buildvcs=false
2241
make test

.tekton/pipelinerun.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ spec:
1919
fsGroup: 0
2020
imagePullSecrets:
2121
- name: icr-secret
22+
nodeSelector:
23+
nvidia.com/gpu.product: "none" # Ensures tasks run on non-GPU nodes
2224
params:
2325
- name: runOptional
2426
value: "true"
@@ -133,6 +135,8 @@ spec:
133135
workspaces:
134136
- name: source
135137
workspace: source
138+
- name: git-auth
139+
workspace: git-auth
136140

137141
- name: go-test
138142
when:
@@ -149,6 +153,8 @@ spec:
149153
workspaces:
150154
- name: source
151155
workspace: source
156+
- name: git-auth
157+
workspace: git-auth
152158

153159
- name: go-build
154160
when:
@@ -165,6 +171,8 @@ spec:
165171
workspaces:
166172
- name: source
167173
workspace: source
174+
- name: git-auth
175+
workspace: git-auth
168176

169177
- name: extract-version-and-registry
170178
params:
@@ -328,6 +336,8 @@ spec:
328336
workspace: registry-secret
329337
- name: container-storage
330338
workspace: container-storage
339+
- name: git-auth
340+
workspace: git-auth
331341

332342
- name: vulnerability-scan
333343
when:

Dockerfile

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,54 @@ FROM quay.io/projectquay/golang:1.24 AS builder
33
ARG TARGETOS
44
ARG TARGETARCH
55

6-
ENV GOPROXY=https://goproxy.io,direct
6+
# Install build tools
7+
RUN dnf install -y gcc-c++ libstdc++ libstdc++-devel && dnf clean all
78

89
WORKDIR /workspace
10+
11+
## NeuralMagic internal repos pull config
12+
ARG GIT_NM_USER
13+
ARG NM_TOKEN
14+
### use git token
15+
RUN echo -e "machine github.com\n\tlogin ${GIT_NM_USER}\n\tpassword ${NM_TOKEN}" >> ~/.netrc
16+
ENV GOPRIVATE=github.com/neuralmagic
17+
ENV GIT_TERMINAL_PROMPT=1
18+
919
# Copy the Go Modules manifests
1020
COPY go.mod go.mod
1121
COPY go.sum go.sum
12-
# cache deps before building and copying source so that we don't need to re-download as much
13-
# and so that source changes don't invalidate our downloaded layer
14-
RUN go mod download
1522

1623
# Copy the go source
17-
COPY cmd/llm-d-inference-scheduler/main.go cmd/cmd.go
18-
COPY hello/ hello/
24+
COPY cmd/ cmd/
25+
COPY pkg/ pkg/
26+
COPY internal/ internal/
27+
28+
# HuggingFace tokenizer bindings
29+
RUN mkdir -p lib
30+
RUN curl -L https://github.com/daulet/tokenizers/releases/download/v1.20.2/libtokenizers.${TARGETOS}-${TARGETARCH}.tar.gz | tar -xz -C lib
31+
RUN ranlib lib/*.a
1932

2033
# Build
2134
# the GOARCH has not a default value to allow the binary be built according to the host where the command
2235
# was called. For example, if we call make image-build in a local env which has the Apple Silicon M1 SO
2336
# the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore,
2437
# by leaving it empty we can ensure that the container and binary shipped on it will have the same platform.
25-
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o bin/llm-d-inference-scheduler cmd/cmd.go
38+
ENV CGO_ENABLED=1
39+
ENV GOOS=${TARGETOS:-linux}
40+
ENV GOARCH=${TARGETARCH}
41+
RUN go build -a -o bin/epp -ldflags="-extldflags '-L$(pwd)/lib'" cmd/epp/main.go cmd/epp/health.go
42+
RUN rm -rf ~/.netrc # remove git token
2643

2744
# Use distroless as minimal base image to package the manager binary
2845
# Refer to https://github.com/GoogleContainerTools/distroless for more details
2946
FROM registry.access.redhat.com/ubi9/ubi:latest
3047
WORKDIR /
31-
COPY --from=builder /workspace/bin/llm-d-inference-scheduler /app/llm-d-inference-scheduler
48+
COPY --from=builder /workspace/bin/epp /app/epp
3249
USER 65532:65532
3350

34-
CMD ["sleep", "infinity"]
35-
51+
# expose gRPC, health and metrics ports
52+
EXPOSE 9002
53+
EXPOSE 9003
54+
EXPOSE 9090
3655

56+
ENTRYPOINT ["/app/epp"]

0 commit comments

Comments
 (0)