Skip to content
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ platform-api/src/resources/openapi_with_binding.yaml

# Gateway
gateway/gateway-runtime/target
gateway/gateway-controller/target/
gateway/gateway-builder/target/
event-gateway/gateway-runtime/target/
dev-policies/

# Copilot Prompts
Expand Down
8 changes: 8 additions & 0 deletions event-gateway/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,20 +73,24 @@ build: build-event-gateway-controller build-gateway-runtime build-webhook-listen
# once gateway-builder is integrated into the event-gateway build pipeline.
build-event-gateway-controller: ## Build event-gateway-controller Docker image
@echo "Building event-gateway-controller Docker image ($(VERSION))..."
@mkdir -p ../gateway/gateway-controller/target
@cp ../LICENSE ../gateway/gateway-controller/target/
@cd ../gateway/gateway-controller && \
docker buildx build -f Dockerfile \
--build-context sdk=../../sdk \
--build-context sdk-core=../../sdk/core \
--build-context common=../../common \
--build-context build-manifest=.. \
--build-context policies=../../event-gateway/default-policies \
--build-context target=target \
--build-arg VERSION=$(VERSION) \
--build-arg FUNCTIONALITY_TYPE=event \
--build-arg GIT_COMMIT=$$(git rev-parse --short HEAD 2>/dev/null || echo "unknown") \
--target production \
-t $(EVENT_GATEWAY_CONTROLLER_IMAGE):$(VERSION) \
--load \
.
@rm -rf ../gateway/gateway-controller/target

.PHONY: build-gateway-runtime
build-gateway-runtime: ## Build event-gateway-runtime Docker image
Expand All @@ -107,13 +111,16 @@ build-and-push-multiarch: build-and-push-multiarch-event-gateway-controller buil
# once gateway-builder is integrated into the event-gateway build pipeline.
build-and-push-multiarch-event-gateway-controller: ## Build and push event-gateway-controller Docker image for multiple architectures
@echo "Building and pushing multi-arch event-gateway-controller Docker image ($(VERSION))..."
@mkdir -p ../gateway/gateway-controller/target
@cp ../LICENSE ../gateway/gateway-controller/target/
@cd ../gateway/gateway-controller && \
docker buildx build -f Dockerfile \
--build-context sdk=../../sdk \
--build-context sdk-core=../../sdk/core \
--build-context common=../../common \
--build-context build-manifest=.. \
--build-context policies=../../event-gateway/default-policies \
--build-context target=target \
--platform linux/amd64,linux/arm64 \
--build-arg VERSION=$(VERSION) \
--build-arg FUNCTIONALITY_TYPE=event \
Expand All @@ -122,6 +129,7 @@ build-and-push-multiarch-event-gateway-controller: ## Build and push event-gatew
-t $(EVENT_GATEWAY_CONTROLLER_IMAGE):$(VERSION) \
--push \
.
@rm -rf ../gateway/gateway-controller/target

.PHONY: build-and-push-multiarch-gateway-runtime
build-and-push-multiarch-gateway-runtime: ## Build and push event-gateway-runtime Docker image for multiple architectures
Expand Down
1 change: 1 addition & 0 deletions event-gateway/gateway-runtime/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ RUN apk add --no-cache ca-certificates bash tini && \
WORKDIR /app

COPY --from=policy-compiler /api-platform/output/event-gateway/event-gateway /app/event-gateway
COPY --from=target LICENSE /app/LICENSE
COPY configs/config.toml /etc/event-gateway/config.toml
COPY configs/channels.yaml /etc/event-gateway/channels.yaml
COPY docker-entrypoint.sh /app/docker-entrypoint.sh
Expand Down
1 change: 1 addition & 0 deletions event-gateway/gateway-runtime/Dockerfile.debug
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ RUN go install github.com/go-delve/delve/cmd/dlv@latest
WORKDIR /app

COPY --from=policy-compiler /api-platform/output/event-gateway/event-gateway /app/event-gateway
COPY --from=target LICENSE /app/LICENSE
COPY configs/config.toml /etc/event-gateway/config.toml
COPY configs/channels.yaml /etc/event-gateway/channels.yaml

