Skip to content

Commit a3afa19

Browse files
authored
Merge pull request #1181 from vyos/T8595-add-agents-md
general: T8595: add AGENTS.md
2 parents 2413b09 + b479062 commit a3afa19

2 files changed

Lines changed: 106 additions & 0 deletions

File tree

.github/copilot-instructions.md

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

AGENTS.md

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# VyOS ISO build AGENTS.md file
2+
3+
## Project purpose
4+
5+
Top-level VyOS image builder. Orchestrates the multi-step build that produces
6+
a hybrid live ISO from Debian packages and VyOS-specific `.deb`s. The official
7+
starting point for anyone building a VyOS image from source. The ISO is
8+
bootable on both BIOS and UEFI systems.
9+
10+
## Tech stack
11+
12+
- Python entry-point for ISO image build is (`build-vyos-image`) and some
13+
`Makefile` wrappers.
14+
- Container-based build via `docker/` (`Dockerfile` pulls Debian + tooling).
15+
- Debian `live-build` (forked at https://github.com/vyos/vyos-live-build)
16+
consumed at ISO assembly time as prebuilt `.deb` package.
17+
- Configuration: TOML used as markup language which supports merging multiple
18+
snippets into one final configuration. Best suited for inheritance. TOML
19+
files used during build can be found here:
20+
* `data/architectures/*.toml`
21+
* `data/build-flavors/*.toml`
22+
* `data/build-types/*.toml`
23+
* `data/defaults.toml`
24+
- TOML files are combined by `build-vyos-image` into a single Python dict and
25+
used to instruct `live-build` to create the ISO image.
26+
27+
## Build instructions
28+
29+
```
30+
make generic # builds the generic flavor
31+
./build-vyos-image generic # equivalent direct call
32+
```
33+
34+
- Must run inside the build container. Container `Dockerfile` located in `docker`
35+
folder. Use `docker build -t vyos/vyos-build docker` from top-level dir.
36+
- Git submodules are not in use. Prebuilt binary packages are pulled from
37+
`https://packages.vyos.net/repositories/<train>` at build time.
38+
39+
## Testing instructions
40+
41+
- Requires ISO image generated from build instructions
42+
- `Makefile` has several targets starting with `test*`. Each target tests a
43+
different path of the resulting image.
44+
- The `test-ci-qcow2` target requires a QCOW2 image being generated as special
45+
flavor and is used to validate cloud-init by providing the necessary seed
46+
data. Exclude this from automated tests.
47+
- Test framework is orchestrated by `scripts/check-qemu-install` and internally
48+
also referred to as smoketests.
49+
- There is no need to run all tests all the time, a single smoketest like the
50+
one named `test_protocols_bgp.py` can be executed by:
51+
`make test -- --match protocols_bgp`
52+
- Test framework must run as user `root` to spawn QEMU VMs.
53+
54+
## Repository layout
55+
56+
- `build-vyos-image` - Python entry-point.
57+
- `Makefile` - flavor dispatcher (`make <flavor>``./build-vyos-image <flavor>`).
58+
- `data/defaults.toml` - Holds cross-flavor defaults like Linux Kernel version,
59+
URL to VyOS Debian package repository, release branch/train or bootloaders
60+
- `data/build-flavors/` - per-flavor TOML descriptors (`generic.toml` ships
61+
canonical).
62+
- `docker/` - build container.
63+
- `scripts/` - `check-qemu-install` (smoketest harness), helper scripts.
64+
- `tools/`, `packages/` - supporting assets.
65+
66+
## Cross-repo context
67+
68+
- All listed packages can be found in the GitHub `vyos` organisation
69+
- Consumes pre-built `*.deb` packages. The most important ones are:
70+
* `vyos-1x` CLI representation and all configure/op-mode scripts
71+
* `vyos-cloud-init` our Cloud-init handler
72+
* `vyos-http-api-tools` HTTP API RESTful and GraphQL
73+
* `live-boot` fork with custom patches not yet upstreamed
74+
* `hvinfo` tool to get information from running Hypervisor
75+
* `vyatta-bash` fork of bash to implement CLI completion help
76+
* `vyatta-biosdevname` get NIC information also from Hypervisor platforms
77+
* `vyatta-cfg` referred to as the old configuration backend running CStore.
78+
It is old but very much in operation.
79+
- ISO assembly delegates to `vyos/vyos-live-build` (Debian live-build fork)
80+
instead of the upstream live-build version.
81+
- Smoketests inside the QEMU harness exercise `vyos-1x`'s `smoketest/` suite.
82+
83+
## PR instructions
84+
85+
- Commit/PR title must follow: `component: T1234: description`. Phorge IDs at
86+
https://vyos.dev. Enforced by `check-pr-message.yml` reusable workflow.
87+
- See also `CONTRIBUTING.md` for further hints on the commit messages.
88+
- Linting: unused-imports (Pylint) and J2 lint (note: workflow file is named
89+
`linit-j2.yml` in this repo — known cosmetic typo). Both inherited from
90+
`vyos/.github@current`.
91+
- PR conflicts are flagged automatically via `check-pr-conflicts.yml` (reusable
92+
`check-pr-merge-conflict.yml` from `vyos/.github@current`).
93+
94+
## Notes for future contributors
95+
96+
- No `git submodule init` needed - packages come from the apt mirror at build
97+
time.
98+
- Bumping `data/defaults.toml`'s `debian_distribution` or `kernel_version` is a
99+
coordinated change touching multiple build-set repos.
100+
Open a Phorge task and coordinate with maintainers.
101+
- Reusable workflow `trigger_rebuild_packages.yml` fires REST
102+
`workflow_dispatch` into `$REMOTE_OWNER/vyos-build-packages` (REMOTE_OWNER =
103+
the private side). The dispatcher runs as `vyosbot`.
104+
- For new flavors, add a `data/build-flavors/<flavor>.toml` and document the
105+
resulting `make <flavor>` target.

0 commit comments

Comments
 (0)