truss 0.9.45.dev101__tar.gz → 0.9.45rc9__tar.gz

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.
Files changed (419) hide show
  1. {truss-0.9.45.dev101 → truss-0.9.45rc9}/PKG-INFO +2 -2
  2. {truss-0.9.45.dev101 → truss-0.9.45rc9}/pyproject.toml +3 -2
  3. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/local/local_config_handler.py +12 -0
  4. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/server/model_wrapper.py +89 -1
  5. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/server/requirements.txt +1 -0
  6. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/server/truss_server.py +1 -0
  7. truss-0.9.45rc9/truss/templates/shared/dynamic_config_resolver.py +28 -0
  8. truss-0.9.45rc9/truss/test_data/model_load_failure_test/config.yaml +2 -0
  9. truss-0.9.45rc9/truss/tests/templates/core/server/test_dynamic_config_resolver.py +126 -0
  10. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/test_model_inference.py +113 -0
  11. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/truss_handle.py +6 -0
  12. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss-chains/truss_chains/framework.py +20 -0
  13. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss-chains/truss_chains/stub.py +5 -9
  14. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss-chains/truss_chains/utils.py +1 -40
  15. truss-0.9.45.dev101/truss/.pytest_cache/.gitignore +0 -2
  16. truss-0.9.45.dev101/truss/.pytest_cache/CACHEDIR.TAG +0 -4
  17. truss-0.9.45.dev101/truss/.pytest_cache/README.md +0 -8
  18. truss-0.9.45.dev101/truss/.pytest_cache/v/cache/lastfailed +0 -1
  19. truss-0.9.45.dev101/truss/.pytest_cache/v/cache/nodeids +0 -3
  20. truss-0.9.45.dev101/truss/.pytest_cache/v/cache/stepwise +0 -1
  21. truss-0.9.45.dev101/truss/api/__pycache__/__init__.cpython-39.pyc +0 -0
  22. truss-0.9.45.dev101/truss/api/__pycache__/definitions.cpython-39.pyc +0 -0
  23. truss-0.9.45.dev101/truss/cli/__pycache__/__init__.cpython-39.pyc +0 -0
  24. truss-0.9.45.dev101/truss/cli/__pycache__/cli.cpython-39.pyc +0 -0
  25. truss-0.9.45.dev101/truss/cli/__pycache__/console.cpython-39.pyc +0 -0
  26. truss-0.9.45.dev101/truss/cli/__pycache__/create.cpython-39.pyc +0 -0
  27. truss-0.9.45.dev101/truss/config/__pycache__/trt_llm.cpython-39.pyc +0 -0
  28. truss-0.9.45.dev101/truss/contexts/__pycache__/truss_context.cpython-39.pyc +0 -0
  29. truss-0.9.45.dev101/truss/contexts/image_builder/__pycache__/cache_warmer.cpython-39.pyc +0 -0
  30. truss-0.9.45.dev101/truss/contexts/image_builder/__pycache__/image_builder.cpython-39.pyc +0 -0
  31. truss-0.9.45.dev101/truss/contexts/image_builder/__pycache__/serving_image_builder.cpython-39-pytest-7.2.0.pyc +0 -0
  32. truss-0.9.45.dev101/truss/contexts/image_builder/__pycache__/serving_image_builder.cpython-39.pyc +0 -0
  33. truss-0.9.45.dev101/truss/contexts/image_builder/__pycache__/util.cpython-39.pyc +0 -0
  34. truss-0.9.45.dev101/truss/contexts/local_loader/__pycache__/docker_build_emulator.cpython-39.pyc +0 -0
  35. truss-0.9.45.dev101/truss/contexts/local_loader/__pycache__/load_model_local.cpython-39.pyc +0 -0
  36. truss-0.9.45.dev101/truss/contexts/local_loader/__pycache__/truss_module_loader.cpython-39.pyc +0 -0
  37. truss-0.9.45.dev101/truss/contexts/local_loader/__pycache__/utils.cpython-39.pyc +0 -0
  38. truss-0.9.45.dev101/truss/local/__pycache__/local_config.cpython-39.pyc +0 -0
  39. truss-0.9.45.dev101/truss/local/__pycache__/local_config_handler.cpython-39.pyc +0 -0
  40. truss-0.9.45.dev101/truss/patch/__pycache__/calc_patch.cpython-39.pyc +0 -0
  41. truss-0.9.45.dev101/truss/patch/__pycache__/custom_types.cpython-39.pyc +0 -0
  42. truss-0.9.45.dev101/truss/patch/__pycache__/dir_signature.cpython-39.pyc +0 -0
  43. truss-0.9.45.dev101/truss/patch/__pycache__/hash.cpython-39.pyc +0 -0
  44. truss-0.9.45.dev101/truss/patch/__pycache__/signature.cpython-39.pyc +0 -0
  45. truss-0.9.45.dev101/truss/patch/__pycache__/truss_dir_patch_applier.cpython-39.pyc +0 -0
  46. truss-0.9.45.dev101/truss/patch/__pycache__/types.cpython-39.pyc +0 -0
  47. truss-0.9.45.dev101/truss/remote/__pycache__/remote_cli.cpython-39.pyc +0 -0
  48. truss-0.9.45.dev101/truss/remote/__pycache__/remote_factory.cpython-39.pyc +0 -0
  49. truss-0.9.45.dev101/truss/remote/__pycache__/truss_remote.cpython-39.pyc +0 -0
  50. truss-0.9.45.dev101/truss/remote/baseten/__pycache__/__init__.cpython-39.pyc +0 -0
  51. truss-0.9.45.dev101/truss/remote/baseten/__pycache__/api.cpython-39.pyc +0 -0
  52. truss-0.9.45.dev101/truss/remote/baseten/__pycache__/auth.cpython-39.pyc +0 -0
  53. truss-0.9.45.dev101/truss/remote/baseten/__pycache__/core.cpython-39.pyc +0 -0
  54. truss-0.9.45.dev101/truss/remote/baseten/__pycache__/custom_types.cpython-39.pyc +0 -0
  55. truss-0.9.45.dev101/truss/remote/baseten/__pycache__/error.cpython-39.pyc +0 -0
  56. truss-0.9.45.dev101/truss/remote/baseten/__pycache__/remote.cpython-39.pyc +0 -0
  57. truss-0.9.45.dev101/truss/remote/baseten/__pycache__/service.cpython-39.pyc +0 -0
  58. truss-0.9.45.dev101/truss/remote/baseten/__pycache__/types.cpython-39.pyc +0 -0
  59. truss-0.9.45.dev101/truss/remote/baseten/utils/__pycache__/status.cpython-39.pyc +0 -0
  60. truss-0.9.45.dev101/truss/remote/baseten/utils/__pycache__/tar.cpython-39.pyc +0 -0
  61. truss-0.9.45.dev101/truss/remote/baseten/utils/__pycache__/transfer.cpython-39.pyc +0 -0
  62. truss-0.9.45.dev101/truss/templates/__pycache__/__init__.cpython-39.pyc +0 -0
  63. truss-0.9.45.dev101/truss/templates/control/control/__pycache__/application.cpython-39.pyc +0 -0
  64. truss-0.9.45.dev101/truss/templates/control/control/__pycache__/endpoints.cpython-39.pyc +0 -0
  65. truss-0.9.45.dev101/truss/templates/control/control/helpers/__pycache__/context_managers.cpython-39.pyc +0 -0
  66. truss-0.9.45.dev101/truss/templates/control/control/helpers/__pycache__/custom_types.cpython-39.pyc +0 -0
  67. truss-0.9.45.dev101/truss/templates/control/control/helpers/__pycache__/errors.cpython-39.pyc +0 -0
  68. truss-0.9.45.dev101/truss/templates/control/control/helpers/__pycache__/inference_server_controller.cpython-39.pyc +0 -0
  69. truss-0.9.45.dev101/truss/templates/control/control/helpers/__pycache__/inference_server_process_controller.cpython-39.pyc +0 -0
  70. truss-0.9.45.dev101/truss/templates/control/control/helpers/__pycache__/inference_server_starter.cpython-39.pyc +0 -0
  71. truss-0.9.45.dev101/truss/templates/control/control/helpers/__pycache__/types.cpython-39.pyc +0 -0
  72. truss-0.9.45.dev101/truss/templates/control/control/helpers/truss_patch/__pycache__/__init__.cpython-39.pyc +0 -0
  73. truss-0.9.45.dev101/truss/templates/control/control/helpers/truss_patch/__pycache__/model_code_patch_applier.cpython-39.pyc +0 -0
  74. truss-0.9.45.dev101/truss/templates/control/control/helpers/truss_patch/__pycache__/model_container_patch_applier.cpython-39.pyc +0 -0
  75. truss-0.9.45.dev101/truss/templates/control/control/helpers/truss_patch/__pycache__/requirement_name_identifier.cpython-39.pyc +0 -0
  76. truss-0.9.45.dev101/truss/templates/control/control/helpers/truss_patch/__pycache__/system_packages.cpython-39.pyc +0 -0
  77. truss-0.9.45.dev101/truss/templates/server/__pycache__/__init__.cpython-39.pyc +0 -0
  78. truss-0.9.45.dev101/truss/templates/server/common/__pycache__/__init__.cpython-39.pyc +0 -0
  79. truss-0.9.45.dev101/truss/templates/server/common/__pycache__/errors.cpython-39.pyc +0 -0
  80. truss-0.9.45.dev101/truss/templates/server/common/__pycache__/patches.cpython-39.pyc +0 -0
  81. truss-0.9.45.dev101/truss/templates/server/common/__pycache__/retry.cpython-39.pyc +0 -0
  82. truss-0.9.45.dev101/truss/templates/server/common/__pycache__/schema.cpython-39.pyc +0 -0
  83. truss-0.9.45.dev101/truss/templates/server/common/__pycache__/termination_handler_middleware.cpython-39.pyc +0 -0
  84. truss-0.9.45.dev101/truss/templates/server/common/__pycache__/truss_server.cpython-39.pyc +0 -0
  85. truss-0.9.45.dev101/truss/templates/shared/__pycache__/__init__.cpython-39.pyc +0 -0
  86. truss-0.9.45.dev101/truss/templates/shared/__pycache__/dynamic_config_resolver.cpython-39.pyc +0 -0
  87. truss-0.9.45.dev101/truss/templates/shared/__pycache__/lazy_data_resolver.cpython-39.pyc +0 -0
  88. truss-0.9.45.dev101/truss/templates/shared/__pycache__/logging.cpython-39.pyc +0 -0
  89. truss-0.9.45.dev101/truss/templates/shared/__pycache__/secrets_resolver.cpython-39.pyc +0 -0
  90. truss-0.9.45.dev101/truss/templates/shared/__pycache__/serialization.cpython-39.pyc +0 -0
  91. truss-0.9.45.dev101/truss/templates/shared/__pycache__/util.cpython-39.pyc +0 -0
  92. truss-0.9.45.dev101/truss/templates/shared/dynamic_config_resolver.py +0 -13
  93. truss-0.9.45.dev101/truss/test_data/model_load_failure_test/config.yaml +0 -2
  94. truss-0.9.45.dev101/truss/test_data/test_basic_truss/packages2/package1/foo.py +0 -2
  95. truss-0.9.45.dev101/truss/test_data/test_basic_truss/sidscript.py +0 -8
  96. truss-0.9.45.dev101/truss/test_data/test_streaming_async_generator_truss/model/__pycache__/model.cpython-39.pyc +0 -0
  97. truss-0.9.45.dev101/truss/tests/__pycache__/__init__.cpython-39.pyc +0 -0
  98. truss-0.9.45.dev101/truss/tests/__pycache__/conftest.cpython-39-pytest-7.2.0.pyc +0 -0
  99. truss-0.9.45.dev101/truss/tests/__pycache__/helpers.cpython-39.pyc +0 -0
  100. truss-0.9.45.dev101/truss/tests/__pycache__/test_build.cpython-39-pytest-7.2.0.pyc +0 -0
  101. truss-0.9.45.dev101/truss/tests/__pycache__/test_config.cpython-39-pytest-7.2.0.pyc +0 -0
  102. truss-0.9.45.dev101/truss/tests/__pycache__/test_context_builder_image.cpython-39-pytest-7.2.0.pyc +0 -0
  103. truss-0.9.45.dev101/truss/tests/__pycache__/test_control_truss_patching.cpython-39-pytest-7.2.0.pyc +0 -0
  104. truss-0.9.45.dev101/truss/tests/__pycache__/test_docker.cpython-39-pytest-7.2.0.pyc +0 -0
  105. truss-0.9.45.dev101/truss/tests/__pycache__/test_model_inference.cpython-39-pytest-7.2.0.pyc +0 -0
  106. truss-0.9.45.dev101/truss/tests/__pycache__/test_model_schema.cpython-39-pytest-7.2.0.pyc +0 -0
  107. truss-0.9.45.dev101/truss/tests/__pycache__/test_testing_utilities_for_other_tests.cpython-39-pytest-7.2.0.pyc +0 -0
  108. truss-0.9.45.dev101/truss/tests/__pycache__/test_truss_gatherer.cpython-39-pytest-7.2.0.pyc +0 -0
  109. truss-0.9.45.dev101/truss/tests/__pycache__/test_truss_handle.cpython-39-pytest-7.2.0.pyc +0 -0
  110. truss-0.9.45.dev101/truss/tests/__pycache__/test_trussless_docker_server.cpython-39-pytest-7.2.0.pyc +0 -0
  111. truss-0.9.45.dev101/truss/tests/__pycache__/test_util.cpython-39-pytest-7.2.0.pyc +0 -0
  112. truss-0.9.45.dev101/truss/tests/__pycache__/test_validation.cpython-39-pytest-7.2.0.pyc +0 -0
  113. truss-0.9.45.dev101/truss/tests/contexts/image_builder/__pycache__/test_serving_image_builder.cpython-39-pytest-7.2.0.pyc +0 -0
  114. truss-0.9.45.dev101/truss/tests/contexts/local_loader/__pycache__/test_load_local.cpython-39-pytest-7.2.0.pyc +0 -0
  115. truss-0.9.45.dev101/truss/tests/contexts/local_loader/__pycache__/test_truss_module_finder.cpython-39-pytest-7.2.0.pyc +0 -0
  116. truss-0.9.45.dev101/truss/tests/local/__pycache__/__init__.cpython-39.pyc +0 -0
  117. truss-0.9.45.dev101/truss/tests/local/__pycache__/test_local_config_handler.cpython-39-pytest-7.2.0.pyc +0 -0
  118. truss-0.9.45.dev101/truss/tests/patch/__pycache__/test_calc_patch.cpython-39-pytest-7.2.0.pyc +0 -0
  119. truss-0.9.45.dev101/truss/tests/patch/__pycache__/test_dir_signature.cpython-39-pytest-7.2.0.pyc +0 -0
  120. truss-0.9.45.dev101/truss/tests/patch/__pycache__/test_hash.cpython-39-pytest-7.2.0.pyc +0 -0
  121. truss-0.9.45.dev101/truss/tests/patch/__pycache__/test_signature.cpython-39-pytest-7.2.0.pyc +0 -0
  122. truss-0.9.45.dev101/truss/tests/patch/__pycache__/test_truss_dir_patch_applier.cpython-39-pytest-7.2.0.pyc +0 -0
  123. truss-0.9.45.dev101/truss/tests/patch/__pycache__/test_types.cpython-39-pytest-7.2.0.pyc +0 -0
  124. truss-0.9.45.dev101/truss/tests/remote/__pycache__/test_remote_factory.cpython-39-pytest-7.2.0.pyc +0 -0
  125. truss-0.9.45.dev101/truss/tests/remote/__pycache__/test_truss_remote.cpython-39-pytest-7.2.0.pyc +0 -0
  126. truss-0.9.45.dev101/truss/tests/remote/baseten/__pycache__/test_api.cpython-39-pytest-7.2.0.pyc +0 -0
  127. truss-0.9.45.dev101/truss/tests/remote/baseten/__pycache__/test_auth.cpython-39-pytest-7.2.0.pyc +0 -0
  128. truss-0.9.45.dev101/truss/tests/remote/baseten/__pycache__/test_core.cpython-39-pytest-7.2.0.pyc +0 -0
  129. truss-0.9.45.dev101/truss/tests/remote/baseten/__pycache__/test_remote.cpython-39-pytest-7.2.0.pyc +0 -0
  130. truss-0.9.45.dev101/truss/tests/remote/baseten/__pycache__/test_service.cpython-39-pytest-7.2.0.pyc +0 -0
  131. truss-0.9.45.dev101/truss/tests/templates/control/control/__pycache__/test_server.cpython-39-pytest-7.2.0.pyc +0 -0
  132. truss-0.9.45.dev101/truss/tests/templates/control/control/__pycache__/test_server_integration.cpython-39-pytest-7.2.0.pyc +0 -0
  133. truss-0.9.45.dev101/truss/tests/templates/control/control/helpers/__pycache__/test_context_managers.cpython-39-pytest-7.2.0.pyc +0 -0
  134. truss-0.9.45.dev101/truss/tests/templates/control/control/helpers/__pycache__/test_model_container_patch_applier.cpython-39-pytest-7.2.0.pyc +0 -0
  135. truss-0.9.45.dev101/truss/tests/templates/control/control/helpers/__pycache__/test_requirement_name_identifier.cpython-39-pytest-7.2.0.pyc +0 -0
  136. truss-0.9.45.dev101/truss/tests/templates/core/server/__pycache__/test_dynamic_config_resolver.cpython-39-pytest-7.2.0.pyc +0 -0
  137. truss-0.9.45.dev101/truss/tests/templates/core/server/__pycache__/test_lazy_data_resolver.cpython-39-pytest-7.2.0.pyc +0 -0
  138. truss-0.9.45.dev101/truss/tests/templates/core/server/__pycache__/test_secrets_resolver.cpython-39-pytest-7.2.0.pyc +0 -0
  139. truss-0.9.45.dev101/truss/tests/templates/core/server/common/__pycache__/test_truss_server.cpython-39-pytest-7.2.0.pyc +0 -0
  140. truss-0.9.45.dev101/truss/tests/templates/core/server/common/__pycache__/test_util.cpython-39-pytest-7.2.0.pyc +0 -0
  141. truss-0.9.45.dev101/truss/tests/templates/core/server/test_dynamic_config_resolver.py +0 -34
  142. truss-0.9.45.dev101/truss/tests/templates/server/__pycache__/test_model_wrapper.cpython-39-pytest-7.2.0.pyc +0 -0
  143. truss-0.9.45.dev101/truss/tests/templates/server/__pycache__/test_schema.cpython-39-pytest-7.2.0.pyc +0 -0
  144. truss-0.9.45.dev101/truss/tests/templates/server/__pycache__/test_truss_server.cpython-39-pytest-7.2.0.pyc +0 -0
  145. truss-0.9.45.dev101/truss/tests/templates/server/common/__pycache__/test_retry.cpython-39-pytest-7.2.0.pyc +0 -0
  146. truss-0.9.45.dev101/truss/tests/templates/server/common/__pycache__/test_termination_handler_middleware.cpython-39-pytest-7.2.0.pyc +0 -0
  147. truss-0.9.45.dev101/truss/tests/trt_llm/__pycache__/test_validation.cpython-39-pytest-7.2.0.pyc +0 -0
  148. truss-0.9.45.dev101/truss/tests/util/__pycache__/test_config_checks.cpython-39-pytest-7.2.0.pyc +0 -0
  149. truss-0.9.45.dev101/truss/tests/util/__pycache__/test_path.cpython-39-pytest-7.2.0.pyc +0 -0
  150. truss-0.9.45.dev101/truss/trt_llm/__pycache__/validation.cpython-39.pyc +0 -0
  151. truss-0.9.45.dev101/truss/util/__pycache__/config_checks.cpython-39.pyc +0 -0
  152. truss-0.9.45.dev101/truss/util/__pycache__/data_structures.cpython-39.pyc +0 -0
  153. truss-0.9.45.dev101/truss/util/__pycache__/download.cpython-39.pyc +0 -0
  154. truss-0.9.45.dev101/truss/util/__pycache__/errors.cpython-39.pyc +0 -0
  155. truss-0.9.45.dev101/truss/util/__pycache__/jinja.cpython-39.pyc +0 -0
  156. truss-0.9.45.dev101/truss/util/__pycache__/log_utils.cpython-39.pyc +0 -0
  157. truss-0.9.45.dev101/truss/util/__pycache__/path.cpython-39.pyc +0 -0
  158. {truss-0.9.45.dev101 → truss-0.9.45rc9}/CODE_OF_CONDUCT.md +0 -0
  159. {truss-0.9.45.dev101 → truss-0.9.45rc9}/CONTRIBUTING.md +0 -0
  160. {truss-0.9.45.dev101 → truss-0.9.45rc9}/LICENSE +0 -0
  161. {truss-0.9.45.dev101 → truss-0.9.45rc9}/README.md +0 -0
  162. {truss-0.9.45.dev101 → truss-0.9.45rc9}/context_builder.Dockerfile +0 -0
  163. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/__init__.py +0 -0
  164. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/api/__init__.py +0 -0
  165. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/api/definitions.py +0 -0
  166. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/blob/blob_backend.py +0 -0
  167. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/blob/blob_backend_registry.py +0 -0
  168. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/blob/http_public_blob_backend.py +0 -0
  169. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/build.py +0 -0
  170. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/cli/__init__.py +0 -0
  171. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/cli/cli.py +0 -0
  172. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/config/trt_llm.py +0 -0
  173. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/constants.py +0 -0
  174. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/contexts/image_builder/cache_warmer.py +0 -0
  175. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/contexts/image_builder/image_builder.py +0 -0
  176. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/contexts/image_builder/serving_image_builder.py +0 -0
  177. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/contexts/image_builder/util.py +0 -0
  178. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/contexts/local_loader/docker_build_emulator.py +0 -0
  179. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/contexts/local_loader/load_model_local.py +0 -0
  180. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/contexts/local_loader/truss_module_loader.py +0 -0
  181. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/contexts/local_loader/utils.py +0 -0
  182. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/contexts/truss_context.py +0 -0
  183. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/custom_types.py +0 -0
  184. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/decorators.py +0 -0
  185. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/docker.py +0 -0
  186. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/errors.py +0 -0
  187. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/local/local_config.py +0 -0
  188. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/model_inference.py +0 -0
  189. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/notebook.py +0 -0
  190. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/patch/calc_patch.py +0 -0
  191. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/patch/constants.py +0 -0
  192. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/patch/custom_types.py +0 -0
  193. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/patch/dir_signature.py +0 -0
  194. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/patch/hash.py +0 -0
  195. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/patch/local_truss_patch_applier.py +0 -0
  196. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/patch/signature.py +0 -0
  197. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/patch/truss_dir_patch_applier.py +0 -0
  198. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/readme_generator.py +0 -0
  199. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/remote/baseten/__init__.py +0 -0
  200. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/remote/baseten/api.py +0 -0
  201. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/remote/baseten/auth.py +0 -0
  202. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/remote/baseten/core.py +0 -0
  203. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/remote/baseten/custom_types.py +0 -0
  204. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/remote/baseten/error.py +0 -0
  205. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/remote/baseten/remote.py +0 -0
  206. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/remote/baseten/service.py +0 -0
  207. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/remote/baseten/utils/status.py +0 -0
  208. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/remote/baseten/utils/tar.py +0 -0
  209. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/remote/baseten/utils/transfer.py +0 -0
  210. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/remote/remote_cli.py +0 -0
  211. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/remote/remote_factory.py +0 -0
  212. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/remote/truss_remote.py +0 -0
  213. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/README.md.jinja +0 -0
  214. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/__init__.py +0 -0
  215. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/base.Dockerfile.jinja +0 -0
  216. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/cache.Dockerfile.jinja +0 -0
  217. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/cache_requirements.txt +0 -0
  218. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/control/control/application.py +0 -0
  219. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/control/control/endpoints.py +0 -0
  220. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/control/control/helpers/context_managers.py +0 -0
  221. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/control/control/helpers/custom_types.py +0 -0
  222. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/control/control/helpers/errors.py +0 -0
  223. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/control/control/helpers/inference_server_controller.py +0 -0
  224. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/control/control/helpers/inference_server_process_controller.py +0 -0
  225. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/control/control/helpers/inference_server_starter.py +0 -0
  226. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/control/control/helpers/truss_patch/__init__.py +0 -0
  227. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/control/control/helpers/truss_patch/model_code_patch_applier.py +0 -0
  228. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/control/control/helpers/truss_patch/model_container_patch_applier.py +0 -0
  229. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/control/control/helpers/truss_patch/requirement_name_identifier.py +0 -0
  230. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/control/control/helpers/truss_patch/system_packages.py +0 -0
  231. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/control/control/server.py +0 -0
  232. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/control/requirements.txt +0 -0
  233. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/copy_cache_files.Dockerfile.jinja +0 -0
  234. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/custom/examples.yaml +0 -0
  235. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/custom/model/__init__.py +0 -0
  236. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/custom/model/model.py +0 -0
  237. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/docker_server/proxy.conf.jinja +0 -0
  238. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/docker_server/supervisord.conf.jinja +0 -0
  239. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/docker_server_requirements.txt +0 -0
  240. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/server/__init__.py +0 -0
  241. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/server/common/__init__.py +0 -0
  242. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/server/common/errors.py +0 -0
  243. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/server/common/patches/whisper/patch.py +0 -0
  244. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/server/common/patches.py +0 -0
  245. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/server/common/retry.py +0 -0
  246. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/server/common/schema.py +0 -0
  247. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/server/common/termination_handler_middleware.py +0 -0
  248. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/server/common/tracing.py +0 -0
  249. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/server/main.py +0 -0
  250. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/server.Dockerfile.jinja +0 -0
  251. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/shared/README.md +0 -0
  252. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/shared/__init__.py +0 -0
  253. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/shared/lazy_data_resolver.py +0 -0
  254. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/shared/logging.py +0 -0
  255. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/shared/secrets_resolver.py +0 -0
  256. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/shared/serialization.py +0 -0
  257. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/shared/util.py +0 -0
  258. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/trtllm-audio/model/model.py +0 -0
  259. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/trtllm-audio/packages/sigint_patch.py +0 -0
  260. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/trtllm-audio/packages/whisper_trt/__init__.py +0 -0
  261. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/trtllm-audio/packages/whisper_trt/assets.py +0 -0
  262. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/trtllm-audio/packages/whisper_trt/batching.py +0 -0
  263. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/trtllm-audio/packages/whisper_trt/custom_types.py +0 -0
  264. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/trtllm-audio/packages/whisper_trt/modeling.py +0 -0
  265. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/trtllm-audio/packages/whisper_trt/tokenizer.py +0 -0
  266. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/trtllm-audio/packages/whisper_trt/utils.py +0 -0
  267. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/trtllm-briton/README.md +0 -0
  268. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/trtllm-briton/packages/briton_pb2.py +0 -0
  269. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/trtllm-briton/packages/briton_pb2_grpc.py +0 -0
  270. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/trtllm-briton/src/engine.py +0 -0
  271. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/templates/trtllm-briton/src/extension.py +0 -0
  272. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/annotated_types_truss/config.yaml +0 -0
  273. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/annotated_types_truss/model/__init__.py +0 -0
  274. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/annotated_types_truss/model/model.py +0 -0
  275. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/auto-mpg.data +0 -0
  276. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/context_builder_image_test/Dockerfile +0 -0
  277. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/context_builder_image_test/test.py +0 -0
  278. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/gcs_fix/config.yaml +0 -0
  279. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/gcs_fix/model/__init__.py +0 -0
  280. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/gcs_fix/model/model.py +0 -0
  281. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/happy.ipynb +0 -0
  282. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/model_load_failure_test/model/model.py +0 -0
  283. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/patch_ping_test_server/app.py +0 -0
  284. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/pima-indians-diabetes.csv +0 -0
  285. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/readme_int_example.md +0 -0
  286. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/readme_no_example.md +0 -0
  287. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/readme_str_example.md +0 -0
  288. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/server.Dockerfile +0 -0
  289. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/server_conformance_test_truss/config.yaml +0 -0
  290. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/server_conformance_test_truss/model/__init__.py +0 -0
  291. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/server_conformance_test_truss/model/model.py +0 -0
  292. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_async_truss/config.yaml +0 -0
  293. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_async_truss/model/model.py +0 -0
  294. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_basic_truss/config.yaml +0 -0
  295. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_basic_truss/model/__init__.py +0 -0
  296. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_basic_truss/model/model.py +0 -0
  297. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_build_commands/config.yaml +0 -0
  298. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_build_commands/model/model.py +0 -0
  299. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_build_commands_failure/config.yaml +0 -0
  300. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_build_commands_failure/model/model.py +0 -0
  301. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_concurrency_truss/config.yaml +0 -0
  302. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_concurrency_truss/model/model.py +0 -0
  303. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_docker_server_truss/config.yaml +0 -0
  304. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_docker_server_truss/test_docker_image/Dockerfile +0 -0
  305. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_docker_server_truss/test_docker_image/README.md +0 -0
  306. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_docker_server_truss/test_docker_image/VERSION +0 -0
  307. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_docker_server_truss/test_docker_image/app.py +0 -0
  308. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_docker_server_truss/test_docker_image/build_upload_new_image.sh +0 -0
  309. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_pyantic_v1/config.yaml +0 -0
  310. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_pyantic_v1/model/__init__.py +0 -0
  311. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_pyantic_v1/model/model.py +0 -0
  312. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_pyantic_v1/requirements.txt +0 -0
  313. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_pyantic_v2/config.yaml +0 -0
  314. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_pyantic_v2/model/__init__.py +0 -0
  315. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_pyantic_v2/model/model.py +0 -0
  316. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_pyantic_v2/requirements.txt +0 -0
  317. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_requirements_file_truss/config.yaml +0 -0
  318. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_requirements_file_truss/model/__init__.py +0 -0
  319. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_requirements_file_truss/model/model.py +0 -0
  320. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_requirements_file_truss/requirements.txt +0 -0
  321. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_streaming_async_generator_truss/config.yaml +0 -0
  322. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_streaming_async_generator_truss/model/model.py +0 -0
  323. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_streaming_read_timeout/config.yaml +0 -0
  324. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_streaming_read_timeout/model/model.py +0 -0
  325. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_streaming_truss/config.yaml +0 -0
  326. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_streaming_truss/model/model.py +0 -0
  327. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_streaming_truss_with_error/config.yaml +0 -0
  328. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_streaming_truss_with_error/model/model.py +0 -0
  329. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_streaming_truss_with_error/packages/helpers_1.py +0 -0
  330. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_streaming_truss_with_error/packages/helpers_2.py +0 -0
  331. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_streaming_truss_with_tracing/config.yaml +0 -0
  332. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_streaming_truss_with_tracing/model/model.py +0 -0
  333. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_trt_llm_truss/config.yaml +0 -0
  334. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_trt_llm_truss/model/__init__.py +0 -0
  335. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_trt_llm_truss/model/model.py +0 -0
  336. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_truss/config.yaml +0 -0
  337. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_truss/examples.yaml +0 -0
  338. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_truss/model/__init__.py +0 -0
  339. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_truss/model/dummy +0 -0
  340. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_truss/model/model.py +0 -0
  341. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_truss/packages/test_package/test.py +0 -0
  342. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_truss_server_caching_truss/config.yaml +0 -0
  343. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_truss_server_caching_truss/model/__init__.py +0 -0
  344. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_truss_server_caching_truss/model/model.py +0 -0
  345. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_truss_with_error/config.yaml +0 -0
  346. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_truss_with_error/model/__init__.py +0 -0
  347. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_truss_with_error/model/model.py +0 -0
  348. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_truss_with_error/packages/helpers_1.py +0 -0
  349. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/test_data/test_truss_with_error/packages/helpers_2.py +0 -0
  350. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/__init__.py +0 -0
  351. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/conftest.py +0 -0
  352. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/contexts/image_builder/test_serving_image_builder.py +0 -0
  353. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/contexts/local_loader/test_load_local.py +0 -0
  354. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/contexts/local_loader/test_truss_module_finder.py +0 -0
  355. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/helpers.py +0 -0
  356. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/local/__init__.py +0 -0
  357. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/local/test_local_config_handler.py +0 -0
  358. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/patch/test_calc_patch.py +0 -0
  359. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/patch/test_dir_signature.py +0 -0
  360. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/patch/test_hash.py +0 -0
  361. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/patch/test_signature.py +0 -0
  362. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/patch/test_truss_dir_patch_applier.py +0 -0
  363. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/patch/test_types.py +0 -0
  364. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/remote/baseten/test_api.py +0 -0
  365. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/remote/baseten/test_auth.py +0 -0
  366. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/remote/baseten/test_core.py +0 -0
  367. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/remote/baseten/test_remote.py +0 -0
  368. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/remote/baseten/test_service.py +0 -0
  369. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/remote/test_remote_factory.py +0 -0
  370. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/remote/test_truss_remote.py +0 -0
  371. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/templates/control/control/helpers/test_context_managers.py +0 -0
  372. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/templates/control/control/helpers/test_model_container_patch_applier.py +0 -0
  373. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/templates/control/control/helpers/test_requirement_name_identifier.py +0 -0
  374. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/templates/control/control/test_server.py +0 -0
  375. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/templates/control/control/test_server_integration.py +0 -0
  376. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/templates/core/server/test_lazy_data_resolver.py +0 -0
  377. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/templates/core/server/test_secrets_resolver.py +0 -0
  378. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/templates/server/common/test_retry.py +0 -0
  379. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/templates/server/common/test_termination_handler_middleware.py +0 -0
  380. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/templates/server/test_model_wrapper.py +0 -0
  381. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/templates/server/test_schema.py +0 -0
  382. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/templates/server/test_truss_server.py +0 -0
  383. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/test_build.py +0 -0
  384. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/test_config.py +0 -0
  385. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/test_context_builder_image.py +0 -0
  386. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/test_control_truss_patching.py +0 -0
  387. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/test_docker.py +0 -0
  388. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/test_model_schema.py +0 -0
  389. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/test_testing_utilities_for_other_tests.py +0 -0
  390. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/test_truss_gatherer.py +0 -0
  391. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/test_truss_handle.py +0 -0
  392. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/test_trussless_docker_server.py +0 -0
  393. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/test_util.py +0 -0
  394. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/test_validation.py +0 -0
  395. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/trt_llm/test_validation.py +0 -0
  396. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/util/test_config_checks.py +0 -0
  397. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/tests/util/test_path.py +0 -0
  398. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/trt_llm/validation.py +0 -0
  399. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/truss_config.py +0 -0
  400. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/truss_gatherer.py +0 -0
  401. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/truss_spec.py +0 -0
  402. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/util/.truss_ignore +0 -0
  403. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/util/config_checks.py +0 -0
  404. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/util/data_structures.py +0 -0
  405. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/util/download.py +0 -0
  406. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/util/errors.py +0 -0
  407. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/util/gpu.py +0 -0
  408. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/util/jinja.py +0 -0
  409. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/util/log_utils.py +0 -0
  410. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/util/path.py +0 -0
  411. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss/validation.py +0 -0
  412. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss-chains/truss_chains/__init__.py +0 -0
  413. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss-chains/truss_chains/code_gen.py +0 -0
  414. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss-chains/truss_chains/definitions.py +0 -0
  415. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss-chains/truss_chains/example_chainlet.py +0 -0
  416. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss-chains/truss_chains/model_skeleton.py +0 -0
  417. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss-chains/truss_chains/public_api.py +0 -0
  418. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss-chains/truss_chains/py.typed +0 -0
  419. {truss-0.9.45.dev101 → truss-0.9.45rc9}/truss-chains/truss_chains/remote.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: truss