Expand Down
12 changes: 9 additions & 3 deletions event-gateway/gateway-runtime/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ debug-local: generate ## Build locally with debug symbols and launch Delve on :2
.PHONY: build-docker
build-docker: ## Build Docker image
@echo "Building event-gateway-runtime Docker image ($(VERSION))..."
@mkdir -p target && cp ../build.yaml target/
@mkdir -p target
@cp ../build.yaml target/
@cp ../../LICENSE target/
docker buildx build \
--load \
--platform linux/$(shell uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/') \
Expand All @@ -100,7 +102,9 @@ build-docker: ## Build Docker image
.PHONY: build-debug
build-debug: ## Build Docker image with Delve remote debugger (port 2345)
@echo "Building event-gateway-runtime debug Docker image ($(VERSION))..."
@mkdir -p target && cp ../build.yaml target/
@mkdir -p target
@cp ../build.yaml target/
@cp ../../LICENSE target/
docker buildx build \
--load \
--platform linux/$(shell uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/') \
Expand All @@ -120,7 +124,9 @@ build-debug: ## Build Docker image with Delve remote debugger (port 2345)
.PHONY: build-and-push-multiarch
build-and-push-multiarch: ## Build and push Docker image for multiple architectures
@echo "Building and pushing multi-arch event-gateway-runtime Docker image ($(VERSION))..."
@mkdir -p target && cp ../build.yaml target/
@mkdir -p target
@cp ../build.yaml target/
@cp ../../LICENSE target/
docker buildx build \
--push \
--platform linux/amd64,linux/arm64 \
Expand Down
1 change: 1 addition & 0 deletions gateway/gateway-builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ COPY --from=system-policies . /api-platform/gateway/system-policies
COPY --from=common . /api-platform/common
COPY --from=sdk-core . /api-platform/sdk/core
COPY --from=sdk-python . /api-platform/sdk-python
COPY --from=target LICENSE /app/LICENSE

# Set working directory
WORKDIR /workspace
Expand Down
6 changes: 6 additions & 0 deletions gateway/gateway-builder/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ help: ## Show this help message
.PHONY: build
build: ## Build Docker image using buildx
@echo "Building Docker image ($(IMAGE_NAME):$(VERSION))..."
@mkdir -p target
@cp ../../LICENSE target/
@docker buildx build -f Dockerfile \
--build-context policy-engine=../gateway-runtime/policy-engine \
--build-context python-executor=../gateway-runtime/python-executor \
Expand All @@ -64,6 +66,7 @@ build: ## Build Docker image using buildx
--build-context sdk-core=../../sdk/core \
--build-context sdk-python=../../sdk-python \
--build-context common=../../common \
--build-context target=target \
--build-arg VERSION=$(VERSION) \
--build-arg GIT_COMMIT=$(GIT_COMMIT) \
-t $(IMAGE_NAME):$(VERSION) \
Expand All @@ -81,6 +84,8 @@ push: ## Push Docker image to registry
.PHONY: build-and-push-multiarch
build-and-push-multiarch: ## Build and push multi-architecture Docker image (linux/amd64, linux/arm64)
@echo "Building and pushing multi-arch Docker image: $(IMAGE_NAME):$(VERSION)"
@mkdir -p target
@cp ../../LICENSE target/
docker buildx build -f Dockerfile \
--build-context policy-engine=../gateway-runtime/policy-engine \
--build-context python-executor=../gateway-runtime/python-executor \
Expand All @@ -89,6 +94,7 @@ build-and-push-multiarch: ## Build and push multi-architecture Docker image (lin
--build-context sdk-core=../../sdk/core \
--build-context sdk-python=../../sdk-python \
--build-context common=../../common \
--build-context target=target \
--platform linux/amd64,linux/arm64 \
--build-arg VERSION=$(VERSION) \
--build-arg GIT_COMMIT=$(GIT_COMMIT) \
Expand Down
4 changes: 3 additions & 1 deletion gateway/gateway-controller/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ RUN --mount=type=cache,target=/go/pkg/mod \
COPY --from=builder /build/controller .
COPY --from=build-manifest build-manifest.yaml /app/build-manifest.yaml
COPY --from=policies . /app/default-policies
COPY --from=target LICENSE /app/LICENSE
COPY lua /app/lua
COPY default-llm-provider-templates /app/default-llm-provider-templates

Expand Down Expand Up @@ -117,11 +118,12 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
rm -rf /var/lib/apt/lists/*

WORKDIR /app
# Copy build manifest
# Copy build manifest
COPY --from=build-manifest build-manifest.yaml /app/build-manifest.yaml

COPY --from=builder /build/controller .
COPY --from=policies . /app/default-policies
COPY --from=target LICENSE /app/LICENSE
COPY lua /app/lua
COPY default-llm-provider-templates /app/default-llm-provider-templates

Expand Down
16 changes: 16 additions & 0 deletions gateway/gateway-controller/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,15 @@ test: ## Run unit and integration tests

build: generate-server-code test ## Build Docker image using buildx
@echo "Building Docker image ($(IMAGE_NAME):$(VERSION))..."
@mkdir -p target
@cp ../../LICENSE target/
docker buildx build -f Dockerfile \
--build-context sdk=../../sdk \
--build-context sdk-core=../../sdk/core \
--build-context common=../../common \
--build-context build-manifest=.. \
--build-context policies=$(POLICIES_BUILD_CONTEXT) \
--build-context target=target \
--build-arg VERSION=$(VERSION) \
--build-arg FUNCTIONALITY_TYPE=$(FUNCTIONALITY_TYPE) \
--build-arg GIT_COMMIT=$(GIT_COMMIT) \
Expand All @@ -88,6 +91,7 @@ build: generate-server-code test ## Build Docker image using buildx
-t $(IMAGE_NAME):latest \
--load \
.
@rm -rf target
@echo "Docker image ($(IMAGE_NAME):$(VERSION)) built successfully."

push: ## Push Docker image to registry
Expand All @@ -97,12 +101,15 @@ push: ## Push Docker image to registry

build-and-push-multiarch: ## Build and push multi-architecture Docker image (linux/amd64, linux/arm64)
@echo "Building and pushing multi-arch Docker image: $(IMAGE_NAME):$(VERSION)"
@mkdir -p target
@cp ../../LICENSE target/
docker buildx build -f Dockerfile \
--build-context sdk=../../sdk \
--build-context sdk-core=../../sdk/core \
--build-context common=../../common \
--build-context build-manifest=.. \
--build-context policies=$(POLICIES_BUILD_CONTEXT) \
--build-context target=target \
--platform linux/amd64,linux/arm64 \
--build-arg VERSION=$(VERSION) \
--build-arg FUNCTIONALITY_TYPE=$(FUNCTIONALITY_TYPE) \
Expand All @@ -112,14 +119,18 @@ build-and-push-multiarch: ## Build and push multi-architecture Docker image (lin
-t $(IMAGE_NAME):latest \
--push \
.
@rm -rf target

build-coverage-image: test ## Build coverage-instrumented gateway-controller image
@mkdir -p target
@cp ../../LICENSE target/
docker buildx build -f Dockerfile \
--build-context sdk=../../sdk \
--build-context sdk-core=../../sdk/core \
--build-context common=../../common \
--build-context build-manifest=.. \
--build-context policies=$(POLICIES_BUILD_CONTEXT) \
--build-context target=target \
--build-arg VERSION=$(VERSION) \
--build-arg FUNCTIONALITY_TYPE=$(FUNCTIONALITY_TYPE) \
--build-arg GIT_COMMIT=$(GIT_COMMIT) \
Expand All @@ -128,14 +139,18 @@ build-coverage-image: test ## Build coverage-instrumented gateway-controller ima
-t $(IMAGE_NAME)-coverage:$(VERSION) \
--load \
.
@rm -rf target

build-debug: ## Build debug image for remote debugging with dlv (VS Code attach on port 2345)
@mkdir -p target
@cp ../../LICENSE target/
docker buildx build -f Dockerfile \
--build-context sdk=../../sdk \
--build-context sdk-core=../../sdk/core \
--build-context common=../../common \
--build-context build-manifest=.. \
--build-context policies=$(POLICIES_BUILD_CONTEXT) \
--build-context target=target \
--build-arg VERSION=$(VERSION) \
--build-arg FUNCTIONALITY_TYPE=$(FUNCTIONALITY_TYPE) \
--build-arg GIT_COMMIT=$(GIT_COMMIT) \
Expand All @@ -145,6 +160,7 @@ build-debug: ## Build debug image for remote debugging with dlv (VS Code attach
-t $(IMAGE_NAME)-debug:latest \
--load \
.
@rm -rf target

generate-listener-certs: ## Generate listener certificates
@echo "Generating listener certificates..."
Expand Down
2 changes: 2 additions & 0 deletions gateway/gateway-runtime/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ COPY router/config/config-override.yaml /etc/envoy/config-override.yaml
COPY docker-entrypoint-debug.sh /usr/local/bin/docker-entrypoint.sh
COPY health-check.sh /usr/local/bin/health-check.sh
COPY --from=target configs/llm-pricing/ /home/wso2/conf/llm-pricing/
COPY --from=target LICENSE /app/LICENSE

RUN chmod +x /app/policy-engine /usr/local/bin/dlv /usr/local/bin/docker-entrypoint.sh /usr/local/bin/health-check.sh

Expand Down Expand Up @@ -263,6 +264,7 @@ COPY router/config/config-override.yaml /etc/envoy/config-override.yaml
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
COPY health-check.sh /usr/local/bin/health-check.sh
COPY --from=target configs/llm-pricing/ /home/wso2/conf/llm-pricing/
COPY --from=target LICENSE /app/LICENSE

RUN chmod +x /app/policy-engine /usr/local/bin/docker-entrypoint.sh /usr/local/bin/health-check.sh

Expand Down
20 changes: 16 additions & 4 deletions gateway/gateway-runtime/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ help: ## Show this help message

build: test ## Build Gateway Runtime Docker image using buildx
@echo "Building Gateway Runtime Docker image ($(IMAGE_NAME):$(VERSION))..."
@mkdir -p target/configs && cp ../build.yaml target/ && cp -r ../configs/llm-pricing target/configs/
@mkdir -p target/configs
@cp ../build.yaml target/
@cp ../../LICENSE target/
@cp -r ../configs/llm-pricing target/configs/
docker buildx build -f Dockerfile \
--build-context sdk=../../sdk \
--build-context sdk-python=../../sdk-python \
Expand Down Expand Up @@ -105,7 +108,10 @@ extract-policies: ## Extract controller policy YAMLs from the policy-compiler st

build-debug: ## Build debug Gateway Runtime image for remote debugging with dlv (VS Code attach on port 2346)
@echo "Building Gateway Runtime debug image ($(IMAGE_NAME)-debug:$(VERSION))..."
@mkdir -p target/configs && cp ../build.yaml target/ && cp -r ../configs/llm-pricing target/configs/
@mkdir -p target/configs
@cp ../build.yaml target/
@cp ../../LICENSE target/
@cp -r ../configs/llm-pricing target/configs/
docker buildx build -f Dockerfile \
--build-context sdk=../../sdk \
--build-context sdk-python=../../sdk-python \
Expand All @@ -132,7 +138,10 @@ build-debug: ## Build debug Gateway Runtime image for remote debugging with dlv

build-coverage-image: test ## Build Gateway Runtime Docker image with coverage instrumentation
@echo "Building Gateway Runtime coverage image ($(IMAGE_NAME)-coverage:$(VERSION))..."
@mkdir -p target/configs && cp ../build.yaml target/ && cp -r ../configs/llm-pricing target/configs/
@mkdir -p target/configs
@cp ../build.yaml target/
@cp ../../LICENSE target/
@cp -r ../configs/llm-pricing target/configs/
DOCKER_BUILDKIT=1 docker build -f Dockerfile \
--build-context sdk=../../sdk \
--build-context sdk-python=../../sdk-python \
Expand Down Expand Up @@ -160,7 +169,10 @@ push: ## Push Docker image to registry

build-and-push-multiarch: ## Build and push Gateway Runtime Docker image for multiple architectures (amd64, arm64)
@echo "Building and pushing multi-arch Gateway Runtime Docker image ($(VERSION))..."
@mkdir -p target/configs && cp ../build.yaml target/ && cp -r ../configs/llm-pricing target/configs/
@mkdir -p target/configs
@cp ../build.yaml target/
@cp ../../LICENSE target/
@cp -r ../configs/llm-pricing target/configs/
docker buildx build -f Dockerfile \
--build-context sdk=../../sdk \
--build-context sdk-python=../../sdk-python \
Expand Down
Loading