From 17087ec67b0f45683296bfdae7bb897e2bdf1385 Mon Sep 17 00:00:00 2001 From: Dr Marco Claudio De La Pierre Date: Wed, 27 Mar 2024 11:04:53 +0800 Subject: [PATCH 1/6] Update from Tower endpoint URL to Platform endpoint URL Signed-off-by: Dr Marco Claudio De La Pierre --- docs/cli.md | 2 +- .../src/main/groovy/nextflow/config/ConfigBuilder.groovy | 2 +- .../src/test/groovy/nextflow/config/ConfigBuilderTest.groovy | 2 +- .../src/main/io/seqera/tower/plugin/TowerClient.groovy | 2 +- .../src/main/io/seqera/wave/plugin/config/TowerConfig.groovy | 2 +- .../test/io/seqera/wave/plugin/config/TowerConfigTest.groovy | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/cli.md b/docs/cli.md index 3a70d64029..b7f2435674 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -1266,7 +1266,7 @@ The `run` command is used to execute a local pipeline script or remote pipeline `-with-timeline` (`timeline-.html`) : Create workflow execution timeline. -`-with-tower` (`https://api.tower.nf`) +`-with-tower` (`https://api.cloud.seqera.io`) : Monitor workflow execution with [Seqera Platform](https://cloud.tower.nf/) (formerly Tower Cloud). `-with-trace` (`trace-.txt`) diff --git a/modules/nextflow/src/main/groovy/nextflow/config/ConfigBuilder.groovy b/modules/nextflow/src/main/groovy/nextflow/config/ConfigBuilder.groovy index 362a25af1d..13ec5f0bf2 100644 --- a/modules/nextflow/src/main/groovy/nextflow/config/ConfigBuilder.groovy +++ b/modules/nextflow/src/main/groovy/nextflow/config/ConfigBuilder.groovy @@ -694,7 +694,7 @@ class ConfigBuilder { if( cmdRun.withTower != '-' ) config.tower.endpoint = cmdRun.withTower else if( !config.tower.endpoint ) - config.tower.endpoint = 'https://api.tower.nf' + config.tower.endpoint = 'https://api.cloud.seqera.io' } // -- set wave options diff --git a/modules/nextflow/src/test/groovy/nextflow/config/ConfigBuilderTest.groovy b/modules/nextflow/src/test/groovy/nextflow/config/ConfigBuilderTest.groovy index 89238db39d..6a5114ffa9 100644 --- a/modules/nextflow/src/test/groovy/nextflow/config/ConfigBuilderTest.groovy +++ b/modules/nextflow/src/test/groovy/nextflow/config/ConfigBuilderTest.groovy @@ -1110,7 +1110,7 @@ class ConfigBuilderTest extends Specification { then: config.tower instanceof Map config.tower.enabled - config.tower.endpoint == 'https://api.tower.nf' + config.tower.endpoint == 'https://api.cloud.seqera.io' } def 'should set wave options' () { diff --git a/plugins/nf-tower/src/main/io/seqera/tower/plugin/TowerClient.groovy b/plugins/nf-tower/src/main/io/seqera/tower/plugin/TowerClient.groovy index 20cef33a0e..9274e68b0c 100644 --- a/plugins/nf-tower/src/main/io/seqera/tower/plugin/TowerClient.groovy +++ b/plugins/nf-tower/src/main/io/seqera/tower/plugin/TowerClient.groovy @@ -56,7 +56,7 @@ import nextflow.util.Threads @CompileStatic class TowerClient implements TraceObserver { - static final public String DEF_ENDPOINT_URL = 'https://api.tower.nf' + static final public String DEF_ENDPOINT_URL = 'https://api.cloud.seqera.io' static private final int TASKS_PER_REQUEST = 100 diff --git a/plugins/nf-wave/src/main/io/seqera/wave/plugin/config/TowerConfig.groovy b/plugins/nf-wave/src/main/io/seqera/wave/plugin/config/TowerConfig.groovy index e9f60e8c96..5a0877039f 100644 --- a/plugins/nf-wave/src/main/io/seqera/wave/plugin/config/TowerConfig.groovy +++ b/plugins/nf-wave/src/main/io/seqera/wave/plugin/config/TowerConfig.groovy @@ -50,7 +50,7 @@ class TowerConfig { private String endpoint0(Map opts, Map env) { def result = opts.endpoint as String if( !result || result=='-' ) - result = env.get('TOWER_API_ENDPOINT') ?: 'https://api.tower.nf' + result = env.get('TOWER_API_ENDPOINT') ?: 'https://api.cloud.seqera.io' return result.stripEnd('/') } diff --git a/plugins/nf-wave/src/test/io/seqera/wave/plugin/config/TowerConfigTest.groovy b/plugins/nf-wave/src/test/io/seqera/wave/plugin/config/TowerConfigTest.groovy index 46a786cc8f..ec5e16808b 100644 --- a/plugins/nf-wave/src/test/io/seqera/wave/plugin/config/TowerConfigTest.groovy +++ b/plugins/nf-wave/src/test/io/seqera/wave/plugin/config/TowerConfigTest.groovy @@ -118,12 +118,12 @@ class TowerConfigTest extends Specification { when: config = new TowerConfig([:], [:]) then: - config.endpoint == 'https://api.tower.nf' + config.endpoint == 'https://api.cloud.seqera.io' when: config = new TowerConfig([endpoint:'-'], [:]) then: - config.endpoint == 'https://api.tower.nf' + config.endpoint == 'https://api.cloud.seqera.io' when: config = new TowerConfig([endpoint:'http://foo.com'], [:]) From 88beb5d8c4987dae53d22ab9915d4029b15072e6 Mon Sep 17 00:00:00 2001 From: Dr Marco Claudio De La Pierre Date: Wed, 27 Mar 2024 11:28:26 +0800 Subject: [PATCH 2/6] Added warning when passing old API URL as env var Signed-off-by: Dr Marco Claudio De La Pierre --- .../main/io/seqera/tower/plugin/TowerFactory.groovy | 8 ++++++-- .../io/seqera/wave/plugin/config/TowerConfig.groovy | 10 ++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/plugins/nf-tower/src/main/io/seqera/tower/plugin/TowerFactory.groovy b/plugins/nf-tower/src/main/io/seqera/tower/plugin/TowerFactory.groovy index afba131240..63fa567872 100644 --- a/plugins/nf-tower/src/main/io/seqera/tower/plugin/TowerFactory.groovy +++ b/plugins/nf-tower/src/main/io/seqera/tower/plugin/TowerFactory.groovy @@ -64,8 +64,12 @@ class TowerFactory implements TraceObserverFactory { Duration requestInterval = config.navigate('tower.requestInterval') as Duration Duration aliveInterval = config.navigate('tower.aliveInterval') as Duration - if ( !endpoint || endpoint=='-' ) - endpoint = env.get('TOWER_API_ENDPOINT') ?: TowerClient.DEF_ENDPOINT_URL + if ( !endpoint || endpoint=='-' ) { + String env_api_endpoint = env.get('TOWER_API_ENDPOINT') + if( env_api_endpoint && env_api_endpoint.equals('https://api.tower.nf')) + log.warn "The endpoint `https://api.tower.nf` is deprecated. Please use `https://api.cloud.seqera.io` instead." + endpoint = env_api_endpoint ?: TowerClient.DEF_ENDPOINT_URL + } final tower = new TowerClient(session, endpoint).withEnvironment(env) if( aliveInterval ) diff --git a/plugins/nf-wave/src/main/io/seqera/wave/plugin/config/TowerConfig.groovy b/plugins/nf-wave/src/main/io/seqera/wave/plugin/config/TowerConfig.groovy index 5a0877039f..373c7c755f 100644 --- a/plugins/nf-wave/src/main/io/seqera/wave/plugin/config/TowerConfig.groovy +++ b/plugins/nf-wave/src/main/io/seqera/wave/plugin/config/TowerConfig.groovy @@ -19,6 +19,7 @@ package io.seqera.wave.plugin.config import groovy.transform.CompileStatic import groovy.transform.ToString +import groovy.util.logging.Slf4j /** * Model Tower config accessed by Wave @@ -26,6 +27,7 @@ import groovy.transform.ToString * @author Paolo Di Tommaso */ @ToString(includeNames = true, includePackage = false) +@Slf4j @CompileStatic class TowerConfig { @@ -49,8 +51,12 @@ class TowerConfig { private String endpoint0(Map opts, Map env) { def result = opts.endpoint as String - if( !result || result=='-' ) - result = env.get('TOWER_API_ENDPOINT') ?: 'https://api.cloud.seqera.io' + if( !result || result=='-' ) { + String env_api_endpoint = env.get('TOWER_API_ENDPOINT') + if( env_api_endpoint && env_api_endpoint.equals('https://api.tower.nf')) + log.warn "The endpoint `https://api.tower.nf` is deprecated. Please use `https://api.cloud.seqera.io` instead." + result = env_api_endpoint ?: 'https://api.cloud.seqera.io' + } return result.stripEnd('/') } From e3c453e21433b8dfcd9e1cf59228e85d66a05281 Mon Sep 17 00:00:00 2001 From: Paolo Di Tommaso Date: Wed, 27 Mar 2024 11:00:06 +0100 Subject: [PATCH 3/6] Improve default endpoint handling Signed-off-by: Paolo Di Tommaso --- .../src/main/io/seqera/tower/plugin/TowerClient.groovy | 5 +++++ .../main/io/seqera/tower/plugin/TowerFactory.groovy | 8 ++------ .../test/io/seqera/tower/plugin/TowerClientTest.groovy | 1 + .../io/seqera/wave/plugin/config/TowerConfig.groovy | 10 ++-------- 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/plugins/nf-tower/src/main/io/seqera/tower/plugin/TowerClient.groovy b/plugins/nf-tower/src/main/io/seqera/tower/plugin/TowerClient.groovy index 9274e68b0c..d1e6a32368 100644 --- a/plugins/nf-tower/src/main/io/seqera/tower/plugin/TowerClient.groovy +++ b/plugins/nf-tower/src/main/io/seqera/tower/plugin/TowerClient.groovy @@ -212,6 +212,11 @@ class TowerClient implements TraceObserver { * @return The requested url or the default url, if invalid */ protected String checkUrl(String url){ + // report a warning for legacy endpoint + if( url.contains('https://api.tower.nf') ) { + log.warn "The endpoint `https://api.tower.nf` is deprecated - Please use `https://api.cloud.seqera.io` instead" + return DEF_ENDPOINT_URL + } if( url =~ "^(https|http)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" ) { while( url.endsWith('/') ) url = url[0..-2] diff --git a/plugins/nf-tower/src/main/io/seqera/tower/plugin/TowerFactory.groovy b/plugins/nf-tower/src/main/io/seqera/tower/plugin/TowerFactory.groovy index 63fa567872..afba131240 100644 --- a/plugins/nf-tower/src/main/io/seqera/tower/plugin/TowerFactory.groovy +++ b/plugins/nf-tower/src/main/io/seqera/tower/plugin/TowerFactory.groovy @@ -64,12 +64,8 @@ class TowerFactory implements TraceObserverFactory { Duration requestInterval = config.navigate('tower.requestInterval') as Duration Duration aliveInterval = config.navigate('tower.aliveInterval') as Duration - if ( !endpoint || endpoint=='-' ) { - String env_api_endpoint = env.get('TOWER_API_ENDPOINT') - if( env_api_endpoint && env_api_endpoint.equals('https://api.tower.nf')) - log.warn "The endpoint `https://api.tower.nf` is deprecated. Please use `https://api.cloud.seqera.io` instead." - endpoint = env_api_endpoint ?: TowerClient.DEF_ENDPOINT_URL - } + if ( !endpoint || endpoint=='-' ) + endpoint = env.get('TOWER_API_ENDPOINT') ?: TowerClient.DEF_ENDPOINT_URL final tower = new TowerClient(session, endpoint).withEnvironment(env) if( aliveInterval ) diff --git a/plugins/nf-tower/src/test/io/seqera/tower/plugin/TowerClientTest.groovy b/plugins/nf-tower/src/test/io/seqera/tower/plugin/TowerClientTest.groovy index 0c2764c368..3793333f1e 100644 --- a/plugins/nf-tower/src/test/io/seqera/tower/plugin/TowerClientTest.groovy +++ b/plugins/nf-tower/src/test/io/seqera/tower/plugin/TowerClientTest.groovy @@ -129,6 +129,7 @@ class TowerClientTest extends Specification { observer.checkUrl('http://google.com:8080/foo/bar') == 'http://google.com:8080/foo/bar' observer.checkUrl('http://google.com:8080/foo/bar/') == 'http://google.com:8080/foo/bar' observer.checkUrl('http://google.com:8080/foo/bar///') == 'http://google.com:8080/foo/bar' + observer.checkUrl('https://api.tower.nf') == 'https://api.cloud.seqera.io' when: observer.checkUrl('ftp://localhost') diff --git a/plugins/nf-wave/src/main/io/seqera/wave/plugin/config/TowerConfig.groovy b/plugins/nf-wave/src/main/io/seqera/wave/plugin/config/TowerConfig.groovy index 373c7c755f..e9f60e8c96 100644 --- a/plugins/nf-wave/src/main/io/seqera/wave/plugin/config/TowerConfig.groovy +++ b/plugins/nf-wave/src/main/io/seqera/wave/plugin/config/TowerConfig.groovy @@ -19,7 +19,6 @@ package io.seqera.wave.plugin.config import groovy.transform.CompileStatic import groovy.transform.ToString -import groovy.util.logging.Slf4j /** * Model Tower config accessed by Wave @@ -27,7 +26,6 @@ import groovy.util.logging.Slf4j * @author Paolo Di Tommaso */ @ToString(includeNames = true, includePackage = false) -@Slf4j @CompileStatic class TowerConfig { @@ -51,12 +49,8 @@ class TowerConfig { private String endpoint0(Map opts, Map env) { def result = opts.endpoint as String - if( !result || result=='-' ) { - String env_api_endpoint = env.get('TOWER_API_ENDPOINT') - if( env_api_endpoint && env_api_endpoint.equals('https://api.tower.nf')) - log.warn "The endpoint `https://api.tower.nf` is deprecated. Please use `https://api.cloud.seqera.io` instead." - result = env_api_endpoint ?: 'https://api.cloud.seqera.io' - } + if( !result || result=='-' ) + result = env.get('TOWER_API_ENDPOINT') ?: 'https://api.tower.nf' return result.stripEnd('/') } From 272ed92203228cad449efdb3d5e15600ce21cebf Mon Sep 17 00:00:00 2001 From: Paolo Di Tommaso Date: Wed, 27 Mar 2024 13:59:51 +0100 Subject: [PATCH 4/6] Fix failing tests Signed-off-by: Paolo Di Tommaso --- .../src/main/io/seqera/wave/plugin/config/TowerConfig.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/nf-wave/src/main/io/seqera/wave/plugin/config/TowerConfig.groovy b/plugins/nf-wave/src/main/io/seqera/wave/plugin/config/TowerConfig.groovy index e9f60e8c96..5a0877039f 100644 --- a/plugins/nf-wave/src/main/io/seqera/wave/plugin/config/TowerConfig.groovy +++ b/plugins/nf-wave/src/main/io/seqera/wave/plugin/config/TowerConfig.groovy @@ -50,7 +50,7 @@ class TowerConfig { private String endpoint0(Map opts, Map env) { def result = opts.endpoint as String if( !result || result=='-' ) - result = env.get('TOWER_API_ENDPOINT') ?: 'https://api.tower.nf' + result = env.get('TOWER_API_ENDPOINT') ?: 'https://api.cloud.seqera.io' return result.stripEnd('/') } From 56d7ecbd7a4efd57d38eba483c2922d3ef5fe111 Mon Sep 17 00:00:00 2001 From: Paolo Di Tommaso Date: Wed, 27 Mar 2024 15:47:51 +0100 Subject: [PATCH 5/6] Remove endpoint endforcement [ci fast] Signed-off-by: Paolo Di Tommaso --- .../nf-tower/src/main/io/seqera/tower/plugin/TowerClient.groovy | 1 - .../src/test/io/seqera/tower/plugin/TowerClientTest.groovy | 1 - 2 files changed, 2 deletions(-) diff --git a/plugins/nf-tower/src/main/io/seqera/tower/plugin/TowerClient.groovy b/plugins/nf-tower/src/main/io/seqera/tower/plugin/TowerClient.groovy index d1e6a32368..d202420138 100644 --- a/plugins/nf-tower/src/main/io/seqera/tower/plugin/TowerClient.groovy +++ b/plugins/nf-tower/src/main/io/seqera/tower/plugin/TowerClient.groovy @@ -215,7 +215,6 @@ class TowerClient implements TraceObserver { // report a warning for legacy endpoint if( url.contains('https://api.tower.nf') ) { log.warn "The endpoint `https://api.tower.nf` is deprecated - Please use `https://api.cloud.seqera.io` instead" - return DEF_ENDPOINT_URL } if( url =~ "^(https|http)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" ) { while( url.endsWith('/') ) diff --git a/plugins/nf-tower/src/test/io/seqera/tower/plugin/TowerClientTest.groovy b/plugins/nf-tower/src/test/io/seqera/tower/plugin/TowerClientTest.groovy index 3793333f1e..0c2764c368 100644 --- a/plugins/nf-tower/src/test/io/seqera/tower/plugin/TowerClientTest.groovy +++ b/plugins/nf-tower/src/test/io/seqera/tower/plugin/TowerClientTest.groovy @@ -129,7 +129,6 @@ class TowerClientTest extends Specification { observer.checkUrl('http://google.com:8080/foo/bar') == 'http://google.com:8080/foo/bar' observer.checkUrl('http://google.com:8080/foo/bar/') == 'http://google.com:8080/foo/bar' observer.checkUrl('http://google.com:8080/foo/bar///') == 'http://google.com:8080/foo/bar' - observer.checkUrl('https://api.tower.nf') == 'https://api.cloud.seqera.io' when: observer.checkUrl('ftp://localhost') From 80f776a382a8d851e3c027a5bbd1685c272f1245 Mon Sep 17 00:00:00 2001 From: Paolo Di Tommaso Date: Wed, 27 Mar 2024 16:17:31 +0100 Subject: [PATCH 6/6] Fix docs [ci skip] Signed-off-by: Paolo Di Tommaso --- docs/cli.md | 4 ++-- docs/config.md | 6 +++--- docs/google.md | 2 +- docs/plugins.md | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/cli.md b/docs/cli.md index b7f2435674..928d739e3b 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -1267,7 +1267,7 @@ The `run` command is used to execute a local pipeline script or remote pipeline : Create workflow execution timeline. `-with-tower` (`https://api.cloud.seqera.io`) -: Monitor workflow execution with [Seqera Platform](https://cloud.tower.nf/) (formerly Tower Cloud). +: Monitor workflow execution with [Seqera Platform](https://seqera.io/) (formerly Tower Cloud). `-with-trace` (`trace-.txt`) : Create workflow execution trace file. @@ -1331,7 +1331,7 @@ The `run` command is used to execute a local pipeline script or remote pipeline $ nextflow run main.nf -entry workflow_A ``` -- Execute a pipeline with integrated monitoring in [Seqera Platform](https://cloud.tower.nf). +- Execute a pipeline with integrated monitoring in [Seqera Platform](https://seqera.io). ```console $ nextflow run nextflow-io/hello -with-tower diff --git a/docs/config.md b/docs/config.md index fd254b953e..c0410435b1 100644 --- a/docs/config.md +++ b/docs/config.md @@ -1580,20 +1580,20 @@ The following settings are available: ### Scope `tower` -The `tower` scope controls the settings for the [Seqera Platform](https://tower.nf) (formerly Tower Cloud). +The `tower` scope controls the settings for the [Seqera Platform](https://seqera.io) (formerly Tower Cloud). The following settings are available: `tower.accessToken` : The unique access token specific to your account on an instance of Seqera Platform. - Your `accessToken` can be obtained from your Seqera Platform instance in the [Tokens page](https://tower.nf/tokens). + Your `accessToken` can be obtained from your Seqera Platform instance in the [Tokens page](https://cloud.seqera.io/tokens). `tower.enabled` : When `true` Nextflow sends the workflow tracing and execution metrics to Seqera Platform (default: `false`). `tower.endpoint` -: The endpoint of your Seqera Platform instance (default: `https://tower.nf`). +: The endpoint of your Seqera Platform instance (default: `https://api.cloud.seqera.io`). `tower.workspaceId` : The ID of the Seqera Platform workspace where the run should be added (default: the launching user personal workspace). diff --git a/docs/google.md b/docs/google.md index 74ecc5c346..0fc51b0ab9 100644 --- a/docs/google.md +++ b/docs/google.md @@ -236,7 +236,7 @@ process.scratch = false tower.accessToken = '' ``` -The [Seqera Platform](https://cloud.tower.nf) access token is optional, but it enables higher API rate limits for the {ref}`wave-page` service required by Fusion. +The [Seqera Platform](https://seqera.io) access token is optional, but it enables higher API rate limits for the {ref}`wave-page` service required by Fusion. By default, Fusion mounts a local SSD disk to the VM at `/tmp`, using a machine type that can attach local SSD disks. If you specify your own machine type or machine series, they should be able to attach local SSD disks, otherwise the job scheduling will fail. diff --git a/docs/plugins.md b/docs/plugins.md index bffd702b8c..e3213cc77f 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -16,7 +16,7 @@ The following functionalities are provided via plugin components, and they make - `nf-console`: Implement Nextflow [REPL console](https://www.nextflow.io/blog/2015/introducing-nextflow-console.html). - `nf-ga4gh`: Support [GA4GH APIs](https://www.ga4gh.org/). - `nf-google`: Support for Google Cloud. -- `nf-tower`: Support for [Seqera Platform](https://tower.nf) (formerly Tower Cloud). +- `nf-tower`: Support for [Seqera Platform](https://seqera.io) (formerly Tower Cloud). - `nf-wave`: Support for [Wave containers](https://seqera.io/wave/) service.