forked from aws/sagemaker-python-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_framework_model.py
More file actions
551 lines (482 loc) · 20.2 KB
/
test_framework_model.py
File metadata and controls
551 lines (482 loc) · 20.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
from __future__ import absolute_import
import os
import subprocess
from sagemaker.model import FrameworkModel
from sagemaker.predictor import Predictor
import pytest
from mock import MagicMock, Mock, patch
from sagemaker.session_settings import SessionSettings
MODEL_DATA = "s3://bucket/model.tar.gz"
MODEL_IMAGE = "mi"
ENTRY_POINT = "blah.py"
ROLE = "some-role"
DATA_DIR = os.path.join(os.path.dirname(__file__), "..", "data")
SCRIPT_NAME = "dummy_script.py"
SCRIPT_PATH = os.path.join(DATA_DIR, SCRIPT_NAME)
TIMESTAMP = "2017-10-10-14-14-15"
BUCKET_NAME = "mybucket"
INSTANCE_COUNT = 1
INSTANCE_TYPE = "c4.4xlarge"
REGION = "us-west-2"
MODEL_NAME = "{}-{}".format(MODEL_IMAGE, TIMESTAMP)
GIT_REPO = "https://github.com/aws/sagemaker-python-sdk.git"
BRANCH = "test-branch-git-config"
COMMIT = "ae15c9d7d5b97ea95ea451e4662ee43da3401d73"
PRIVATE_GIT_REPO_SSH = "git@github.com:testAccount/private-repo.git"
PRIVATE_GIT_REPO = "https://github.com/testAccount/private-repo.git"
PRIVATE_BRANCH = "test-branch"
PRIVATE_COMMIT = "329bfcf884482002c05ff7f44f62599ebc9f445a"
CODECOMMIT_REPO = "https://git-codecommit.us-west-2.amazonaws.com/v1/repos/test-repo/"
CODECOMMIT_REPO_SSH = "ssh://git-codecommit.us-west-2.amazonaws.com/v1/repos/test-repo/"
CODECOMMIT_BRANCH = "master"
REPO_DIR = "/tmp/repo_dir"
IMAGE_URI = "763104351884.dkr.ecr.us-west-2.amazonaws.com/pytorch-inference:1.9.0-gpu-py38"
class DummyFrameworkModel(FrameworkModel):
def __init__(self, sagemaker_session, **kwargs):
super(DummyFrameworkModel, self).__init__(
MODEL_DATA,
MODEL_IMAGE,
ROLE,
ENTRY_POINT,
sagemaker_session=sagemaker_session,
**kwargs,
)
def create_predictor(self, endpoint_name):
return Predictor(endpoint_name, sagemaker_session=self.sagemaker_session)
class DummyFrameworkModelForGit(FrameworkModel):
def __init__(self, sagemaker_session, entry_point, **kwargs):
super(DummyFrameworkModelForGit, self).__init__(
MODEL_DATA,
MODEL_IMAGE,
ROLE,
entry_point=entry_point,
sagemaker_session=sagemaker_session,
**kwargs,
)
def create_predictor(self, endpoint_name):
return Predictor(endpoint_name, sagemaker_session=self.sagemaker_session)
@pytest.fixture()
def sagemaker_session():
boto_mock = Mock(name="boto_session", region_name=REGION)
sms = Mock(
name="sagemaker_session",
boto_session=boto_mock,
boto_region_name=REGION,
config=None,
local_mode=False,
s3_client=None,
s3_resource=None,
settings=SessionSettings(),
default_bucket_prefix=None,
)
sms.default_bucket = Mock(name="default_bucket", return_value=BUCKET_NAME)
# For tests which doesn't verify config file injection, operate with empty config
sms.sagemaker_config = {}
return sms
@patch("shutil.rmtree", MagicMock())
@patch("tarfile.open", MagicMock())
@patch("os.listdir", MagicMock(return_value=["blah.py"]))
@patch("time.strftime", return_value=TIMESTAMP)
def test_prepare_container_def(time, sagemaker_session):
model = DummyFrameworkModel(sagemaker_session)
assert model.prepare_container_def(INSTANCE_TYPE) == {
"Environment": {
"SAGEMAKER_PROGRAM": ENTRY_POINT,
"SAGEMAKER_SUBMIT_DIRECTORY": "s3://mybucket/mi-2017-10-10-14-14-15/sourcedir.tar.gz",
"SAGEMAKER_CONTAINER_LOG_LEVEL": "20",
"SAGEMAKER_REGION": REGION,
},
"Image": MODEL_IMAGE,
"ModelDataUrl": MODEL_DATA,
}
@patch("shutil.rmtree", MagicMock())
@patch("tarfile.open", MagicMock())
@patch("os.listdir", MagicMock(return_value=["blah.py"]))
@patch("time.strftime", return_value=TIMESTAMP)
def test_prepare_container_def_with_network_isolation(time, sagemaker_session):
model = DummyFrameworkModel(sagemaker_session, enable_network_isolation=True)
assert model.prepare_container_def(INSTANCE_TYPE) == {
"Environment": {
"SAGEMAKER_PROGRAM": ENTRY_POINT,
"SAGEMAKER_SUBMIT_DIRECTORY": "/opt/ml/model/code",
"SAGEMAKER_CONTAINER_LOG_LEVEL": "20",
"SAGEMAKER_REGION": REGION,
},
"Image": MODEL_IMAGE,
"ModelDataUrl": MODEL_DATA,
}
@patch("shutil.rmtree", MagicMock())
@patch("tarfile.open", MagicMock())
@patch("os.path.exists", MagicMock(return_value=True))
@patch("os.path.isdir", MagicMock(return_value=True))
@patch("os.listdir", MagicMock(return_value=["blah.py"]))
@patch("time.strftime", MagicMock(return_value=TIMESTAMP))
def test_prepare_container_def_no_model_defaults(sagemaker_session, tmpdir):
model = DummyFrameworkModel(
sagemaker_session,
source_dir="sd",
env={"a": "a"},
name="name",
container_log_level=55,
code_location="s3://cb/cp",
)
assert model.prepare_container_def(INSTANCE_TYPE) == {
"Environment": {
"SAGEMAKER_PROGRAM": ENTRY_POINT,
"SAGEMAKER_SUBMIT_DIRECTORY": "s3://cb/cp/name/sourcedir.tar.gz",
"SAGEMAKER_CONTAINER_LOG_LEVEL": "55",
"SAGEMAKER_REGION": REGION,
"a": "a",
},
"Image": MODEL_IMAGE,
"ModelDataUrl": MODEL_DATA,
}
@patch("sagemaker.git_utils.git_clone_repo")
@patch("sagemaker.model.fw_utils.tar_and_upload_dir")
def test_git_support_succeed(tar_and_upload_dir, git_clone_repo, sagemaker_session):
git_clone_repo.side_effect = lambda gitconfig, entrypoint, sourcedir, dependency: {
"entry_point": "entry_point",
"source_dir": "/tmp/repo_dir/source_dir",
"dependencies": ["/tmp/repo_dir/foo", "/tmp/repo_dir/bar"],
}
entry_point = "entry_point"
source_dir = "source_dir"
dependencies = ["foo", "bar"]
git_config = {"repo": GIT_REPO, "branch": BRANCH, "commit": COMMIT}
model = DummyFrameworkModelForGit(
sagemaker_session=sagemaker_session,
entry_point=entry_point,
source_dir=source_dir,
dependencies=dependencies,
git_config=git_config,
)
model.prepare_container_def(instance_type=INSTANCE_TYPE)
git_clone_repo.assert_called_with(git_config, entry_point, source_dir, dependencies)
assert model.entry_point == "entry_point"
assert model.source_dir == "/tmp/repo_dir/source_dir"
assert model.dependencies == ["/tmp/repo_dir/foo", "/tmp/repo_dir/bar"]
def test_git_support_repo_not_provided(sagemaker_session):
entry_point = "source_dir/entry_point"
git_config = {"branch": BRANCH, "commit": COMMIT}
with pytest.raises(ValueError) as error:
model = DummyFrameworkModelForGit(
sagemaker_session=sagemaker_session, entry_point=entry_point, git_config=git_config
)
model.prepare_container_def(instance_type=INSTANCE_TYPE)
assert "Please provide a repo for git_config." in str(error)
@patch(
"sagemaker.git_utils.git_clone_repo",
side_effect=subprocess.CalledProcessError(
returncode=1, cmd="git clone https://github.com/aws/no-such-repo.git /tmp/repo_dir"
),
)
def test_git_support_git_clone_fail(sagemaker_session):
sagemaker_session.sagemaker_config = {}
entry_point = "source_dir/entry_point"
git_config = {"repo": "https://github.com/aws/no-such-repo.git", "branch": BRANCH}
with pytest.raises(subprocess.CalledProcessError) as error:
model = DummyFrameworkModelForGit(
sagemaker_session=sagemaker_session, entry_point=entry_point, git_config=git_config
)
model.prepare_container_def(instance_type=INSTANCE_TYPE)
assert "returned non-zero exit status" in str(error.value)
@patch(
"sagemaker.git_utils.git_clone_repo",
side_effect=subprocess.CalledProcessError(
returncode=1, cmd="git checkout branch-that-does-not-exist"
),
)
def test_git_support_branch_not_exist(git_clone_repo, sagemaker_session):
entry_point = "source_dir/entry_point"
git_config = {"repo": GIT_REPO, "branch": "branch-that-does-not-exist", "commit": COMMIT}
with pytest.raises(subprocess.CalledProcessError) as error:
model = DummyFrameworkModelForGit(
sagemaker_session=sagemaker_session, entry_point=entry_point, git_config=git_config
)
model.prepare_container_def(instance_type=INSTANCE_TYPE)
assert "returned non-zero exit status" in str(error.value)
@patch(
"sagemaker.git_utils.git_clone_repo",
side_effect=subprocess.CalledProcessError(
returncode=1, cmd="git checkout commit-sha-that-does-not-exist"
),
)
def test_git_support_commit_not_exist(git_clone_repo, sagemaker_session):
entry_point = "source_dir/entry_point"
git_config = {"repo": GIT_REPO, "branch": BRANCH, "commit": "commit-sha-that-does-not-exist"}
with pytest.raises(subprocess.CalledProcessError) as error:
model = DummyFrameworkModelForGit(
sagemaker_session=sagemaker_session, entry_point=entry_point, git_config=git_config
)
model.prepare_container_def(instance_type=INSTANCE_TYPE)
assert "returned non-zero exit status" in str(error.value)
@patch(
"sagemaker.git_utils.git_clone_repo",
side_effect=ValueError("Entry point does not exist in the repo."),
)
def test_git_support_entry_point_not_exist(sagemaker_session):
sagemaker_session.sagemaker_config = {}
entry_point = "source_dir/entry_point"
git_config = {"repo": GIT_REPO, "branch": BRANCH, "commit": COMMIT}
with pytest.raises(ValueError) as error:
model = DummyFrameworkModelForGit(
sagemaker_session=sagemaker_session, entry_point=entry_point, git_config=git_config
)
model.prepare_container_def(instance_type=INSTANCE_TYPE)
assert "Entry point does not exist in the repo." in str(error)
@patch(
"sagemaker.git_utils.git_clone_repo",
side_effect=ValueError("Source directory does not exist in the repo."),
)
def test_git_support_source_dir_not_exist(sagemaker_session):
sagemaker_session.sagemaker_config = {}
entry_point = "entry_point"
source_dir = "source_dir_that_does_not_exist"
git_config = {"repo": GIT_REPO, "branch": BRANCH, "commit": COMMIT}
with pytest.raises(ValueError) as error:
model = DummyFrameworkModelForGit(
sagemaker_session=sagemaker_session,
entry_point=entry_point,
source_dir=source_dir,
git_config=git_config,
)
model.prepare_container_def(instance_type=INSTANCE_TYPE)
assert "Source directory does not exist in the repo." in str(error)
@patch(
"sagemaker.git_utils.git_clone_repo",
side_effect=ValueError("Dependency no-such-dir does not exist in the repo."),
)
def test_git_support_dependencies_not_exist(sagemaker_session):
sagemaker_session.sagemaker_config = {}
entry_point = "entry_point"
dependencies = ["foo", "no_such_dir"]
git_config = {"repo": GIT_REPO, "branch": BRANCH, "commit": COMMIT}
with pytest.raises(ValueError) as error:
model = DummyFrameworkModelForGit(
sagemaker_session=sagemaker_session,
entry_point=entry_point,
dependencies=dependencies,
git_config=git_config,
)
model.prepare_container_def(instance_type=INSTANCE_TYPE)
assert "Dependency", "does not exist in the repo." in str(error)
@patch(
"sagemaker.git_utils.git_clone_repo",
side_effect=lambda gitconfig, entrypoint, source_dir=None, dependencies=None: {
"entry_point": "/tmp/repo_dir/entry_point",
"source_dir": None,
"dependencies": None,
},
)
@patch("sagemaker.model.fw_utils.tar_and_upload_dir")
def test_git_support_with_username_password_no_2fa(
tar_and_upload_dir, git_clone_repo, sagemaker_session
):
entry_point = "entry_point"
git_config = {
"repo": PRIVATE_GIT_REPO,
"branch": PRIVATE_BRANCH,
"commit": PRIVATE_COMMIT,
"username": "username",
"password": "passw0rd!",
}
model = DummyFrameworkModelForGit(
sagemaker_session=sagemaker_session, entry_point=entry_point, git_config=git_config
)
model.prepare_container_def(instance_type=INSTANCE_TYPE)
git_clone_repo.assert_called_with(git_config, entry_point, None, [])
assert model.entry_point == "/tmp/repo_dir/entry_point"
@patch(
"sagemaker.git_utils.git_clone_repo",
side_effect=lambda gitconfig, entrypoint, source_dir=None, dependencies=None: {
"entry_point": "/tmp/repo_dir/entry_point",
"source_dir": None,
"dependencies": None,
},
)
@patch("sagemaker.model.fw_utils.tar_and_upload_dir")
def test_git_support_with_token_2fa(tar_and_upload_dir, git_clone_repo, sagemaker_session):
entry_point = "entry_point"
git_config = {
"repo": PRIVATE_GIT_REPO,
"branch": PRIVATE_BRANCH,
"commit": PRIVATE_COMMIT,
"token": "my-token",
"2FA_enabled": True,
}
model = DummyFrameworkModelForGit(
sagemaker_session=sagemaker_session, entry_point=entry_point, git_config=git_config
)
model.prepare_container_def(instance_type=INSTANCE_TYPE)
git_clone_repo.assert_called_with(git_config, entry_point, None, [])
assert model.entry_point == "/tmp/repo_dir/entry_point"
@patch(
"sagemaker.git_utils.git_clone_repo",
side_effect=lambda gitconfig, entrypoint, source_dir=None, dependencies=None: {
"entry_point": "/tmp/repo_dir/entry_point",
"source_dir": None,
"dependencies": None,
},
)
@patch("sagemaker.model.fw_utils.tar_and_upload_dir")
def test_git_support_ssh_no_passphrase_needed(
tar_and_upload_dir, git_clone_repo, sagemaker_session
):
entry_point = "entry_point"
git_config = {"repo": PRIVATE_GIT_REPO_SSH, "branch": PRIVATE_BRANCH, "commit": PRIVATE_COMMIT}
model = DummyFrameworkModelForGit(
sagemaker_session=sagemaker_session, entry_point=entry_point, git_config=git_config
)
model.prepare_container_def(instance_type=INSTANCE_TYPE)
git_clone_repo.assert_called_with(git_config, entry_point, None, [])
assert model.entry_point == "/tmp/repo_dir/entry_point"
@patch(
"sagemaker.git_utils.git_clone_repo",
side_effect=subprocess.CalledProcessError(
returncode=1, cmd="git clone {} {}".format(PRIVATE_GIT_REPO_SSH, REPO_DIR)
),
)
@patch("sagemaker.model.fw_utils.tar_and_upload_dir")
def test_git_support_ssh_passphrase_required(tar_and_upload_dir, git_clone_repo, sagemaker_session):
entry_point = "entry_point"
git_config = {"repo": PRIVATE_GIT_REPO_SSH, "branch": PRIVATE_BRANCH, "commit": PRIVATE_COMMIT}
with pytest.raises(subprocess.CalledProcessError) as error:
model = DummyFrameworkModelForGit(
sagemaker_session=sagemaker_session, entry_point=entry_point, git_config=git_config
)
model.prepare_container_def(instance_type=INSTANCE_TYPE)
assert "returned non-zero exit status" in str(error.value)
@patch(
"sagemaker.git_utils.git_clone_repo",
side_effect=lambda gitconfig, entrypoint, source_dir=None, dependencies=None: {
"entry_point": "/tmp/repo_dir/entry_point",
"source_dir": None,
"dependencies": None,
},
)
@patch("sagemaker.model.fw_utils.tar_and_upload_dir")
def test_git_support_codecommit_with_username_and_password_succeed(
tar_and_upload_dir, git_clone_repo, sagemaker_session
):
entry_point = "entry_point"
git_config = {
"repo": CODECOMMIT_REPO,
"branch": CODECOMMIT_BRANCH,
"username": "username",
"password": "passw0rd!",
}
model = DummyFrameworkModelForGit(
sagemaker_session=sagemaker_session, entry_point=entry_point, git_config=git_config
)
model.prepare_container_def(instance_type=INSTANCE_TYPE)
git_clone_repo.assert_called_with(git_config, entry_point, None, [])
assert model.entry_point == "/tmp/repo_dir/entry_point"
@patch(
"sagemaker.git_utils.git_clone_repo",
side_effect=lambda gitconfig, entrypoint, source_dir=None, dependencies=None: {
"entry_point": "/tmp/repo_dir/entry_point",
"source_dir": None,
"dependencies": None,
},
)
@patch("sagemaker.model.fw_utils.tar_and_upload_dir")
def test_git_support_codecommit_ssh_no_passphrase_needed(
tar_and_upload_dir, git_clone_repo, sagemaker_session
):
entry_point = "entry_point"
git_config = {"repo": CODECOMMIT_REPO_SSH, "branch": CODECOMMIT_BRANCH}
model = DummyFrameworkModelForGit(
sagemaker_session=sagemaker_session, entry_point=entry_point, git_config=git_config
)
model.prepare_container_def(instance_type=INSTANCE_TYPE)
git_clone_repo.assert_called_with(git_config, entry_point, None, [])
assert model.entry_point == "/tmp/repo_dir/entry_point"
@patch(
"sagemaker.git_utils.git_clone_repo",
side_effect=subprocess.CalledProcessError(
returncode=1, cmd="git clone {} {}".format(PRIVATE_GIT_REPO_SSH, REPO_DIR)
),
)
@patch("sagemaker.model.fw_utils.tar_and_upload_dir")
def test_git_support_codecommit_ssh_passphrase_required(
tar_and_upload_dir, git_clone_repo, sagemaker_session
):
entry_point = "entry_point"
git_config = {"repo": CODECOMMIT_REPO_SSH, "branch": CODECOMMIT_BRANCH}
with pytest.raises(subprocess.CalledProcessError) as error:
model = DummyFrameworkModelForGit(
sagemaker_session=sagemaker_session, entry_point=entry_point, git_config=git_config
)
model.prepare_container_def(instance_type=INSTANCE_TYPE)
assert "returned non-zero exit status" in str(error.value)
@patch("sagemaker.utils.repack_model")
def test_not_repack_code_location_with_key_prefix(repack_model, sagemaker_session):
code_location = "s3://my-bucket/code/location/"
t = FrameworkModel(
entry_point=ENTRY_POINT,
role=ROLE,
sagemaker_session=sagemaker_session,
source_dir="s3://codebucket/someprefix/sourcedir.tar.gz",
image_uri=IMAGE_URI,
model_data=MODEL_DATA,
code_location=code_location,
)
t.deploy(instance_type=INSTANCE_TYPE, initial_instance_count=INSTANCE_COUNT)
repack_model.assert_not_called()
@patch("sagemaker.utils.repack_model")
def test_is_repack_with_code_location(repack_model, sagemaker_session):
code_location = "s3://my-bucket/code/location/"
model = FrameworkModel(
entry_point=ENTRY_POINT,
role=ROLE,
sagemaker_session=sagemaker_session,
source_dir="s3://codebucket/someprefix/sourcedir.tar.gz",
image_uri=IMAGE_URI,
model_data=MODEL_DATA,
code_location=code_location,
)
assert not model.is_repack()
@patch("sagemaker.utils.repack_model")
def test_is_repack_with_none_type(repack_model, sagemaker_session):
"""Test is_repack() returns a boolean value when source_dir and entry_point are None"""
model = FrameworkModel(
role=ROLE,
sagemaker_session=sagemaker_session,
image_uri=IMAGE_URI,
model_data=MODEL_DATA,
)
assert model.is_repack() is False
@patch("sagemaker.git_utils.git_clone_repo")
@patch("sagemaker.model.fw_utils.tar_and_upload_dir")
def test_is_repack_with_git_config(tar_and_upload_dir, git_clone_repo, sagemaker_session):
git_clone_repo.side_effect = lambda gitconfig, entrypoint, sourcedir, dependency: {
"entry_point": "entry_point",
"source_dir": "/tmp/repo_dir/source_dir",
"dependencies": ["/tmp/repo_dir/foo", "/tmp/repo_dir/bar"],
}
entry_point = "entry_point"
source_dir = "source_dir"
dependencies = ["foo", "bar"]
git_config = {"repo": GIT_REPO, "branch": BRANCH, "commit": COMMIT}
model = FrameworkModel(
sagemaker_session=sagemaker_session,
entry_point=entry_point,
source_dir=source_dir,
dependencies=dependencies,
git_config=git_config,
image_uri=IMAGE_URI,
model_data=MODEL_DATA,
)
assert not model.is_repack()