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

[Build] Use apt-get to predictably support dependency ordered configuration of lazy packages #12164

Merged
merged 5 commits into from
Nov 17, 2022

Conversation

lornelong
Copy link
Contributor

Why I did it

  • The current lazy installer relies on a filename sort for both unpack and configuration steps. When systemd services are configured [started] by multiple packages the order is by filename not by the declared package dependencies. This can cause the start order of services to differ between first-boot and subsequent boots. Declared systemd service dependencies further exacerbate the issue (e.g. blocking the first-boot script).

  • The current installer leaves packages un-configured if the package dependency order does not match the filename order.

  • This also fixes a trivial bug in [Build]: Support to use symbol links for lazy installation targets to reduce the image size #10923 where externally downloaded dependencies are duplicated across lazy package device directories.

How I did it

Changed the staging and first-boot scripts to use apt-get:

dpkg -i /host/image-$SONIC_VERSION/platform/$platform/*.deb

becomes

apt-get -y install /host/image-$SONIC_VERSION/platform/$platform/*.deb

when dependencies are detected during image staging.

How to verify it

Apt-get critical rules

Add a Depends= to the control information of a package. Grep the syslog for rc.local between images and observe the configuration order of packages change.

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

  • 201811
  • 201911
  • 202006
  • [ X] 202012
  • 202106
  • 202111
  • [ X] 202205

Description for the changelog

Use apt-get to predictably support dependency ordered configuration of lazy packages

Signed-off-by: Lorne Long <77469668+lornelong@users.noreply.github.com>
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Sep 22, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: lornelong / name: Lorne Long (4bd8870)

@lornelong
Copy link
Contributor Author

@xumia

@xumia
Copy link
Collaborator

xumia commented Sep 29, 2022

/AzurePipelines run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@sachinv-msft
Copy link

@wangxin could you please take a look at this?

@xumia
Copy link
Collaborator

xumia commented Nov 14, 2022

/azp run Azure.sonic-buildimage

@xumia
Copy link
Collaborator

xumia commented Nov 14, 2022

/AzurePipelines run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@yejianquan
Copy link
Contributor

/AzurePipelines run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@xumia xumia merged commit 7e525d9 into sonic-net:master Nov 17, 2022
qiluo-msft pushed a commit that referenced this pull request Nov 23, 2022
…ration of lazy packages (#12164)

Why I did it
The current lazy installer relies on a filename sort for both unpack and configuration steps. When systemd services are configured [started] by multiple packages the order is by filename not by the declared package dependencies. This can cause the start order of services to differ between first-boot and subsequent boots. Declared systemd service dependencies further exacerbate the issue (e.g. blocking the first-boot script).

The current installer leaves packages un-configured if the package dependency order does not match the filename order.

This also fixes a trivial bug in [Build]: Support to use symbol links for lazy installation targets to reduce the image size #10923 where externally downloaded dependencies are duplicated across lazy package device directories.

How I did it
Changed the staging and first-boot scripts to use apt-get:

dpkg -i /host/image-$SONIC_VERSION/platform/$platform/*.deb

becomes

apt-get -y install /host/image-$SONIC_VERSION/platform/$platform/*.deb

when dependencies are detected during image staging.

How to verify it
Apt-get critical rules

Add a Depends= to the control information of a package. Grep the syslog for rc.local between images and observe the configuration order of packages change.
richardyu-ms pushed a commit to richardyu-ms/sonic-buildimage that referenced this pull request Nov 25, 2022
yxieca pushed a commit that referenced this pull request Nov 28, 2022
…ration of lazy packages (#12164)

Why I did it
The current lazy installer relies on a filename sort for both unpack and configuration steps. When systemd services are configured [started] by multiple packages the order is by filename not by the declared package dependencies. This can cause the start order of services to differ between first-boot and subsequent boots. Declared systemd service dependencies further exacerbate the issue (e.g. blocking the first-boot script).

The current installer leaves packages un-configured if the package dependency order does not match the filename order.

This also fixes a trivial bug in [Build]: Support to use symbol links for lazy installation targets to reduce the image size #10923 where externally downloaded dependencies are duplicated across lazy package device directories.

How I did it
Changed the staging and first-boot scripts to use apt-get:

dpkg -i /host/image-$SONIC_VERSION/platform/$platform/*.deb

becomes

apt-get -y install /host/image-$SONIC_VERSION/platform/$platform/*.deb

when dependencies are detected during image staging.

How to verify it
Apt-get critical rules

Add a Depends= to the control information of a package. Grep the syslog for rc.local between images and observe the configuration order of packages change.
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.

7 participants