Skip to content

Commit 2fbf114

Browse files
committed
Adds an API server to enable advanced ilab features from the UI
Signed-off-by: Brent Salisbury <[email protected]>
1 parent a6f0cbd commit 2fbf114

File tree

14 files changed

+3176
-0
lines changed

14 files changed

+3176
-0
lines changed

api-server/.gitignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Binaries for programs and plugins
2+
*.exe
3+
*.exe~
4+
*.dll
5+
*.so
6+
*.dylib
7+
8+
# Test binary, built with `go test -c`
9+
*.test
10+
11+
# Output of the go coverage tool, specifically when used with LiteIDE
12+
*.out
13+
14+
# Dependency directories (remove the comment below to include it)
15+
# vendor/
16+
17+
# Go workspace file
18+
go.work
19+
go.work.sum
20+
21+
# env file
22+
.env
23+
24+
# app specific
25+
logs/
26+
jobs.json

api-server/Containerfile

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Stage 1: Build the Go application
2+
FROM golang:1.23.5-alpine AS builder
3+
4+
# build-base needed for CGO
5+
RUN apk update && apk add --no-cache git bash build-base
6+
7+
# Set envs
8+
ENV GO111MODULE=on \
9+
CGO_ENABLED=1 \
10+
GOOS=linux \
11+
GOARCH=amd64
12+
13+
# Create app directory
14+
WORKDIR /app
15+
16+
# Copy go.mod and go.sum files
17+
COPY go.mod go.sum ./
18+
19+
RUN go mod download
20+
21+
# Copy the source code
22+
COPY . .
23+
24+
# Build the Go binary
25+
RUN go build -o ilab-api-router
26+
27+
# Stage 2: Create the runtime image
28+
FROM alpine:latest
29+
30+
# runtime dependencies
31+
RUN apk update && apk add --no-cache bash git podman
32+
33+
WORKDIR /app
34+
35+
# Copy the built binary from the builder stage
36+
COPY --from=builder /app/ilab-api-router .
37+
38+
RUN chmod +x ilab-api-router
39+
40+
RUN mkdir -p /var/home/cloud-user/.local/share/instructlab/taxonomy/ \
41+
&& mkdir -p /var/home/cloud-user/.cache/instructlab/models/ \
42+
&& mkdir -p /var/home/cloud-user/.local/share/instructlab/datasets/ \
43+
&& mkdir -p /var/home/cloud-user/.local/share/instructlab/checkpoints/hf_format/ \
44+
&& mkdir -p /var/home/cloud-user/.local/share/instructlab/taxonomy/
45+
46+
# Define default command with parameters (can be overridden at runtime)
47+
ENTRYPOINT ["./ilab-api-router"]
48+
CMD ["--taxonomy-path", "/var/home/cloud-user/.local/share/instructlab/taxonomy/", "--rhelai", "--vllm", "--debug"]

0 commit comments

Comments
 (0)