Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add streamable to TES input #244

Merged
merged 2 commits into from
Jun 6, 2023
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
14 changes: 14 additions & 0 deletions src/Tes/Models/TesInput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ public TesInput()
[DataMember(Name = "content")]
public string Content { get; set; }

/// <summary>
/// Indicates that the file should not be downloaded
/// https://github.com/ga4gh/task-execution-schemas/blob/1df37d34242f74d3f03475c6b9de3324b8094054/openapi/task_execution_service.openapi.yaml#L481
/// </summary>
[DataMember(Name = "streamable")]
public bool Streamable { get; set; }

/// <summary>
/// Returns the string presentation of the object
/// </summary>
Expand All @@ -80,6 +87,7 @@ public override string ToString()
.Append(" Path: ").Append(Path).Append('\n')
.Append(" Type: ").Append(Type).Append('\n')
.Append(" Content: ").Append(Content).Append('\n')
.Append(" Streamable: ").Append(Streamable).Append('\n')
.Append("}\n")
.ToString();

Expand Down Expand Up @@ -142,6 +150,9 @@ Path is not null &&
Content == other.Content ||
Content is not null &&
Content.Equals(other.Content)
) &&
(
Streamable.Equals(other.Streamable)
),
};

Expand Down Expand Up @@ -176,11 +187,14 @@ public override int GetHashCode()
}

hashCode = hashCode * 59 + Type.GetHashCode();

if (Content is not null)
{
hashCode = hashCode * 59 + Content.GetHashCode();
}

hashCode = hashCode * 59 + Streamable.GetHashCode();

return hashCode;
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/TesApi.Tests/expectedBasicJsonResult.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"description": "string",
"url": "string",
"path": "string",
"type": "FILE"
"type": "FILE",
"streamable": false
}
],
"outputs": [
Expand Down
3 changes: 2 additions & 1 deletion src/TesApi.Tests/expectedFullJsonResult.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"url": "string",
"path": "string",
"type": "FILE",
"content": "string"
"content": "string",
"streamable": false
}
],
"outputs": [
Expand Down
1 change: 1 addition & 0 deletions src/TesApi.Web/BatchScheduler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -994,6 +994,7 @@ private async Task<CloudTask> ConvertTesTaskToBatchTaskAsync(string taskId, TesT
var filesToDownload = await Task.WhenAll(
inputFiles
.Except(drsInputFiles) // do not attempt to download DRS input files since the cromwell-drs-localizer will
.Where(f => f?.Streamable == false) // Don't download files where localization_optional is set to true in WDL (corresponds to "Streamable" property being true on TesInput)
.Union(additionalInputFiles)
.Select(async f => await GetTesInputFileUrlAsync(f, task, queryStringsToRemoveFromLocalFilePaths, cancellationToken)));

Expand Down