Reuse TowerClient to handle Fusion token requests#6207
Conversation
✅ Deploy Preview for nextflow-docs-staging canceled.
|
pditommaso
left a comment
There was a problem hiding this comment.
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 <jordi@jordeu.net>
Signed-off-by: Jordi Deu-Pons <jordi@jordeu.net>
Signed-off-by: Jordi Deu-Pons <jordi@jordeu.net>
Signed-off-by: Jordi Deu-Pons <jordi@jordeu.net>
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 <paolo.ditommaso@gmail.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
|
It turns our Platform telemetry is a desired requirement. Therefore this implementation makes more sense. |
|
Ouch getting this in the CI tests |
|
I've reverted this PR 👉 b8a7722 |
…quests nextflow-io#6207" [ci fast] This reverts commit 9883b4d. Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com> Signed-off-by: Satoshi OHSHIMA <ohshima@cc.kyushu-u.ac.jp>
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)