Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move pkg/ext-proc -> cmd/ext-proc #368

Merged
merged 2 commits into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,17 @@ ENV CGO_ENABLED=0
ENV GOOS=linux
ENV GOARCH=amd64

# Dependencies
WORKDIR /src
COPY . .
WORKDIR /src/pkg/ext-proc
COPY go.mod go.sum ./
RUN go mod download

# Sources
COPY cmd ./cmd
COPY pkg ./pkg
COPY internal ./internal
COPY api ./api
WORKDIR /src/cmd/ext-proc
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how should we organize the dockerfiles if we want to support multiple applications in the repo? say we add another app under cmd/ for #355?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you create a separate Dockerfile for each, unless you need all of them in a single image, which you usually don't. But even that is perfectly possible by using a build stage per executable, then copying all the artifacts into the last stage.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we create a docker file per app, how do you suggest we do it? Using different names at the top level or put the dockerfile in the cmd/app directory?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I usually create docker/<component>.Dockerfile, e.g. docker/ExtProc.Dockerfile. But that is simply what I came up with for my projects.

RUN go build -o /ext-proc

## Multistage deploy
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion pkg/ext-proc/main.go → cmd/ext-proc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ import (
"sigs.k8s.io/controller-runtime/pkg/manager"
"sigs.k8s.io/controller-runtime/pkg/metrics/filters"
"sigs.k8s.io/gateway-api-inference-extension/api/v1alpha1"
"sigs.k8s.io/gateway-api-inference-extension/internal/runnable"
"sigs.k8s.io/gateway-api-inference-extension/pkg/ext-proc/backend"
"sigs.k8s.io/gateway-api-inference-extension/pkg/ext-proc/backend/vllm"
"sigs.k8s.io/gateway-api-inference-extension/pkg/ext-proc/datastore"
"sigs.k8s.io/gateway-api-inference-extension/pkg/ext-proc/internal/runnable"
"sigs.k8s.io/gateway-api-inference-extension/pkg/ext-proc/metrics"
runserver "sigs.k8s.io/gateway-api-inference-extension/pkg/ext-proc/server"
"sigs.k8s.io/gateway-api-inference-extension/pkg/ext-proc/util/logging"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ require (
k8s.io/client-go v0.32.2
k8s.io/code-generator v0.32.2
k8s.io/component-base v0.32.2
k8s.io/klog/v2 v2.130.1
k8s.io/utils v0.0.0-20241210054802-24370beab758
sigs.k8s.io/controller-runtime v0.20.2
sigs.k8s.io/structured-merge-diff/v4 v4.5.0
Expand Down Expand Up @@ -137,6 +136,7 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiserver v0.32.2 // indirect
k8s.io/gengo/v2 v2.0.0-20240911193312-2b36238f13e9 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f // indirect
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.0 // indirect
sigs.k8s.io/controller-tools v0.14.0 // indirect
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion pkg/ext-proc/server/runserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ import (
"k8s.io/apimachinery/pkg/types"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/manager"
"sigs.k8s.io/gateway-api-inference-extension/internal/runnable"
"sigs.k8s.io/gateway-api-inference-extension/pkg/ext-proc/backend"
"sigs.k8s.io/gateway-api-inference-extension/pkg/ext-proc/controller"
"sigs.k8s.io/gateway-api-inference-extension/pkg/ext-proc/datastore"
"sigs.k8s.io/gateway-api-inference-extension/pkg/ext-proc/handlers"
"sigs.k8s.io/gateway-api-inference-extension/pkg/ext-proc/internal/runnable"
"sigs.k8s.io/gateway-api-inference-extension/pkg/ext-proc/scheduling"
)

Expand Down