Skip to content

Commit 1e670f6

Browse files
committed
add more contents to build procedure page for kubeedge.
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
1 parent 0881d28 commit 1e670f6

File tree

1 file changed

+191
-1
lines changed

1 file changed

+191
-1
lines changed

docs/developer/build.md

Lines changed: 191 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,24 @@ sidebar_position: 1
66
## Prerequisites
77

88
* A recent Go distribution (>=1.16)
9+
* ``yq`` command-line YAML processor (latest version recommended, install from [binary releases](https://github.com/mikefarah/yq/releases))
910

10-
Additionally, if you are on macOS, you will need bash > v4, GNU sed (gsed), jq, and wget.
11+
Additionally, if you are on macOS, you will need ``bash`` > v4, GNU ``sed`` (gsed), ``jq``, and ``wget``.
1112

1213
```bash
1314
brew install bash gnu-sed jq wget
1415
```
1516

17+
For ``yq``, it's recommended to install the latest version from binary:
18+
19+
```bash
20+
# Download and install the latest yq binary (platform-specific)
21+
# For Linux (amd64)
22+
wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/local/bin/yq && chmod +x /usr/local/bin/yq
23+
24+
# Or visit https://github.com/mikefarah/yq/releases for other platforms
25+
```
26+
1627
## Downloading the source
1728

1829
```bash
@@ -22,18 +33,197 @@ cd kubeedge
2233

2334
## Compiling kubeedge
2435

36+
Build all KubeEdge binaries:
37+
2538
```bash
2639
make
2740
```
2841

42+
Build specific components using the `WHAT` parameter. Available binaries include: `cloudcore`, `admission`, `edgecore`, `edgesite-agent`, `edgesite-server`, `keadm`, `csidriver`, `iptablesmanager`, `edgemark`, `controllermanager`, and `conformance`.
43+
44+
```bash
45+
# Build only cloudcore
46+
make all WHAT=cloudcore
47+
48+
# Build only edgecore
49+
make all WHAT=edgecore
50+
```
51+
52+
Build without container (uses local environment):
53+
54+
```bash
55+
make all BUILD_WITH_CONTAINER=false
56+
```
57+
2958
Note: Currently keadm is only supported on Ubuntu and CentOS, so the binaries are built with `GOOS=linux` and placed in `_output/local/bin`.
3059

60+
### Cross-platform builds
61+
62+
Build binaries for different architectures:
63+
64+
```bash
65+
# Cross-build for ARM architecture (ARMv8 by default)
66+
make crossbuild
67+
68+
# Cross-build specific components
69+
make crossbuild WHAT=edgecore
70+
71+
# Cross-build for ARMv7
72+
make crossbuild ARM_VERSION=GOARM7
73+
```
74+
75+
### Small builds
76+
77+
Create optimized small builds (useful for edge devices with limited resources):
78+
79+
```bash
80+
# Small build for edgecore
81+
make smallbuild WHAT=edgecore
82+
83+
# Small build without container
84+
make smallbuild WHAT=edgecore BUILD_WITH_CONTAINER=false
85+
```
86+
87+
### Clean build artifacts
88+
89+
Remove generated binaries and build artifacts:
90+
91+
```bash
92+
make clean
93+
```
94+
3195
## Running tests
3296

97+
### Lint
98+
99+
Run linting checks on the codebase:
100+
101+
```bash
102+
make lint
103+
```
104+
105+
You can lint specific components using the `WHAT` parameter:
106+
107+
```bash
108+
# Lint only cloud components
109+
make lint WHAT=cloud
110+
111+
# Lint only edge components
112+
make lint WHAT=edge
113+
```
114+
115+
### Verify code quality
116+
117+
Runs verification checks including golang version, vendor dependencies, code generation, vendor licenses, and CRDs:
118+
33119
```bash
34120
make verify
121+
```
122+
123+
This target runs the following checks:
124+
- `verify-golang` - Verifies Go version and formatting
125+
- `verify-vendor` - Ensures vendor dependencies are up to date
126+
- `verify-codegen` - Validates generated code is current
127+
- `verify-vendor-licenses` - Checks vendor license compliance
128+
- `verify-crds` - Verifies CRD (CustomResourceDefinition) configurations
129+
130+
### Unit tests
131+
132+
Run golang test cases for KubeEdge components:
133+
134+
```bash
35135
make test
136+
```
137+
138+
You can specify which component to test using the `WHAT` parameter:
139+
140+
```bash
141+
# Test only cloud components
142+
make test WHAT=cloud
143+
144+
# Test only edge components
145+
make test WHAT=edge
146+
```
147+
148+
To generate a coverage profile:
149+
150+
```bash
151+
make test PROFILE=y
152+
```
153+
154+
### Integration tests
155+
156+
Run integration tests for edge and cloud components:
157+
158+
```bash
36159
make integrationtest
37160
```
38161

162+
This will:
163+
1. Build the edgecore binary
164+
2. Execute edge integration tests
165+
3. Execute cloud integration tests
166+
39167
Note: Currently the integrationtest is only supported on Ubuntu.
168+
169+
### E2E tests
170+
171+
Run end-to-end tests:
172+
173+
```bash
174+
make e2e
175+
```
176+
177+
Run keadm-specific E2E tests:
178+
179+
```bash
180+
# New keadm E2E tests
181+
make keadm_e2e
182+
183+
# Deprecated keadm E2E tests (legacy)
184+
make keadm_deprecated_e2e
185+
```
186+
187+
## Installation
188+
189+
Install built binaries to the system (default: `/usr/local/bin`):
190+
191+
```bash
192+
# Install all binaries
193+
make install
194+
195+
# Install specific binary
196+
make install WHAT=edgecore
197+
198+
# Install to custom directory
199+
make install INSTALL_BIN_DIR=/custom/path
200+
```
201+
202+
## Release
203+
204+
Create release packages for KubeEdge components:
205+
206+
```bash
207+
# Release all components
208+
make release
209+
210+
# Release specific component (kubeedge, edgesite, or keadm)
211+
make release WHAT=kubeedge
212+
213+
# Release without container
214+
make release WHAT=kubeedge BUILD_WITH_CONTAINER=false
215+
```
216+
217+
## Additional targets
218+
219+
### Generate DMI protobuf
220+
221+
Generate Device Management Interface (DMI) API protobuf files:
222+
223+
```bash
224+
# Generate for default version (v1alpha1)
225+
make dmi-proto
226+
227+
# Generate for specific DMI version
228+
make dmi-proto DMI_VERSION=v1alpha1
229+
```

0 commit comments

Comments
 (0)