3
- Version: 0.9.45.dev101
3
+ Version: 0.9.45rc9
4
4
  Summary: A seamless bridge from model development to model delivery
5
5
  Home-page: https://github.com/basetenlabs/truss
6
6
  License: MIT
@@ -17,7 +17,7 @@ Classifier: Programming Language :: Python :: 3.11
17
17
  Classifier: Programming Language :: Python :: 3.12
18
18
  Requires-Dist: Jinja2 (>=3.1.2,<4.0.0)
19
19
  Requires-Dist: PyYAML (>=6.0)
20
- Requires-Dist: aiohttp (>=3.10.10,<4.0.0)
20
+ Requires-Dist: aiofiles (>=24.1.0,<25.0.0)
21
21
  Requires-Dist: blake3 (>=0.3.3,<0.4.0)
22
22
  Requires-Dist: boto3 (>=1.34.85,<2.0.0)
23
23
  Requires-Dist: fastapi (>=0.109.1)
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "truss"
3
- version = "0.9.45dev101"
3
+ version = "0.9.45rc009"
4
4
  description = "A seamless bridge from model development to model delivery"
5
5
  license = "MIT"
6
6
  readme = "README.md"
@@ -27,7 +27,7 @@ packages = [
27
27
  "Baseten" = "https://baseten.co"
28
28
 
29
29
  [tool.poetry.dependencies]
30
- aiohttp = "^3.10.10"
30
+ aiofiles = "^24.1.0"
31
31
  blake3 = "^0.3.3"
32
32
  boto3 = "^1.34.85"
33
33
  fastapi = ">=0.109.1"
@@ -97,6 +97,7 @@ pytest = "7.2.0"
97
97
  pytest-cov = "^3.0.0"
98
98
  types-PyYAML = "^6.0.12.12"
99
99
  types-setuptools = "^69.0.0.0"
100
+ types-aiofiles = "^24.1.0.20240626"
100
101
 
101
102
  [tool.poetry.scripts]
102
103
  truss = 'truss.cli:truss_cli'
@@ -75,6 +75,18 @@ class LocalConfigHandler:
75
75
  bptr_data_dir.mkdir(exist_ok=True, parents=True)
76
76
  return bptr_data_dir
77
77
 
78
+ @staticmethod
79
+ def dynamic_config_path():
80
+ dynamic_config_dir = LocalConfigHandler.TRUSS_CONFIG_DIR / "b10_dynamic_config"
81
+ dynamic_config_dir.mkdir(exist_ok=True, parents=True)
82
+ return dynamic_config_dir
83
+
84
+ @staticmethod
85
+ def set_dynamic_config(key: str, value: str):
86
+ key_path = LocalConfigHandler.dynamic_config_path() / key
87
+ with key_path.open("w") as key_file:
88
+ key_file.write(value)
89
+
78
90
  @staticmethod
79
91
  def _signatures_dir_path():
80
92
  return LocalConfigHandler.TRUSS_CONFIG_DIR / "signatures"
@@ -4,6 +4,7 @@ import enum
4
4
  import importlib
5
5
  import importlib.util
6
6
  import inspect
7
+ import json
7
8
  import logging
8
9
  import os
9
10
  import pathlib
@@ -35,7 +36,7 @@ from common.retry import retry
35
36
  from common.schema import TrussSchema
36
37
  from opentelemetry import trace
37
38
  from pydantic import BaseModel
38
- from shared import serialization
39
+ from shared import dynamic_config_resolver, serialization
39
40
  from shared.lazy_data_resolver import LazyDataResolver
40
41
  from shared.secrets_resolver import SecretsResolver
41
42
 
@@ -53,6 +54,7 @@ EXTENSIONS_DIR_NAME = "extensions"
53
54
  EXTENSION_CLASS_NAME = "Extension"
54
55
  EXTENSION_FILE_NAME = "extension"
55
56
  TRT_LLM_EXTENSION_NAME = "trt_llm"
57
+ POLL_FOR_ENVIRONMENT_UPDATES_TIMEOUT_SECS = 30
56
58
 
57
59
 
58
60
  @asynccontextmanager
@@ -191,6 +193,7 @@ class ModelDescriptor:
191
193
  predict: MethodDescriptor
192
194
  postprocess: Optional[MethodDescriptor]
193
195
  truss_schema: Optional[TrussSchema]
196
+ setup_environment: Optional[MethodDescriptor]
194
197
 
195
198
  @cached_property
196
199
  def skip_input_parsing(self) -> bool:
@@ -243,11 +246,19 @@ class ModelDescriptor:
243
246
  else:
244
247
  return_annotation = inspect.signature(model.predict).return_annotation
245
248
 
249
+ if hasattr(model, "setup_environment"):
250
+ setup_environment = MethodDescriptor.from_method(
251
+ model.setup_environment, "setup_environment"
252
+ )
253
+ else:
254
+ setup_environment = None
255
+
246
256
  return cls(
247
257
  preprocess=preprocess,
248
258
  predict=predict,
249
259
  postprocess=postprocess,
250
260
  truss_schema=TrussSchema.from_signature(parameters, return_annotation),
261
+ setup_environment=setup_environment,
251
262
  )
252
263
 
253
264
 
@@ -259,6 +270,8 @@ class ModelWrapper:
259
270
  _logger: logging.Logger
260
271
  _status: "ModelWrapper.Status"
261
272
  _predict_semaphore: Semaphore
273
+ _poll_for_environment_updates_task: Optional[asyncio.Task]
274
+ _environment: Optional[dict]
262
275
 
263
276
  class Status(Enum):
264
277
  NOT_READY = 0
@@ -280,6 +293,8 @@ class ModelWrapper:
280
293
  "predict_concurrency", DEFAULT_PREDICT_CONCURRENCY
281
294
  )
