Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
docker buildx version

- name: Build Agentcube API Server Docker image
run: make docker-build
run: make docker-build-workloadmanager
79 changes: 17 additions & 62 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ SHELL = /usr/bin/env bash -o pipefail
.SHELLFLAGS = -ec

.PHONY: all
all: build
.PHONY: all build-all build-workloadmanager build-agentd build-router clean test deps
all: build-all

##@ General

Expand Down Expand Up @@ -68,7 +69,7 @@ gen-check: gen-all ## Check if generated code is up to date
.PHONY: build run clean test deps
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

The .PHONY declaration still lists build and run, but those targets no longer exist. This can be confusing for maintainers and makes it harder to reason about intended targets; update the .PHONY list to match the current target set.

Suggested change
.PHONY: build run clean test deps
.PHONY: clean test deps

Copilot uses AI. Check for mistakes.

# Build targets
build: generate ## Build workloadmanager binary
build-workloadmanager: generate ## Build workloadmanager binary
@echo "Building workloadmanager..."
go build -o bin/workloadmanager ./cmd/workload-manager

Expand All @@ -80,37 +81,12 @@ build-router: generate ## Build agentcube-router binary
@echo "Building agentcube-router..."
go build -o bin/agentcube-router ./cmd/router

build-all: build build-agentd build-router ## Build all binaries

# Run server (development mode)
run:
@echo "Running workloadmanager..."
go run ./cmd/workload-manager/main.go \
--port=8080 \
--ssh-username=sandbox \
--ssh-port=22

# Run server (with kubeconfig)
run-local:
@echo "Running workloadmanager with local kubeconfig..."
go run ./cmd/workload-manager/main.go \
--port=8080 \
--kubeconfig=${HOME}/.kube/config \
--ssh-username=sandbox \
--ssh-port=22

# Run router (development mode)
run-router:
@echo "Running agentcube-router..."
go run ./cmd/router/main.go \
--port=8080 \
--debug
build-all: build-workloadmanager build-agentd build-router
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

build-all still depends on the removed build target, so make build-all (and default make all) will fail. Update this dependency to build-workloadmanager (or reintroduce an alias target) to keep builds working.

Copilot uses AI. Check for mistakes.

# Clean build artifacts
clean:
@echo "Cleaning..."
rm -rf bin/
rm -f workloadmanager agentd agentcube-router

# Install dependencies
deps:
Expand Down Expand Up @@ -149,62 +125,51 @@ gen-copyright:
@echo "Adding copyright headers..."
@hack/update-copyright.sh

# Install to system
install: build
@echo "Installing workloadmanager..."
sudo cp bin/workloadmanager /usr/local/bin/

# Docker image variables
WORKLOAD_MANAGER_IMAGE ?= workloadmanager:latest
ROUTER_IMAGE ?= agentcube-router:latest
PICOD_IMAGE ?= picod:latest
IMAGE_REGISTRY ?= ""

# Docker and Kubernetes targets
docker-build:
docker-build-workloadmanager:
@echo "Building Docker image..."
docker build -f docker/Dockerfile -t $(WORKLOAD_MANAGER_IMAGE) .

# Multi-architecture build (supports amd64, arm64)
docker-buildx:
@echo "Building multi-architecture Docker image..."
docker buildx build -f docker/Dockerfile --platform linux/amd64,linux/arm64 -t $(WORKLOAD_MANAGER_IMAGE) .
docker build -f docker/Dockerfile.workloadmanager -t $(WORKLOAD_MANAGER_IMAGE) .
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The docker-buildx, docker-buildx-router, and docker-buildx-picod targets for building multi-architecture images without pushing have been removed. This removes potentially useful functionality for developers who want to build and test multi-arch images locally without pushing to a registry. Please consider re-adding these targets with the new naming convention, for example:

