Skip to content

Commit

Permalink
refactor: wip: Refactor FusionClient into TowerClient
Browse files Browse the repository at this point in the history
Signed-off-by: Alberto Miranda <[email protected]>
  • Loading branch information
alberto-miranda committed Dec 17, 2024
1 parent 4fae0b6 commit 09138e4
Show file tree
Hide file tree
Showing 14 changed files with 131 additions and 676 deletions.
2 changes: 0 additions & 2 deletions modules/nextflow/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ dependencies {
api 'org.bouncycastle:bcpkix-jdk18on:1.78.1'

testImplementation 'org.subethamail:subethasmtp:3.1.7'
// wiremock needed by FusionClient tests
testImplementation "org.wiremock:wiremock:3.5.4"

// test configuration
testFixturesApi ("org.apache.groovy:groovy-test:4.0.24") { exclude group: 'org.apache.groovy' }
Expand Down
204 changes: 0 additions & 204 deletions modules/nextflow/src/main/groovy/nextflow/fusion/FusionClient.groovy

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,16 @@

package nextflow.fusion

import groovy.util.logging.Slf4j
import nextflow.Session
import nextflow.plugin.Plugins

import nextflow.plugin.Plugins
/**
* Provider strategy for {@link FusionEnv}
*
* @author Paolo Di Tommaso <[email protected]>
*/
@Slf4j
class FusionEnvProvider {

// The client used to interact with Platform for Fusion-related operations
final private FusionClient client

FusionEnvProvider(Session session) {
this.client = new FusionClient(session)
}

Map<String, String> getEnvironment(String scheme) {
Map<String,String> getEnvironment(String scheme) {
final config = FusionConfig.getConfig()
final list = Plugins.getExtensions(FusionEnv)
final result = new HashMap<String,String>()
Expand All @@ -54,14 +44,6 @@ class FusionEnvProvider {
result.FUSION_LOG_LEVEL = config.logLevel()
if( config.cacheSize() )
result.FUSION_CACHE_SIZE = "${config.cacheSize().toMega()}M"
// license settings
try {
result.FUSION_LICENSE_TOKEN = client.getLicenseToken()
} catch( Exception e ) {
// TODO(amiranda): This should actually fail, but since fusion licensing is not mandatory yet, we'll just
// log a warning and continue.
log.warn("Error retrieving Fusion license information: ${e.message}")
}
return result
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@

package nextflow.fusion

import nextflow.Global
import nextflow.Session

import static nextflow.fusion.FusionConfig.FUSION_PATH
import static nextflow.fusion.FusionHelper.*

Expand All @@ -31,7 +28,6 @@ import nextflow.executor.BashWrapperBuilder
import nextflow.processor.TaskBean
import nextflow.processor.TaskRun
import nextflow.util.Escape

/**
* Command script launcher implementing the support for Fusion files
*
Expand Down Expand Up @@ -92,7 +88,7 @@ class FusionScriptLauncher extends BashWrapperBuilder {
final result = new LinkedHashMap(10)
result.FUSION_WORK = work
// foreign env
final provider = new FusionEnvProvider(Global.session as Session)
final provider = new FusionEnvProvider()
result.putAll(provider.getEnvironment(scheme))
env = result
}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 09138e4

Please sign in to comment.