-
Notifications
You must be signed in to change notification settings - Fork 739
Reuse TowerClient to handle Fusion token requests #6207
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
Conversation
✅ Deploy Preview for nextflow-docs-staging canceled.
|
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.
Not sure this can easily back-ported to older branches
I checked with 24.04, and it is no problem to backport it because the |
Signed-off-by: Jordi Deu-Pons <[email protected]>
Signed-off-by: Jordi Deu-Pons <[email protected]>
Signed-off-by: Jordi Deu-Pons <[email protected]>
Signed-off-by: Jordi Deu-Pons <[email protected]>
365f35a to
475f64e
Compare
|
Thanks for looking into this @jordeu, it looks good however I think it would be better to keep using The main raison is that, in principle, Fusion can be used even without activating Platform telemetry (provided the access token is provided). This PR instead, implicitly enables the telemetry even if not required. I've opened a separate PR to add the JWT token logic in the current implementation #6231 It's true that there's some code duplication, however this already a problem for other clients. see this and this, other than this. For this problem we may introduce a new http client class dedicated to properly handle this need in across all implementations. |
Signed-off-by: Paolo Di Tommaso <[email protected]>
Signed-off-by: Paolo Di Tommaso <[email protected]>
|
It turns our Platform telemetry is a desired requirement. Therefore this implementation makes more sense. |
|
Ouch getting this in the CI tests |
…quests #6207" [ci fast] This reverts commit 9883b4d. Signed-off-by: Paolo Di Tommaso <[email protected]>
|
I've reverted this PR 👉 b8a7722 |
…quests nextflow-io#6207" [ci fast] This reverts commit 9883b4d. Signed-off-by: Paolo Di Tommaso <[email protected]> Signed-off-by: Satoshi OHSHIMA <[email protected]>
Overview
This PR reuses the
TowerClientlogic to handle all license token requests, which will avoid the code from diverging in the future and fix the missing refresh token issue in the current implementation.Implementation details
This pull request introduces significant changes to the
TowerFusionTokenclass and its related components, focusing on simplifying the codebase and improving integration with theTowerClient. The updates remove redundant HTTP handling logic, streamline configuration validation, and enhance test coverage. Additionally, a new method is added to serialize license token requests into a map format.Codebase Simplification:
TowerClient: TheTowerFusionTokenclass now uses theTowerClientfor HTTP requests, removing custom HTTP client logic, retry policies, and related helper methods. This simplifies the code and centralizes HTTP handling. (plugins/nf-tower/src/main/io/seqera/tower/plugin/TowerFusionToken.groovy, [1] [2]endpointandaccessTokenhas been removed, relying instead onTowerClientto handle these concerns. (plugins/nf-tower/src/main/io/seqera/tower/plugin/TowerFusionToken.groovy, [1] [2]Feature Enhancements:
toMapMethod inGetLicenseTokenRequest: A new method has been added to convert license token request objects into a map, facilitating integration withTowerClient. (plugins/nf-tower/src/main/io/seqera/tower/plugin/exchange/GetLicenseTokenRequest.groovy, plugins/nf-tower/src/main/io/seqera/tower/plugin/exchange/GetLicenseTokenRequest.groovyR32-R43)Test Updates:
endpointandaccessTokenextraction logic, as these functionalities are now handled byTowerClient. New tests were added to validate workflow creation and token retrieval using the updatedTowerFusionTokenimplementation. (plugins/nf-tower/src/test/io/seqera/tower/plugin/TowerFusionEnvTest.groovy, plugins/nf-tower/src/test/io/seqera/tower/plugin/TowerFusionEnvTest.groovyL46-R91)