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

Support building sonic-utilities as a Python wheel package instead of a Debian package #1122

Merged
merged 9 commits into from
Sep 19, 2020
Merged

Conversation

jleveque
Copy link
Contributor

@jleveque jleveque commented Sep 19, 2020

- What I did

Support building sonic-utilities as a Python wheel package rather than a Debian package.

Notes:

  • Wheel packaging restricts the installation of files to within the dist-packages directory. Thus, we cannot install data files to system directories. Therefore, I am building a separate 'sonic-utilities-data' package for installing the data files (bash_completion, templates)
  • Wheel packages install scripts/entrypoints to the /usr/local/bin directory, whereas Debian packages install to /usr/bin

- How I did it

  • Specify all Python wheel dependencies in setup.py
  • Remove data_files section from setup.py
  • Build an extra 'sonic-utilities-data' Debian package which will handle installing data files to system directories
  • Update all references to sonic-utilities scripts/entrypoints to either reference the new /usr/local/bin/ location or remove absolute path entirely
  • Update .gitignore file as necessary

- How to verify it

Ensure all CLI-related functionality continues to work as expected

NOTE: PR tests will fail until the build job is updated to build as a Python wheel. PR here: Azure/sonic-build-tools#160

@@ -324,7 +324,7 @@ function reboot_pre_check()
fi

# Make sure ASIC configuration has not changed between images
ASIC_CONFIG_CHECK_SCRIPT="/usr/bin/asic_config_check"
ASIC_CONFIG_CHECK_SCRIPT="/usr/local/bin/asic_config_check"
Copy link
Contributor

Choose a reason for hiding this comment

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

is it doable not to change the path?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately, no. Wheels install to /usr/local/bin, whereas .debs install to /usr/bin. There's no way to change this behavior.

jleveque added a commit to Azure/sonic-build-tools that referenced this pull request Sep 19, 2020
Build sonic-utilities as a Python wheel instead of a Debian package to support sonic-net/sonic-utilities#1122
@jleveque
Copy link
Contributor Author

Retest this please

1 similar comment
@jleveque
Copy link
Contributor Author

Retest this please

@jleveque
Copy link
Contributor Author

jleveque commented Sep 19, 2020

After reviewing the check build logs, it is apparent there is a chicken/egg problem, as the build copies artifacts from the last successful build of buildimage-vs-all. Therefore, the new sonic-utilities wheel package built here will not even get installed in the VS container before running the swss tests, making this test meaningless. I will merge this PR and update the submodule in sonic-net/sonic-buildimage#5409 and iterate on that PR if necessary.

@jleveque jleveque merged commit 2244d7b into sonic-net:master Sep 19, 2020
@jleveque jleveque deleted the build_as_wheel branch September 19, 2020 07:31
jleveque added a commit to sonic-net/sonic-ztp that referenced this pull request Sep 19, 2020
…cal/bin/ (#19)

Update paths to reflect new sonic-utilities install location. As of PR sonic-net/sonic-utilities#1122, sonic-utilities is built and installed as a Python Wheel package. As such, the installation directory of the scripts/entrypoints has changed from `/usr/bin/` to `/usr/local/bin`. This patch updates all references to the old location to either reference the new location, or remove the absolute path entirely, where applicable.
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.

2 participants