diff --git a/src/Tes/Models/TesInput.cs b/src/Tes/Models/TesInput.cs index 4bfdb3860..d9e23cbd6 100644 --- a/src/Tes/Models/TesInput.cs +++ b/src/Tes/Models/TesInput.cs @@ -67,6 +67,13 @@ public TesInput() [DataMember(Name = "content")] public string Content { get; set; } + /// + /// Indicates that the file should not be downloaded + /// https://github.com/ga4gh/task-execution-schemas/blob/1df37d34242f74d3f03475c6b9de3324b8094054/openapi/task_execution_service.openapi.yaml#L481 + /// + [DataMember(Name = "streamable")] + public bool Streamable { get; set; } + /// /// Returns the string presentation of the object /// @@ -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(); @@ -142,6 +150,9 @@ Path is not null && Content == other.Content || Content is not null && Content.Equals(other.Content) + ) && + ( + Streamable.Equals(other.Streamable) ), }; @@ -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; } } diff --git a/src/TesApi.Tests/expectedBasicJsonResult.json b/src/TesApi.Tests/expectedBasicJsonResult.json index 102cc89c8..b04baa93b 100644 --- a/src/TesApi.Tests/expectedBasicJsonResult.json +++ b/src/TesApi.Tests/expectedBasicJsonResult.json @@ -9,7 +9,8 @@ "description": "string", "url": "string", "path": "string", - "type": "FILE" + "type": "FILE", + "streamable": false } ], "outputs": [ diff --git a/src/TesApi.Tests/expectedFullJsonResult.json b/src/TesApi.Tests/expectedFullJsonResult.json index 01ff8db37..01991efbd 100644 --- a/src/TesApi.Tests/expectedFullJsonResult.json +++ b/src/TesApi.Tests/expectedFullJsonResult.json @@ -10,7 +10,8 @@ "url": "string", "path": "string", "type": "FILE", - "content": "string" + "content": "string", + "streamable": false } ], "outputs": [ diff --git a/src/TesApi.Web/BatchScheduler.cs b/src/TesApi.Web/BatchScheduler.cs index 953db6fc6..b2737d360 100644 --- a/src/TesApi.Web/BatchScheduler.cs +++ b/src/TesApi.Web/BatchScheduler.cs @@ -994,6 +994,7 @@ private async Task 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)));