Skip to content

Commit

Permalink
Launch with optimization turned off (#424)
Browse files Browse the repository at this point in the history
* add missing workflow query attribute to properly retrieve labels

* retrieve optimization status along with workflow labels

* omit optimization data if flag is set

* update tests with optimization data

* test for disabling optimization

* update reflection files

* manually fix missing method in reflection file

* fix: missing query param in test
  • Loading branch information
JaimeSeqLabs authored Jul 22, 2024
1 parent 7354447 commit 7260a40
Show file tree
Hide file tree
Showing 7 changed files with 274 additions and 38 deletions.
8 changes: 5 additions & 3 deletions conf/reflect-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2825,7 +2825,8 @@
{
"name":"io.seqera.tower.model.PipelineOptimizationStatus",
"allDeclaredFields":true,
"queryAllDeclaredMethods":true
"queryAllDeclaredMethods":true,
"methods":[{"name":"<init>","parameterTypes":["java.lang.String"] }, {"name":"fromValue","parameterTypes":["java.lang.String"] }]
},
{
"name":"io.seqera.tower.model.PipelineSecret",
Expand Down Expand Up @@ -2896,13 +2897,14 @@
"allDeclaredFields":true,
"allDeclaredMethods":true,
"allDeclaredConstructors":true,
"methods":[{"name":"<init>","parameterTypes":[] }]
"methods":[{"name":"<init>","parameterTypes":[] }, {"name":"getLaunch","parameterTypes":[] }]
},
{
"name":"io.seqera.tower.model.SubmitWorkflowLaunchResponse",
"allDeclaredFields":true,
"allDeclaredMethods":true,
"allDeclaredConstructors":true
"allDeclaredConstructors":true,
"methods":[{"name":"<init>","parameterTypes":[] }, {"name":"setWorkflowId","parameterTypes":["java.lang.String"] }]
},
{
"name":"io.seqera.tower.model.Task",
Expand Down
7 changes: 5 additions & 2 deletions src/main/java/io/seqera/tower/cli/commands/LaunchCmd.java
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ private WorkflowLaunchRequest updateLaunchRequest(WorkflowLaunchRequest base) th
.schemaName(coalesce(adv().schemaName, base.getSchemaName()))
.pullLatest(coalesce(adv().pullLatest, base.getPullLatest()))
.stubRun(coalesce(adv().stubRun, base.getStubRun()))
.optimizationId(base.getOptimizationId())
.optimizationTargets(base.getOptimizationTargets())
.optimizationId(coalesce(adv().disableOptimization, false) ? null : base.getOptimizationId())
.optimizationTargets(coalesce(adv().disableOptimization, false) ? null : base.getOptimizationTargets())
.labelIds(base.getLabelIds())
.headJobCpus(base.getHeadJobCpus())
.headJobMemoryMb(base.getHeadJobMemoryMb());
Expand Down Expand Up @@ -373,6 +373,9 @@ public static class AdvancedOptions {
@Option(names = {"--workspace-secrets"}, split = ",", description = "Pipeline Secrets required by the pipeline execution. Those secrets must be defined in the launching workspace.")
public List<String> workspaceSecrets;

@Option(names = {"--disable-optimization"}, description = "Turn off the optimization for the pipeline before launching.")
public Boolean disableOptimization;

}

}
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/io/seqera/tower/cli/commands/runs/DumpCmd.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ private String collectWorkflowInfo(Long workspaceId) throws IOException, ApiExce
private String collectWorkflowMetadata(Long workspaceId) throws IOException, ApiException {
progress.println(ansi("- Workflow metadata"));

// Workflow metadata aggregates
// Workflow metadata aggregates including:
// + labels
// + optimization status

var workflowDesc = getWorkflowDescription(workspaceId);
var workflowLaunchDesc = getWorkflowLaunchDescription(workspaceId);
Expand Down Expand Up @@ -286,7 +288,7 @@ private void addTaskLog(TarFileHelper.TarFileAppender tar, Long taskId, String l

private DescribeWorkflowResponse getWorkflowDescription(Long workspaceId) throws ApiException {
if (this.workflowDescription == null) {
this.workflowDescription = workflowById(workspaceId, id, List.of(WorkflowQueryAttribute.LABELS));
this.workflowDescription = workflowById(workspaceId, id, List.of(WorkflowQueryAttribute.LABELS, WorkflowQueryAttribute.OPTIMIZED));
}
return this.workflowDescription;
}
Expand Down
Loading

0 comments on commit 7260a40

Please sign in to comment.