282
295
  )
296
+ self._poll_for_environment_updates_task = None
297
+ self._environment = None
283
298
 
284
299
  @property
285
300
  def _model(self) -> Any:
@@ -419,6 +434,9 @@ class ModelWrapper:
419
434
 
420
435
  self._maybe_model_descriptor = ModelDescriptor.from_model(self._model)
421
436
 
437
+ if self._maybe_model_descriptor.setup_environment:
438
+ self._initialize_environment_before_load()
439
+
422
440
  if hasattr(self._model, "load"):
423
441
  retry(
424
442
  self._model.load,
@@ -428,6 +446,76 @@ class ModelWrapper:
428
446
  gap_seconds=1.0,
429
447
  )
430
448
 
449
+ def setup_polling_for_environment_updates(self):
450
+ self._poll_for_environment_updates_task = asyncio.create_task(
451
+ self.poll_for_environment_updates()
452
+ )
453
+
454
+ def _initialize_environment_before_load(self):
455
+ environment_str = dynamic_config_resolver.get_dynamic_config_value_sync(
456
+ dynamic_config_resolver.ENVIRONMENT_DYNAMIC_CONFIG_KEY
457
+ )
458
+ if environment_str:
459
+ environment_json = json.loads(environment_str)
460
+ self._logger.info(
461
+ f"Executing model.setup_environment with environment: {environment_json}"
462
+ )
463
+ # TODO: Support calling an async setup_environment() here once we support async load()
464
+ self._model.setup_environment(environment_json)
465
+ self._environment = environment_json
466
+
467
+ async def setup_environment(self, environment: Optional[dict]):
468
+ descriptor = self.model_descriptor.setup_environment
469
+ if not descriptor:
470
+ return
471
+ self._logger.info(
472
+ f"Executing model.setup_environment with new environment: {environment}"
473
+ )
474
+ if descriptor.is_async:
475
+ return await self._model.setup_environment(environment)
476
+ else:
477
+ return await to_thread.run_sync(self._model.setup_environment, environment)
478
+
479
+ async def poll_for_environment_updates(self) -> None:
480
+ last_modified_time = None
481
+ environment_config_filename = (
482
+ dynamic_config_resolver.get_dynamic_config_file_path(
483
+ dynamic_config_resolver.ENVIRONMENT_DYNAMIC_CONFIG_KEY
484
+ )
485
+ )
486
+
487
+ while True:
488
+ # Give control back to the event loop while waiting for environment updates
489
+ await asyncio.sleep(POLL_FOR_ENVIRONMENT_UPDATES_TIMEOUT_SECS)
490
+
491
+ # Wait for load to finish before checking for environment updates
492
+ if not self.ready:
493
+ continue
494
+
495
+ # Skip polling if no setup_environment implementation provided
496
+ if not self.model_descriptor.setup_environment:
497
+ break
498
+
499
+ if environment_config_filename.exists():
500
+ try:
501
+ current_mtime = os.path.getmtime(environment_config_filename)
502
+ if not last_modified_time or last_modified_time != current_mtime:
503
+ environment_str = await dynamic_config_resolver.get_dynamic_config_value_async(
504
+ dynamic_config_resolver.ENVIRONMENT_DYNAMIC_CONFIG_KEY
505
+ )
506
+ if environment_str:
507
+ last_modified_time = current_mtime
508
+ environment_json = json.loads(environment_str)
509
+ # Avoid rerunning `setup_environment` with the same environment
510
+ if self._environment != environment_json:
511
+ await self.setup_environment(environment_json)
512
+ self._environment = environment_json
513
+ except Exception as e:
514
+ self._logger.exception(
515
+ "Exception while setting up environment: " + str(e),
516
+ exc_info=errors.filter_traceback(self._model_file_name),
517
+ )
518
+
431
519
  async def preprocess(
432
520
  self,
433
521
  inputs: serialization.InputType,
@@ -17,3 +17,4 @@ pyyaml==6.0.0
17
17
  requests==2.31.0
18
18
  uvicorn==0.24.0
19
19
  uvloop==0.19.0
20
+ aiofiles==24.1.0
@@ -281,6 +281,7 @@ class TrussServer:
281
281
  if self._setup_json_logger:
282
282
  setup_logging()
283
283
  self._model.start_load_thread()
284
+ self._model.setup_polling_for_environment_updates()
284
285
 
285
286
  def create_application(self):
286
287
  app = FastAPI(
@@ -0,0 +1,28 @@
1
+ from pathlib import Path
2
+ from typing import Optional
3
+
4
+ import aiofiles
5
+
6
+ DYNAMIC_CONFIG_MOUNT_DIR = "/etc/b10_dynamic_config"
7
+ ENVIRONMENT_DYNAMIC_CONFIG_KEY = "environment"
8
+
9
+
10
+ def get_dynamic_config_value_sync(key: str) -> Optional[str]:
11
+ dynamic_config_path = Path(DYNAMIC_CONFIG_MOUNT_DIR) / key
12
+ if dynamic_config_path.exists():
13
+ with dynamic_config_path.open() as dynamic_config_file:
14
+ return dynamic_config_file.read()
15
+ return None
16
+
17
+
18
+ def get_dynamic_config_file_path(key: str):
19
+ dynamic_config_path = Path(DYNAMIC_CONFIG_MOUNT_DIR) / key
20
+ return dynamic_config_path
21
+
22
+
23
+ async def get_dynamic_config_value_async(key: str) -> Optional[str]:
24
+ dynamic_config_path = get_dynamic_config_file_path(key)
25
+ if dynamic_config_path.exists():
26
+ async with aiofiles.open(dynamic_config_path, "r") as dynamic_config_file:
27
+ return await dynamic_config_file.read()
28
+ return None
@@ -0,0 +1,2 @@
1
+ model_name: Test Load Failure
2
+ python_version: py39
@@ -0,0 +1,126 @@
1
+ import json
2
+
3
+ import aiofiles
4
+ import pytest
5
+ from truss.templates.shared import dynamic_config_resolver
6
+
7
+ from truss_chains import definitions
8
+
9
+
10
+ @pytest.mark.parametrize(
11
+ "config",
12
+ [
13
+ {
14
+ "RandInt": {
15
+ "predict_url": "https://model-id.api.baseten.co/deployment/deployment-id/predict"
16
+ }
17
+ },
18
+ {},
19
+ "",
20
+ ],
21
+ )
22
+ def test_get_dynamic_chainlet_config_value_sync(
23
+ config, tmp_path, dynamic_config_mount_dir
24
+ ):
25
+ with (tmp_path / definitions.DYNAMIC_CHAINLET_CONFIG_KEY).open("w") as f:
26
+ f.write(json.dumps(config))
27
+ chainlet_service_config = dynamic_config_resolver.get_dynamic_config_value_sync(
28
+ definitions.DYNAMIC_CHAINLET_CONFIG_KEY
29
+ )
30
+ assert json.loads(chainlet_service_config) == config
31
+
32
+
33
+ @pytest.mark.parametrize(
34
+ "config",
35
+ [
36
+ {
37
+ "environment_name": "production",
38
+ "foo": "bar",
39
+ },
40
+ {},
41
+ "",
42
+ None,
43
+ ],
44
+ )
45
+ def test_get_dynamic_config_environment_value_sync(
46
+ config, tmp_path, dynamic_config_mount_dir
47
+ ):
48
+ with (tmp_path / dynamic_config_resolver.ENVIRONMENT_DYNAMIC_CONFIG_KEY).open(
49
+ "w"
50
+ ) as f:
51
+ f.write(json.dumps(config))
52
+ environment_str = dynamic_config_resolver.get_dynamic_config_value_sync(
53
+ dynamic_config_resolver.ENVIRONMENT_DYNAMIC_CONFIG_KEY
54
+ )
55
+ assert json.loads(environment_str) == config
56
+
57
+
58
+ def test_get_missing_config_value_sync(dynamic_config_mount_dir):
59
+ chainlet_service_config = dynamic_config_resolver.get_dynamic_config_value_sync(
60
+ definitions.DYNAMIC_CHAINLET_CONFIG_KEY
61
+ )
62
+ assert not chainlet_service_config
63
+
64
+
65
+ @pytest.mark.asyncio
66
+ @pytest.mark.parametrize(
67
+ "config",
68
+ [
69
+ {
70
+ "RandInt": {
71
+ "predict_url": "https://model-id.api.baseten.co/deployment/deployment-id/predict"
72
+ }
73
+ },
74
+ {},
75
+ "",
76
+ ],
77
+ )
78
+ async def test_get_dynamic_chainlet_config_value_async(
79
+ config, tmp_path, dynamic_config_mount_dir
80
+ ):
81
+ async with aiofiles.open(
82
+ tmp_path / definitions.DYNAMIC_CHAINLET_CONFIG_KEY, "w"
83
+ ) as f:
84
+ await f.write(json.dumps(config))
85
+ chainlet_service_config = (
86
+ await dynamic_config_resolver.get_dynamic_config_value_async(
87
+ definitions.DYNAMIC_CHAINLET_CONFIG_KEY
88
+ )
89
+ )
90
+ assert json.loads(chainlet_service_config) == config
91
+
92
+
93
+ @pytest.mark.asyncio
94
+ @pytest.mark.parametrize(
95
+ "config",
96
+ [
97
+ {
98
+ "environment_name": "production",
99
+ "foo": "bar",
100
+ },
101
+ {},
102
+ "",
103
+ None,
104
+ ],
105
+ )
106
+ async def test_get_dynamic_config_environment_value_async(
107
+ config, tmp_path, dynamic_config_mount_dir
108
+ ):
109
+ async with aiofiles.open(
110
+ tmp_path / dynamic_config_resolver.ENVIRONMENT_DYNAMIC_CONFIG_KEY, "w"
111
+ ) as f:
112
+ await f.write(json.dumps(config))
113
+ environment_str = await dynamic_config_resolver.get_dynamic_config_value_async(
114
+ dynamic_config_resolver.ENVIRONMENT_DYNAMIC_CONFIG_KEY
115
+ )
116
+ assert json.loads(environment_str) == config
117
+
118
+
119
+ @pytest.mark.asyncio
120
+ async def test_get_missing_config_value_async(dynamic_config_mount_dir):
121
+ chainlet_service_config = (
122
+ await dynamic_config_resolver.get_dynamic_config_value_async(
123
+ definitions.DYNAMIC_CHAINLET_CONFIG_KEY
124
+ )
125
+ )
126
+ assert not chainlet_service_config
@@ -760,6 +760,119 @@ def test_slow_truss():
760
760
  _test_invocations(200)
761
761
 
762
762
 
763
+ @pytest.mark.integration
764
+ def test_setup_environment():
765
+ # Test truss that uses setup_environment() without load()
766
+ model = """
767
+ from typing import Optional
768
+ class Model:
769
+ def setup_environment(self, environment: Optional[dict]):
770
+ print("setup_environment called with", environment)
771
+ self.environment_name = environment.get("name") if environment else None
772
+ print(f"in {self.environment_name} environment")
773
+
774
+ def predict(self, model_input):
775
+ return model_input
776
+ """
777
+ config = "model_name: setup-environment-truss"
778
+ with ensure_kill_all(), temp_truss(model, config) as tr:
779
+ container = tr.docker_run(
780
+ local_port=8090,
781
+ detach=True,
782
+ wait_for_server_ready=True,
783
+ )
784
+ # Mimic environment changing to beta
785
+ beta_env = {"name": "beta"}
786
+ beta_env_str = json.dumps(beta_env)
787
+ container.execute(
788
+ [
789
+ "bash",
790
+ "-c",
791
+ f"echo '{beta_env_str}' > /etc/b10_dynamic_config/environment",
792
+ ]
793
+ )
794
+ time.sleep(30)
795
+ single_quote_beta_env_str = beta_env_str.replace('"', "'")
796
+ assert (
797
+ f"Executing model.setup_environment with environment: {single_quote_beta_env_str}"
798
+ in container.logs()
799
+ )
800
+ assert (
801
+ f"setup_environment called with {single_quote_beta_env_str}"
802
+ in container.logs()
803
+ )
804
+ assert "in beta environment" in container.logs()
805
+ container.execute(
806
+ [
807
+ "bash",
808
+ "-c",
809
+ "rm -f /etc/b10_dynamic_config/environment",
810
+ ]
811
+ )
812
+
813
+ # Test a truss that uses the environment in load()
814
+ model = """
815
+ from typing import Optional
816
+ class Model:
817
+ def setup_environment(self, environment: Optional[dict]):
818
+ print("setup_environment called with", environment)
819
+ self.environment_name = environment.get("name") if environment else None
820
+ print(f"in {self.environment_name} environment")
821
+
822
+ def load(self):
823
+ print("loading in environment", self.environment_name)
824
+
825
+ def predict(self, model_input):
826
+ return model_input
827
+ """
828
+ config = "model_name: setup-environment-and-load-truss"
829
+ with ensure_kill_all(), temp_truss(model, config) as tr:
830
+ # Mimic environment changing to staging
831
+ staging_env = {"name": "staging"}
832
+ staging_env_str = json.dumps(staging_env)
833
+ LocalConfigHandler.set_dynamic_config("environment", staging_env_str)
834
+ container = tr.docker_run(
835
+ local_port=8090,
836
+ detach=True,
837
+ wait_for_server_ready=True,
838
+ )
839
+ # Don't need to wait here because we explicitly grab the environment from dynamic_config_resolver before calling user's load()
840
+ single_quote_staging_env_str = staging_env_str.replace('"', "'")
841
+ assert (
842
+ f"Executing model.setup_environment with environment: {single_quote_staging_env_str}"
843
+ in container.logs()
844
+ )
845
+ assert (
846
+ f"setup_environment called with {single_quote_staging_env_str}"
847
+ in container.logs()
848
+ )
849
+ assert "in staging environment" in container.logs()
850
+ assert "loading in environment staging" in container.logs()
851
+ # Set environment to None
852
+ no_env = None
853
+ no_env_str = json.dumps(no_env)
854
+ container.execute(
855
+ [
856
+ "bash",
857
+ "-c",
858
+ f"echo '{no_env_str}' > /etc/b10_dynamic_config/environment",
859
+ ]
860
+ )
861
+ time.sleep(30)
862
+ assert (
863
+ f"Executing model.setup_environment with new environment: {no_env}"
864
+ in container.logs()
865
+ )
866
+ assert "setup_environment called with None" in container.logs()
867
+ container.execute(
868
+ [
869
+ "bash",
870
+ "-c",
871
+ "rm -f /etc/b10_dynamic_config/environment",
872
+ ]
873
+ )
874
+
875
+
763
876
  # Tracing ##############################################################################
764
877
 
765
878
 
@@ -298,6 +298,12 @@ class TrussHandle:
298
298
  f"src={str(LocalConfigHandler.bptr_data_resolution_dir_path())}",
299
299
  "target=/bptr",
300
300
  ],
301
+ [
302
+ "type=bind",
303
+ f"src={str(LocalConfigHandler.dynamic_config_path())}",
304
+ "target=/etc/b10_dynamic_config",
305
+ "readonly=false",
306
+ ],
301
307
  ],
