Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update setup-container.sh to save build time. #6541

Conversation

yutongzhang-microsoft
Copy link
Contributor

@yutongzhang-microsoft yutongzhang-microsoft commented Oct 14, 2022

Description of PR

In setup-container.sh, when building the docker container, the step "User configuration" will hang around several minutes probability because of the bug [https://github.com/moby/moby/issues/5419] of docker, and the whole script will cost about 20 minutes. Using useradd can work around this bug, but usermod can't. In this pr, we use useradd instead of usermod to work around this bug, and save the build time. Now, the whole script will take around 6 minutes.

Summary:
Fixes # (issue)

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Back port request

  • 201911
  • 202012
  • 202205

Approach

What is the motivation for this PR?

In setup-container.sh, when building the docker container, the step "User configuration" will hang around several minutes probability because of the bug [https://github.com/moby/moby/issues/5419] of docker, and the whole script will cost about 20 minutes. Using useradd can work around this bug, but usermod can't. In this pr, we use useradd instead of usermod to work around this bug, and save the build time. Now, the whole script will take around 6 minutes.

How did you do it?

In step "User configuration", when getent passwd {{ USER_NAME }} returns True, first delete the user and use useradd to add the user.

How did you verify/test it?

Setup container with new script and run test cases.

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

@yejianquan
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@yutongzhang-microsoft yutongzhang-microsoft changed the title [ignore] Update setup-container.sh to save build time. Update setup-container.sh to save build time. Oct 26, 2022
wangxin
wangxin previously approved these changes Oct 26, 2022
yejianquan
yejianquan previously approved these changes Oct 26, 2022
Copy link
Collaborator

@yejianquan yejianquan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@yejianquan yejianquan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yutongzhang-microsoft yutongzhang-microsoft merged commit cfb0e7c into sonic-net:master Oct 26, 2022
@yutongzhang-microsoft yutongzhang-microsoft deleted the yutongzhang/setup-container branch October 26, 2022 06:50
yutongzhang-microsoft added a commit that referenced this pull request Oct 26, 2022
Description of PR
In pr #6541 , it changed the logic of generating golden config.It will cause more reload during test running, and add test running time. Most reload is caused by the "FLEX_COUNTER_DELAY_STATUS" in "FLEX_COUNTER_TABLE". In this pr, we temporarily skip this key, and we fix the issue, we will add this check back.

What is the motivation for this PR?
In pr #6541 , it changed the logic of generating golden config.It will cause more reload during test running, and add test running time. Most reload is caused by the "FLEX_COUNTER_DELAY_STATUS" in "FLEX_COUNTER_TABLE". In this pr, we temporarily skip this key, and we fix the issue, we will add this check back.

How did you do it?
Skip check the key "FLEX_COUNTER_DELAY_STATUS" when checking the running config.

Signed-off-by: Yutong Zhang <yutongzhang@microsoft.com>
yejianquan pushed a commit that referenced this pull request Oct 27, 2022
Description of PR
In setup-container.sh, when building the docker container, the step "User configuration" will hang around several minutes probability because of the bug [moby/moby#5419] of docker, and the whole script will cost about 20 minutes. Using useradd can work around this bug, but usermod can't. In this pr, we use useradd instead of usermod to work around this bug, and save the build time. Now, the whole script will take around 6 minutes.

What is the motivation for this PR?
In setup-container.sh, when building the docker container, the step "User configuration" will hang around several minutes probability because of the bug [moby/moby#5419] of docker, and the whole script will cost about 20 minutes. Using useradd can work around this bug, but usermod can't. In this pr, we use useradd instead of usermod to work around this bug, and save the build time. Now, the whole script will take around 6 minutes.

How did you do it?
In step "User configuration", when getent passwd {{ USER_NAME }} returns True, first delete the user and use useradd to add the user.

How did you verify/test it?
Setup container with new script and run test cases.

Signed-off-by: Yutong Zhang <yutongzhang@microsoft.com>
yejianquan pushed a commit that referenced this pull request Oct 27, 2022
Description of PR
In setup-container.sh, when building the docker container, the step "User configuration" will hang around several minutes probability because of the bug [moby/moby#5419] of docker, and the whole script will cost about 20 minutes. Using useradd can work around this bug, but usermod can't. In this pr, we use useradd instead of usermod to work around this bug, and save the build time. Now, the whole script will take around 6 minutes.

What is the motivation for this PR?
In setup-container.sh, when building the docker container, the step "User configuration" will hang around several minutes probability because of the bug [moby/moby#5419] of docker, and the whole script will cost about 20 minutes. Using useradd can work around this bug, but usermod can't. In this pr, we use useradd instead of usermod to work around this bug, and save the build time. Now, the whole script will take around 6 minutes.

How did you do it?
In step "User configuration", when getent passwd {{ USER_NAME }} returns True, first delete the user and use useradd to add the user.

How did you verify/test it?
Setup container with new script and run test cases.

Signed-off-by: Yutong Zhang <yutongzhang@microsoft.com>
yejianquan pushed a commit that referenced this pull request Oct 27, 2022
Description of PR
In pr #6541 , it changed the logic of generating golden config.It will cause more reload during test running, and add test running time. Most reload is caused by the "FLEX_COUNTER_DELAY_STATUS" in "FLEX_COUNTER_TABLE". In this pr, we temporarily skip this key, and we fix the issue, we will add this check back.

What is the motivation for this PR?
In pr #6541 , it changed the logic of generating golden config.It will cause more reload during test running, and add test running time. Most reload is caused by the "FLEX_COUNTER_DELAY_STATUS" in "FLEX_COUNTER_TABLE". In this pr, we temporarily skip this key, and we fix the issue, we will add this check back.

How did you do it?
Skip check the key "FLEX_COUNTER_DELAY_STATUS" when checking the running config.

Signed-off-by: Yutong Zhang <yutongzhang@microsoft.com>
yejianquan pushed a commit that referenced this pull request Oct 27, 2022
Description of PR
In pr #6541 , it changed the logic of generating golden config.It will cause more reload during test running, and add test running time. Most reload is caused by the "FLEX_COUNTER_DELAY_STATUS" in "FLEX_COUNTER_TABLE". In this pr, we temporarily skip this key, and we fix the issue, we will add this check back.

What is the motivation for this PR?
In pr #6541 , it changed the logic of generating golden config.It will cause more reload during test running, and add test running time. Most reload is caused by the "FLEX_COUNTER_DELAY_STATUS" in "FLEX_COUNTER_TABLE". In this pr, we temporarily skip this key, and we fix the issue, we will add this check back.

How did you do it?
Skip check the key "FLEX_COUNTER_DELAY_STATUS" when checking the running config.

Signed-off-by: Yutong Zhang <yutongzhang@microsoft.com>
allen-xf pushed a commit to allen-xf/sonic-mgmt that referenced this pull request Oct 28, 2022
Description of PR
In setup-container.sh, when building the docker container, the step "User configuration" will hang around several minutes probability because of the bug [moby/moby#5419] of docker, and the whole script will cost about 20 minutes. Using useradd can work around this bug, but usermod can't. In this pr, we use useradd instead of usermod to work around this bug, and save the build time. Now, the whole script will take around 6 minutes.

What is the motivation for this PR?
In setup-container.sh, when building the docker container, the step "User configuration" will hang around several minutes probability because of the bug [moby/moby#5419] of docker, and the whole script will cost about 20 minutes. Using useradd can work around this bug, but usermod can't. In this pr, we use useradd instead of usermod to work around this bug, and save the build time. Now, the whole script will take around 6 minutes.

How did you do it?
In step "User configuration", when getent passwd {{ USER_NAME }} returns True, first delete the user and use useradd to add the user.

How did you verify/test it?
Setup container with new script and run test cases.

Signed-off-by: Yutong Zhang <yutongzhang@microsoft.com>
allen-xf pushed a commit to allen-xf/sonic-mgmt that referenced this pull request Oct 28, 2022
…-net#6624)

Description of PR
In pr sonic-net#6541 , it changed the logic of generating golden config.It will cause more reload during test running, and add test running time. Most reload is caused by the "FLEX_COUNTER_DELAY_STATUS" in "FLEX_COUNTER_TABLE". In this pr, we temporarily skip this key, and we fix the issue, we will add this check back.

What is the motivation for this PR?
In pr sonic-net#6541 , it changed the logic of generating golden config.It will cause more reload during test running, and add test running time. Most reload is caused by the "FLEX_COUNTER_DELAY_STATUS" in "FLEX_COUNTER_TABLE". In this pr, we temporarily skip this key, and we fix the issue, we will add this check back.

How did you do it?
Skip check the key "FLEX_COUNTER_DELAY_STATUS" when checking the running config.

Signed-off-by: Yutong Zhang <yutongzhang@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants