truss 0.11.2rc504__py3-none-any.whl → 0.11.2rc505__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of truss might be problematic. Click here for more details.

@@ -54,7 +54,9 @@ class ModelContainerPatchApplier:
54
54
  py_req_patch: PythonRequirementPatch = patch.body
55
55
  self._apply_python_requirement_patch(py_req_patch)
56
56
  elif isinstance(patch.body, SystemPackagePatch):
57
- raise UnsupportedPatch("System package patches are not supported for model container, please push truss again instead")
57
+ raise UnsupportedPatch(
58
+ "System package patches are not supported for model container, please run truss push again"
59
+ )
58
60
  elif isinstance(patch.body, ConfigPatch):
59
61
  config_patch: ConfigPatch = patch.body
60
62
  self._apply_config_patch(config_patch)
@@ -113,7 +115,6 @@ class ModelContainerPatchApplier:
113
115
  else:
114
116
  raise ValueError(f"Unknown python requirement patch action {action}")
115
117
 
116
-
117
118
  def _apply_config_patch(self, config_patch: ConfigPatch):
118
119
  self._app_logger.debug(f"Applying config patch {config_patch.to_dict()}")
119
120
  TrussConfig.from_dict(config_patch.config).write_to_yaml_file(
@@ -740,7 +740,9 @@ def test_calc_config_patches_add_system_package(custom_model_truss_dir: Path):
740
740
  patches = _apply_config_change_and_calc_patches(
741
741
  custom_model_truss_dir, lambda config: config.system_packages.append("curl")
742
742
  )
743
- assert len(patches) == 2
743
+ # System package changes no longer generate separate patches - only config patches
744
+ # System packages will require full rebuild instead of patching
745
+ assert len(patches) == 1
744
746
  assert patches == [
745
747
  Patch(
746
748
  type=PatchType.CONFIG,
@@ -749,10 +751,6 @@ def test_calc_config_patches_add_system_package(custom_model_truss_dir: Path):
749
751
  config=yaml.safe_load((custom_model_truss_dir / "config.yaml").open()),
750
752
  ),
751
753
  ),
752
- Patch(
753
- type=PatchType.SYSTEM_PACKAGE,
754
- body=SystemPackagePatch(action=Action.ADD, package="curl"),
755
- ),
756
754
  ]
757
755
 
758
756
 
@@ -762,7 +760,9 @@ def test_calc_config_patches_remove_system_package(custom_model_truss_dir: Path)
762
760
  config_pre_op=lambda config: config.system_packages.append("curl"),
763
761
  config_op=lambda config: config.system_packages.clear(),
764
762
  )
765
- assert len(patches) == 2
763
+ # System package changes no longer generate separate patches - only config patches
764
+ # System packages will require full rebuild instead of patching
765
+ assert len(patches) == 1
766
766
  assert patches == [
767
767
  Patch(
768
768
  type=PatchType.CONFIG,
@@ -771,10 +771,6 @@ def test_calc_config_patches_remove_system_package(custom_model_truss_dir: Path)
771
771
  config=yaml.safe_load((custom_model_truss_dir / "config.yaml").open()),
772
772
  ),
773
773
  ),
774
- Patch(
775
- type=PatchType.SYSTEM_PACKAGE,
776
- body=SystemPackagePatch(action=Action.REMOVE, package="curl"),
777
- ),
778
774
  ]
779
775
 
780
776
 