302
308
  gpus=gpus,
303
309
  envs=envs,
@@ -11,6 +11,7 @@ import pathlib
11
11
  import pprint
12
12
  import sys
13
13
  import types
14
+ import warnings
14
15
  from typing import (
15
16
  Any,
16
17
  Callable,
@@ -268,6 +269,25 @@ def _validate_and_describe_endpoint(
268
269
  is_async = False
269
270
  is_generator = inspect.isgeneratorfunction(endpoint_method)
270
271
 
272
+ if not is_async:
273
+ warnings.warn(
274
+ "`run_remote` must be an async (coroutine) function in future releases. "
275
+ "Replace `def run_remote(...` with `async def run_remote(...`. "
276
+ "Local testing and execution can be done with "
277
+ "`asyncio.run(my_chainlet.run_remote(...))`.\n"
278
+ "Note on concurrency: previously sync functions were run in threads by the "
279
+ "Truss server.\bn"
280
+ "For some frameworks this was **unsafe** (e.g. in torch the CUDA context "
281
+ "is not thread-safe).\n"
282
+ "Additionally, python threads hold the GIL and therefore might not give "
283
+ "actual throughput gains.\n"
284
+ "To achieve safe and performant concurrency, use framework-specific async "
285
+ "APIs (e.g. AsyncLLMEngine for vLLM) or generic async batching like such "
286
+ "as https://github.com/hussein-awala/async-batcher.",
287
+ DeprecationWarning,
288
+ stacklevel=1,
289
+ )
290
+
271
291
  return definitions.EndpointAPIDescriptor(
272
292
  input_args=input_args,
273
293
  output_types=output_types,
@@ -7,7 +7,6 @@ import time
7
7
  from typing import Any, ClassVar, Mapping, Optional, Type, TypeVar, final
8
8
 
9
9
  import httpx
10
- import aiohttp
11
10
  import tenacity
12
11
 
13
12
  from truss_chains import definitions, utils
@@ -82,20 +81,17 @@ class BasetenSession:
82
81
  assert self._cached_sync_client is not None
83
82
  return self._cached_sync_client[0]
84
83
 
85
- async def _client_async(self) -> aiohttp.ClientSession:
84
+ async def _client_async(self) -> httpx.AsyncClient:
86
85
  # Check `_client_cycle_needed` before and after locking to avoid
87
86
  # needing a lock each time the client is accessed.
88
87
  if self._client_cycle_needed(self._cached_async_client):
89
88
  async with self._async_lock:
90
89
  if self._client_cycle_needed(self._cached_async_client):
91
- connector = aiohttp.TCPConnector(
92
- limit=self._client_limits.max_connections,
93
- )
94
90
  self._cached_async_client = (
95
- aiohttp.ClientSession(
91
+ httpx.AsyncClient(
96
92
  headers=self._auth_header,
97
- connector=connector,
98
- timeout=aiohttp.ClientTimeout(total=self._service_descriptor.options.timeout_sec),
93
+ timeout=self._service_descriptor.options.timeout_sec,
94
+ limits=self._client_limits,
99
95
  ),
100
96
  int(time.time()),
101
97
  )
@@ -142,7 +138,7 @@ class BasetenSession:
142
138
  resp = await client.post(
143
139
  self._service_descriptor.predict_url, json=json_payload
144
140
  )
145
- return await utils.handle_async_response(resp, self.name)
141
+ return utils.handle_response(resp, self.name)
146
142
  # As a special case we invalidate the client in case of certificate
147
143
  # errors. This has happened in the past and is a defensive measure.
148
144
  except ssl.SSLError:
@@ -134,7 +134,7 @@ def override_chainlet_to_service_metadata(
134
134
  chainlet_to_service: Mapping[str, definitions.ServiceDescriptor],
135
135
  ):
136
136
  # Override predict_urls in chainlet_to_service ServiceDescriptors if dynamic_chainlet_config exists
137
- dynamic_chainlet_config_str = dynamic_config_resolver.get_dynamic_config_value(
137
+ dynamic_chainlet_config_str = dynamic_config_resolver.get_dynamic_config_value_sync(
138
138
  definitions.DYNAMIC_CHAINLET_CONFIG_KEY
139
139
  )
140
140
  if dynamic_chainlet_config_str:
@@ -309,45 +309,6 @@ def handle_response(response: httpx.Response, remote_name: str) -> Any:
309
309
  return response.json()
310
310
 
311
311
 
312
- async def handle_async_response(response: httpx.Response, remote_name: str) -> Any:
313
- """For successful requests returns JSON, otherwise raises error.
314
- """
315
- if response.status >= 400:
316
- try:
317
- response_json = await response.json()
318
- except Exception as e:
319
- raise ValueError(
320
- "Could not get JSON from error response. Status: "
321
- f"`{response.status}`."
322
- ) from e
323
- try:
324
- error_json = response_json["error"]
325
- except KeyError as e:
326
- logging.error(f"response_json: {response_json}")
327
- raise ValueError(
328
- "Could not get `error` field from JSON from error response"
329
- ) from e
330
- try:
331
- error = definitions.RemoteErrorDetail.model_validate(error_json)
332
- except pydantic.ValidationError as e:
333
- if isinstance(error_json, str):
334
- msg = f"Remote error occurred in `{remote_name}`: '{error_json}'"
335
- raise definitions.GenericRemoteException(msg) from None
336
- raise ValueError(
337
- "Could not parse error. Error details are expected to be either a "
338
- "plain string (old truss models) or a serialized "
339
- f"`definitions.RemoteErrorDetail.__name__`, got:\n{repr(error_json)}"
340
- ) from e
341
- exception_cls = _resolve_exception_class(error)
342
- msg = (
343
- f"(showing remote errors, root message at the bottom)\n"
344
- f"--> Preceding Remote Cause:\n"
345
- f"{textwrap.indent(error.format(), ' ')}"
346
- )
347
- raise exception_cls(msg)
348
- return await response.json()
349
-
350
-
351
312
  class InjectedError(Exception):
352
313
  """Test error for debugging/dev."""
353
314
 
@@ -1,2 +0,0 @@
1
- # Created by pytest automatically.
2
- *
@@ -1,4 +0,0 @@
1
- Signature: 8a477f597d28d172789f06886806bc55
2
- # This file is a cache directory tag created by pytest.
3
- # For information about cache directory tags, see:
4
- # https://bford.info/cachedir/spec.html
@@ -1,8 +0,0 @@
1
- # pytest cache directory #
2
-
3
- This directory contains data from the pytest's cache plugin,
4
- which provides the `--lf` and `--ff` options, as well as the `cache` fixture.
5
-
6
- **Do not** commit this to version control.
7
-
8
- See [the docs](https://docs.pytest.org/en/stable/how-to/cache.html) for more information.