Skip to content

Commit b3137f0

Browse files
committed
[#30272] YSQL: Add agent config files
Summary: Adds a simple top-level [[ https://agents.md/ | AGENTS.md ]] file describing the layout of the repo. Also, adds an AGENTS.md in `src/` describing how to build YugabyteDB, run tests, and run the linter. This file lives in the `src/` directory, covering the postgres, YB C++, and Odyssey codebases. Also adds a top-level AGENTS.md that for now just points to `src/AGENTS.md`, and a top-level `CLAUDE.md` that points to `AGENTS.md`. Additionally, adds environment config files for Cursor cloud agents telling them to use the latest alma9 image from https://github.com/yugabyte/build-infra/tree/master/docker_images Test Plan: Manual test: Create a Cursor cloud agent and have it run one of the DB unit tests, verify that the build + test succeeds Reviewers: hsunder Reviewed By: hsunder Differential Revision: https://phorge.dev.yugabyte.com/D50343
1 parent 29c48b2 commit b3137f0

File tree

6 files changed

+74
-0
lines changed

6 files changed

+74
-0
lines changed

.cursor/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
FROM yugabyteci/yb_build_infra_almalinux9_x86_64:latest

.cursor/environment.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"build": {
3+
"dockerfile": "Dockerfile"
4+
}
5+
}

AGENTS.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# AGENTS.md
2+
3+
This document provides a guide for agents working on YugabyteDB
4+
5+
### Deploying and running
6+
7+
For agents that want to deploy, configure and run YugabyteDB refer to instructions at https://docs.yugabyte.com/stable/quick-start
8+
9+
### Repo Structure
10+
11+
| Directory | What it contains |
12+
|---|---|
13+
| `src/` | Core database code: PostgreSQL fork (`src/postgres/`), YugabyteDB C++ storage engine (`src/yb/`), Odyssey connection pooler (`src/odyssey/`) |
14+
| `java/` | Java client library, CDC connector, and DB tests |
15+
| `managed/` | YugabyteDB Anywhere (YBA) platform — orchestration UI, CLI, node agent, and backend (Scala/Java) |
16+
| `docs/` | Source files for the docs website (docs.yugabyte.com) |
17+
| `python/` | Python build utilities and test infrastructure scripts |
18+
| `build-support/` | Build system scripts, linting, and third-party dependency tooling |
19+
| `cmake_modules/` | CMake modules for locating dependencies and custom build functions |
20+
| `cloud/` | Docker, Kubernetes, and Grafana deployment configurations |
21+
| `yugabyted-ui/` | Yugabyted web UI (React frontend + Go API server) |
22+
| `architecture/` | Internal design documents and architecture specs |
23+
| `troubleshoot/` | Troubleshooting framework backend and UI |
24+
25+
### Coding and Development
26+
27+
When working on DB code (`src/`), refer to `src/AGENTS.md` for build and test guidance

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@AGENTS.md

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ Review detailed architecture in our [Docs](https://docs.yugabyte.com/stable/arch
175175

176176
As an open-source project with a strong focus on the user community, we welcome contributions as GitHub pull requests. See our [Contributor Guides](https://docs.yugabyte.com/stable/contribute/) to get going. Discussions and RFCs for features happen on the design discussions section of our [Forum](https://forum.yugabyte.com/c/design-discussions/7).
177177

178+
For AI agents, refer to [AGENTS.md](AGENTS.md) for guidance on working with this codebase.
179+
178180
# License
179181

180182
Source code in this repository is variously licensed under the Apache License 2.0 and the Polyform Free Trial License 1.0.0. A copy of each license can be found in the [licenses](licenses) directory.

src/AGENTS.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
## Build System
2+
3+
The primary build entry point is `yb_build.sh` at the repository root.
4+
5+
Use release build by default. Only use debug builds when explicitly asked to do so.
6+
Skip java build (`--sj`) unless you have to run java tests.
7+
8+
The first time you run a test, you will need to run initdb beforehand:
9+
10+
```bash
11+
./yb_build.sh release initdb
12+
```
13+
14+
### Common Build Commands
15+
16+
```bash
17+
./yb_build.sh release --sj
18+
```
19+
20+
### C++ Tests
21+
22+
```bash
23+
./yb_build.sh release --cxx-test tablet-test
24+
25+
./yb_build.sh release --cxx-test cluster_balance_preferred_leader-test --gtest_filter TestLoadBalancerPreferredLeader.TestBalancingMultiPriorityWildcardLeaderPreference
26+
27+
./yb_build.sh release --cxx-test cluster_balance_preferred_leader-test --gtest_filter "*Wildcard*"
28+
29+
./yb_build.sh release --cxx-test cluster_balance_preferred_leader-test -n 10
30+
```
31+
32+
### Java Tests
33+
34+
```bash
35+
./yb_build.sh release --java-test org.yb.client.TestYBClient
36+
37+
./yb_build.sh release --java-test 'org.yb.client.TestYBClient#testClientCreateDestroy'
38+
```

0 commit comments

Comments
 (0)