Skip to content

Commit 841d0c0

Browse files
author
David Shiga
authored
Use v4.0.0 of hca cli, boost number of allowed redirects, and parameterize pipeline tools docker image version (838). (#56)
1 parent 87ad1b6 commit 841d0c0

File tree

6 files changed

+44
-20
lines changed

6 files changed

+44
-20
lines changed

adapter_pipelines/Optimus/adapter.wdl

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ task GetInputs {
88
String dss_url
99
Int retry_seconds
1010
Int timeout_seconds
11+
String pipeline_tools_version
1112

1213
command <<<
1314
# Force the binary layer of the stdout and stderr streams to be unbuffered.
@@ -24,7 +25,7 @@ task GetInputs {
2425
CODE
2526
>>>
2627
runtime {
27-
docker: "quay.io/humancellatlas/secondary-analysis-pipeline-tools:v0.21.0"
28+
docker: "quay.io/humancellatlas/secondary-analysis-pipeline-tools:" + pipeline_tools_version
2829
}
2930
output {
3031
String sample_id = read_string("inputs.tsv")
@@ -35,6 +36,7 @@ task GetInputs {
3536
task inputs_for_submit {
3637
Array[Array[File]] fastq_inputs
3738
Array[Object] other_inputs
39+
String pipeline_tools_version
3840

3941
command <<<
4042
# Force the binary layer of the stdout and stderr streams to be unbuffered.
@@ -66,7 +68,7 @@ task inputs_for_submit {
6668
>>>
6769

6870
runtime {
69-
docker: "quay.io/humancellatlas/secondary-analysis-pipeline-tools:v0.21.0"
71+
docker: "quay.io/humancellatlas/secondary-analysis-pipeline-tools:" + pipeline_tools_version
7072
}
7173

7274
output {
@@ -79,6 +81,7 @@ task outputs_for_submit {
7981
Array[Array[File]] umi_metrics
8082
Array[Array[File]] duplicate_metrics
8183
Array[File] other_outputs
84+
String pipeline_tools_version
8285

8386
command <<<
8487
# Force the binary layer of the stdout and stderr streams to be unbuffered.
@@ -106,7 +109,7 @@ task outputs_for_submit {
106109
>>>
107110

108111
runtime {
109-
docker: "quay.io/humancellatlas/secondary-analysis-pipeline-tools:v0.21.0"
112+
docker: "quay.io/humancellatlas/secondary-analysis-pipeline-tools:" + pipeline_tools_version
110113
}
111114

112115
output {
@@ -139,14 +142,16 @@ workflow AdapterOptimus {
139142

140143
# Set runtime environment such as "dev" or "staging" or "prod" so submit task could choose proper docker image to use
141144
String runtime_environment
145+
String pipeline_tools_version = "v0.22.0"
142146

143147
call GetInputs as prep {
144148
input:
145149
bundle_uuid = bundle_uuid,
146150
bundle_version = bundle_version,
147151
dss_url = dss_url,
148152
retry_seconds = retry_seconds,
149-
timeout_seconds = timeout_seconds
153+
timeout_seconds = timeout_seconds,
154+
pipeline_tools_version = pipeline_tools_version
150155
}
151156
152157
call Optimus.Optimus as analysis {
@@ -184,7 +189,8 @@ workflow AdapterOptimus {
184189
"name": "ref_genome_fasta",
185190
"value": ref_genome_fasta
186191
}
187-
]
192+
],
193+
pipeline_tools_version = pipeline_tools_version
188194
}
189195

190196
call outputs_for_submit {
@@ -197,7 +203,8 @@ workflow AdapterOptimus {
197203
analysis.matrix,
198204
analysis.matrix_summary,
199205
analysis.picard_metrics
200-
]
206+
],
207+
pipeline_tools_version = pipeline_tools_version
201208
}
202209
203210
Array[Object] inputs = read_objects(inputs_for_submit.inputs)
@@ -217,6 +224,7 @@ workflow AdapterOptimus {
217224
retry_seconds = retry_seconds,
218225
timeout_seconds = timeout_seconds,
219226
runtime_environment = runtime_environment,
220-
use_caas = use_caas
227+
use_caas = use_caas,
228+
pipeline_tools_version = pipeline_tools_version
221229
}
222230
}

adapter_pipelines/ss2_single_sample/adapter.wdl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ task GetInputs {
1111
Int? retry_max_interval
1212
Int? individual_request_timeout
1313
Boolean record_http
14+
String pipeline_tools_version
1415

1516
command <<<
1617
export RECORD_HTTP_REQUESTS="${record_http}"
@@ -31,7 +32,7 @@ task GetInputs {
3132
CODE
3233
>>>
3334
runtime {
34-
docker: "quay.io/humancellatlas/secondary-analysis-pipeline-tools:v0.21.0"
35+
docker: "quay.io/humancellatlas/secondary-analysis-pipeline-tools:" + pipeline_tools_version
3536
}
3637
output {
3738
Array[File] http_requests = glob("request_*.txt")
@@ -78,6 +79,7 @@ workflow AdapterSmartSeq2SingleCell{
7879
Boolean record_http = false
7980

8081
Int max_cromwell_retries = 0
82+
String pipeline_tools_version = "v0.22.0"
8183

8284
call GetInputs as prep {
8385
input:
@@ -88,7 +90,8 @@ workflow AdapterSmartSeq2SingleCell{
8890
retry_max_interval = retry_max_interval,
8991
retry_timeout = retry_timeout,
9092
individual_request_timeout = individual_request_timeout,
91-
record_http = record_http
93+
record_http = record_http,
94+
pipeline_tools_version = pipeline_tools_version
9295
}
9396
9497
call ss2.SmartSeq2SingleCell as analysis {
@@ -217,6 +220,7 @@ workflow AdapterSmartSeq2SingleCell{
217220
individual_request_timeout = individual_request_timeout,
218221
runtime_environment = runtime_environment,
219222
use_caas = use_caas,
220-
record_http = record_http
223+
record_http = record_http,
224+
pipeline_tools_version = pipeline_tools_version
221225
}
222226
}

adapter_pipelines/submit.wdl

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ task create_submission {
5656
Int? retry_timeout
5757
Int? individual_request_timeout
5858
Boolean record_http
59+
String pipeline_tools_version
5960

6061
command <<<
6162
export RECORD_HTTP_REQUESTS="${record_http}"
@@ -93,7 +94,7 @@ task create_submission {
9394
>>>
9495

9596
runtime {
96-
docker: "quay.io/humancellatlas/secondary-analysis-pipeline-tools:v0.21.0"
97+
docker: "quay.io/humancellatlas/secondary-analysis-pipeline-tools:" + pipeline_tools_version
9798
}
9899
output {
99100
File analysis_json = "analysis.json"
@@ -116,6 +117,7 @@ task stage_files {
116117
String lb = "{"
117118
String rb = "}"
118119
Boolean record_http
120+
String pipeline_tools_version
119121

120122
command <<<
121123
set -e
@@ -147,7 +149,7 @@ task stage_files {
147149
>>>
148150

149151
runtime {
150-
docker: "quay.io/humancellatlas/secondary-analysis-pipeline-tools:v0.21.0"
152+
docker: "quay.io/humancellatlas/secondary-analysis-pipeline-tools:" + pipeline_tools_version
151153
}
152154
output {
153155
Array[File] http_requests = glob("request_*.txt")
@@ -167,6 +169,7 @@ task confirm_submission {
167169
Int? retry_timeout
168170
Int? individual_request_timeout
169171
Boolean record_http
172+
String pipeline_tools_version
170173

171174
command <<<
172175
set -e
@@ -186,7 +189,7 @@ task confirm_submission {
186189
>>>
187190

188191
runtime {
189-
docker: "quay.io/humancellatlas/secondary-analysis-pipeline-tools:v0.21.0"
192+
docker: "quay.io/humancellatlas/secondary-analysis-pipeline-tools:" + pipeline_tools_version
190193
}
191194

192195
output {
@@ -214,6 +217,7 @@ workflow submit {
214217
Boolean use_caas
215218
# By default, don't record http requests
216219
Boolean record_http = false
220+
String pipeline_tools_version
217221

218222
call get_metadata {
219223
input:
@@ -245,7 +249,8 @@ workflow submit {
245249
individual_request_timeout = individual_request_timeout,
246250
retry_multiplier = retry_multiplier,
247251
retry_max_interval = retry_max_interval,
248-
record_http = record_http
252+
record_http = record_http,
253+
pipeline_tools_version = pipeline_tools_version
249254
}
250255
251256
call stage_files {
@@ -256,7 +261,8 @@ workflow submit {
256261
individual_request_timeout = individual_request_timeout,
257262
retry_multiplier = retry_multiplier,
258263
retry_max_interval = retry_max_interval,
259-
record_http = record_http
264+
record_http = record_http,
265+
pipeline_tools_version = pipeline_tools_version
260266
}
261267
262268
call confirm_submission {
@@ -267,7 +273,8 @@ workflow submit {
267273
individual_request_timeout = individual_request_timeout,
268274
retry_multiplier = retry_multiplier,
269275
retry_max_interval = retry_max_interval,
270-
record_http = record_http
276+
record_http = record_http,
277+
pipeline_tools_version = pipeline_tools_version
271278
}
272279
273280
output {

adapter_pipelines/submit_stub/submit.wdl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ workflow submit {
2727
Int? individual_request_timeout
2828
# By default, don't record http requests
2929
Boolean record_http = false
30+
String pipeline_tools_version
3031

3132
call submit_stub
3233

pipeline_tools/http_requests.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,12 +234,16 @@ def _http_request(self, *args, **kwargs):
234234

235235
@staticmethod
236236
def _get_method(http_method):
237+
session = requests.Session()
238+
# The default max_redirects is 30. We need to boost it because DSS sometimes redirects us more than 30 times,
239+
# which causes an error if we don't allow for more.
240+
session.max_redirects = 100
237241
if http_method == 'get':
238-
fn = requests.get
242+
fn = session.get
239243
elif http_method == 'put':
240-
fn = requests.put
244+
fn = session.put
241245
elif http_method == 'post':
242-
fn = requests.post
246+
fn = session.post
243247
else:
244248
raise NotImplementedError('Only get, put, and post are implemented.')
245249
return fn

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
install_requires=[
1313
'cromwell-tools',
1414
'google-cloud-storage>=1.8.0',
15-
'hca>=3.5.0',
15+
'hca>=4.0.0',
1616
'mock>=2.0.0',
1717
'requests>=2.18.4',
1818
'requests-mock>=1.4.0',

0 commit comments

Comments
 (0)