Skip to content

Commit 4926e59

Browse files
committed
cleanup Makefiles, add CODEOWNERS
1 parent 77faf60 commit 4926e59

File tree

6 files changed

+29
-55
lines changed

6 files changed

+29
-55
lines changed

CODEOWNERS

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
python/ @EItanya @peterj
2+
go/ @EItanya @ilackarms
3+
ui/ @peterj
4+
helm/ @EItanya @ilackarms

CONTRIBUTION.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ See the [DEVELOPMENT.md](DEVELOPMENT.md) file for more information.
3232
#### Coding Standards
3333

3434
- **Go Code**:
35-
- Follow the [Go Code Review Comments](https://github.com/golang/go/wiki/CodeReviewComments)
35+
- Follow the [Go Code Review Comments](https://go.dev/wiki/CodeReviewComments)
3636
- Run `make lint` before submitting your changes
3737
- Ensure all tests pass with `make test`
3838
- Add tests for new functionality

DEVELOPMENT.md

+11
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
# Development
2+
3+
To understand how to develop for kagent, It's important to understand the architecture of the project. Please refer to the [README.md](README.md#architecture) file for an overview of the project.
4+
5+
When making changes to `kagent`, the most important thing is to figure out which piece of the project is affected by the change, and then make the change in the appropriate folder. Each piece of the project has its own README with more information about how to setup the development environment and run that piece of the project.
6+
7+
- [python](python): Contains the code for the autogen engine.
8+
- [go](go): Contains the code for the kubernetes controller, and the CLI.
9+
- [ui](ui): Contains the code for the web UI.
10+
11+
112
## How to run everything locally
213

314
Running outside Kubernetes:

go/Makefile

-51
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
# Image configuration
2-
DOCKER_REGISTRY ?= ghcr.io
3-
DOCKER_REPO ?= kagent-dev/kagent
4-
IMAGE_NAME ?= controller
51
VERSION ?= $(shell git describe --tags --always --dirty)
6-
IMAGE_TAG ?= $(VERSION)
7-
IMG ?= $(DOCKER_REGISTRY)/$(DOCKER_REPO)/$(IMAGE_NAME):$(IMAGE_TAG)
82

93
GIT_COMMIT := $(shell git rev-parse --short HEAD || echo "unknown")
104
BUILD_DATE := $(shell date -u '+%Y-%m-%d')
@@ -20,31 +14,6 @@ else
2014
GOBIN=$(shell go env GOBIN)
2115
endif
2216

23-
# Setting SHELL to bash allows bash commands to be executed by recipes.
24-
# Options are set to exit when a recipe line exits non-zero or a piped command fails.
25-
SHELL = /usr/bin/env bash -o pipefail
26-
.SHELLFLAGS = -ec
27-
28-
.PHONY: all
29-
all: build
30-
31-
##@ General
32-
33-
# The help target prints out all targets with their descriptions organized
34-
# beneath their categories. The categories are represented by '##@' and the
35-
# target descriptions by '##'. The awk command is responsible for reading the
36-
# entire set of makefiles included in this invocation, looking for lines of the
37-
# file as xyz: ## something, and then pretty-format the target and help. Then,
38-
# if there's a line with ##@ something, that gets pretty-printed as a category.
39-
# More info on the usage of ANSI control characters for terminal formatting:
40-
# https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters
41-
# More info on the awk command:
42-
# http://linuxcommand.org/lc3_adv_awk.php
43-
44-
.PHONY: help
45-
help: ## Display this help.
46-
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
47-
4817
##@ Development
4918

5019
.PHONY: manifests
@@ -63,26 +32,6 @@ fmt: ## Run go fmt against code.
6332
vet: ## Run go vet against code.
6433
go vet ./...
6534

66-
.PHONY: test
67-
test: manifests generate fmt vet setup-envtest ## Run tests.
68-
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $$(go list ./... | grep -v /e2e) -coverprofile cover.out
69-
70-
# TODO(user): To use a different vendor for e2e tests, modify the setup under 'tests/e2e'.
71-
# The default setup assumes Kind is pre-installed and builds/loads the Manager Docker image locally.
72-
# Prometheus and CertManager are installed by default; skip with:
73-
# - PROMETHEUS_INSTALL_SKIP=true
74-
# - CERT_MANAGER_INSTALL_SKIP=true
75-
.PHONY: test-e2e
76-
test-e2e: manifests generate fmt vet ## Run the e2e tests. Expected an isolated environment using Kind.
77-
@command -v kind >/dev/null 2>&1 || { \
78-
echo "Kind is not installed. Please install Kind manually."; \
79-
exit 1; \
80-
}
81-
@kind get clusters | grep -q 'kind' || { \
82-
echo "No Kind cluster is running. Please start a Kind cluster before running the e2e tests."; \
83-
exit 1; \
84-
}
85-
go test ./test/e2e/ -v -ginkgo.v
8635

8736
.PHONY: lint
8837
lint: golangci-lint ## Run golangci-lint linter

python/README.md

+12-2
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,29 @@
66

77
## Python
88

9+
Firstly setup a virtual environment:
10+
```bash
11+
uv venv .venv
12+
```
13+
914
We use uv to manage dependencies as well as the python version.
1015

1116
```bash
1217
uv python install 3.12
1318
```
1419

15-
## Running python code
20+
Once we have python installed, we can download the dependencies:
1621

17-
First we build and install dependencies:
1822
```bash
1923
uv sync --all-extras
2024
```
2125

26+
## Running the engine
27+
28+
```bash
29+
uv run autogenstudio ui
30+
```
31+
2232
## Testing
2333

2434
We use pytest to run tests.

python/src/kagent/tools/k8s/_generate_resource.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ async def _generate_resource(
6060
self,
6161
policy_description: str,
6262
resource_type: ResourceTypes,
63-
cancellation_token: Optional[CancellationToken] = None,
63+
cancellation_token: CancellationToken,
6464
) -> str:
6565
"""
6666
Asynchronously generates a resource YAML based on the

0 commit comments

Comments
 (0)