# Multi-architecture build (supports amd64, arm64)
docker-buildx-workloadmanager:
	@echo "Building multi-architecture Docker image..."
	docker buildx build -f docker/Dockerfile.workloadmanager --platform linux/amd64,linux/arm64 -t $(WORKLOAD_MANAGER_IMAGE) .

Similar targets could be added for router and picod.


# Multi-architecture build and push
docker-buildx-push:
docker-buildx-push-workloadmanager:
@if [ -z "$(IMAGE_REGISTRY)" ]; then \
echo "Error: IMAGE_REGISTRY not set. Usage: make docker-buildx-push IMAGE_REGISTRY=your-registry.com"; \
echo "Error: IMAGE_REGISTRY not set. Usage: make docker-buildx-push-workloadmanager IMAGE_REGISTRY=your-registry.com"; \
exit 1; \
fi
@echo "Building and pushing multi-architecture Docker image to $(IMAGE_REGISTRY)/$(WORKLOAD_MANAGER_IMAGE)..."
docker buildx build -f docker/Dockerfile --platform linux/amd64,linux/arm64 \
docker buildx build -f docker/Dockerfile.workloadmanager --platform linux/amd64,linux/arm64 \
-t $(IMAGE_REGISTRY)/$(WORKLOAD_MANAGER_IMAGE) \
--push .
Comment on lines 139 to 148
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

The workload manager multi-arch release target was renamed to docker-buildx-push-workloadmanager, but existing automation still invokes make docker-buildx-push (e.g., .github/workflows/build-push-release.yml). Without updating those callers (or keeping a backward-compatible alias), release image publishing will break.

Copilot uses AI. Check for mistakes.

docker-push: docker-build
docker-push-workloadmanager: docker-build-workloadmanager
@if [ -z "$(IMAGE_REGISTRY)" ]; then \
echo "Error: IMAGE_REGISTRY not set. Usage: make docker-push IMAGE_REGISTRY=your-registry.com"; \
echo "Error: IMAGE_REGISTRY not set. Usage: make docker-push-workloadmanager IMAGE_REGISTRY=your-registry.com"; \
exit 1; \
fi
@echo "Tagging and pushing Docker image to $(IMAGE_REGISTRY)/$(WORKLOAD_MANAGER_IMAGE)..."
docker tag $(WORKLOAD_MANAGER_IMAGE) $(IMAGE_REGISTRY)/$(WORKLOAD_MANAGER_IMAGE)
docker push $(IMAGE_REGISTRY)/$(WORKLOAD_MANAGER_IMAGE)

# Load image to kind cluster
# Load images to kind cluster
kind-load:
@echo "Loading image to kind..."
@echo "Loading workload manager image to kind..."
kind load docker-image $(WORKLOAD_MANAGER_IMAGE)
@echo "Loading router image to kind..."
kind load docker-image $(ROUTER_IMAGE)
@echo "Loading picod image to kind..."
kind load docker-image $(PICOD_IMAGE)

# Router Docker targets
docker-build-router:
@echo "Building Router Docker image..."
docker build -f docker/Dockerfile.router -t $(ROUTER_IMAGE) .

# Multi-architecture build for router (supports amd64, arm64)
docker-buildx-router:
@echo "Building multi-architecture Router Docker image..."
docker buildx build -f docker/Dockerfile.router --platform linux/amd64,linux/arm64 -t $(ROUTER_IMAGE) .

# Multi-architecture build and push for router
docker-buildx-push-router:
@if [ -z "$(IMAGE_REGISTRY)" ]; then \
Expand All @@ -225,21 +190,11 @@ docker-push-router: docker-build-router
docker tag $(ROUTER_IMAGE) $(IMAGE_REGISTRY)/$(ROUTER_IMAGE)
docker push $(IMAGE_REGISTRY)/$(ROUTER_IMAGE)

# Load router image to kind cluster
kind-load-router:
@echo "Loading router image to kind..."
kind load docker-image $(ROUTER_IMAGE)

