[build]: Parallel building of sonic dockers using native dockerd(dood)#6086
[build]: Parallel building of sonic dockers using native dockerd(dood)#6086Kalimuthu-Velappan wants to merge 3 commits intosonic-net:masterfrom
Conversation
34d1680 to
2d8c2ec
Compare
|
retest this please |
2d8c2ec to
83d09b1
Compare
|
retest this please |
83d09b1 to
521c411
Compare
|
retest vs please |
|
@xumia - what's the next step? Can we advance towards merge pls? |
521c411 to
12c5b6a
Compare
|
@ben-gale , i have posted my comments, we have some questions. |
|
@xumia , does this have any interference with reproducible build as they rename the docker from name. not sure if you have some hardcoded rule to tack this. |
Thx |
acfb362 to
c8166c4
Compare
c8166c4 to
7cc5e88
Compare
Currently, the build dockers are created as a user dockers(docker-base-stretch-<user>, etc) that are
specific to each user. But the sonic dockers (docker-database, docker-swss, etc) are
created with a fixed docker name and common to all the users.
docker-database:latest
docker-swss:latest
When multiple builds are triggered on the same build server that creates parallel building issue because
all the build jobs are trying to create the same docker with latest tag.
This happens only when sonic dockers are built using native host dockerd for sonic docker image creation.
This patch creates all sonic dockers as user sonic dockers and then, while
saving and loading the user sonic dockers, it rename the user sonic
dockers into correct sonic dockers with tag as latest.
The user sonic docker names are derived from '_LOAD_DOCKER' make
variable and using Jinja template, it replaces the FROM docker name with correct user sonic docker name for
loading and saving the docker image.
7cc5e88 to
f1a4b65
Compare
|
retest vsimage please |
|
i tried this pr and armhf build, but it failed. |
|
if I am doing only the armhf build without this pr, then it works. https://dev.azure.com/sonicswitch/build/_build/results?buildId=1817&view=logs&j=83516c17-6666-5250-abde-63983ce72a49 i am not sure what went wrong here. |
| @@ -1,5 +1,5 @@ | |||
| {% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %} | |||
| FROM docker-base-buster | |||
| FROM {{ docker_config_engine_buster_load_image }} | |||
There was a problem hiding this comment.
i am not able to figure out what went wrong for this pr for armhf build, but can you split this pr into following pr so that the problem can be isolated.
- use the load_image from the .mk file.
- everything else.
| export vs_build_prepare_mem=$(VS_PREPARE_MEM) | ||
|
|
||
| ############################################################################### | ||
| ## Canned sequences |
There was a problem hiding this comment.
maybe we should move this to Makefile.docker? all instructions related to docker should go there.
There was a problem hiding this comment.
I will make the change as you suggested and will get back to you.
|
It is conflicting with the reproducible build PR and requires some rework. We will fix and submit the changes in a separate PR and will close this PR. |
Currently, the build dockers are created as a user dockers(docker-base-stretch-, etc) that are
specific to each user. But the sonic dockers (docker-database, docker-swss, etc) are
created with a fixed docker name and common to all the users.
When multiple builds are triggered on the same build server that creates parallel building issue because
all the build jobs are trying to create the same docker with latest tag.
This happens only when sonic dockers are built using native host dockerd for sonic docker image creation.
This patch creates all sonic dockers as user sonic dockers and then, while
saving and loading the user sonic dockers, it rename the user sonic
dockers into correct sonic dockers with tag as latest.
The user sonic docker names are derived from '_LOAD_DOCKER' make
variable and using Jinja template, it replaces the FROM docker name with correct user sonic docker name for
loading and saving the docker image.
The template processing covers only for common dockers, Broadcom and VS platform dockers. For other vendor specific dockers, respective vendors need to add the support.
- Why I did it
To enable the parallel build using native dockerd for sonic dockers.
- How I did it
Created user dockers for each of the sonic dockers.
docker-swss:latest <=SAVE/LOAD=> docker-swss-<user>:latest
- How to verify it
Parallel build on the same build server
- Which release branch to backport (provide reason below if selected)
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)