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

✨ catalog: adds services compatibility policy 🗃️ #6071

Merged
merged 26 commits into from
Jul 19, 2024

Conversation

pcrespov
Copy link
Member

@pcrespov pcrespov commented Jul 16, 2024

What do these changes do?

Uses version specifiers clauses (e.g. ~=0.9, >=1.0, !=1.3.4.*, <2.0) to define version ranges for compatibility policies. This provides rules to determine, given a service:X.Y.Z, a range of compatible versions from which the latest is returned as can_update_to. This is then usedin the front-end to update to the "latest compatible version".

Hightlights

  • 🎨 Default compatibility policy upgrades to the latest patch, i.e. latest(>X.Y.Z, ~=X.Y.Z).
  • ✨ Service owners can customize the compatibility policy
    • between versions: Service A:X.Y.Z is compatible with service A:$versions_specifier
    • across service keys: Service A:X.Y.Z is compatible with service B:$versions_specifier
    • 🗃️ A new services_compatibility table to serialize customization (otherwise defaults policy).
  • Web API: Compatibility is returned in all history entries, both in
    - Listing (temporarily to monitor performance)
    - GET operations.

Related issue/s

How to test

  • Driving test
cd services/catalog
make install-dev
pytest -vv tests/unit/test_services_compatibility.py
  • Manual test using swagger /dev/catalog/services/* entrypoints
  • Set services_compatibility row with custom rules for simcore/services/comp/itis/sleeper:1.0.0
    image
    image
    From the image
  1. custom policy applies: upgrades to a different service key/version
  2. default patch-upgrade policy
  3. cannot upgrade o anything since it is the latest version

Dev-ops checklist

@pcrespov pcrespov self-assigned this Jul 16, 2024
@pcrespov pcrespov added a:database associated to postgres service and postgres-database package a:catalog catalog service a:models-library labels Jul 16, 2024
@pcrespov pcrespov added this to the Tom Bombadil milestone Jul 16, 2024
Copy link

codecov bot commented Jul 16, 2024

Codecov Report

Attention: Patch coverage is 91.46341% with 7 lines in your changes missing coverage. Please review.

Project coverage is 88.0%. Comparing base (cafbf96) to head (aca1d90).
Report is 360 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #6071      +/-   ##
=========================================
+ Coverage    84.5%   88.0%    +3.4%     
=========================================
  Files          10    1267    +1257     
  Lines         214   53376   +53162     
  Branches       25     732     +707     
=========================================
+ Hits          181   46983   +46802     
- Misses         23    6230    +6207     
- Partials       10     163     +153     
Flag Coverage Δ
integrationtests 60.5% <ø> (?)
unittests 86.5% <91.4%> (+1.9%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...src/models_library/api_schemas_catalog/services.py 100.0% <100.0%> (ø)
...els-library/src/models_library/services_history.py 100.0% <100.0%> (ø)
...e/src/simcore_postgres_database/models/services.py 100.0% <ø> (ø)
...postgres_database/models/services_compatibility.py 100.0% <100.0%> (ø)
...e_service_catalog/db/repositories/_services_sql.py 100.0% <100.0%> (ø)
...s/catalog/src/simcore_service_catalog/db/tables.py 100.0% <100.0%> (ø)
.../src/simcore_service_catalog/models/services_db.py 100.0% <100.0%> (ø)
...c/simcore_service_catalog/services/services_api.py 79.3% <100.0%> (ø)
...se/src/simcore_postgres_database/models/_common.py 95.0% <75.0%> (ø)
.../simcore_service_catalog/services/compatibility.py 97.6% <97.6%> (ø)
... and 1 more

... and 1229 files with indirect coverage changes

@pcrespov pcrespov force-pushed the is5964/compatibility-policy branch from fa9c49a to 6ff7203 Compare July 18, 2024 12:20
@pcrespov pcrespov changed the title WIP: ✨ Is5964/compatibility policy ✨ catalog: adds services compatibility policy Jul 18, 2024
@pcrespov pcrespov added the a:webserver issue related to the webserver service label Jul 18, 2024
@pcrespov pcrespov marked this pull request as ready for review July 18, 2024 13:02
Copy link
Member

@odeimaiz odeimaiz left a comment

Choose a reason for hiding this comment

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

I've seen it working, nice 👌

@mguidon
Copy link
Member

mguidon commented Jul 18, 2024

Very very good. Thank you. One thing that comes to mind (but in the case of sim4life it might anyhow not work) Can you deduce the inverse dependency chain? i.e. can the frontend deduce how to downgrade from one version to another across different keys?

@pcrespov pcrespov enabled auto-merge (squash) July 18, 2024 13:30
@pcrespov pcrespov changed the title ✨ catalog: adds services compatibility policy ✨ catalog: adds services compatibility policy 🗃️ Jul 18, 2024
@pcrespov
Copy link
Member Author

Very very good. Thank you. One thing that comes to mind (but in the case of sim4life it might anyhow not work) Can you deduce the inverse dependency chain? i.e. can the frontend deduce how to downgrade from one version to another across different keys?

@mguidon @odeimaiz the reverse operation is one-to-many. A way forward would be that when a service is upgraded, we keep the changes history (similar to do/undo functionatliy). Perhaps a service in a project could keep that in a special entry.

Copy link
Contributor

@bisgaard-itis bisgaard-itis left a comment

Choose a reason for hiding this comment

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

Very cool! Thanks a lot for the effort

Copy link
Contributor

@GitHK GitHK left a comment

Choose a reason for hiding this comment

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

Please consider my two comments.

Copy link
Contributor

@matusdrobuliak66 matusdrobuliak66 left a comment

Choose a reason for hiding this comment

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

Cool, thanks!

@pcrespov pcrespov disabled auto-merge July 19, 2024 09:09
@pcrespov pcrespov merged commit 1f24fe3 into ITISFoundation:master Jul 19, 2024
56 checks passed
@pcrespov pcrespov deleted the is5964/compatibility-policy branch July 22, 2024 14:00
@matusdrobuliak66 matusdrobuliak66 mentioned this pull request Aug 15, 2024
67 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:catalog catalog service a:database associated to postgres service and postgres-database package a:models-library a:webserver issue related to the webserver service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants