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(agw): Fix reinstall logic and error handling in pydep #13799

Merged
merged 3 commits into from
Sep 1, 2022

Conversation

MoritzThomasHuebner
Copy link
Contributor

@MoritzThomasHuebner MoritzThomasHuebner commented Sep 1, 2022

Follow up to:
#13795

See also:
#13787

Summary

  • Changed the pydep script to reinstall all packages with apt since already installed packages might not be registered with python. This solves an issue in the build process where the uninstallation of "idna" breaks some Python scripts.
  • Fixed the error handling of fabric (catching exceptions does not work) so the script can run even if no new dependencies are built.

Test Plan

I made a temporary change to trigger the AGW build workflow.

https://github.com/sebathomas/magma/actions/runs/2971214324

Additional Information

  • This change is backwards-breaking

Using install could lead to situations where the package is already installed but not recognized by the python environment. Explicitly running reinstall solves this issue.

Signed-off-by: Moritz Huebner <moritz.huebner@tngtech.com>
@pull-request-size pull-request-size bot added the size/XS Denotes a PR that changes 0-9 lines. label Sep 1, 2022
@github-actions github-actions bot added the component: ci All updates on CI (Jenkins/CircleCi/Github Action) label Sep 1, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Sep 1, 2022

Thanks for opening a PR! 💯

A couple initial guidelines

Howto

  • Reviews. The "Reviewers" listed for this PR are the Magma maintainers who will shepherd it.
  • Checks. All required CI checks must pass before merge.
  • Merge. Once approved and passing CI checks, use the ready2merge label to indicate the maintainers can merge your PR.

More info

Please take a moment to read through the Magma project's

If this is your first Magma PR, also consider reading

@github-actions
Copy link
Contributor

github-actions bot commented Sep 1, 2022

✔️ The Semantic PR check ended with status success. See instructions on formatting your commit and pull request titles.

@MoritzThomasHuebner MoritzThomasHuebner changed the title Idna import fix fix(agw): Idna import fix Sep 1, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Sep 1, 2022

feg-workflow

    2 files  203 suites   39s ⏱️
374 tests 374 ✔️ 0 💤 0
388 runs  388 ✔️ 0 💤 0

Results for commit cf6d9c8.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 1, 2022

dp-workflow

14 tests   14 ✔️  3m 9s ⏱️
  1 suites    0 💤
  1 files      0

Results for commit cf6d9c8.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 1, 2022

agw-workflow

615 tests   611 ✔️  3m 53s ⏱️
    2 suites      4 💤
    2 files        0

Results for commit cf6d9c8.

♻️ This comment has been updated with latest results.

@github-actions github-actions bot added the component: agw Access gateway-related issue label Sep 1, 2022
lte/gateway/fabfile.py Outdated Show resolved Hide resolved
@@ -1086,7 +1086,7 @@ def main(args):
pip_packages = [req.key for req in repo_installable]
subprocess.call(shlex.split('sudo pip3 uninstall -y '
+ ' '.join(pip_packages)))
subprocess.call(shlex.split('sudo apt install -y '
subprocess.call(shlex.split('sudo apt reinstall -y '
Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch!

This prevents the fabric script from failing if no dependencies have been built.

Signed-off-by: Moritz Huebner <moritz.huebner@tngtech.com>
lte/gateway/fabfile.py Outdated Show resolved Hide resolved
@pull-request-size pull-request-size bot added size/S Denotes a PR that changes 10-29 lines. and removed size/XS Denotes a PR that changes 0-9 lines. labels Sep 1, 2022
@pull-request-size pull-request-size bot added size/XS Denotes a PR that changes 0-9 lines. and removed size/S Denotes a PR that changes 10-29 lines. labels Sep 1, 2022
@MoritzThomasHuebner MoritzThomasHuebner marked this pull request as ready for review September 1, 2022 07:08
@MoritzThomasHuebner MoritzThomasHuebner requested a review from a team as a code owner September 1, 2022 07:08
Signed-off-by: Sebastian Thomas <sebastian.thomas@tngtech.com>
@sebathomas sebathomas changed the title fix(agw): Idna import fix fix(agw): Fix reinstall logic and error handling in pydep Sep 1, 2022
@sebathomas sebathomas merged commit e98445f into magma:master Sep 1, 2022
rsarwad pushed a commit to rsarwad/magma that referenced this pull request Sep 4, 2022
- Changed the pydep script to reinstall all packages with apt
  since already installed packages might not be registered with
  python. This solves an issue in the build process where the
  uninstallation of "idna" breaks some Python scripts.
- Fixed the error handling of fabric (catching exceptions does
  not work) so the script can run even if no new dependencies
  are built.

Signed-off-by: Moritz Huebner <moritz.huebner@tngtech.com>
Signed-off-by: Sebastian Thomas <sebastian.thomas@tngtech.com>
Co-authored-by: Sebastian Thomas <sebastian.thomas@tngtech.com>
@MoritzThomasHuebner MoritzThomasHuebner deleted the idna_import_fix branch February 23, 2023 01:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: agw Access gateway-related issue component: ci All updates on CI (Jenkins/CircleCi/Github Action) size/XS Denotes a PR that changes 0-9 lines.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants