synapse-sdk 1.0.0a38__tar.gz → 1.0.0a40__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 (162) hide show
  1. {synapse_sdk-1.0.0a38/synapse_sdk.egg-info → synapse_sdk-1.0.0a40}/PKG-INFO +2 -1
  2. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/pyproject.toml +2 -1
  3. synapse_sdk-1.0.0a40/synapse_sdk/plugins/categories/neural_net/actions/deployment.py +58 -0
  4. synapse_sdk-1.0.0a40/synapse_sdk/plugins/categories/neural_net/actions/gradio.py +131 -0
  5. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/utils/file.py +4 -0
  6. synapse_sdk-1.0.0a40/synapse_sdk/utils/http.py +110 -0
  7. synapse_sdk-1.0.0a40/synapse_sdk/utils/network.py +37 -0
  8. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40/synapse_sdk.egg-info}/PKG-INFO +2 -1
  9. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk.egg-info/SOURCES.txt +2 -0
  10. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk.egg-info/requires.txt +1 -0
  11. synapse_sdk-1.0.0a38/synapse_sdk/plugins/categories/neural_net/actions/deployment.py +0 -107
  12. synapse_sdk-1.0.0a38/synapse_sdk/utils/network.py +0 -16
  13. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/.github/workflows/lint.yml +0 -0
  14. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/.github/workflows/pypi-publish.yml +0 -0
  15. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/.gitignore +0 -0
  16. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/.pre-commit-config.yaml +0 -0
  17. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/LICENSE +0 -0
  18. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/README.md +0 -0
  19. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/locale/en/LC_MESSAGES/messages.mo +0 -0
  20. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/locale/en/LC_MESSAGES/messages.po +0 -0
  21. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/locale/ko/LC_MESSAGES/messages.mo +0 -0
  22. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/locale/ko/LC_MESSAGES/messages.po +0 -0
  23. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/requirements.test.txt +0 -0
  24. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/requirements.txt +0 -0
  25. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/setup.cfg +0 -0
  26. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/__init__.py +0 -0
  27. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/cli/__init__.py +0 -0
  28. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/cli/alias/__init__.py +0 -0
  29. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/cli/alias/create.py +0 -0
  30. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/cli/alias/dataclass.py +0 -0
  31. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/cli/alias/default.py +0 -0
  32. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/cli/alias/delete.py +0 -0
  33. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/cli/alias/list.py +0 -0
  34. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/cli/alias/read.py +0 -0
  35. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/cli/alias/update.py +0 -0
  36. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/cli/alias/utils.py +0 -0
  37. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/cli/plugin/__init__.py +0 -0
  38. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/cli/plugin/create.py +0 -0
  39. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/cli/plugin/publish.py +0 -0
  40. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/cli/plugin/run.py +0 -0
  41. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/clients/__init__.py +0 -0
  42. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/clients/agent/__init__.py +0 -0
  43. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/clients/agent/core.py +0 -0
  44. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/clients/agent/ray.py +0 -0
  45. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/clients/agent/service.py +0 -0
  46. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/clients/backend/__init__.py +0 -0
  47. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/clients/backend/annotation.py +0 -0
  48. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/clients/backend/core.py +0 -0
  49. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/clients/backend/dataset.py +0 -0
  50. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/clients/backend/hitl.py +0 -0
  51. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/clients/backend/integration.py +0 -0
  52. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/clients/backend/ml.py +0 -0
  53. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/clients/backend/models.py +0 -0
  54. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/clients/base.py +0 -0
  55. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/clients/exceptions.py +0 -0
  56. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/clients/ray/__init__.py +0 -0
  57. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/clients/ray/core.py +0 -0
  58. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/clients/ray/serve.py +0 -0
  59. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/clients/utils.py +0 -0
  60. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/clients/validators/__init__.py +0 -0
  61. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/clients/validators/collections.py +0 -0
  62. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/i18n.py +0 -0
  63. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/loggers.py +0 -0
  64. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/__init__.py +0 -0
  65. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/__init__.py +0 -0
  66. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/base.py +0 -0
  67. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/data_validation/__init__.py +0 -0
  68. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/data_validation/actions/__init__.py +0 -0
  69. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/data_validation/actions/validation.py +0 -0
  70. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/data_validation/templates/config.yaml +0 -0
  71. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/data_validation/templates/plugin/__init__.py +0 -0
  72. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/data_validation/templates/plugin/validation.py +0 -0
  73. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/decorators.py +0 -0
  74. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/export/__init__.py +0 -0
  75. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/export/actions/__init__.py +0 -0
  76. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/export/actions/export.py +0 -0
  77. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/export/enums.py +0 -0
  78. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/export/templates/config.yaml +0 -0
  79. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/export/templates/plugin/__init__.py +0 -0
  80. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/export/templates/plugin/export.py +0 -0
  81. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/neural_net/__init__.py +0 -0
  82. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/neural_net/actions/__init__.py +0 -0
  83. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/neural_net/actions/inference.py +0 -0
  84. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/neural_net/actions/test.py +0 -0
  85. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/neural_net/actions/train.py +0 -0
  86. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/neural_net/actions/tune.py +0 -0
  87. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/neural_net/base/__init__.py +0 -0
  88. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/neural_net/base/inference.py +0 -0
  89. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/neural_net/templates/config.yaml +0 -0
  90. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/neural_net/templates/plugin/__init__.py +0 -0
  91. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/neural_net/templates/plugin/inference.py +0 -0
  92. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/neural_net/templates/plugin/test.py +0 -0
  93. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/neural_net/templates/plugin/train.py +0 -0
  94. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/post_annotation/__init__.py +0 -0
  95. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/post_annotation/actions/__init__.py +0 -0
  96. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/post_annotation/actions/post_annotation.py +0 -0
  97. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/post_annotation/templates/config.yaml +0 -0
  98. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/post_annotation/templates/plugin/__init__.py +0 -0
  99. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/post_annotation/templates/plugin/post_annotation.py +0 -0
  100. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/pre_annotation/__init__.py +0 -0
  101. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/pre_annotation/actions/__init__.py +0 -0
  102. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/pre_annotation/actions/pre_annotation.py +0 -0
  103. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/pre_annotation/templates/config.yaml +0 -0
  104. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/pre_annotation/templates/plugin/__init__.py +0 -0
  105. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/pre_annotation/templates/plugin/pre_annotation.py +0 -0
  106. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/registry.py +0 -0
  107. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/smart_tool/__init__.py +0 -0
  108. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/smart_tool/actions/__init__.py +0 -0
  109. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/smart_tool/actions/auto_label.py +0 -0
  110. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/smart_tool/templates/config.yaml +0 -0
  111. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/smart_tool/templates/plugin/__init__.py +0 -0
  112. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/smart_tool/templates/plugin/auto_label.py +0 -0
  113. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/templates.py +0 -0
  114. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/upload/__init__.py +0 -0
  115. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/upload/actions/__init__.py +0 -0
  116. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/upload/actions/upload.py +0 -0
  117. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/upload/templates/config.yaml +0 -0
  118. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/upload/templates/plugin/__init__.py +0 -0
  119. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/categories/upload/templates/plugin/upload.py +0 -0
  120. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/enums.py +0 -0
  121. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/exceptions.py +0 -0
  122. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/models.py +0 -0
  123. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/templates/cookiecutter.json +0 -0
  124. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/templates/hooks/post_gen_project.py +0 -0
  125. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/templates/hooks/pre_prompt.py +0 -0
  126. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/templates/synapse-{{cookiecutter.plugin_code}}-plugin/.gitignore +0 -0
  127. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/templates/synapse-{{cookiecutter.plugin_code}}-plugin/.pre-commit-config.yaml +0 -0
  128. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/templates/synapse-{{cookiecutter.plugin_code}}-plugin/README.md +0 -0
  129. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/templates/synapse-{{cookiecutter.plugin_code}}-plugin/config.yaml +0 -0
  130. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/templates/synapse-{{cookiecutter.plugin_code}}-plugin/plugin/__init__.py +0 -0
  131. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/templates/synapse-{{cookiecutter.plugin_code}}-plugin/pyproject.toml +0 -0
  132. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/templates/synapse-{{cookiecutter.plugin_code}}-plugin/requirements.txt +0 -0
  133. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/upload.py +0 -0
  134. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/plugins/utils.py +0 -0
  135. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/shared/__init__.py +0 -0
  136. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/shared/enums.py +0 -0
  137. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/types.py +0 -0
  138. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/utils/__init__.py +0 -0
  139. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/utils/dataset.py +0 -0
  140. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/utils/debug.py +0 -0
  141. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/utils/module_loading.py +0 -0
  142. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/utils/pydantic/__init__.py +0 -0
  143. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/utils/pydantic/config.py +0 -0
  144. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/utils/pydantic/errors.py +0 -0
  145. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/utils/pydantic/validators.py +0 -0
  146. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/utils/storage/__init__.py +0 -0
  147. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/utils/storage/providers/__init__.py +0 -0
  148. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/utils/storage/providers/gcp.py +0 -0
  149. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/utils/storage/providers/s3.py +0 -0
  150. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/utils/storage/providers/sftp.py +0 -0
  151. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/utils/storage/registry.py +0 -0
  152. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk/utils/string.py +0 -0
  153. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk.egg-info/dependency_links.txt +0 -0
  154. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk.egg-info/entry_points.txt +0 -0
  155. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/synapse_sdk.egg-info/top_level.txt +0 -0
  156. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/tests/__init__.py +0 -0
  157. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/tests/clients/__init__.py +0 -0
  158. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/tests/clients/test_backend_models.py +0 -0
  159. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/tests/clients/test_base_client.py +0 -0
  160. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/tests/clients/test_collection_validators.py +0 -0
  161. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/tests/utils/__init__,py +0 -0
  162. {synapse_sdk-1.0.0a38 → synapse_sdk-1.0.0a40}/tests/utils/test_debug.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: synapse-sdk
