From 9d14b142b300acec4808b18de681a73a50097d80 Mon Sep 17 00:00:00 2001 From: Kshitij Kaushik <97613721+KshitijKaushik123@users.noreply.github.com> Date: Mon, 24 Aug 2026 22:54:57 +0530 Subject: [PATCH] fix: rename cargo.toml to Cargo.toml and add missing Makefile targets - Rename rust/cargo.toml to rust/Cargo.toml so Cargo recognizes it (was causing "cargo.toml is not a Cargo.toml" error on make build-rust) - Add missing Makefile targets referenced in README: deps, generate, docker-build, docker-run-all, docker-compose-up, docker-compose-down - Update README build instructions to match actual available targets and remove references to non-existent targets (run-dev, test-coverage, grpc-test, mcp-test, health-check, sample-*) - Add Rust build/run instructions to README Closes #17 --- Makefile | 29 ++++++++++++++++++++- README.md | 46 +++++++++++++++++++-------------- rust/{cargo.toml => Cargo.toml} | 0 3 files changed, 55 insertions(+), 20 deletions(-) rename rust/{cargo.toml => Cargo.toml} (100%) diff --git a/Makefile b/Makefile index 5f032ff..2b78cd9 100644 --- a/Makefile +++ b/Makefile @@ -2,9 +2,20 @@ BINARY=artf-agent LANGUAGES=go # cpp go csharp objc python ruby js +DOCKER_IMAGE=artf-agent +DOCKER_TAG=latest # Go build and run targets -.PHONY: build run-all run-grpc run-mcp run-web test +.PHONY: build run-all run-grpc run-mcp run-web test deps generate + +deps: + go mod download + @echo "Ensure protoc plugins are installed:" + @echo " go install google.golang.org/protobuf/cmd/protoc-gen-go@latest" + @echo " go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest" + +generate: + bash scripts/generate.sh build: go build -o $(BINARY) ./cmd/agent @@ -37,6 +48,22 @@ run-rust: build-rust build-all: build build-rust +# Docker targets +.PHONY: docker-build docker-run-all docker-compose-up docker-compose-down + +docker-build: + docker build -t $(DOCKER_IMAGE):$(DOCKER_TAG) . + +docker-run-all: + docker run --rm -p 50051:50051 -p 8081:8081 -p 8080:8080 \ + $(DOCKER_IMAGE):$(DOCKER_TAG) + +docker-compose-up: + docker compose up -d + +docker-compose-down: + docker compose down + # Protobuf targets bindings: diff --git a/README.md b/README.md index 0bfcc9a..7045502 100644 --- a/README.md +++ b/README.md @@ -79,20 +79,35 @@ Go module dependencies (managed via `go.mod`): #### Build and Run ```bash -# Install dependencies +# Download Go module dependencies make deps -# Generate protobuf code +# Generate protobuf code (requires protoc and plugins) make generate # Build the server make build -# Run with all services enabled +# Run with all services enabled (gRPC + MCP + Web UI) make run-all -# Run in development mode (verbose) -make run-dev +# Run individual services +make run-grpc # gRPC only (port 50051) +make run-mcp # MCP only (port 50052) +make run-web # Web UI + MCP (port 8081) +``` + +#### Rust Implementation + +```bash +# Build the Rust server +make build-rust + +# Run the Rust server (gRPC on 50053, HTTP on 8082) +make run-rust + +# Build both Go and Rust +make build-all ``` #### Docker Deployment @@ -190,22 +205,15 @@ This configures the agent so that: # Run unit tests make test -# Run with coverage -make test-coverage - -# Test gRPC endpoint (requires grpcurl) -make grpc-test - -# Test MCP endpoint -make mcp-test +# Test gRPC endpoint manually (requires grpcurl) +grpcurl -plaintext localhost:50051 describe +grpcurl -plaintext -d @ localhost:50051 \ + com.iabtechlab.bidstream.mutation.services.v1.RTBExtensionPoint/GetMutations \ + < samples/banner-basic.json # Check health endpoints -make health-check - -# Send sample requests via MCP -make sample-banner -make sample-video -make sample-bidshade +curl http://localhost:8080/health/live +curl http://localhost:8080/health/ready ``` ### Security diff --git a/rust/cargo.toml b/rust/Cargo.toml similarity index 100% rename from rust/cargo.toml rename to rust/Cargo.toml