Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewsapronov committed Aug 26, 2021
2 parents 33b9f2d + 48da159 commit c40748b
Show file tree
Hide file tree
Showing 82 changed files with 1,989 additions and 374 deletions.
4 changes: 2 additions & 2 deletions .azure-pipelines/docker-sonic-slave.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ parameters:
default: sonicdev

variables:
- ${{ if and(startsWith(variables['Build.SourceBranchName'], '202'), eq(length(variables['Build.SourceBranchName']), 6)) }}:
- ${{ if eq(variables['Build.SourceBranchName'], '202012' }}:
- name: BUILD_OPTIONS
value: 'SONIC_VERSION_CONTROL_COMPONENTS=deb,py2,py3,web'
value: 'SONIC_VERSION_CONTROL_COMPONENTS=deb,py2,py3,web,git,docker'

stages:
- stage: Build
Expand Down
64 changes: 37 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,24 +67,27 @@
Following is the instruction on how to build an [(ONIE)](https://github.com/opencomputeproject/onie) compatible network operating system (NOS) installer image for network switches, and also how to build docker images running inside the NOS. Note that SONiC image are build per ASIC platform. Switches using the same ASIC platform share a common image. For a list of supported switches and ASIC, please refer to this [list](https://github.com/Azure/SONiC/wiki/Supported-Devices-and-Platforms)

# Hardware
Any server can be a build image server. We are using a server with 1T hard disk. The OS is Ubuntu 16.04.

## Prerequisites
Any server can be a build image server as long as it has:

Install pip and jinja in host build machine, execute below commands if j2/j2cli is not available:
* Multiple cores to increase build speed
* Plenty of RAM (less than 8 GiB is likely to cause issues)
* 300G of free disk space

sudo apt-get install -y python-pip
sudo python2 -m pip install -U pip==9.0.3
sudo pip install --force-reinstall --upgrade jinja2>=2.10
sudo pip install j2cli
A good choice of OS for building SONiC is currently Ubuntu 20.04.

Configure your system to allow running the 'docker' command without 'sudo':
Add current user to the docker group
`sudo gpasswd -a ${USER} docker`
Log out and log back in so that your group membership is re-evaluated
## Prerequisites

## SAI Version
Please refer to [SONiC roadmap](https://github.com/Azure/SONiC/wiki/Sonic-Roadmap-Planning) on the SAI version for each SONiC release.
* Install pip and jinja in host build machine, execute below commands if j2/j2cli is not available:

```
sudo apt install -y python3-pip
sudo pip3 install j2cli
```

* Install [Docker](https://docs.docker.com/engine/install/) and configure your system to allow running the 'docker' command without 'sudo':
* Add current user to the docker group: `sudo gpasswd -a ${USER} docker`
* Log out and log back in so that your group membership is re-evaluated

## Clone or fetch the code repository with all git submodules
To clone the code repository recursively, assuming git version 1.9 or newer:
Expand All @@ -110,8 +113,22 @@ To build SONiC installer image and docker images, run the following commands:
# Execute make configure once to configure ASIC
make configure PLATFORM=[ASIC_VENDOR]

# Build SONiC image
make all
# Build SONiC image with 4 jobs in parallel.
# Note: You can set this higher, but 4 is a good number for most cases
# and is well-tested.
make SONIC_BUILD_JOBS=4 all

The supported ASIC vendors are:

- PLATFORM=broadcom
- PLATFORM=marvell
- PLATFORM=mellanox
- PLATFORM=cavium
- PLATFORM=centec
- PLATFORM=nephos
- PLATFORM=innovium
- PLATFORM=p4
- PLATFORM=vs

## Usage for ARM Architecture
To build Arm32 bit for (ARMHF) platform
Expand Down Expand Up @@ -147,7 +164,7 @@ To build Arm64 bit for platform

**NOTE**:

- Recommend reserving 50G free space to build one platform.
- Recommend reserving at least 100G free space to build one platform with a single job. The build process will use more disk if you are setting `SONIC_BUILD_JOBS` to more than 1.
- If Docker's workspace folder, `/var/lib/docker`, resides on a partition without sufficient free space, you may encounter an error like the following during a Docker container build job:

`/usr/bin/tar: /path/to/sonic-buildimage/<some_file>: Cannot write: No space left on device`
Expand All @@ -156,17 +173,7 @@ To build Arm64 bit for platform
- Use `http_proxy=[your_proxy] https_proxy=[your_proxy] no_proxy=[your_no_proxy] make` to enable http(s) proxy in the build process.
- Add your user account to `docker` group and use your user account to make. `root` or `sudo` are not supported.

The SONiC installer contains all docker images needed. SONiC uses one image for all devices of a same ASIC vendor. The supported ASIC vendors are:

- PLATFORM=broadcom
- PLATFORM=marvell
- PLATFORM=mellanox
- PLATFORM=cavium
- PLATFORM=centec
- PLATFORM=nephos
- PLATFORM=innovium
- PLATFORM=p4
- PLATFORM=vs
The SONiC installer contains all docker images needed. SONiC uses one image for all devices of a same ASIC vendor.

For Broadcom ASIC, we build ONIE and EOS image. EOS image is used for Arista devices, ONIE image is used for all other Broadcom ASIC based devices.

Expand Down Expand Up @@ -198,6 +205,9 @@ It is recommended to use clean targets to clean all packages that are built toge
## Build debug dockers and debug SONiC installer image:
SONiC build system supports building dockers and ONIE-image with debug tools and debug symbols, to help with live & core debugging. For details refer to [(SONiC Buildimage Guide)](https://github.com/Azure/sonic-buildimage/blob/master/README.buildsystem.md).

## SAI Version
Please refer to [SONiC roadmap](https://github.com/Azure/SONiC/wiki/Sonic-Roadmap-Planning) on the SAI version for each SONiC release.

## Notes:
- If you are running make for the first time, a sonic-slave-${USER} docker image will be built automatically.
This may take a while, but it is a one-time action, so please be patient.
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ stages:
variables:
CACHE_MODE: rcache
${{ if eq(variables['Build.SourceBranchName'], '202012') }}:
VERSION_CONTROL_OPTIONS: 'SONIC_VERSION_CONTROL_COMPONENTS=deb,py2,py3,web'
VERSION_CONTROL_OPTIONS: 'SONIC_VERSION_CONTROL_COMPONENTS=deb,py2,py3,web,git,docker'
jobs:
- template: .azure-pipelines/azure-pipelines-build.yml
parameters:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
# name lanes alias index speed
Ethernet0 0,1 Ethernet1/1 1 100000
Ethernet4 2,3 Ethernet2/1 2 100000
Ethernet8 4,5 Ethernet3/1 3 100000
Ethernet12 6,7 Ethernet4/1 4 100000
Ethernet16 8,9 Ethernet5/1 5 100000
Ethernet20 10,11 Ethernet6/1 6 100000
Ethernet24 12,13 Ethernet7/1 7 100000
Ethernet28 14,15 Ethernet8/1 8 100000
Ethernet32 16,17 Ethernet9/1 9 100000
Ethernet36 18,19 Ethernet10/1 10 100000
Ethernet40 20,21 Ethernet11/1 11 100000
Ethernet44 22,23 Ethernet12/1 12 100000
Ethernet48 24,25 Ethernet13/1 13 100000
Ethernet52 26,27 Ethernet14/1 14 100000
Ethernet56 28,29 Ethernet15/1 15 100000
Ethernet60 30,31 Ethernet16/1 16 100000
Ethernet64 72,73 Ethernet17/1 17 100000
Ethernet68 74,75 Ethernet18/1 18 100000
Ethernet72 76,77 Ethernet19/1 19 100000
Ethernet76 78,79 Ethernet20/1 20 100000
Ethernet80 64,65 Ethernet21/1 21 100000
Ethernet84 66,67 Ethernet22/1 22 100000
Ethernet88 68,69 Ethernet23/1 23 100000
Ethernet92 70,71 Ethernet24/1 24 100000
Ethernet96 56,57 Ethernet25/1 25 100000
Ethernet100 58,59 Ethernet26/1 26 100000
Ethernet104 60,61 Ethernet27/1 27 100000
Ethernet108 62,63 Ethernet28/1 28 100000
Ethernet112 48,49 Ethernet29/1 29 100000
Ethernet116 50,51 Ethernet30/1 30 100000
Ethernet120 52,53 Ethernet31/1 31 100000
Ethernet124 54,55 Ethernet32/1 32 100000
Ethernet128 32,33,34,35,36,37,38,39 Ethernet33/1 33 400000
Ethernet136 40,41,42,43,44,45,46,47 Ethernet34/1 34 400000
Ethernet144 88,89,90,91,92,93,94,95 Ethernet35/1 35 400000
Ethernet152 80,81,82,83,84,85,86,87 Ethernet36/1 36 400000
# name lanes alias index speed fec
Ethernet0 0,1 Ethernet1/1 1 100000 rs
Ethernet4 2,3 Ethernet2/1 2 100000 rs
Ethernet8 4,5 Ethernet3/1 3 100000 rs
Ethernet12 6,7 Ethernet4/1 4 100000 rs
Ethernet16 8,9 Ethernet5/1 5 100000 rs
Ethernet20 10,11 Ethernet6/1 6 100000 rs
Ethernet24 12,13 Ethernet7/1 7 100000 rs
Ethernet28 14,15 Ethernet8/1 8 100000 rs
Ethernet32 16,17 Ethernet9/1 9 100000 rs
Ethernet36 18,19 Ethernet10/1 10 100000 rs
Ethernet40 20,21 Ethernet11/1 11 100000 rs
Ethernet44 22,23 Ethernet12/1 12 100000 rs
Ethernet48 24,25 Ethernet13/1 13 100000 rs
Ethernet52 26,27 Ethernet14/1 14 100000 rs
Ethernet56 28,29 Ethernet15/1 15 100000 rs
Ethernet60 30,31 Ethernet16/1 16 100000 rs
Ethernet64 72,73 Ethernet17/1 17 100000 rs
Ethernet68 74,75 Ethernet18/1 18 100000 rs
Ethernet72 76,77 Ethernet19/1 19 100000 rs
Ethernet76 78,79 Ethernet20/1 20 100000 rs
Ethernet80 64,65 Ethernet21/1 21 100000 rs
Ethernet84 66,67 Ethernet22/1 22 100000 rs
Ethernet88 68,69 Ethernet23/1 23 100000 rs
Ethernet92 70,71 Ethernet24/1 24 100000 rs
Ethernet96 56,57 Ethernet25/1 25 100000 rs
Ethernet100 58,59 Ethernet26/1 26 100000 rs
Ethernet104 60,61 Ethernet27/1 27 100000 rs
Ethernet108 62,63 Ethernet28/1 28 100000 rs
Ethernet112 48,49 Ethernet29/1 29 100000 rs
Ethernet116 50,51 Ethernet30/1 30 100000 rs
Ethernet120 52,53 Ethernet31/1 31 100000 rs
Ethernet124 54,55 Ethernet32/1 32 100000 rs
Ethernet128 32,33,34,35,36,37,38,39 Ethernet33/1 33 400000 none
Ethernet136 40,41,42,43,44,45,46,47 Ethernet34/1 34 400000 none
Ethernet144 88,89,90,91,92,93,94,95 Ethernet35/1 35 400000 none
Ethernet152 80,81,82,83,84,85,86,87 Ethernet36/1 36 400000 none
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
# name lanes alias index speed
Ethernet0 0,1 Ethernet1/1 1 100000
Ethernet4 2,3 Ethernet2/1 2 100000
Ethernet8 4,5 Ethernet3/1 3 100000
Ethernet12 6,7 Ethernet4/1 4 100000
Ethernet16 8,9 Ethernet5/1 5 100000
Ethernet20 10,11 Ethernet6/1 6 100000
Ethernet24 12,13 Ethernet7/1 7 100000
Ethernet28 14,15 Ethernet8/1 8 100000
Ethernet32 16,17 Ethernet9/1 9 100000
Ethernet36 18,19 Ethernet10/1 10 100000
Ethernet40 20,21 Ethernet11/1 11 100000
Ethernet44 22,23 Ethernet12/1 12 100000
Ethernet48 24,25 Ethernet13/1 13 100000
Ethernet52 26,27 Ethernet14/1 14 100000
Ethernet56 28,29 Ethernet15/1 15 100000
Ethernet60 30,31 Ethernet16/1 16 100000
Ethernet64 72,73 Ethernet17/1 17 100000
Ethernet68 74,75 Ethernet18/1 18 100000
Ethernet72 76,77 Ethernet19/1 19 100000
Ethernet76 78,79 Ethernet20/1 20 100000
Ethernet80 64,65 Ethernet21/1 21 100000
Ethernet84 66,67 Ethernet22/1 22 100000
Ethernet88 68,69 Ethernet23/1 23 100000
Ethernet92 70,71 Ethernet24/1 24 100000
Ethernet96 56,57 Ethernet25/1 25 100000
Ethernet100 58,59 Ethernet26/1 26 100000
Ethernet104 60,61 Ethernet27/1 27 100000
Ethernet108 62,63 Ethernet28/1 28 100000
Ethernet112 48,49 Ethernet29/1 29 100000
Ethernet116 50,51 Ethernet30/1 30 100000
Ethernet120 52,53 Ethernet31/1 31 100000
Ethernet124 54,55 Ethernet32/1 32 100000
Ethernet128 32,33,34,35 Ethernet33/1 33 100000
Ethernet132 36,37,38,39 Ethernet33/5 33 100000
Ethernet136 40,41,42,43 Ethernet34/1 34 100000
Ethernet140 44,45,46,47 Ethernet34/5 34 100000
Ethernet144 88,89,90,91 Ethernet35/1 35 100000
Ethernet148 92,93,94,95 Ethernet35/5 35 100000
Ethernet152 80,81,82,83 Ethernet36/1 36 100000
Ethernet156 84,85,86,87 Ethernet36/5 36 100000
# name lanes alias index speed fec
Ethernet0 0,1 Ethernet1/1 1 100000 rs
Ethernet4 2,3 Ethernet2/1 2 100000 rs
Ethernet8 4,5 Ethernet3/1 3 100000 rs
Ethernet12 6,7 Ethernet4/1 4 100000 rs
Ethernet16 8,9 Ethernet5/1 5 100000 rs
Ethernet20 10,11 Ethernet6/1 6 100000 rs
Ethernet24 12,13 Ethernet7/1 7 100000 rs
Ethernet28 14,15 Ethernet8/1 8 100000 rs
Ethernet32 16,17 Ethernet9/1 9 100000 rs
Ethernet36 18,19 Ethernet10/1 10 100000 rs
Ethernet40 20,21 Ethernet11/1 11 100000 rs
Ethernet44 22,23 Ethernet12/1 12 100000 rs
Ethernet48 24,25 Ethernet13/1 13 100000 rs
Ethernet52 26,27 Ethernet14/1 14 100000 rs
Ethernet56 28,29 Ethernet15/1 15 100000 rs
Ethernet60 30,31 Ethernet16/1 16 100000 rs
Ethernet64 72,73 Ethernet17/1 17 100000 rs
Ethernet68 74,75 Ethernet18/1 18 100000 rs
Ethernet72 76,77 Ethernet19/1 19 100000 rs
Ethernet76 78,79 Ethernet20/1 20 100000 rs
Ethernet80 64,65 Ethernet21/1 21 100000 rs
Ethernet84 66,67 Ethernet22/1 22 100000 rs
Ethernet88 68,69 Ethernet23/1 23 100000 rs
Ethernet92 70,71 Ethernet24/1 24 100000 rs
Ethernet96 56,57 Ethernet25/1 25 100000 rs
Ethernet100 58,59 Ethernet26/1 26 100000 rs
Ethernet104 60,61 Ethernet27/1 27 100000 rs
Ethernet108 62,63 Ethernet28/1 28 100000 rs
Ethernet112 48,49 Ethernet29/1 29 100000 rs
Ethernet116 50,51 Ethernet30/1 30 100000 rs
Ethernet120 52,53 Ethernet31/1 31 100000 rs
Ethernet124 54,55 Ethernet32/1 32 100000 rs
Ethernet128 32,33,34,35 Ethernet33/1 33 100000 rs
Ethernet132 36,37,38,39 Ethernet33/5 33 100000 rs
Ethernet136 40,41,42,43 Ethernet34/1 34 100000 rs
Ethernet140 44,45,46,47 Ethernet34/5 34 100000 rs
Ethernet144 88,89,90,91 Ethernet35/1 35 100000 rs
Ethernet148 92,93,94,95 Ethernet35/5 35 100000 rs
Ethernet152 80,81,82,83 Ethernet36/1 36 100000 rs
Ethernet156 84,85,86,87 Ethernet36/5 36 100000 rs
1 change: 1 addition & 0 deletions device/arista/x86_64-arista_7280cr3mk_32d4/gbsyncd.ini
Loading

0 comments on commit c40748b

Please sign in to comment.