@@ -71,6 +71,7 @@ class TestDeploymentsCreate(object):
71
71
"--name" , "some_name" ,
72
72
"--machineType" , "G1" ,
73
73
"--imageUrl" , "https://www.latlmes.com/breaking/paperspace-now-has-a-100-bilion-valuation" ,
74
+ "--clusterId" , "some_cluster_id" ,
74
75
"--instanceCount" , "666" ,
75
76
]
76
77
BASIC_OPTIONS_COMMAND_WITH_CURRENT_DIR_AS_WORKSPACE = [
@@ -80,6 +81,7 @@ class TestDeploymentsCreate(object):
80
81
"--name" , "some_name" ,
81
82
"--machineType" , "G1" ,
82
83
"--imageUrl" , "https://www.latlmes.com/breaking/paperspace-now-has-a-100-bilion-valuation" ,
84
+ "--clusterId" , "some_cluster_id" ,
83
85
"--instanceCount" , "666" ,
84
86
"--workspace" , "." ,
85
87
]
@@ -90,6 +92,7 @@ class TestDeploymentsCreate(object):
90
92
"--name" , "some_name" ,
91
93
"--machineType" , "G1" ,
92
94
"--imageUrl" , "https://www.latlmes.com/breaking/paperspace-now-has-a-100-bilion-valuation" ,
95
+ "--clusterId" , "some_cluster_id" ,
93
96
"--instanceCount" , "666" ,
94
97
"--tag" , "test0" ,
95
98
"--tag" , "test1" ,
@@ -112,6 +115,7 @@ class TestDeploymentsCreate(object):
112
115
"--name" , "some_name" ,
113
116
"--machineType" , "G1" ,
114
117
"--imageUrl" , "https://www.latlmes.com/breaking/paperspace-now-has-a-100-bilion-valuation" ,
118
+ "--clusterId" , "some_cluster_id" ,
115
119
"--instanceCount" , "666" ,
116
120
"--apiKey" , "some_key" ,
117
121
]
@@ -153,6 +157,7 @@ class TestDeploymentsCreate(object):
153
157
"--machineType" , "G1" ,
154
158
"--imageUrl" , "https://www.latlmes.com/breaking/paperspace-now-has-a-100-bilion-valuation" ,
155
159
"--instanceCount" , "666" ,
160
+ "--clusterId" , "some_cluster_id" ,
156
161
"--minInstanceCount" , "4" ,
157
162
"--maxInstanceCount" , "64" ,
158
163
"--scaleCooldownPeriod" , "123" ,
@@ -165,6 +170,7 @@ class TestDeploymentsCreate(object):
165
170
"machineType" : u"G1" ,
166
171
"name" : u"some_name" ,
167
172
"imageUrl" : u"https://www.latlmes.com/breaking/paperspace-now-has-a-100-bilion-valuation" ,
173
+ "cluster" : "some_cluster_id" ,
168
174
"deploymentType" : "TFServing" ,
169
175
"instanceCount" : 666 ,
170
176
"modelId" : u"some_model_id" ,
@@ -217,6 +223,7 @@ class TestDeploymentsCreate(object):
217
223
"deploymentType" : "TFServing" ,
218
224
"instanceCount" : 666 ,
219
225
"modelId" : u"some_model_id" ,
226
+ "cluster" : "some_cluster_id" ,
220
227
"autoscaling" : {
221
228
"minInstanceCount" : 4 ,
222
229
"maxInstanceCount" : 64 ,
@@ -266,7 +273,7 @@ def test_should_send_proper_data_and_print_message_when_create_deployment_with_b
266
273
result = runner .invoke (cli .cli , self .BASIC_OPTIONS_COMMAND )
267
274
268
275
assert result .output == self .EXPECTED_STDOUT , result .exc_info
269
- post_patched .assert_called_once_with (self .URL ,
276
+ post_patched .assert_called_once_with (self .URL_V2 ,
270
277
headers = EXPECTED_HEADERS ,
271
278
json = self .BASIC_OPTIONS_REQUEST ,
272
279
params = None ,
@@ -334,10 +341,11 @@ def test_should_send_proper_data_and_print_message_when_create_deployment_with_z
334
341
params = {
335
342
"contentType" : content_type ,
336
343
"fileName" : archive_name ,
344
+ "clusterHandle" : 'some_cluster_id' ,
337
345
})
338
346
]
339
347
)
340
- post_patched .assert_called_once_with (self .URL ,
348
+ post_patched .assert_called_once_with (self .URL_V2 ,
341
349
headers = EXPECTED_HEADERS ,
342
350
json = post_params ,
343
351
params = None ,
@@ -360,7 +368,7 @@ def test_should_send_proper_data_and_print_message_when_create_deployment_with_w
360
368
archive_location = '/temp_foo'
361
369
archive_name = "workspace.zip"
362
370
uuid = 111
363
- content_type = "application/zip"
371
+ content_type = "application/zip" ,
364
372
presigned_url = "https://{bucket_name}.s3.amazonaws.com/{team_handle}/deployments/{uuid}/{archive_name}?AWSAccessKeyId=AWSKEY&Content-Type={content_type}&Expires=0&Signature=bar" .format (
365
373
bucket_name = bucket_name ,
366
374
team_handle = team_handle ,
@@ -401,12 +409,13 @@ def test_should_send_proper_data_and_print_message_when_create_deployment_with_w
401
409
headers = EXPECTED_HEADERS ,
402
410
json = None ,
403
411
params = {
404
- "contentType" : content_type ,
412
+ "contentType" : 'application/zip' ,
405
413
"fileName" : archive_name ,
414
+ "clusterHandle" : 'some_cluster_id' ,
406
415
})
407
416
]
408
417
)
409
- post_patched .assert_called_once_with (self .URL ,
418
+ post_patched .assert_called_once_with (self .URL_V2 ,
410
419
headers = EXPECTED_HEADERS ,
411
420
json = post_params ,
412
421
params = None ,
@@ -457,7 +466,7 @@ def test_should_send_different_api_key_when_api_key_parameter_was_used(self, pos
457
466
result = runner .invoke (cli .cli , self .BASIC_OPTIONS_COMMAND_WITH_API_KEY )
458
467
459
468
assert result .output == self .EXPECTED_STDOUT , result .exc_info
460
- post_patched .assert_called_once_with (self .URL ,
469
+ post_patched .assert_called_once_with (self .URL_V2 ,
461
470
headers = EXPECTED_HEADERS_WITH_CHANGED_API_KEY ,
462
471
json = self .BASIC_OPTIONS_REQUEST ,
463
472
params = None ,
@@ -490,7 +499,7 @@ def test_should_send_proper_data_and_print_message_when_create_wrong_model_id_wa
490
499
runner = CliRunner ()
491
500
result = runner .invoke (cli .cli , self .BASIC_OPTIONS_COMMAND )
492
501
493
- post_patched .assert_called_once_with (self .URL ,
502
+ post_patched .assert_called_once_with (self .URL_V2 ,
494
503
headers = EXPECTED_HEADERS ,
495
504
json = self .BASIC_OPTIONS_REQUEST ,
496
505
params = None ,
@@ -511,7 +520,7 @@ def test_should_send_proper_data_and_tag_deployment(self, post_patched, get_patc
511
520
result = runner .invoke (cli .cli , self .BASIC_OPTIONS_COMMAND_WITH_TAGS )
512
521
513
522
assert result .output == self .EXPECTED_STDOUT , result .exc_info
514
- post_patched .assert_called_once_with (self .URL ,
523
+ post_patched .assert_called_once_with (self .URL_V2 ,
515
524
headers = EXPECTED_HEADERS ,
516
525
json = self .BASIC_OPTIONS_REQUEST ,
517
526
params = None ,
@@ -536,7 +545,7 @@ def test_should_send_autoscaling_options_with_metric_and_resource_requirements(s
536
545
result = runner .invoke (cli .cli , self .BASIC_OPTIONS_COMMAND_WITH_AUTOSCALING )
537
546
538
547
assert result .output == self .EXPECTED_STDOUT , result .exc_info
539
- post_patched .assert_called_once_with (self .URL ,
548
+ post_patched .assert_called_once_with (self .URL_V2 ,
540
549
headers = EXPECTED_HEADERS ,
541
550
json = self .BASIC_OPTIONS_COMMAND_WITH_AUTOSCALING_REQUEST ,
542
551
params = None ,
0 commit comments