@@ -227,59 +227,64 @@ def test_ec2_volume_validator(mocker, boto3_stubber):
227
227
228
228
229
229
@pytest .mark .parametrize (
230
- "region, base_os, scheduler, expected_message, expected_warning " ,
230
+ "region, base_os, scheduler, expected_message" ,
231
231
[
232
232
# verify awsbatch supported regions
233
- ("ap-northeast-3" , "alinux" , "awsbatch" , "scheduler is not supported in the .* region" , None ),
234
- ("us-gov-east-1" , "alinux" , "awsbatch" , "scheduler is not supported in the .* region" , None ),
235
- ("us-gov-west-1" , "alinux" , "awsbatch" , "scheduler is not supported in the .* region" , None ),
236
- ("eu-west-1" , "alinux" , "awsbatch" , None , None ),
237
- ("us-east-1" , "alinux" , "awsbatch" , None , None ),
238
- ("eu-north-1" , "alinux" , "awsbatch" , None , None ),
239
- ("cn-north-1" , "alinux" , "awsbatch" , None , None ),
240
- ("cn-northwest-1" , "alinux" , "awsbatch" , None , None ),
241
- ("cn-northwest-1" , "alinux2" , "awsbatch" , None , None ),
233
+ ("ap-northeast-3" , "alinux" , "awsbatch" , "scheduler is not supported in the .* region" ),
234
+ ("us-gov-east-1" , "alinux" , "awsbatch" , "scheduler is not supported in the .* region" ),
235
+ ("us-gov-west-1" , "alinux" , "awsbatch" , "scheduler is not supported in the .* region" ),
236
+ ("eu-west-1" , "alinux" , "awsbatch" , None ),
237
+ ("us-east-1" , "alinux" , "awsbatch" , None ),
238
+ ("eu-north-1" , "alinux" , "awsbatch" , None ),
239
+ ("cn-north-1" , "alinux" , "awsbatch" , None ),
240
+ ("cn-northwest-1" , "alinux" , "awsbatch" , None ),
241
+ ("cn-northwest-1" , "alinux2" , "awsbatch" , None ),
242
242
# verify traditional schedulers are supported in all the regions
243
- ("cn-northwest-1" , "alinux" , "sge" , None , ".sge. is scheduled to be deprecated" ),
244
- ("ap-northeast-3" , "alinux" , "sge" , None , ".sge. is scheduled to be deprecated" ),
245
- ("cn-northwest-1" , "alinux" , "slurm" , None , None ),
246
- ("ap-northeast-3" , "alinux" , "slurm" , None , None ),
247
- ("cn-northwest-1" , "alinux" , "torque" , None , ".torque. is scheduled to be deprecated" ),
248
- ("ap-northeast-3" , "alinux" , "torque" , None , ".torque. is scheduled to be deprecated" ),
243
+ ("cn-northwest-1" , "alinux" , "sge" , None ),
244
+ ("ap-northeast-3" , "alinux" , "sge" , None ),
245
+ ("cn-northwest-1" , "alinux" , "slurm" , None ),
246
+ ("ap-northeast-3" , "alinux" , "slurm" , None ),
247
+ ("cn-northwest-1" , "alinux" , "torque" , None ),
248
+ ("ap-northeast-3" , "alinux" , "torque" , None ),
249
249
# verify awsbatch supported OSes
250
- ("eu-west-1" , "centos6" , "awsbatch" , "scheduler supports the following Operating Systems" , None ),
251
- ("eu-west-1" , "centos7" , "awsbatch" , "scheduler supports the following Operating Systems" , None ),
252
- ("eu-west-1" , "ubuntu1604" , "awsbatch" , "scheduler supports the following Operating Systems" , None ),
253
- ("eu-west-1" , "ubuntu1804" , "awsbatch" , "scheduler supports the following Operating Systems" , None ),
254
- ("eu-west-1" , "alinux" , "awsbatch" , None , None ),
255
- ("eu-west-1" , "alinux2" , "awsbatch" , None , None ),
250
+ ("eu-west-1" , "centos6" , "awsbatch" , "scheduler supports the following Operating Systems" ),
251
+ ("eu-west-1" , "centos7" , "awsbatch" , "scheduler supports the following Operating Systems" ),
252
+ ("eu-west-1" , "ubuntu1604" , "awsbatch" , "scheduler supports the following Operating Systems" ),
253
+ ("eu-west-1" , "ubuntu1804" , "awsbatch" , "scheduler supports the following Operating Systems" ),
254
+ ("eu-west-1" , "alinux" , "awsbatch" , None ),
255
+ ("eu-west-1" , "alinux2" , "awsbatch" , None ),
256
256
# verify sge supports all the OSes
257
- ("eu-west-1" , "centos6" , "sge" , None , ".sge. is scheduled to be deprecated" ),
258
- ("eu-west-1" , "centos7" , "sge" , None , ".sge. is scheduled to be deprecated" ),
259
- ("eu-west-1" , "ubuntu1604" , "sge" , None , ".sge. is scheduled to be deprecated" ),
260
- ("eu-west-1" , "ubuntu1804" , "sge" , None , ".sge. is scheduled to be deprecated" ),
261
- ("eu-west-1" , "alinux" , "sge" , None , ".sge. is scheduled to be deprecated" ),
262
- ("eu-west-1" , "alinux2" , "sge" , None , ".sge. is scheduled to be deprecated" ),
257
+ ("eu-west-1" , "centos6" , "sge" , None ),
258
+ ("eu-west-1" , "centos7" , "sge" , None ),
259
+ ("eu-west-1" , "ubuntu1604" , "sge" , None ),
260
+ ("eu-west-1" , "ubuntu1804" , "sge" , None ),
261
+ ("eu-west-1" , "alinux" , "sge" , None ),
262
+ ("eu-west-1" , "alinux2" , "sge" , None ),
263
263
# verify slurm supports all the OSes
264
- ("eu-west-1" , "centos6" , "slurm" , None , None ),
265
- ("eu-west-1" , "centos7" , "slurm" , None , None ),
266
- ("eu-west-1" , "ubuntu1604" , "slurm" , None , None ),
267
- ("eu-west-1" , "ubuntu1804" , "slurm" , None , None ),
268
- ("eu-west-1" , "alinux" , "slurm" , None , None ),
269
- ("eu-west-1" , "alinux2" , "slurm" , None , None ),
264
+ ("eu-west-1" , "centos6" , "slurm" , None ),
265
+ ("eu-west-1" , "centos7" , "slurm" , None ),
266
+ ("eu-west-1" , "ubuntu1604" , "slurm" , None ),
267
+ ("eu-west-1" , "ubuntu1804" , "slurm" , None ),
268
+ ("eu-west-1" , "alinux" , "slurm" , None ),
269
+ ("eu-west-1" , "alinux2" , "slurm" , None ),
270
270
# verify torque supports all the OSes
271
- ("eu-west-1" , "centos6" , "torque" , None , ".torque. is scheduled to be deprecated" ),
272
- ("eu-west-1" , "centos7" , "torque" , None , ".torque. is scheduled to be deprecated" ),
273
- ("eu-west-1" , "ubuntu1604" , "torque" , None , ".torque. is scheduled to be deprecated" ),
274
- ("eu-west-1" , "ubuntu1804" , "torque" , None , ".torque. is scheduled to be deprecated" ),
275
- ("eu-west-1" , "alinux" , "torque" , None , ".torque. is scheduled to be deprecated" ),
276
- ("eu-west-1" , "alinux2" , "torque" , None , ".torque. is scheduled to be deprecated" ),
271
+ ("eu-west-1" , "centos6" , "torque" , None ),
272
+ ("eu-west-1" , "centos7" , "torque" , None ),
273
+ ("eu-west-1" , "ubuntu1604" , "torque" , None ),
274
+ ("eu-west-1" , "ubuntu1804" , "torque" , None ),
275
+ ("eu-west-1" , "alinux" , "torque" , None ),
276
+ ("eu-west-1" , "alinux2" , "torque" , None ),
277
277
],
278
278
)
279
- def test_scheduler_validator (mocker , capsys , region , base_os , scheduler , expected_message , expected_warning ):
279
+ def test_scheduler_validator (mocker , capsys , region , base_os , scheduler , expected_message ):
280
280
# we need to set the region in the environment because it takes precedence respect of the config file
281
281
os .environ ["AWS_DEFAULT_REGION" ] = region
282
282
config_parser_dict = {"cluster default" : {"base_os" : base_os , "scheduler" : scheduler }}
283
+ # Deprecation warning should be printed for sge and torque
284
+ expected_warning = None
285
+ wiki_url = "https://github.com/aws/aws-parallelcluster/wiki/Deprecation-of-SGE-and-Torque-in-ParallelCluster"
286
+ if scheduler in ["sge" , "torque" ]:
287
+ expected_warning = ".{0}. is scheduled to be deprecated.*{1}" .format (scheduler , wiki_url )
283
288
utils .assert_param_validator (mocker , config_parser_dict , expected_message , capsys , expected_warning )
284
289
285
290
0 commit comments