You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+39-2
Original file line number
Diff line number
Diff line change
@@ -15,16 +15,53 @@ This repository produces two packages, as follows:
15
15
16
16
A Python wheel package, containing all the Python source code for the command-line utilities
17
17
18
+
#### Setting up a build/test environment
19
+
20
+
The sonic-utilities package depends on a number of other packages, many of which are available via PyPI, but some are part of the SONiC codebase. When building/testing the package, setuptools/pip will attempt to install the packages available from PyPI. However, you will need to manually build and install the SONiC dependencies before attempting to build or test the package.
21
+
22
+
Currently, this list of dependencies is as follows:
23
+
24
+
25
+
- libyang_1.0.73_amd64.deb
26
+
- libyang-cpp_1.0.73_amd64.deb
27
+
- python3-yang_1.0.73_amd64.deb
28
+
- redis_dump_load-1.1-py3-none-any.whl
29
+
- swsssdk-2.0.1-py3-none-any.whl
30
+
- sonic_py_common-1.0-py3-none-any.whl
31
+
- sonic_config_engine-1.0-py3-none-any.whl
32
+
- sonic_yang_mgmt-1.0-py3-none-any.whl
33
+
- sonic_yang_models-1.0-py3-none-any.whl
34
+
35
+
36
+
A convenient alternative is to let the SONiC build system configure a build enviroment for you. This can be done by cloning the [sonic-buildimage](https://github.com/Azure/sonic-buildimage) repo, building the sonic-utilities package inside the Debian Buster slave container, and staying inside the container once the build finishes. During the build process, the SONiC build system will build and install all the necessary dependencies inside the container. After following the instructions to clone and initialize the sonic-buildimage repo, this can be done as follows:
37
+
38
+
1. Configure the build environment for an ASIC type (any type will do, here we use `generic`)
39
+
```
40
+
make configure PLATFORM=generic
41
+
```
42
+
43
+
2. Build the sonic-utilities Python wheel package inside the Buster slave container, and tell the build system to keep the container alive when finished
44
+
```
45
+
make NOJESSIE=1 NOSTRETCH=1 KEEP_SLAVE_ON=yes target/python-wheels/sonic_utilities-1.2-py3-none-any.whl
46
+
```
47
+
48
+
3. When the build finishes, your prompt will change to indicate you are inside the slave container. Change into the `src/sonic-utilities/` directory
49
+
```
50
+
user@911799f161a0:/sonic$ cd src/sonic-utilities/
51
+
```
52
+
53
+
4. You can now make changes to the sonic-utilities source and build the package or run unit tests with the commands below. When finished, you can exit the container by calling `exit`.
0 commit comments