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

Fix docker-sonic-mgmt reproducible related issue. #9647

Merged
merged 2 commits into from
Jan 5, 2022

Conversation

liushilongbuaa
Copy link
Contributor

@liushilongbuaa liushilongbuaa commented Dec 27, 2021

Why I did it

when using 'sed -i' the directory must also be writable as sed will create a temporary file in that directory first.
This issue breaks building sonic-mgmt docker image.
we should use sudo to resolve this issue, but sonic-base image haven't installed sudo tool.
So we should use both 'sed -i' and 'sudo sed -i'

How I did it

add retry with sudo.

How to verify it

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106

Description for the changelog

A picture of a cute animal (not mandatory but encouraged)

@liushilongbuaa
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

You have several pipelines (over 10) configured to build pull requests in this repository. Specify which pipelines you would like to run by using /azp run [pipelines] command. You can specify multiple pipelines using a comma separated list.

@liushilongbuaa
Copy link
Contributor Author

/azp run Azure.docker-sonic-mgmt

@azure-pipelines
Copy link

Azure Pipelines could not run because the pipeline triggers exclude this branch/path.

@liushilongbuaa
Copy link
Contributor Author

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@liushilongbuaa liushilongbuaa requested a review from xumia December 28, 2021 08:41
@@ -72,7 +72,7 @@ set_reproducible_mirrors()

local mirrors="/etc/apt/sources.list $(find /etc/apt/sources.list.d/ -type f)"
for mirror in $mirrors; do
sed -i "$expression" "$mirror"
sed -i "$expression" "$mirror" || sudo sed -i "$expression" "$mirror"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we change to run the command as root in docker-sonic-mgmt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

how about now?

SUDO=sudo
else
SUDO=''
fi
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can be simplified to
[ $USER != 'root' ] && [ -n $(which sudo) ] && SUDO=sudo

@xumia
Copy link
Collaborator

xumia commented Jan 5, 2022

@liushilongbuaa , we should not need to merge to release branches, right?

@liushilongbuaa liushilongbuaa merged commit 3844ae8 into sonic-net:master Jan 5, 2022
xumia pushed a commit to xumia/sonic-buildimage-1 that referenced this pull request Apr 11, 2022
Reproducible build script breaks docker-sonic-mgmt build.
qiluo-msft pushed a commit that referenced this pull request Apr 21, 2022
Reproducible build script breaks docker-sonic-mgmt build.
judyjoseph pushed a commit that referenced this pull request Apr 25, 2022
Reproducible build script breaks docker-sonic-mgmt build.
liushilongbuaa added a commit to liushilongbuaa/sonic-buildimage that referenced this pull request May 10, 2022
Reproducible build script breaks docker-sonic-mgmt build.
liushilongbuaa added a commit that referenced this pull request May 11, 2022
Reproducible build script breaks docker-sonic-mgmt build.
@liushilongbuaa liushilongbuaa deleted the fix-sed branch October 18, 2022 07:00
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.

4 participants