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

MANOPD-81038 MANOPD-78302 Refactoring and fixes of OS/package versions #278

Merged
merged 12 commits into from
Nov 30, 2022

Conversation

ilia1243
Copy link
Contributor

@ilia1243 ilia1243 commented Nov 9, 2022

Description

  1. cluster_finalized.yaml no longer caches versions of custom packages from services.packages.install section after [PSUPCLPL-9592] packages versions #168
  2. Changes in enrichment procedure in [MANOPD-76880] Fix cache package version #181 related to cache_versions property are doubtful and should be reverted/reworked.
    • If the user customizes an association, its caching is skipped during add_node.
      Instead, turning the caching off should be done intentionally via the same cache_versions=false property for each necessary association.
    • If the user uses cache_versions=false for all associations, we do not use our recommended package versions.
      We should do use recommended versions.
      The user will still be able to not follow our recommendations by explicitly redefining of package_name section of each necessary association.
  3. Detection and work with OS versions are weird and should be reworked.

Fixes #262

Solution

  • Enrichment procedure is changed as per the p. 2 of the Description.
  • cluster_finalized.yaml now caches package versions independently on cache_versions property.
    If any package is installed with different versions on different nodes, warning is printed and the package is taken as-is from the inventory.
    If multiple OS families or versions detected on nodes, packages detection is skipped.
  • Major refactoring of OS and package versions detection, enrichment and usage.
    • Enrichment of packages now happens independently on whether it is add_node or any other procedure.
      Customized packages are moved to OS family specific section and later used from there.
    • It is no longer possible to customize associations in global section for clusters in multiple OS.
      The customization should be moved to the corresponding OS specific section before OS migration.
    • cluster.context['os'] variable is removed. Now cluster global OS is detected using cluster.get_os_family().
      It does not depend on the procedure with the only exception that global OS family is calculated based on final nodes only.
    • NodeGroup.get_nodes_os() no longer accepts any flag.
      It returns OS family of really those group on which it is called and does not throw exceptions for unsupported or multiple OS families.
  • Fixed unnecessary audit installation if balancer is added.
  • Resolving of cluster_finalized.yaml is rewritten to enrichment-like style.
  • Other fixes of cluster_finalized.yaml resolving if multiple OS families or versions detected on nodes or if some nodes are not sudoers.
  • Fixes in check_paas procedure for clusters on multiple OS.
  • Other refactoring and fixes.

Test Cases

TestCase 1

Test Configuration:

  • Hardware: Any
  • OS: All nodes have the same OS
  • Inventory: Any with non-empty services.packages.install section. Some of packages have equal version on all nodes and some of them do not.

Steps:

  1. Run any procedure

Results:

Before After
cluster_finalized.yaml does not contain versions for services.packages.install section Packages that have equal version on all nodes are cached. For other packages there are warnings in logs.

Regression Tests

  • upgrade and migrate_cri procedures with custom packages sections.
  • Audit installation on cluster with debian nodes.
  • OS migration
  • add_node when initial nodes having different associations packages versions and if cache_versions option is specified.

Checklist

  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation.
  • Integration CI passed
  • Unit tests. If Yes list of new/changed tests with brief description.
  • There is no merge conflicts

Unit tests

  • test_cluster.py: added tests for cluster.get_os_family()
  • test_audit.py, test_haproxy.py, test_keepalived.py: fixes according to new enrichment approach
  • test_migrate_cri.py, test_upgrade.py: added tests for packages enrichment and finalization
  • test_packages.py: added many tests for packages enrichment, detection and caching.

@ilia1243 ilia1243 added bug Something isn't working improvement New feature or request labels Nov 9, 2022
@ilia1243 ilia1243 marked this pull request as draft November 9, 2022 18:28
@ilia1243 ilia1243 force-pushed the refactoring/os_versions_check branch from 63b58e1 to ef2ad16 Compare November 11, 2022 08:48
@koryaga koryaga requested a review from Imadzuma November 14, 2022 08:22
@ilia1243 ilia1243 force-pushed the refactoring/os_versions_check branch from ea9baa9 to 968bf67 Compare November 15, 2022 10:09
@ilia1243 ilia1243 added the documentation Improvements or additions to documentation label Nov 15, 2022
@ilia1243 ilia1243 requested a review from shmo1218 November 15, 2022 13:02
@ilia1243 ilia1243 marked this pull request as ready for review November 15, 2022 13:06
@ilia1243 ilia1243 force-pushed the refactoring/os_versions_check branch from 87ce1fa to 757135d Compare November 16, 2022 15:26
Copy link
Contributor

@shmo1218 shmo1218 left a comment

Choose a reason for hiding this comment

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

The doc file is reviewed.

@ilia1243 ilia1243 force-pushed the refactoring/os_versions_check branch from 7b79cea to d477599 Compare November 21, 2022 12:25
@ilia1243 ilia1243 mentioned this pull request Nov 23, 2022
5 tasks
@ilia1243 ilia1243 force-pushed the refactoring/os_versions_check branch from d477599 to 119178a Compare November 30, 2022 06:32
@koryaga koryaga merged commit ad5d660 into main Nov 30, 2022
@koryaga koryaga deleted the refactoring/os_versions_check branch November 30, 2022 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation improvement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unclear flow to work with nodes OS
4 participants