Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -762,10 +762,10 @@ tw managed-identities credentials -o my-org -n hpc1 add -l my_linux_user -k ~/.s
- AWS Cloud: `--log-group`. Google Cloud: `--project-id`.
- HPC platforms: `--propagate-head-job-options`.
- Seqera Compute: `--data-retention-policy`.
- `tw launch`, `tw pipelines add|update`, `tw runs relaunch`, and `tw actions add|update`: `--tower-config`.
- `tw launch`, `tw pipelines add|update`, `tw runs relaunch`, and `tw actions add|update`: `--tower-config`. List the Nextflow and Fusion versions you can launch with `tw info versions` (`-c fusion` for Fusion).
- `tw runs star|unstar`, `tw runs view log [--next <cursor>]`, and `tw runs delete -i <id>,<id>`.
- `tw pipelines schema`: show a pipeline's parameter schema.
- `tw studios extend|rename-checkpoint`. `--mount-data-uris` also accepts a folder inside a data link.
- `tw studios star|unstar|extend|rename-checkpoint`. `--mount-data-uris` also accepts a folder inside a data link.
- `tw data-links delete-content|download-script`.
- `tw datasets add --url`, `tw datasets update --url`, and `tw datasets disable-version`.

Expand Down
40 changes: 40 additions & 0 deletions conf/reflect-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -1431,6 +1431,13 @@
"allDeclaredMethods":true,
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"name":"io.seqera.tower.cli.commands.info.VersionsCmd",
"queryAllDeclaredMethods":true,
"queryAllDeclaredConstructors":true,
"fields":[{"name":"component"}, {"name":"fusion"}, {"name":"nextflow"}],
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"name":"io.seqera.tower.cli.commands.labels.AbstractLabelsCmd",
"allDeclaredFields":true,
Expand Down Expand Up @@ -2183,6 +2190,13 @@
"fields":[{"name":"checkpointId"}, {"name":"newName"}, {"name":"studioRefOptions"}, {"name":"workspace"}],
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"name":"io.seqera.tower.cli.commands.studios.StarCmd",
"queryAllDeclaredMethods":true,
"queryAllDeclaredConstructors":true,
"fields":[{"name":"studioRefOptions"}, {"name":"workspace"}],
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"name":"io.seqera.tower.cli.commands.studios.StartCmd",
"allDeclaredFields":true,
Expand Down Expand Up @@ -2250,6 +2264,13 @@
"queryAllDeclaredMethods":true,
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"name":"io.seqera.tower.cli.commands.studios.UnstarCmd",
"queryAllDeclaredMethods":true,
"queryAllDeclaredConstructors":true,
"fields":[{"name":"studioRefOptions"}, {"name":"workspace"}],
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"name":"io.seqera.tower.cli.commands.studios.UpdateCmd",
"allDeclaredFields":true,
Expand Down Expand Up @@ -2426,6 +2447,19 @@
"allDeclaredConstructors":true,
"methods":[{"name":"<init>","parameterTypes":[] }, {"name":"setMessage","parameterTypes":["java.lang.String"] }]
},
{
"name":"io.seqera.tower.cli.responses.ComponentVersions",
"allDeclaredFields":true,
"queryAllDeclaredMethods":true,
"queryAllDeclaredConstructors":true
},
{
"name":"io.seqera.tower.cli.responses.ComponentVersions$ComponentVersion",
"allDeclaredFields":true,
"queryAllDeclaredMethods":true,
"queryAllDeclaredConstructors":true,
"methods":[{"name":"isDefault","parameterTypes":[] }, {"name":"version","parameterTypes":[] }]
},
{
"name":"io.seqera.tower.cli.responses.CredentialsAdded",
"allDeclaredFields":true,
Expand Down Expand Up @@ -3176,6 +3210,12 @@
"queryAllDeclaredMethods":true,
"queryAllDeclaredConstructors":true
},
{
"name":"io.seqera.tower.cli.responses.studios.StudioStarred",
"allDeclaredFields":true,
"queryAllDeclaredMethods":true,
"queryAllDeclaredConstructors":true
},
{
"name":"io.seqera.tower.cli.responses.studios.StudioStartSubmitted",
"allDeclaredFields":true,
Expand Down
12 changes: 12 additions & 0 deletions src/main/java/io/seqera/tower/cli/commands/AbstractApiCmd.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import io.seqera.tower.Pair;
import io.seqera.tower.api.ActionsApi;
import io.seqera.tower.api.AvatarsApi;
import io.seqera.tower.api.CompatibilityApi;
import io.seqera.tower.api.ComputeEnvsApi;
import io.seqera.tower.api.CredentialsApi;
import io.seqera.tower.api.DataLinksApi;
Expand All @@ -30,6 +31,7 @@
import io.seqera.tower.api.IdentitiesApi;
import io.seqera.tower.api.LabelsApi;
import io.seqera.tower.api.LaunchApi;
import io.seqera.tower.api.NextflowApi;
import io.seqera.tower.api.OrgsApi;
import io.seqera.tower.api.PipelineSchemasApi;
import io.seqera.tower.api.PipelineSecretsApi;
Expand Down Expand Up @@ -123,6 +125,7 @@ public abstract class AbstractApiCmd extends AbstractCmd {

private ActionsApi actionsApi;
private AvatarsApi avatarsApi;
private CompatibilityApi compatibilityApi;
private ComputeEnvsApi computeEnvsApi;
private CredentialsApi credentialsApi;
private DataLinksApi dataLinksApi;
Expand All @@ -131,6 +134,7 @@ public abstract class AbstractApiCmd extends AbstractCmd {
private IdentitiesApi identitiesApi;
private LabelsApi labelsApi;
private LaunchApi launchApi;
private NextflowApi nextflowApi;
private OrgsApi orgsApi;
private PipelinesApi pipelinesApi;
private PipelineSchemasApi pipelineSchemasApi;
Expand Down Expand Up @@ -213,6 +217,10 @@ protected AvatarsApi avatarsApi() throws ApiException {
return avatarsApi == null ? new AvatarsApi(apiClient()) : avatarsApi;
}

protected CompatibilityApi compatibilityApi() throws ApiException {
return compatibilityApi == null ? new CompatibilityApi(apiClient()) : compatibilityApi;
}

protected ComputeEnvsApi computeEnvsApi() throws ApiException {
return computeEnvsApi == null ? new ComputeEnvsApi(apiClient()) : computeEnvsApi;
}
Expand Down Expand Up @@ -245,6 +253,10 @@ protected LaunchApi launchApi() throws ApiException {
return launchApi == null ? new LaunchApi(apiClient()) : launchApi;
}

protected NextflowApi nextflowApi() throws ApiException {
return nextflowApi == null ? new NextflowApi(apiClient()) : nextflowApi;
}

protected OrgsApi orgsApi() throws ApiException {
return orgsApi == null ? new OrgsApi(apiClient()) : orgsApi;
}
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/io/seqera/tower/cli/commands/InfoCmd.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package io.seqera.tower.cli.commands;

import io.seqera.tower.ApiException;
import io.seqera.tower.cli.commands.info.VersionsCmd;
import io.seqera.tower.cli.exceptions.TowerException;
import io.seqera.tower.cli.responses.InfoResponse;
import io.seqera.tower.cli.responses.Response;
Expand All @@ -32,7 +33,10 @@

@CommandLine.Command(
name = "info",
description = "Show system info and health status"
description = "Show system info and health status",
subcommands = {
VersionsCmd.class,
}
)
public class InfoCmd extends AbstractRootCmd {
@Override
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/io/seqera/tower/cli/commands/StudiosCmd.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import io.seqera.tower.cli.commands.studios.DeleteCmd;
import io.seqera.tower.cli.commands.studios.ExtendCmd;
import io.seqera.tower.cli.commands.studios.RenameCheckpointCmd;
import io.seqera.tower.cli.commands.studios.StarCmd;
import io.seqera.tower.cli.commands.studios.UnstarCmd;
import io.seqera.tower.cli.commands.studios.ListCmd;
import io.seqera.tower.cli.commands.studios.AddAsNewCmd;
import io.seqera.tower.cli.commands.studios.StartCmd;
Expand All @@ -45,6 +47,8 @@
StopCmd.class,
UpdateCmd.class,
DeleteCmd.class,
StarCmd.class,
UnstarCmd.class,
ExtendCmd.class,
}
)
Expand Down
76 changes: 76 additions & 0 deletions src/main/java/io/seqera/tower/cli/commands/info/VersionsCmd.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/*
* Copyright 2021-2026, Seqera.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/


package io.seqera.tower.cli.commands.info;

import io.seqera.tower.ApiException;
import io.seqera.tower.cli.commands.AbstractApiCmd;
import io.seqera.tower.cli.exceptions.TowerException;
import io.seqera.tower.cli.responses.ComponentVersions;
import io.seqera.tower.cli.responses.ComponentVersions.ComponentVersion;
import io.seqera.tower.cli.responses.Response;
import io.seqera.tower.model.CatalogVersion;
import io.seqera.tower.model.CatalogVersionsResponse;
import io.seqera.tower.model.NextflowVersion;
import io.seqera.tower.model.NextflowVersionsResponse;
import picocli.CommandLine.Command;
import picocli.CommandLine.Option;

import java.util.List;
import java.util.Objects;

@Command(
name = "versions",
description = "List the Nextflow or Fusion versions available to launch with"
)
public class VersionsCmd extends AbstractApiCmd {

private static final String NEXTFLOW = "nextflow";

@Option(names = {"-c", "--component"}, description = "Component to list versions of: 'nextflow' or 'fusion'. Default: nextflow.", defaultValue = NEXTFLOW)
public String component;

@Option(names = {"--nextflow"}, description = "Only list versions compatible with these Nextflow versions. Comma-separated list.")
public String nextflow;

@Option(names = {"--fusion"}, description = "Only list versions compatible with these Fusion versions. Comma-separated list.")
public String fusion;

@Override
protected Response exec() throws ApiException {
NextflowVersionsResponse platformVersions = nextflowApi().nextflowVersions();

if (!Boolean.TRUE.equals(platformVersions.getCatalogEnabled())) {
// Without the compatibility catalog, Platform only knows its configured Nextflow versions.
if (!NEXTFLOW.equals(component) || nextflow != null || fusion != null) {
throw new TowerException("The component compatibility catalog is not enabled on this Platform: only Nextflow versions can be listed, without compatibility filters");
}
List<ComponentVersion> versions = Objects.requireNonNullElse(platformVersions.getNextflowVersions(), List.<NextflowVersion>of()).stream()
.map(v -> new ComponentVersion(v.getVersion(), Boolean.TRUE.equals(v.getDefault())))
.toList();
return new ComponentVersions(component, versions);
}

// Constrain the catalog to this Platform release, as the launch form does.
String platform = serviceInfoApi().info().getServiceInfo().getVersion();
CatalogVersionsResponse catalog = compatibilityApi().catalogComponentVersions(component, platform, nextflow, fusion, null, null);
List<ComponentVersion> versions = Objects.requireNonNullElse(catalog.getVersions(), List.<CatalogVersion>of()).stream()
.map(v -> new ComponentVersion(v.getVersion(), v.getVersion().equals(catalog.getDefaultVersion())))
.toList();
return new ComponentVersions(component, versions);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class NullableLaunchOptions {
@Option(names = {"--syntax-parser"}, description = "Nextflow language syntax parser version: 'v1' (legacy) or 'v2'. Takes precedence over the value stored in the launch configuration.")
public SyntaxParserEnum syntaxParser;

@Option(names = {"--nextflow-version"}, description = "Nextflow version to run the workflow with. Must exist in the Platform version catalog and meet the minimum required by the compute environment. Takes precedence over the value stored in the launch configuration.")
@Option(names = {"--nextflow-version"}, description = "Nextflow version to run the workflow with. Must exist in the Platform version catalog and meet the minimum required by the compute environment (see 'tw info versions'). Takes precedence over the value stored in the launch configuration.")
public String nextflowVersion;

@Option(names = {"--output-dir"}, description = "Per-run output directory, passed to Nextflow as '-output-dir'. Requires Nextflow 24.10.0 or later and the workflow outputs syntax. Takes precedence over the value stored in the launch configuration.")
Expand Down
46 changes: 46 additions & 0 deletions src/main/java/io/seqera/tower/cli/commands/studios/StarCmd.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* Copyright 2021-2026, Seqera.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.seqera.tower.cli.commands.studios;

import io.seqera.tower.ApiException;
import io.seqera.tower.cli.commands.global.WorkspaceOptionalOptions;
import io.seqera.tower.cli.responses.Response;
import io.seqera.tower.cli.responses.studios.StudioStarred;
import picocli.CommandLine;

@CommandLine.Command(
name = "star",
description = "Add a studio to your starred studios."
)
public class StarCmd extends AbstractStudiosCmd {

@CommandLine.Mixin
public WorkspaceOptionalOptions workspace;

@CommandLine.Mixin
public StudioRefOptions studioRefOptions;

@Override
protected Response exec() throws ApiException {
Long wspId = workspaceId(workspace.workspace);
String sessionId = getSessionId(studioRefOptions, wspId);

studiosApi().createDataStudioStar(sessionId, wspId);

return new StudioStarred(studioRefOptions.getStudioIdentifier(), workspaceRef(wspId), true);
}
}
46 changes: 46 additions & 0 deletions src/main/java/io/seqera/tower/cli/commands/studios/UnstarCmd.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* Copyright 2021-2026, Seqera.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.seqera.tower.cli.commands.studios;

import io.seqera.tower.ApiException;
import io.seqera.tower.cli.commands.global.WorkspaceOptionalOptions;
import io.seqera.tower.cli.responses.Response;
import io.seqera.tower.cli.responses.studios.StudioStarred;
import picocli.CommandLine;

@CommandLine.Command(
name = "unstar",
description = "Remove a studio from your starred studios."
)
public class UnstarCmd extends AbstractStudiosCmd {

@CommandLine.Mixin
public WorkspaceOptionalOptions workspace;

@CommandLine.Mixin
public StudioRefOptions studioRefOptions;

@Override
protected Response exec() throws ApiException {
Long wspId = workspaceId(workspace.workspace);
String sessionId = getSessionId(studioRefOptions, wspId);

studiosApi().deleteDataStudioStar(sessionId, wspId);

return new StudioStarred(studioRefOptions.getStudioIdentifier(), workspaceRef(wspId), false);
}
}
Loading
Loading