trainml 0.4.13__tar.gz → 0.4.15__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 (68) hide show
  1. {trainml-0.4.13 → trainml-0.4.15}/PKG-INFO +1 -1
  2. {trainml-0.4.13 → trainml-0.4.15}/tests/unit/test_jobs_unit.py +14 -2
  3. {trainml-0.4.13 → trainml-0.4.15}/trainml/__init__.py +1 -1
  4. {trainml-0.4.13 → trainml-0.4.15}/trainml/checkpoints.py +25 -5
  5. {trainml-0.4.13 → trainml-0.4.15}/trainml/datasets.py +3 -1
  6. {trainml-0.4.13 → trainml-0.4.15}/trainml/jobs.py +9 -3
  7. {trainml-0.4.13 → trainml-0.4.15}/trainml/models.py +3 -1
  8. {trainml-0.4.13 → trainml-0.4.15}/trainml.egg-info/PKG-INFO +1 -1
  9. {trainml-0.4.13 → trainml-0.4.15}/LICENSE +0 -0
  10. {trainml-0.4.13 → trainml-0.4.15}/README.md +0 -0
  11. {trainml-0.4.13 → trainml-0.4.15}/examples/__init__.py +0 -0
  12. {trainml-0.4.13 → trainml-0.4.15}/examples/create_dataset_and_training_job.py +0 -0
  13. {trainml-0.4.13 → trainml-0.4.15}/examples/local_storage.py +0 -0
  14. {trainml-0.4.13 → trainml-0.4.15}/examples/training_inference_pipeline.py +0 -0
  15. {trainml-0.4.13 → trainml-0.4.15}/pyproject.toml +0 -0
  16. {trainml-0.4.13 → trainml-0.4.15}/setup.cfg +0 -0
  17. {trainml-0.4.13 → trainml-0.4.15}/setup.py +0 -0
  18. {trainml-0.4.13 → trainml-0.4.15}/tests/integration/__init__.py +0 -0
  19. {trainml-0.4.13 → trainml-0.4.15}/tests/integration/conftest.py +0 -0
  20. {trainml-0.4.13 → trainml-0.4.15}/tests/integration/test_checkpoints_integration.py +0 -0
  21. {trainml-0.4.13 → trainml-0.4.15}/tests/integration/test_datasets_integration.py +0 -0
  22. {trainml-0.4.13 → trainml-0.4.15}/tests/integration/test_environments_integration.py +0 -0
  23. {trainml-0.4.13 → trainml-0.4.15}/tests/integration/test_gpu_types_integration.py +0 -0
  24. {trainml-0.4.13 → trainml-0.4.15}/tests/integration/test_jobs_integration.py +0 -0
  25. {trainml-0.4.13 → trainml-0.4.15}/tests/integration/test_models_integration.py +0 -0
  26. {trainml-0.4.13 → trainml-0.4.15}/tests/integration/test_projects_integration.py +0 -0
  27. {trainml-0.4.13 → trainml-0.4.15}/tests/integration/test_providers_integration.py +0 -0
  28. {trainml-0.4.13 → trainml-0.4.15}/tests/unit/__init__.py +0 -0
  29. {trainml-0.4.13 → trainml-0.4.15}/tests/unit/cli/__init__.py +0 -0
  30. {trainml-0.4.13 → trainml-0.4.15}/tests/unit/cli/conftest.py +0 -0
  31. {trainml-0.4.13 → trainml-0.4.15}/tests/unit/cli/test_cli_environment_unit.py +0 -0
  32. {trainml-0.4.13 → trainml-0.4.15}/tests/unit/conftest.py +0 -0
  33. {trainml-0.4.13 → trainml-0.4.15}/tests/unit/test_auth.py +0 -0
  34. {trainml-0.4.13 → trainml-0.4.15}/tests/unit/test_checkpoints_unit.py +0 -0
  35. {trainml-0.4.13 → trainml-0.4.15}/tests/unit/test_connections_unit.py +0 -0
  36. {trainml-0.4.13 → trainml-0.4.15}/tests/unit/test_datasets_unit.py +0 -0
  37. {trainml-0.4.13 → trainml-0.4.15}/tests/unit/test_environments_unit.py +0 -0
  38. {trainml-0.4.13 → trainml-0.4.15}/tests/unit/test_exceptions.py +0 -0
  39. {trainml-0.4.13 → trainml-0.4.15}/tests/unit/test_gpu_types_unit.py +0 -0
  40. {trainml-0.4.13 → trainml-0.4.15}/tests/unit/test_models_unit.py +0 -0
  41. {trainml-0.4.13 → trainml-0.4.15}/tests/unit/test_projects_unit.py +0 -0
  42. {trainml-0.4.13 → trainml-0.4.15}/tests/unit/test_providers_unit.py +0 -0
  43. {trainml-0.4.13 → trainml-0.4.15}/tests/unit/test_trainml.py +0 -0
  44. {trainml-0.4.13 → trainml-0.4.15}/trainml/__main__.py +0 -0
  45. {trainml-0.4.13 → trainml-0.4.15}/trainml/auth.py +0 -0
  46. {trainml-0.4.13 → trainml-0.4.15}/trainml/cli/__init__.py +0 -0
  47. {trainml-0.4.13 → trainml-0.4.15}/trainml/cli/checkpoint.py +0 -0
  48. {trainml-0.4.13 → trainml-0.4.15}/trainml/cli/connection.py +0 -0
  49. {trainml-0.4.13 → trainml-0.4.15}/trainml/cli/dataset.py +0 -0
  50. {trainml-0.4.13 → trainml-0.4.15}/trainml/cli/environment.py +0 -0
  51. {trainml-0.4.13 → trainml-0.4.15}/trainml/cli/gpu.py +0 -0
  52. {trainml-0.4.13 → trainml-0.4.15}/trainml/cli/job/__init__.py +0 -0
  53. {trainml-0.4.13 → trainml-0.4.15}/trainml/cli/job/create.py +0 -0
  54. {trainml-0.4.13 → trainml-0.4.15}/trainml/cli/model.py +0 -0
  55. {trainml-0.4.13 → trainml-0.4.15}/trainml/cli/project.py +0 -0
  56. {trainml-0.4.13 → trainml-0.4.15}/trainml/cli/provider.py +0 -0
  57. {trainml-0.4.13 → trainml-0.4.15}/trainml/connections.py +0 -0
  58. {trainml-0.4.13 → trainml-0.4.15}/trainml/environments.py +0 -0
  59. {trainml-0.4.13 → trainml-0.4.15}/trainml/exceptions.py +0 -0
  60. {trainml-0.4.13 → trainml-0.4.15}/trainml/gpu_types.py +0 -0
  61. {trainml-0.4.13 → trainml-0.4.15}/trainml/projects.py +0 -0
  62. {trainml-0.4.13 → trainml-0.4.15}/trainml/providers.py +0 -0
  63. {trainml-0.4.13 → trainml-0.4.15}/trainml/trainml.py +0 -0
  64. {trainml-0.4.13 → trainml-0.4.15}/trainml.egg-info/SOURCES.txt +0 -0
  65. {trainml-0.4.13 → trainml-0.4.15}/trainml.egg-info/dependency_links.txt +0 -0
  66. {trainml-0.4.13 → trainml-0.4.15}/trainml.egg-info/entry_points.txt +0 -0
  67. {trainml-0.4.13 → trainml-0.4.15}/trainml.egg-info/requires.txt +0 -0
  68. {trainml-0.4.13 → trainml-0.4.15}/trainml.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: trainml