3
- Version: 1.0.0a38
3
+ Version: 1.0.0a40
4
4
  Summary: synapse sdk
5
5
  Author-email: datamaker <developer@datamaker.io>
6
6
  License: MIT
@@ -21,6 +21,7 @@ Requires-Dist: universal-pathlib
21
21
  Requires-Dist: fsspec[gcs,s3,sftp]
22
22
  Provides-Extra: all
23
23
  Requires-Dist: ray[all]; extra == "all"
24
+ Requires-Dist: python-nmap; extra == "all"
24
25
  Dynamic: license-file
25
26
 
26
27
  This is the SDK to develop synapse plugins
@@ -29,7 +29,8 @@ dynamic = ["version"]
29
29
 
30
30
  [project.optional-dependencies]
31
31
  all = [
32
- "ray[all]"
32
+ "ray[all]",
33
+ "python-nmap"
33
34
  ]
34
35
 
35
36
  [project.scripts]
@@ -0,0 +1,58 @@
1
+ from synapse_sdk.clients.exceptions import ClientError
2
+ from synapse_sdk.plugins.categories.base import Action
3
+ from synapse_sdk.plugins.categories.decorators import register_action
4
+ from synapse_sdk.plugins.enums import PluginCategory, RunMethod
5
+
6
+
7
+ @register_action
8
+ class DeploymentAction(Action):
9
+ name = 'deployment'
10
+ category = PluginCategory.NEURAL_NET
11
+ method = RunMethod.JOB
12
+
13
+ def get_actor_options(self):
14
+ options = {'runtime_env': self.get_runtime_env()}
15
+ for option in ['num_cpus', 'num_gpus']:
16
+ option_value = self.params.get(option)
17
+ if option_value:
18
+ options[option] = option_value
19
+ return options
20
+
21
+ def start(self):
22
+ from ray import serve
23
+
24
+ from synapse_sdk.plugins.categories.neural_net.base.inference import app
25
+
26
+ self.ray_init()
27
+
28
+ ray_actor_options = self.get_actor_options()
29
+
30
+ deployment = serve.deployment(ray_actor_options=ray_actor_options)(serve.ingress(app)(self.entrypoint)).bind(
31
+ self.envs['SYNAPSE_PLUGIN_RUN_HOST']
32
+ )
33
+
34
+ serve.delete(self.plugin_release.code)
35
+
36
+ # TODO add run object
37
+ serve.run(
38
+ deployment,
39
+ name=self.plugin_release.code,
40
+ route_prefix=f'/{self.plugin_release.checksum}',
41
+ )
42
+
43
+ # 백엔드에 ServeApplication 추가
44
+ serve_application = self.create_serve_application()
45
+ return {'serve_application': serve_application['id'] if serve_application else None}
46
+
47
+ def create_serve_application(self):
48
+ if self.job_id:
49
+ try:
50
+ serve_application = self.ray_client.get_serve_application(self.plugin_release.code)
51
+ return self.client.create_serve_application({
52
+ 'job': self.job_id,
53
+ 'status': serve_application['status'],
54
+ 'data': serve_application,
55
+ })
56
+ except ClientError:
57
+ pass
58
+ return None
@@ -0,0 +1,131 @@
1
+ import contextlib
2
+ import subprocess
3
+ from functools import cached_property
4
+ from pathlib import Path
5
+
6
+ from synapse_sdk.plugins.categories.base import Action
7
+ from synapse_sdk.plugins.categories.decorators import register_action
8
+ from synapse_sdk.plugins.enums import PluginCategory, RunMethod
9
+ from synapse_sdk.utils.network import get_available_ports_host
10
+
11
+
12
+ @register_action
13
+ class GradioAction(Action):
14
+ name = 'gradio'
15
+ category = PluginCategory.NEURAL_NET
16
+ method = RunMethod.JOB
17
+
18
+ @property
19
+ def working_directory(self):
20
+ dir = Path.cwd() / self.config['directory'].replace('.', '/')
21
+ assert dir.is_dir(), f'Working directory {dir} does not exist.'
22
+ return dir
23
+
24
+ @property
25
+ def _requirements(self):
26
+ return self.config.get('requirements', ['gradio>=5'])
27
+
28
+ @property
29
+ def tag(self):
30
+ _tag = f'{self.plugin_release.code}-{self.plugin_release.checksum}'
31
+ return _tag.replace('@', '-')
32
+
33
+ @cached_property
34
+ def deploy_port(self):
35
+ return get_available_ports_host()
36
+
37
+ def deploy(self):
38
+ self.run.log('deploy', 'Start deploying')
39
+
40
+ try:
41
+ # Write Dockerfile and requirements.txt
42
+ path_dockerfile = self.write_dockerfile_template()
43
+ self.write_requirements(path_dockerfile.parent / 'requirements.txt')
44
+
45
+ # Build docker image
46
+ self.build_docker_image(path_dockerfile)
47
+
48
+ # Run docker image
49
+ self.run_docker_image()
50
+ except Exception as e:
51
+ self.run.log('deploy', f'Error: {e}')
52
+ raise e
53
+
54
+ def start(self):
55
+ self.deploy()
56
+ return {'endpoint': f'http://localhost:{self.deploy_port}'}
57
+
58
+ def write_dockerfile_template(self):
59
+ dockerfile_path = self.working_directory / 'Dockerfile'
60
+
61
+ with open(dockerfile_path, 'w') as f:
62
+ f.write("""FROM python:3.10
63
+ WORKDIR /home/user/app
64
+
65
+ RUN pip install --no-cache-dir pip -U && \\
66
+ pip install --no-cache-dir uvicorn
67
+
68
+ RUN apt-get update && \\
69
+ apt-get install -y curl && \\
70
+ curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \\
71
+ apt-get install -y nodejs && \\
72
+ rm -rf /var/lib/apt/lists/* && \\
73
+ apt-get clean
74
+
75
+ COPY . /home/user/app
76
+
77
+ RUN pip install --no-cache-dir -r requirements.txt
78
+
79
+ EXPOSE 7860
80
+
81
+ CMD ["python", "app.py"]
82
+ """)
83
+ return dockerfile_path
84
+
85
+ def write_requirements(self, path):
86
+ with open(path, 'w') as f:
87
+ f.write('\n'.join(self._requirements))
88
+
89
+ def build_docker_image(self, path_dockerfile):
90
+ self.run.log('deploy', 'Start building docker image')
91
+ result = subprocess.run(
92
+ [
93
+ 'docker',
94
+ 'build',
95
+ '-t',
96
+ self.tag,
97
+ '-f',
98
+ str(path_dockerfile),
99
+ '.',
100
+ ],
101
+ cwd=self.working_directory,
102
+ check=True,
103
+ )
104
+ print(result)
105
+
106
+ def run_docker_image(self):
107
+ self.run.log('deploy', 'Start running docker image')
108
+
109
+ # Check for existing container
110
+ self.run.log('deploy', 'Check for existing container')
111
+ with contextlib.suppress(subprocess.CalledProcessError):
112
+ subprocess.run(['docker', 'stop', self.tag], check=True)
113
+ subprocess.run(['docker', 'rm', self.tag], check=True)
114
+
115
+ # Run docker image
116
+ self.run.log('deploy', 'Starting docker container')
117
+ subprocess.run(
118
+ [
119
+ 'docker',
120
+ 'run',
121
+ '-d',
122
+ '--name',
123
+ self.tag,
124
+ '-p',
125
+ f'{self.deploy_port}:7860',
126
+ '-p',
127
+ '8991-8999:8991-8999',
128
+ self.tag,
129
+ ],
130
+ check=True,
131
+ )
@@ -197,6 +197,10 @@ def convert_file_to_base64(file_path):
197
197
  Returns:
198
198
  str: Base64 encoded string of the file contents
199
199
  """
200
+ # FIXME base64 is sent sometimes.
201
+ if file_path.startswith('data:'):
202
+ return file_path
203
+
200
204
  # Convert string path to Path object
201
205
  path = Path(file_path)
202
206
 
@@ -0,0 +1,110 @@
1
+ import logging
2
+ import os
3
+ import tempfile
4
+ import threading
5
+ import time
6
+ from contextlib import contextmanager
7
+ from http.server import HTTPServer, SimpleHTTPRequestHandler
8
+
9
+ from synapse_sdk.utils.network import get_available_ports_host
10
+
11
+
12
+ class SingleFileHttpServer(SimpleHTTPRequestHandler):
13
+ """
14
+ Custom HTTP request handler that serves a single specified file
15
+ regardless of the request path.
16
+ """
17
+
18
+ def __init__(self, *args, file_path=None, content_type=None, **kwargs):
19
+ self.file_path = file_path
20
+ self.content_type = content_type
21
+ super().__init__(*args, **kwargs)
22
+
23
+ def do_GET(self):
24
+ """Handle GET requests by serving the single file."""
25
+ try:
26
+ # Always serve the specified file regardless of the path requested
27
+ self.send_response(200)
28
+ if self.content_type:
29
+ self.send_header('Content-type', self.content_type)
30
+ self.send_header('Content-Length', str(os.path.getsize(self.file_path)))
31
+ self.end_headers()
32
+
33
+ with open(self.file_path, 'rb') as file:
34
+ self.wfile.write(file.read())
35
+
36
+ except Exception as e:
37
+ self.send_error(500, str(e))
38
+
39
+
40
+ @contextmanager
41
+ def temp_file_server(image=None, file_path=None, format='JPEG', host='localhost', port=None, content_type=None):
42
+ """
43
+ Context manager that serves a file temporarily via HTTP.
44
+
45
+ Args:
46
+ image: A PIL Image object to serve (optional)
47
+ file_path: Path to an existing file to serve (optional - used if image not provided)
48
+ format: Image format when saving a PIL Image (default: "JPEG")
49
+ host: Host to serve on (default: "localhost")
50
+ port: Port to serve on (default: auto-selected free port)
51
+ content_type: Content type header (default: auto-detected based on format)
52
+
53
+ Returns:
54
+ URL where the file is being served
55
+
56
+ Usage:
57
+ with temp_file_serve(image=my_pillow_img) as url:
58
+ # use url to access the image
59
+ print(f"Image available at: {url}")
60
+ """
61
+ if image is None and file_path is None:
62
+ raise ValueError('Either image or file_path must be provided')
63
+
64
+ # Use a free port if none specified
65
+ if port is None:
66
+ port = get_available_ports_host(start_port=8991, end_port=8999)
67
+
68
+ temp_dir = None
69
+
70
+ try:
71
+ if image is not None:
72
+ temp_dir = tempfile.mkdtemp()
73
+ ext_map = {'JPEG': '.jpg', 'PNG': '.png', 'GIF': '.gif', 'WEBP': '.webp'}
74
+ content_type_map = {'JPEG': 'image/jpeg', 'PNG': 'image/png', 'GIF': 'image/gif', 'WEBP': 'image/webp'}
75
+
76
+ ext = ext_map.get(format, '.jpg')
77
+ if content_type is None:
78
+ content_type = content_type_map.get(format, 'image/jpeg')
79
+
80
+ temp_file_path = os.path.join(temp_dir, f'temp_image{ext}')
81
+ image.save(temp_file_path, format=format)
82
+ file_path = temp_file_path
83
+
84
+ def handler(*args, **kwargs):
85
+ return SingleFileHttpServer(*args, file_path=file_path, content_type=content_type, **kwargs)
86
+
87
+ server = HTTPServer((host, port), handler)
88
+
89
+ server_thread = threading.Thread(target=server.serve_forever)
90
+ server_thread.daemon = True
91
+ server_thread.start()
92
+
93
+ time.sleep(0.1)
94
+
95
+ url = f'http://{host}:{port}'
96
+
97
+ try:
98
+ yield url
99
+ finally:
100
+ server.shutdown()
101
+ server.server_close()
102
+
103
+ finally:
104
+ if temp_dir:
105
+ try:
106
+ if temp_file_path and os.path.exists(temp_file_path):
107
+ os.unlink(temp_file_path)
108
+ os.rmdir(temp_dir)
109
+ except Exception as e:
110
+ logging.warning(f'Error cleaning up temporary files: {e}')
@@ -0,0 +1,37 @@
1
+ from urllib.parse import urlparse, urlunparse
2
+
3
+
4
+ def clean_url(url, remove_query_params=True, remove_fragment=True):
5
+ parsed = urlparse(url)
6
+ query = '' if remove_query_params else parsed.query
7
+ fragment = '' if remove_fragment else parsed.fragment
8
+
9
+ return urlunparse((
10
+ parsed.scheme,
11
+ parsed.netloc,
12
+ parsed.path,
13
+ parsed.params,
14
+ query,
15
+ fragment,
16
+ ))
17
+
18
+
19
+ def get_available_ports_host(start_port=8900, end_port=8990):
20
+ import nmap
21
+
22
+ nm = nmap.PortScanner()
23
+
24
+ scan_range = f'{start_port}-{end_port}'
25
+ nm.scan(hosts='host.docker.internal', arguments=f'-p {scan_range}')
26
+
27
+ try:
28
+ open_ports = nm['host.docker.internal']['tcp'].keys()
29
+ open_ports = [int(port) for port in open_ports]
30
+ except KeyError:
31
+ open_ports = []
32
+
33
+ for port in range(start_port, end_port + 1):
34
+ if port not in open_ports:
35
+ return port
36
+
37
+ raise IOError(f'No free ports available in range {start_port}-{end_port}')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: synapse-sdk
3
- Version: 1.0.0a38
3
+ Version: 1.0.0a40
4
4
  Summary: synapse sdk
5
5
  Author-email: datamaker <developer@datamaker.io>
6
6
  License: MIT
@@ -21,6 +21,7 @@ Requires-Dist: universal-pathlib
21
21
  Requires-Dist: fsspec[gcs,s3,sftp]
22
22
  Provides-Extra: all
23
23
  Requires-Dist: ray[all]; extra == "all"
24
+ Requires-Dist: python-nmap; extra == "all"
24
25
  Dynamic: license-file
25
26
 
26
27
  This is the SDK to develop synapse plugins
@@ -85,6 +85,7 @@ synapse_sdk/plugins/categories/export/templates/plugin/export.py
85
85
  synapse_sdk/plugins/categories/neural_net/__init__.py
86
86
  synapse_sdk/plugins/categories/neural_net/actions/__init__.py
87
87
  synapse_sdk/plugins/categories/neural_net/actions/deployment.py
88
+ synapse_sdk/plugins/categories/neural_net/actions/gradio.py
88
89
  synapse_sdk/plugins/categories/neural_net/actions/inference.py
89
90
  synapse_sdk/plugins/categories/neural_net/actions/test.py
90
91
  synapse_sdk/plugins/categories/neural_net/actions/train.py
@@ -136,6 +137,7 @@ synapse_sdk/utils/__init__.py
136
137
  synapse_sdk/utils/dataset.py
137
138
  synapse_sdk/utils/debug.py
138
139
  synapse_sdk/utils/file.py
140
+ synapse_sdk/utils/http.py
139
141
  synapse_sdk/utils/module_loading.py
140
142
  synapse_sdk/utils/network.py
141
143
  synapse_sdk/utils/string.py
@@ -12,3 +12,4 @@ fsspec[gcs,s3,sftp]
12
12
 
13
13
  [all]
14
14
  ray[all]
15
+ python-nmap
@@ -1,107 +0,0 @@
1
- from packaging import version
2
-
3
- from synapse_sdk.clients.exceptions import ClientError
4
- from synapse_sdk.i18n import gettext as _
5
- from synapse_sdk.plugins.categories.base import Action
6
- from synapse_sdk.plugins.categories.decorators import register_action
7
- from synapse_sdk.plugins.enums import PluginCategory, RunMethod
8
-
9
-
10
- @register_action
11
- class DeploymentAction(Action):
12
- name = 'deployment'
13
- category = PluginCategory.NEURAL_NET
14
- method = RunMethod.JOB
15
-
16
- def get_actor_options(self):
17
- options = {'runtime_env': self.get_runtime_env()}
18
- for option in ['num_cpus', 'num_gpus']:
19
- option_value = self.params.get(option)
20
- if option_value:
21
- options[option] = option_value
22
- return options
23
-
24
- def start(self):
25
- from ray import serve
26
-
27
- from synapse_sdk.plugins.categories.neural_net.base.inference import app
28
-
29
- self.ray_init()
30
-
31
- ray_actor_options = self.get_actor_options()
32
-
33
- if self.is_gradio_deployment:
34
- from ray.serve.gradio_integrations import GradioServer
35
-
36
- self.assert_gradio_version()
37
-
38
- # GradioIngress differs from serve.ingress(app), thus the difference in self.entrypoint callable
39
- try:
40
- entrypoint = self.entrypoint().app
41
- except (TypeError, ImportError):
42
- raise ClientError(
43
- 400,
44
- _(
45
- 'Gradio app is not callable.'
46
- 'Please ensure that your Deployment class defines a callable `app` function'
47
- ),
48
- )
49
-
50
- deployment = GradioServer.options(ray_actor_options=ray_actor_options).bind(entrypoint)
51
- else:
52
- deployment = serve.deployment(ray_actor_options=ray_actor_options)(
53
- serve.ingress(app)(self.entrypoint)
54
- ).bind(self.envs['SYNAPSE_PLUGIN_RUN_HOST'])
55
-
56
- serve.delete(self.plugin_release.code)
57
-
58
- # TODO add run object
59
- serve.run(
60
- deployment,
61
- name=self.plugin_release.code,
62
- route_prefix=f'/{self.plugin_release.checksum}',
63
- )
64
-
65
- # 백엔드에 ServeApplication 추가
66
- serve_application = self.create_serve_application()
67
- return {'serve_application': serve_application['id'] if serve_application else None}
68
-
69
- def create_serve_application(self):
70
- if self.job_id:
71
- try:
72
- serve_application = self.ray_client.get_serve_application(self.plugin_release.code)
73
- return self.client.create_serve_application({
74
- 'job': self.job_id,
75
- 'status': serve_application['status'],
76
- 'data': serve_application,
77
- })
78
- except ClientError:
79
- pass
80
- return None
81
-
82
- @property
83
- def is_gradio_deployment(self):
84
- return self.config.get('gradio_app', False)
85
-
86
- def assert_gradio_version(self):
87
- """Assert gradio version is not greater than 3.50.2.
88
- Ray Serve cannot pickle gradio endpoints, thus gradio version greater than 3.50.2 is not supported (SSE Issues)
89
- """
90
- GRADIO_VERSION_MAX_ALLOWED = '3.50.2'
91
-
92
- gradio_installed = False
93
- gradio_version = None
94
- for req in self.requirements:
95
- if req.startswith('gradio=='):
96
- gradio_installed = True
97
- gradio_version = req.split('==')[1]
98
- break
99
-
100
- assert gradio_installed, _(
101
- 'Gradio is not installed or version is not specified. Please install gradio==3.50.2 to use this feature.'
102
- )
103
-
104
- if version.parse(gradio_version) > version.parse(GRADIO_VERSION_MAX_ALLOWED):
105
- raise AssertionError(
106
- f'Gradio version {gradio_version} is greater than maximum allowed version {GRADIO_VERSION_MAX_ALLOWED}'
107
- )
@@ -1,16 +0,0 @@
1
- from urllib.parse import urlparse, urlunparse
2
-
3
-
4
- def clean_url(url, remove_query_params=True, remove_fragment=True):
5
- parsed = urlparse(url)
6
- query = '' if remove_query_params else parsed.query
7
- fragment = '' if remove_fragment else parsed.fragment
8
-
9
- return urlunparse((
10
- parsed.scheme,
11
- parsed.netloc,
12
- parsed.path,
13
- parsed.params,
14
- query,
15
- fragment,
16
- ))
File without changes
File without changes
File without changes