# Picod Docker targets
docker-build-picod:
@echo "Building Picod Docker image..."
docker build -f docker/Dockerfile.picod -t $(PICOD_IMAGE) .
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

To improve developer experience, consider adding a target to build all docker images at once, similar to build-all. This would complement the change I've suggested in docs/agentcube/docs/developer-guide/local-development.md. You could add this after the docker-build-picod target:

docker-build-all: docker-build-workloadmanager docker-build-router docker-build-picod ## Build all docker images


# Multi-architecture build for picod (supports amd64, arm64)
docker-buildx-picod:
@echo "Building multi-architecture Picod Docker image..."
docker buildx build -f docker/Dockerfile.picod --platform linux/amd64,linux/arm64 -t $(PICOD_IMAGE) .

# Multi-architecture build and push for picod
docker-buildx-push-picod:
@if [ -z "$(IMAGE_REGISTRY)" ]; then \
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile → docker/Dockerfile.workloadmanager
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ USER apiserver
EXPOSE 8080

ENTRYPOINT ["/app/workloadmanager"]
CMD ["--port=8080"]
CMD ["--port=8080"]
28 changes: 4 additions & 24 deletions docs/agentcube/docs/developer-guide/local-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,45 +35,25 @@ Binaries will be placed in the `bin/` directory.

### Build Specific Components

- **Workload Manager**: `make build`
- **Workload Manager**: `make build-workloadmanager`
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

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

make build-workloadmanager is referenced here, but the Makefile only defines build (which builds the workloadmanager). Either update this doc to reference make build, or add a build-workloadmanager target/alias in the Makefile to match the documentation and the PR goal of making the build more explicit.

Suggested change
- **Workload Manager**: `make build-workloadmanager`
- **Workload Manager**: `make build`

Copilot uses AI. Check for mistakes.
- **AgentD**: `make build-agentd`
- **Router**: `make build-router`

## 3. Running Locally

### Run Workload Manager

You can run the Workload Manager locally using your existing Kubeconfig:

```bash

make run-local
```

This will start the server on port 8080 by default.

### Run Router

```bash
make run-router
```

## 4. Docker Images

### Build All Images

```bash
make docker-build # Workload Manager
make docker-build-router # Router
make docker-build-picod # Picod (Agent Daemon)
make docker-build-workloadmanager
make docker-build-router
make docker-build-picod
Comment on lines +47 to +49
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

It would be more convenient for users to build all Docker images with a single command. I've made a suggestion on the Makefile to add a docker-build-all target. If that is implemented, this documentation can be simplified.

Suggested change
make docker-build-workloadmanager
make docker-build-router
make docker-build-picod
make docker-build-all

```

### Loading to Kind
If you are using Kind for local development, you can load images directly:

```bash
make kind-load
make kind-load-router
```

## 5. Coding Standards
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ rules:
- apiGroups: ["resource.k8s.io"]
resources: ["resourceclaims/status"]
verbs: ["update"]
- apiGroups: ["resource.k8s.io"]
resources: ["resourceclaims/binding"]
verbs: ["update", "patch"]
- apiGroups: ["resource.k8s.io"]
resources: ["deviceclasses","resourceslices"]
verbs: ["get", "list", "watch", "create"]
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ The `run_e2e.sh` script performs the following steps:

1. Creates a Kind cluster
2. Installs CRDs and agent-sandbox
3. **Builds Docker images** (`make docker-build`, `make docker-build-router`, `make docker-build-picod`)
3. **Builds Docker images** (`make docker-build-workloadmanager`, `make docker-build-router`, `make docker-build-picod`)
4. Loads images into Kind cluster
5. Deploys Redis, WorkloadManager, and Router
6. Creates test resources (AgentRuntime, CodeInterpreter)
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/run_e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ run_setup() {

step "Building images..."
# We assume we are in the project root
make docker-build
make docker-build-workloadmanager
make docker-build-router
make docker-build-picod

Expand Down
Loading