@@ -790,24 +786,16 @@ def test_calc_config_patches_add_and_remove_system_package(
790
786
  patches = _apply_config_change_and_calc_patches(
791
787
  custom_model_truss_dir, config_pre_op=config_pre_op, config_op=config_op
792
788
  )
793
- assert len(patches) == 3
794
- assert patches[0] == Patch(
795
- type=PatchType.CONFIG,
796
- body=ConfigPatch(
797
- action=Action.UPDATE,
798
- config=yaml.safe_load((custom_model_truss_dir / "config.yaml").open()),
799
- ),
800
- )
801
- patches = patches[1:]
802
- patches.sort(key=lambda patch: patch.body.package)
789
+ # System package changes no longer generate separate patches - only config patches
790
+ # System packages will require full rebuild instead of patching
791
+ assert len(patches) == 1
803
792
  assert patches == [
804
793
  Patch(
805
- type=PatchType.SYSTEM_PACKAGE,
806
- body=SystemPackagePatch(action=Action.REMOVE, package="jq"),
807
- ),
808
- Patch(
809
- type=PatchType.SYSTEM_PACKAGE,
810
- body=SystemPackagePatch(action=Action.ADD, package="libsnd"),
794
+ type=PatchType.CONFIG,
795
+ body=ConfigPatch(
796
+ action=Action.UPDATE,
797
+ config=yaml.safe_load((custom_model_truss_dir / "config.yaml").open()),
798
+ ),
811
799
  ),
812
800
  ]
813
801
 
@@ -9,8 +9,6 @@ from truss.tests.test_testing_utilities_for_other_tests import ensure_kill_all
9
9
  from truss.tests.test_truss_handle import (
10
10
  verify_python_requirement_installed_on_container,
11
11
  verify_python_requirement_not_installed_on_container,
12
- verify_system_package_installed_on_container,
13
- verify_system_requirement_not_installed_on_container,
14
12
  )
15
13
  from truss.truss_handle.truss_gatherer import calc_shadow_truss_dirname
16
14
  from truss.truss_handle.truss_handle import TrussHandle
@@ -147,13 +145,6 @@ def test_control_truss_python_sys_req_patch(
147
145
  th.remove_python_requirement(req)
148
146
  return th.docker_predict([1], tag=tag, binary=binary, local_port=None)
149
147
 
150
- def predict_with_system_requirement_added(pkg):
151
- th.add_system_package(pkg)
152
- return th.docker_predict([1], tag=tag, binary=binary, local_port=None)
153
-
154
- def predict_with_system_requirement_removed(pkg):
155
- th.remove_system_package(pkg)
156
- return th.docker_predict([1], tag=tag, binary=binary, local_port=None)
157
148
 
158
149
  with ensure_kill_all():
159
150
  th.docker_predict([1], tag=tag, binary=binary, local_port=None)
@@ -170,14 +161,6 @@ def test_control_truss_python_sys_req_patch(
170
161
  assert current_num_docker_images(th) == orig_num_truss_images
171
162
  verify_python_requirement_not_installed_on_container(container, python_req)
172
163
 
173
- system_pkg = "jq"
174
- predict_with_system_requirement_added(system_pkg)
175
- assert current_num_docker_images(th) == orig_num_truss_images
176
- verify_system_package_installed_on_container(container, system_pkg)
177
-
178
- predict_with_system_requirement_removed(system_pkg)
179
- assert current_num_docker_images(th) == orig_num_truss_images
180
- verify_system_requirement_not_installed_on_container(container, system_pkg)
181
164
 
182
165
 
183
166
  @pytest.mark.integration
@@ -425,20 +425,12 @@ def _calc_system_packages_patches(
425
425
  ) -> List[Patch]:
426
426
  """Calculate patch based on changes to system packates.
427
427
 
428
- Empty list means no relevant differences found.
428
+ System package patches are no longer supported, so this always returns an empty list.
429
+ Changes to system packages will require a full rebuild instead of patching.
429
430
  """
430
- patches = []
431
- prev_pkgs = system_packages_set(prev_config.system_packages)
432
- new_pkgs = system_packages_set(new_config.system_packages)
433
- removed_pkgs = prev_pkgs.difference(new_pkgs)
434
- for removed_pkg in removed_pkgs:
435
- patches.append(_mk_system_package_patch(Action.REMOVE, removed_pkg))
436
-
437
- added_pkgs = new_pkgs.difference(prev_pkgs)
438
- for added_pkg in added_pkgs:
439
- patches.append(_mk_system_package_patch(Action.ADD, added_pkg))
440
-
441
- return patches
431
+ # System package patches are no longer supported - return empty list
432
+ # This will cause any system package changes to be handled by full rebuild
433
+ return []
442
434
 
443
435
 
444
436
  def _mk_config_patch(action: Action, config: dict) -> Patch:
@@ -471,13 +463,6 @@ def _mk_python_requirement_patch(action: Action, requirement: str) -> Patch:
471
463
  )
472
464
 
473
465
 
474
- def _mk_system_package_patch(action: Action, package: str) -> Patch:
475
- return Patch(
476
- type=PatchType.SYSTEM_PACKAGE,
477
- body=SystemPackagePatch(action=action, package=package),
478
- )
479
-
480
-
481
466
  def _relative_to(path: str, relative_to_path: str):
482
467
  return str(Path(path).relative_to(relative_to_path))
483
468
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: truss
3
- Version: 0.11.2rc504
3
+ Version: 0.11.2rc505
4
4
  Summary: A seamless bridge from model development to model delivery
5
5
  Project-URL: Repository, https://github.com/basetenlabs/truss
6
6
  Project-URL: Homepage, https://truss.baseten.co
@@ -84,7 +84,7 @@ truss/templates/control/control/helpers/inference_server_process_controller.py,s
84
84
  truss/templates/control/control/helpers/inference_server_starter.py,sha256=Fz2Puijro6Cc5cvTsAqOveNJbBQR_ARYJXl4lvETJ8Y,2633
85
85
  truss/templates/control/control/helpers/truss_patch/__init__.py,sha256=CXZdUV_ylqLTJrKuFpvSnUT6PUFrZrMF2y6jiHbdaKU,998
86
86
  truss/templates/control/control/helpers/truss_patch/model_code_patch_applier.py,sha256=LTIIADLz0wRn7V49j64dU1U7Hbta9YLde3pb5YZWvzQ,2001
87
- truss/templates/control/control/helpers/truss_patch/model_container_patch_applier.py,sha256=rxJzXwNmrr_2FOM9gZSE3TDbV-Bpwz67fv1dcMsQ9EE,6420
87
+ truss/templates/control/control/helpers/truss_patch/model_container_patch_applier.py,sha256=uiZvKhLa_rpr_N67NpApgA-XVrBFLXraZlikSOFDDOw,6445
88
88
  truss/templates/control/control/helpers/truss_patch/requirement_name_identifier.py,sha256=CL3KEAj4B3ApMQShd7TI5umXVbazLZY5StrNlwHwWtc,1995
89
89
  truss/templates/control/control/helpers/truss_patch/system_packages.py,sha256=IYh1CVU_kooAvtSGXKQDDWnNdOhlv7ENWagsL1wvhgw,208
90
90
  truss/templates/custom/examples.yaml,sha256=2UcCtEdavImWmiCtj31ckBlAKVOwNMC5AwMIIznKDag,48
@@ -131,7 +131,7 @@ truss/tests/helpers.py,sha256=DKnUGzmt-k4IN_wSnlAXbVYCiEt58xFzFmmuCDSQ0dg,555
131
131
  truss/tests/test_build.py,sha256=Wq4sM9tmZFVTCN3YljvOcn04Kkj-L-41Tlw0DKQ8Z7c,709
132
132
  truss/tests/test_config.py,sha256=AVpVCL_XHYXKSGHzwecrh7BAJlB_Wr5AUlnnwMqWM98,30559
133
133
  truss/tests/test_context_builder_image.py,sha256=fVZNJSzZNiWa7Dr1X_VhhMJtyJ5HzsLaPglOr6NV2CA,1105
134
- truss/tests/test_control_truss_patching.py,sha256=lbMuAjLbkeDRLxUxXHWr41BZyhZKHQYoMnbJSj3dqrc,15390
134
+ truss/tests/test_control_truss_patching.py,sha256=geBSW8g-Em9FH2T5hsmBkc_Hr5DWPJ8ye2GmstKKiQ0,14499
135
135
  truss/tests/test_custom_server.py,sha256=GP2qMgnqxJMPRtfEciqbhBcG0_JUK7gNL7nrXPGrSLg,1305
136
136
  truss/tests/test_docker.py,sha256=3RI6jEC9CVQsKj83s_gOBl3EkdOaov-KEX4IihfMJW4,523
137
137
  truss/tests/test_model_inference.py,sha256=9QfPMa1kjxvKCWg5XKocjwcpfDkKB7pWd8bn4hIkshk,76213
@@ -150,7 +150,7 @@ truss/tests/contexts/image_builder/test_serving_image_builder.py,sha256=16niCXZn
150
150
  truss/tests/contexts/local_loader/test_load_local.py,sha256=D1qMH2IpYA2j5009v50QMgUnKdeOsX15ndkwXe10a4E,801
151
151
  truss/tests/contexts/local_loader/test_truss_module_finder.py,sha256=oN1K2lg3ATHY5yOVUTfQIaSqusTF9I2wFaYaTSo5-O4,5342
152
152
  truss/tests/local/test_local_config_handler.py,sha256=aLvcOyfppskA2MziVLy_kMcagjxMpO4mjar9zxUN6g0,2245
153
- truss/tests/patch/test_calc_patch.py,sha256=GBPvIwIQ12fgYwqiHn7BUzAO5693-AX5R4upwGqfdB8,31960
153
+ truss/tests/patch/test_calc_patch.py,sha256=avV5-OpJK5rL811d0ERx-Mv9HERkpP4vxecxqh8hM7A,31782
154
154
  truss/tests/patch/test_dir_signature.py,sha256=HnG9Cyqt86YagYkY-jurSf36yYP2oM7PQvfb_d5T2mY,1033
155
155
  truss/tests/patch/test_hash.py,sha256=VsGAllNP653rmyrvPYBRY1gEc0gTpLl38tAhjXFUGGM,5997
156
156
  truss/tests/patch/test_signature.py,sha256=vdAy5dbIqTEWLZVpO6szTGdNTRZgE8PtABGuhPP0Y6s,728
@@ -325,7 +325,7 @@ truss/truss_handle/readme_generator.py,sha256=B4XbGwUjzMNOr71DWNAL8kCu5_ZHq7YOM8
325
325
  truss/truss_handle/truss_gatherer.py,sha256=Xysl_UnCVhehPfZeHa8p7WFp94ENqh-VVpbuqnCui3A,2870
326
326
  truss/truss_handle/truss_handle.py,sha256=WF2MQSly9DQ1SoAvqfi87Ulu4llTadpXoncsDjpL79E,40886
327
327
  truss/truss_handle/patch/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
328
- truss/truss_handle/patch/calc_patch.py,sha256=Qyk1QmacK4jy9Ia8-93L8VtAWJhw15z22DdZUkBKlys,18334
328
+ truss/truss_handle/patch/calc_patch.py,sha256=zaM30WExGxKsZBGiBjevDs583jwk5QSyO-uxH0PogX4,17936
329
329
  truss/truss_handle/patch/constants.py,sha256=pCEi5Pwi8Rnqthrr3VEsWL9EP1P1VV1T8DEYuitHLmc,139
330
330
  truss/truss_handle/patch/custom_types.py,sha256=QklzhgLD_PpvNvNYQCvujAd16eYEaDGfLA1scxk6zsA,3481
331
331
  truss/truss_handle/patch/dir_signature.py,sha256=UCdZCzXkI-l-ae0I0pdmB2bavB9qzhhOKYXyLnDFQZY,921
@@ -368,8 +368,8 @@ truss_train/deployment.py,sha256=lWWANSuzBWu2M4oK4qD7n-oVR1JKdmw2Pn5BJQHg-Ck,307
368
368
  truss_train/loader.py,sha256=0o66EjBaHc2YY4syxxHVR4ordJWs13lNXnKjKq2wq0U,1630
369
369
  truss_train/public_api.py,sha256=9N_NstiUlmBuLUwH_fNG_1x7OhGCytZLNvqKXBlStrM,1220
370
370
  truss_train/restore_from_checkpoint.py,sha256=KmJuTUVpvtvlkEClcmllxAF2TKgbp-FuzfblfGh06XA,1239
371
- truss-0.11.2rc504.dist-info/METADATA,sha256=kmeypQ9CmBsHrPE-nB0Xw7DYTGCirhsQIW6wbP9yiSU,6674
372
- truss-0.11.2rc504.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
373
- truss-0.11.2rc504.dist-info/entry_points.txt,sha256=-MwKfHHQHQ6j0HqIgvxrz3CehCmczDLTD-OsRHnjjuU,130
374
- truss-0.11.2rc504.dist-info/licenses/LICENSE,sha256=FTqGzu85i-uw1Gi8E_o0oD60bH9yQ_XIGtZbA1QUYiw,1064
375
- truss-0.11.2rc504.dist-info/RECORD,,
371
+ truss-0.11.2rc505.dist-info/METADATA,sha256=xktjK8t_rAM2j4EYCBYXAPMKlVFZuowom6o6uE06q_Y,6674
372
+ truss-0.11.2rc505.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
373
+ truss-0.11.2rc505.dist-info/entry_points.txt,sha256=-MwKfHHQHQ6j0HqIgvxrz3CehCmczDLTD-OsRHnjjuU,130
374
+ truss-0.11.2rc505.dist-info/licenses/LICENSE,sha256=FTqGzu85i-uw1Gi8E_o0oD60bH9yQ_XIGtZbA1QUYiw,1064
375
+ truss-0.11.2rc505.dist-info/RECORD,,