3
- Version: 0.4.13
3
+ Version: 0.4.15
4
4
  Summary: trainML client SDK and command line utilities
5
5
  Home-page: https://github.com/trainML/trainml-cli
6
6
  Author: trainML
@@ -314,7 +314,13 @@ class JobTests:
314
314
 
315
315
  @mark.asyncio
316
316
  async def test_job_start(self, job, mock_trainml):
317
- api_response = None
317
+ api_response = {
318
+ "customer_uuid": "cus-id-1",
319
+ "job_uuid": "job-id-1",
320
+ "name": "test notebook",
321
+ "type": "notebook",
322
+ "status": "starting",
323
+ }
318
324
  mock_trainml._query = AsyncMock(return_value=api_response)
319
325
  await job.start()
320
326
  mock_trainml._query.assert_called_once_with(
@@ -326,7 +332,13 @@ class JobTests:
326
332
 
327
333
  @mark.asyncio
328
334
  async def test_job_stop(self, job, mock_trainml):
329
- api_response = None
335
+ api_response = {
336
+ "customer_uuid": "cus-id-1",
337
+ "job_uuid": "job-id-1",
338
+ "name": "test notebook",
339
+ "type": "notebook",
340
+ "status": "stopping",
341
+ }
330
342
  mock_trainml._query = AsyncMock(return_value=api_response)
331
343
  await job.stop()
332
344
  mock_trainml._query.assert_called_once_with(
@@ -13,5 +13,5 @@ logging.basicConfig(
13
13
  logger = logging.getLogger(__name__)
14
14
 
15
15
 
16
- __version__ = "0.4.13"
16
+ __version__ = "0.4.15"
17
17
  __all__ = "TrainML"
@@ -126,8 +126,12 @@ class Checkpoint:
126
126
  ssh_port=self._checkpoint.get("vpn")
127
127
  .get("client")
128
128
  .get("ssh_port"),
129
- input_path=self._checkpoint.get("source_uri"),
130
- output_path=None,
129
+ input_path=self._checkpoint.get("source_uri")
130
+ if self.status in ["new", "downloading"]
131
+ else None,
132
+ output_path=self._checkpoint.get("output_uri")
133
+ if self.status == "exporting"
134
+ else None,
131
135
  )
132
136
  else:
133
137
  details = dict()
@@ -137,7 +141,7 @@ class Checkpoint:
137
141
  if self.status in ["ready", "failed"]:
138
142
  raise SpecificationError(
139
143
  "status",
140
- f"You can only connect to new or downloading checkpoints.",
144
+ f"You can only connect to downloading or exporting checkpoints.",
141
145
  )
142
146
  if self.status == "new":
143
147
  await self.wait_for("downloading")
@@ -162,12 +166,28 @@ class Checkpoint:
162
166
  )
163
167
 
164
168
  async def rename(self, name):
165
- await self.trainml._query(
169
+ resp = await self.trainml._query(
166
170
  f"/checkpoint/{self._id}",
167
171
  "PATCH",
168
- None,
172
+ dict(project_uuid=self._project_uuid),
169
173
  dict(name=name),
170
174
  )
175
+ self.__init__(self.trainml, **resp)
176
+ return self
177
+
178
+ async def export(self, output_type, output_uri, output_options=dict()):
179
+ resp = await self.trainml._query(
180
+ f"/checkpoint/{self._id}/export",
181
+ "POST",
182
+ dict(project_uuid=self._project_uuid),
183
+ dict(
184
+ output_type=output_type,
185
+ output_uri=output_uri,
186
+ output_options=output_options,
187
+ ),
188
+ )
189
+ self.__init__(self.trainml, **resp)
190
+ return self
171
191
 
172
192
  def _get_msg_handler(self, msg_handler):
173
193
  def handler(data):
@@ -158,12 +158,14 @@ class Dataset:
158
158
  )
159
159
 
160
160
  async def rename(self, name):
161
- await self.trainml._query(
161
+ resp = await self.trainml._query(
162
162
  f"/dataset/{self._id}",
163
163
  "PATCH",
164
164
  None,
165
165
  dict(name=name),
166
166
  )
167
+ self.__init__(self.trainml, **resp)
168
+ return self
167
169
 
168
170
  def _get_msg_handler(self, msg_handler):
169
171
  def handler(data):
@@ -253,20 +253,24 @@ class Job:
253
253
  return create_json
254
254
 
255
255
  async def start(self):
256
- await self.trainml._query(
256
+ resp = await self.trainml._query(
257
257
  f"/job/{self._id}",
258
258
  "PATCH",
259
259
  dict(project_uuid=self._project_uuid),
260
260
  dict(command="start"),
261
261
  )
262
+ self.__init__(self.trainml, **resp)
263
+ return self
262
264
 
263
265
  async def stop(self):
264
- await self.trainml._query(
266
+ resp = await self.trainml._query(
265
267
  f"/job/{self._id}",
266
268
  "PATCH",
267
269
  dict(project_uuid=self._project_uuid),
268
270
  dict(command="stop"),
269
271
  )
272
+ self.__init__(self.trainml, **resp)
273
+ return self
270
274
 
271
275
  async def update(self, data):
272
276
  if self.type != "notebook":
@@ -274,12 +278,14 @@ class Job:
274
278
  "type",
275
279
  "Only notebook jobs can be modified.",
276
280
  )
277
- await self.trainml._query(
281
+ resp = await self.trainml._query(
278
282
  f"/job/{self._id}",
279
283
  "PATCH",
280
284
  dict(project_uuid=self._project_uuid),
281
285
  data,
282
286
  )
287
+ self.__init__(self.trainml, **resp)
288
+ return self
283
289
 
284
290
  async def get_worker_log_url(self, job_worker_uuid):
285
291
  resp = await self.trainml._query(
@@ -151,12 +151,14 @@ class Model:
151
151
  )
152
152
 
153
153
  async def rename(self, name):
154
- await self.trainml._query(
154
+ resp = await self.trainml._query(
155
155
  f"/model/{self._id}",
156
156
  "PATCH",
157
157
  None,
158
158
  dict(name=name),
159
159
  )
160
+ self.__init__(self.trainml, **resp)
161
+ return self
160
162
 
161
163
  def _get_msg_handler(self, msg_handler):
162
164
  def handler(data):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: trainml
3
- Version: 0.4.13
3
+ Version: 0.4.15
4
4
  Summary: trainML client SDK and command line utilities
5
5
  Home-page: https://github.com/trainML/trainml-cli
6
6
  Author: trainML
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes