-
Notifications
You must be signed in to change notification settings - Fork 27
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
♻️ director-v2 created api-keys are removed if not used by any service ⚠️ #5043
♻️ director-v2 created api-keys are removed if not used by any service ⚠️ #5043
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #5043 +/- ##
=========================================
+ Coverage 87.2% 88.5% +1.3%
=========================================
Files 1259 775 -484
Lines 51679 34724 -16955
Branches 1111 700 -411
=========================================
- Hits 45074 30763 -14311
+ Misses 6365 3803 -2562
+ Partials 240 158 -82
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please re-use the redis fixture, or modify it but do not duplicate.
Thanks!
services/director-v2/src/simcore_service_director_v2/utils/distributed_identifier.py
Outdated
Show resolved
Hide resolved
When this PR goes in, you have to merge ITISFoundation/osparc-ops-environments#445 and make sure redis-commander is redeployed @GitHK |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ack
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this PR is about:
- Extending BaseDistributedIdentifierManager:
- incorporates a new "cleanup context" concept (name is not very intuitive)
- connect it to redis
- changed a bit the previous interface
- Using the above to update the ApiKeysManager with a "Cleanup Context"
Sorry, it gets too complicated for me to follow at this stage :-)Please consider my suggestions. Perhaps we can clarify some concepts offline.
thx anyway.
services/director-v2/src/simcore_service_director_v2/utils/distributed_identifier.py
Outdated
Show resolved
Hide resolved
services/director-v2/src/simcore_service_director_v2/utils/distributed_identifier.py
Outdated
Show resolved
Hide resolved
services/director-v2/src/simcore_service_director_v2/utils/distributed_identifier.py
Outdated
Show resolved
Hide resolved
Code Climate has analyzed commit ecdaa98 and detected 0 issues on this pull request. View more on Code Climate. |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
What do these changes do?
When
director-v2
creates a service which requires an API-key,director-v2
will also create the API-key.If the service is forcefully removed (eg: manually from portioner) or in case of errors, the API-Key remain in the system.
This was fixed by keeping track of the created API-keys and adding a backup background task that checks if any keys require cleanup.
DistributedIdentifier
is keeps track of created identifiers inRedis
Redis
database, number 6redis-commander
'sREDIS_HOSTS
env var. It is now multiline and redis commander stil likes it even though in the end it gets translated toREDIS_HOSTS= resources:redis:6379:0, locks:redis:6379:1, validation_codes:redis:6379:2, scheduled_maintenance:redis:6379:3, user_notifications:redis:6379:4, announcements:redis:6379:5, distributed_identifiers:redis:6379:6
form yamlRelated issue/s
How to test
Dev Checklist
DevOps Checklist