proximl 0.5.11__tar.gz → 0.5.13__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 (143) hide show
  1. {proximl-0.5.11/proximl.egg-info → proximl-0.5.13}/PKG-INFO +1 -1
  2. {proximl-0.5.11 → proximl-0.5.13}/proximl/__init__.py +1 -1
  3. {proximl-0.5.11 → proximl-0.5.13}/proximl/cli/job/create.py +16 -16
  4. {proximl-0.5.11 → proximl-0.5.13}/proximl/cli/project/__init__.py +1 -1
  5. proximl-0.5.11/proximl/cli/project/key.py → proximl-0.5.13/proximl/cli/project/credential.py +27 -23
  6. {proximl-0.5.11 → proximl-0.5.13}/proximl/cli/project/secret.py +12 -3
  7. proximl-0.5.11/proximl/projects/keys.py → proximl-0.5.13/proximl/projects/credentials.py +12 -12
  8. {proximl-0.5.11 → proximl-0.5.13}/proximl/projects/data_connectors.py +16 -0
  9. {proximl-0.5.11 → proximl-0.5.13}/proximl/projects/datastores.py +16 -0
  10. {proximl-0.5.11 → proximl-0.5.13}/proximl/projects/projects.py +7 -4
  11. {proximl-0.5.11 → proximl-0.5.13}/proximl/projects/secrets.py +1 -1
  12. {proximl-0.5.11 → proximl-0.5.13}/proximl/projects/services.py +16 -0
  13. {proximl-0.5.11 → proximl-0.5.13/proximl.egg-info}/PKG-INFO +1 -1
  14. {proximl-0.5.11 → proximl-0.5.13}/proximl.egg-info/SOURCES.txt +5 -5
  15. {proximl-0.5.11 → proximl-0.5.13}/tests/integration/projects/conftest.py +1 -1
  16. proximl-0.5.13/tests/integration/projects/test_projects_credentials_integration.py +45 -0
  17. {proximl-0.5.11 → proximl-0.5.13}/tests/integration/projects/test_projects_secrets_integration.py +1 -1
  18. {proximl-0.5.11 → proximl-0.5.13}/tests/integration/test_jobs_integration.py +1 -1
  19. proximl-0.5.11/tests/unit/cli/projects/test_cli_project_key_unit.py → proximl-0.5.13/tests/unit/cli/projects/test_cli_project_credential_unit.py +5 -5
  20. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/conftest.py +9 -9
  21. proximl-0.5.13/tests/unit/projects/test_project_credentials_unit.py +100 -0
  22. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/projects/test_projects_unit.py +1 -1
  23. proximl-0.5.11/tests/integration/projects/test_projects_keys_integration.py +0 -43
  24. proximl-0.5.11/tests/unit/projects/test_project_keys_unit.py +0 -96
  25. {proximl-0.5.11 → proximl-0.5.13}/LICENSE +0 -0
  26. {proximl-0.5.11 → proximl-0.5.13}/README.md +0 -0
  27. {proximl-0.5.11 → proximl-0.5.13}/examples/__init__.py +0 -0
  28. {proximl-0.5.11 → proximl-0.5.13}/examples/create_dataset_and_training_job.py +0 -0
  29. {proximl-0.5.11 → proximl-0.5.13}/examples/local_storage.py +0 -0
  30. {proximl-0.5.11 → proximl-0.5.13}/examples/training_inference_pipeline.py +0 -0
  31. {proximl-0.5.11 → proximl-0.5.13}/proximl/__main__.py +0 -0
  32. {proximl-0.5.11 → proximl-0.5.13}/proximl/auth.py +0 -0
  33. {proximl-0.5.11 → proximl-0.5.13}/proximl/checkpoints.py +0 -0
  34. {proximl-0.5.11 → proximl-0.5.13}/proximl/cli/__init__.py +0 -0
  35. {proximl-0.5.11 → proximl-0.5.13}/proximl/cli/checkpoint.py +0 -0
  36. {proximl-0.5.11 → proximl-0.5.13}/proximl/cli/cloudbender/__init__.py +0 -0
  37. {proximl-0.5.11 → proximl-0.5.13}/proximl/cli/cloudbender/data_connector.py +0 -0
  38. {proximl-0.5.11 → proximl-0.5.13}/proximl/cli/cloudbender/datastore.py +0 -0
  39. {proximl-0.5.11 → proximl-0.5.13}/proximl/cli/cloudbender/device.py +0 -0
  40. {proximl-0.5.11 → proximl-0.5.13}/proximl/cli/cloudbender/node.py +0 -0
  41. {proximl-0.5.11 → proximl-0.5.13}/proximl/cli/cloudbender/provider.py +0 -0
  42. {proximl-0.5.11 → proximl-0.5.13}/proximl/cli/cloudbender/region.py +0 -0
  43. {proximl-0.5.11 → proximl-0.5.13}/proximl/cli/cloudbender/service.py +0 -0
  44. {proximl-0.5.11 → proximl-0.5.13}/proximl/cli/connection.py +0 -0
  45. {proximl-0.5.11 → proximl-0.5.13}/proximl/cli/dataset.py +0 -0
  46. {proximl-0.5.11 → proximl-0.5.13}/proximl/cli/environment.py +0 -0
  47. {proximl-0.5.11 → proximl-0.5.13}/proximl/cli/gpu.py +0 -0
  48. {proximl-0.5.11 → proximl-0.5.13}/proximl/cli/job/__init__.py +0 -0
  49. {proximl-0.5.11 → proximl-0.5.13}/proximl/cli/model.py +0 -0
  50. {proximl-0.5.11 → proximl-0.5.13}/proximl/cli/project/data_connector.py +0 -0
  51. {proximl-0.5.11 → proximl-0.5.13}/proximl/cli/project/datastore.py +0 -0
  52. {proximl-0.5.11 → proximl-0.5.13}/proximl/cli/project/service.py +0 -0
  53. {proximl-0.5.11 → proximl-0.5.13}/proximl/cli/volume.py +0 -0
  54. {proximl-0.5.11 → proximl-0.5.13}/proximl/cloudbender/__init__.py +0 -0
  55. {proximl-0.5.11 → proximl-0.5.13}/proximl/cloudbender/cloudbender.py +0 -0
  56. {proximl-0.5.11 → proximl-0.5.13}/proximl/cloudbender/data_connectors.py +0 -0
  57. {proximl-0.5.11 → proximl-0.5.13}/proximl/cloudbender/datastores.py +0 -0
  58. {proximl-0.5.11 → proximl-0.5.13}/proximl/cloudbender/device_configs.py +0 -0
  59. {proximl-0.5.11 → proximl-0.5.13}/proximl/cloudbender/devices.py +0 -0
  60. {proximl-0.5.11 → proximl-0.5.13}/proximl/cloudbender/nodes.py +0 -0
  61. {proximl-0.5.11 → proximl-0.5.13}/proximl/cloudbender/providers.py +0 -0
  62. {proximl-0.5.11 → proximl-0.5.13}/proximl/cloudbender/regions.py +0 -0
  63. {proximl-0.5.11 → proximl-0.5.13}/proximl/cloudbender/services.py +0 -0
  64. {proximl-0.5.11 → proximl-0.5.13}/proximl/connections.py +0 -0
  65. {proximl-0.5.11 → proximl-0.5.13}/proximl/datasets.py +0 -0
  66. {proximl-0.5.11 → proximl-0.5.13}/proximl/environments.py +0 -0
  67. {proximl-0.5.11 → proximl-0.5.13}/proximl/exceptions.py +0 -0
  68. {proximl-0.5.11 → proximl-0.5.13}/proximl/gpu_types.py +0 -0
  69. {proximl-0.5.11 → proximl-0.5.13}/proximl/jobs.py +0 -0
  70. {proximl-0.5.11 → proximl-0.5.13}/proximl/models.py +0 -0
  71. {proximl-0.5.11 → proximl-0.5.13}/proximl/projects/__init__.py +0 -0
  72. {proximl-0.5.11 → proximl-0.5.13}/proximl/proximl.py +0 -0
  73. {proximl-0.5.11 → proximl-0.5.13}/proximl/volumes.py +0 -0
  74. {proximl-0.5.11 → proximl-0.5.13}/proximl.egg-info/dependency_links.txt +0 -0
  75. {proximl-0.5.11 → proximl-0.5.13}/proximl.egg-info/entry_points.txt +0 -0
  76. {proximl-0.5.11 → proximl-0.5.13}/proximl.egg-info/requires.txt +0 -0
  77. {proximl-0.5.11 → proximl-0.5.13}/proximl.egg-info/top_level.txt +0 -0
  78. {proximl-0.5.11 → proximl-0.5.13}/pyproject.toml +0 -0
  79. {proximl-0.5.11 → proximl-0.5.13}/setup.cfg +0 -0
  80. {proximl-0.5.11 → proximl-0.5.13}/setup.py +0 -0
  81. {proximl-0.5.11 → proximl-0.5.13}/tests/integration/__init__.py +0 -0
  82. {proximl-0.5.11 → proximl-0.5.13}/tests/integration/cloudbender/__init__.py +0 -0
  83. {proximl-0.5.11 → proximl-0.5.13}/tests/integration/cloudbender/test_providers_integration.py +0 -0
  84. {proximl-0.5.11 → proximl-0.5.13}/tests/integration/conftest.py +0 -0
  85. {proximl-0.5.11 → proximl-0.5.13}/tests/integration/projects/__init__.py +0 -0
  86. {proximl-0.5.11 → proximl-0.5.13}/tests/integration/projects/test_projects_data_connectors_integration.py +0 -0
  87. {proximl-0.5.11 → proximl-0.5.13}/tests/integration/projects/test_projects_datastores_integration.py +0 -0
  88. {proximl-0.5.11 → proximl-0.5.13}/tests/integration/projects/test_projects_integration.py +0 -0
  89. {proximl-0.5.11 → proximl-0.5.13}/tests/integration/projects/test_projects_services_integration.py +0 -0
  90. {proximl-0.5.11 → proximl-0.5.13}/tests/integration/test_checkpoints_integration.py +0 -0
  91. {proximl-0.5.11 → proximl-0.5.13}/tests/integration/test_datasets_integration.py +0 -0
  92. {proximl-0.5.11 → proximl-0.5.13}/tests/integration/test_environments_integration.py +0 -0
  93. {proximl-0.5.11 → proximl-0.5.13}/tests/integration/test_gpu_types_integration.py +0 -0
  94. {proximl-0.5.11 → proximl-0.5.13}/tests/integration/test_models_integration.py +0 -0
  95. {proximl-0.5.11 → proximl-0.5.13}/tests/integration/test_volumes_integration.py +0 -0
  96. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/__init__.py +0 -0
  97. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/cli/__init__.py +0 -0
  98. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/cli/cloudbender/__init__.py +0 -0
  99. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/cli/cloudbender/test_cli_datastore_unit.py +0 -0
  100. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/cli/cloudbender/test_cli_device_unit.py +0 -0
  101. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/cli/cloudbender/test_cli_node_unit.py +0 -0
  102. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/cli/cloudbender/test_cli_provider_unit.py +0 -0
  103. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/cli/cloudbender/test_cli_region_unit.py +0 -0
  104. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/cli/cloudbender/test_cli_service_unit.py +0 -0
  105. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/cli/conftest.py +0 -0
  106. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/cli/projects/__init__.py +0 -0
  107. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/cli/projects/test_cli_project_data_connector_unit.py +0 -0
  108. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/cli/projects/test_cli_project_datastore_unit.py +0 -0
  109. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/cli/projects/test_cli_project_secret_unit.py +0 -0
  110. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/cli/projects/test_cli_project_service_unit.py +0 -0
  111. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/cli/projects/test_cli_project_unit.py +0 -0
  112. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/cli/test_cli_checkpoint_unit.py +0 -0
  113. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/cli/test_cli_datasets_unit.py +0 -0
  114. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/cli/test_cli_environment_unit.py +0 -0
  115. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/cli/test_cli_gpu_unit.py +0 -0
  116. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/cli/test_cli_job_unit.py +0 -0
  117. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/cli/test_cli_model_unit.py +0 -0
  118. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/cli/test_cli_volume_unit.py +0 -0
  119. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/cloudbender/__init__.py +0 -0
  120. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/cloudbender/test_data_connectors_unit.py +0 -0
  121. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/cloudbender/test_datastores_unit.py +0 -0
  122. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/cloudbender/test_device_configs_unit.py +0 -0
  123. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/cloudbender/test_devices_unit.py +0 -0
  124. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/cloudbender/test_nodes_unit.py +0 -0
  125. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/cloudbender/test_providers_unit.py +0 -0
  126. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/cloudbender/test_regions_unit.py +0 -0
  127. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/cloudbender/test_services_unit.py +0 -0
  128. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/projects/__init__.py +0 -0
  129. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/projects/test_project_data_connectors_unit.py +0 -0
  130. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/projects/test_project_datastores_unit.py +0 -0
  131. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/projects/test_project_secrets_unit.py +0 -0
  132. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/projects/test_project_services_unit.py +0 -0
  133. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/test_auth_unit.py +0 -0
  134. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/test_checkpoints_unit.py +0 -0
  135. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/test_connections_unit.py +0 -0
  136. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/test_datasets_unit.py +0 -0
  137. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/test_environments_unit.py +0 -0
  138. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/test_exceptions.py +0 -0
  139. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/test_gpu_types_unit.py +0 -0
  140. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/test_jobs_unit.py +0 -0
  141. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/test_models_unit.py +0 -0
  142. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/test_proximl_unit.py +0 -0
  143. {proximl-0.5.11 → proximl-0.5.13}/tests/unit/test_volumes_unit.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: proximl
3
- Version: 0.5.11
3
+ Version: 0.5.13
4
4
  Summary: proxiML client SDK and command line utilities
5
5
  Home-page: https://github.com/proxiML/python-sdk
6
6
  Author: proxiML
@@ -13,5 +13,5 @@ logging.basicConfig(
13
13
  logger = logging.getLogger(__name__)
14
14
 
15
15
 
16
- __version__ = "0.5.11"
16
+ __version__ = "0.5.13"
17
17
  __all__ = "ProxiML"
@@ -172,12 +172,12 @@ def create(config):
172
172
  help="Conda packages to install as a comma separated list 'p1,\"p2=v2\",p3'",
173
173
  )
174
174
  @click.option(
175
- "--key",
175
+ "--credential",
176
176
  type=click.Choice(
177
177
  ["aws", "gcp", "kaggle", "azure", "wasabi"],
178
178
  case_sensitive=False,
179
179
  ),
180
- help="Third Party Keys to add to the job environment",
180
+ help="Third Party Credentials to add to the job environment",
181
181
  multiple=True,
182
182
  )
183
183
  @click.option(
@@ -221,7 +221,7 @@ def notebook(
221
221
  environment,
222
222
  custom_image,
223
223
  env,
224
- key,
224
+ credential,
225
225
  apt_packages,
226
226
  pip_packages,
227
227
  conda_packages,
@@ -254,7 +254,7 @@ def notebook(
254
254
  data=dict(datasets=datasets),
255
255
  model=dict(checkpoints=checkpoints),
256
256
  environment=dict(
257
- worker_key_types=[k for k in key],
257
+ credentials=[k for k in credential],
258
258
  ),
259
259
  )
260
260
 
@@ -500,12 +500,12 @@ def notebook(
500
500
  multiple=True,
501
501
  )
502
502
  @click.option(
503
- "--key",
503
+ "--credential",
504
504
  type=click.Choice(
505
505
  ["aws", "gcp", "kaggle", "azure", "wasabi"],
506
506
  case_sensitive=False,
507
507
  ),
508
- help="Third Party Keys to add to the job environment",
508
+ help="Third Party Credentials to add to the job environment",
509
509
  multiple=True,
510
510
  )
511
511
  @click.option(
@@ -563,7 +563,7 @@ def training(
563
563
  environment,
564
564
  custom_image,
565
565
  env,
566
- key,
566
+ credential,
567
567
  apt_packages,
568
568
  pip_packages,
569
569
  conda_packages,
@@ -596,7 +596,7 @@ def training(
596
596
  data=dict(datasets=datasets),
597
597
  model=dict(checkpoints=checkpoints),
598
598
  environment=dict(
599
- worker_key_types=[k for k in key],
599
+ credentials=[k for k in credential],
600
600
  ),
601
601
  )
602
602
 
@@ -844,12 +844,12 @@ def training(
844
844
  multiple=True,
845
845
  )
846
846
  @click.option(
847
- "--key",
847
+ "--credential",
848
848
  type=click.Choice(
849
849
  ["aws", "gcp", "kaggle", "azure", "wasabi"],
850
850
  case_sensitive=False,
851
851
  ),
852
- help="Third Party Keys to add to the job environment",
852
+ help="Third Party Credentials to add to the job environment",
853
853
  multiple=True,
854
854
  )
855
855
  @click.option(
@@ -907,7 +907,7 @@ def inference(
907
907
  environment,
908
908
  custom_image,
909
909
  env,
910
- key,
910
+ credential,
911
911
  apt_packages,
912
912
  pip_packages,
913
913
  conda_packages,
@@ -933,7 +933,7 @@ def inference(
933
933
  data=dict(datasets=[]),
934
934
  model=dict(checkpoints=checkpoints),
935
935
  environment=dict(
936
- worker_key_types=[k for k in key],
936
+ credentials=[k for k in credential],
937
937
  ),
938
938
  )
939
939
 
@@ -1163,12 +1163,12 @@ def from_json(config, attach, connect, file):
1163
1163
  multiple=True,
1164
1164
  )
1165
1165
  @click.option(
1166
- "--key",
1166
+ "--credential",
1167
1167
  type=click.Choice(
1168
1168
  ["aws", "gcp", "kaggle", "azure", "wasabi"],
1169
1169
  case_sensitive=False,
1170
1170
  ),
1171
- help="Third Party Keys to add to the job environment",
1171
+ help="Third Party Credentials to add to the job environment",
1172
1172
  multiple=True,
1173
1173
  )
1174
1174
  @click.option(
@@ -1230,7 +1230,7 @@ def endpoint(
1230
1230
  environment,
1231
1231
  custom_image,
1232
1232
  env,
1233
- key,
1233
+ credential,
1234
1234
  apt_packages,
1235
1235
  pip_packages,
1236
1236
  conda_packages,
@@ -1257,7 +1257,7 @@ def endpoint(
1257
1257
  max_price=max_price,
1258
1258
  model=dict(checkpoints=checkpoints),
1259
1259
  environment=dict(
1260
- worker_key_types=[k for k in key],
1260
+ credentials=[k for k in credential],
1261
1261
  ),
1262
1262
  )
1263
1263
 
@@ -78,7 +78,7 @@ def remove(config, project):
78
78
 
79
79
 
80
80
  from proximl.cli.project.secret import secret
81
- from proximl.cli.project.key import key
81
+ from proximl.cli.project.credential import credential
82
82
  from proximl.cli.project.data_connector import data_connector
83
83
  from proximl.cli.project.datastore import datastore
84
84
  from proximl.cli.project.service import service
@@ -9,15 +9,15 @@ from proximl.cli.project import project
9
9
 
10
10
  @project.group()
11
11
  @pass_config
12
- def key(config):
13
- """proxiML project key commands."""
12
+ def credential(config):
13
+ """proxiML project credential commands."""
14
14
  pass
15
15
 
16
16
 
17
- @key.command()
17
+ @credential.command()
18
18
  @pass_config
19
19
  def list(config):
20
- """List keys."""
20
+ """List credentials."""
21
21
  data = [
22
22
  ["TYPE", "KEY ID", "UPDATED AT"],
23
23
  [
@@ -27,14 +27,14 @@ def list(config):
27
27
  ],
28
28
  ]
29
29
  project = config.proximl.run(config.proximl.client.projects.get_current())
30
- keys = config.proximl.run(project.keys.list())
30
+ credentials = config.proximl.run(project.credentials.list())
31
31
 
32
- for key in keys:
32
+ for credential in credentials:
33
33
  data.append(
34
34
  [
35
- key.type,
36
- key.key_id,
37
- key.updated_at.isoformat(timespec="seconds"),
35
+ credential.type,
36
+ credential.key_id,
37
+ credential.updated_at.isoformat(timespec="seconds"),
38
38
  ]
39
39
  )
40
40
 
@@ -45,7 +45,7 @@ def list(config):
45
45
  )
46
46
 
47
47
 
48
- @key.command()
48
+ @credential.command()
49
49
  @click.argument(
50
50
  "type",
51
51
  type=click.Choice(
@@ -65,19 +65,21 @@ def list(config):
65
65
  @pass_config
66
66
  def put(config, type):
67
67
  """
68
- Set a key.
68
+ Set a credential.
69
69
 
70
- A key is uploaded.
70
+ A credential is uploaded.
71
71
  """
72
72
  project = config.proximl.run(config.proximl.client.projects.get_current())
73
73
 
74
74
  tenant = None
75
75
 
76
76
  if type in ["aws", "wasabi"]:
77
- key_id = click.prompt("Enter the key ID", type=str, hide_input=False)
78
- secret = click.prompt("Enter the secret key", type=str, hide_input=True)
77
+ credential_id = click.prompt(
78
+ "Enter the credential ID", type=str, hide_input=False
79
+ )
80
+ secret = click.prompt("Enter the secret credential", type=str, hide_input=True)
79
81
  elif type == "azure":
80
- key_id = click.prompt(
82
+ credential_id = click.prompt(
81
83
  "Enter the Application (client) ID", type=str, hide_input=False
82
84
  )
83
85
  tenant = click.prompt(
@@ -85,7 +87,7 @@ def put(config, type):
85
87
  )
86
88
  secret = click.prompt("Enter the client secret", type=str, hide_input=True)
87
89
  elif type in ["docker", "huggingface"]:
88
- key_id = click.prompt("Enter the username", type=str, hide_input=False)
90
+ credential_id = click.prompt("Enter the username", type=str, hide_input=False)
89
91
  secret = click.prompt("Enter the access token", type=str, hide_input=True)
90
92
  elif type in ["gcp", "kaggle"]:
91
93
  file_name = click.prompt(
@@ -95,30 +97,32 @@ def put(config, type):
95
97
  ),
96
98
  hide_input=False,
97
99
  )
98
- key_id = os.path.basename(file_name)
100
+ credential_id = os.path.basename(file_name)
99
101
  with open(file_name) as f:
100
102
  secret = json.load(f)
101
103
  secret = json.dumps(secret)
102
104
  elif type == "ngc":
103
- key_id = "$oauthtoken"
105
+ credential_id = "$oauthtoken"
104
106
  secret = click.prompt("Enter the access token", type=str, hide_input=True)
105
107
  else:
106
- raise click.UsageError("Unsupported key type")
108
+ raise click.UsageError("Unsupported credential type")
107
109
 
108
110
  return config.proximl.run(
109
- project.keys.put(type=type, key_id=key_id, secret=secret, tenant=tenant)
111
+ project.credentials.put(
112
+ type=type, credential_id=credential_id, secret=secret, tenant=tenant
113
+ )
110
114
  )
111
115
 
112
116
 
113
- @key.command()
117
+ @credential.command()
114
118
  @click.argument("name", type=click.STRING)
115
119
  @pass_config
116
120
  def remove(config, name):
117
121
  """
118
- Remove a key.
122
+ Remove a credential.
119
123
 
120
124
 
121
125
  """
122
126
  project = config.proximl.run(config.proximl.client.projects.get_current())
123
127
 
124
- return config.proximl.run(project.key.remove(name))
128
+ return config.proximl.run(project.credential.remove(name))
@@ -1,4 +1,5 @@
1
1
  import click
2
+ import os
2
3
  from proximl.cli import pass_config
3
4
  from proximl.cli.project import project
4
5
 
@@ -42,17 +43,25 @@ def list(config):
42
43
 
43
44
 
44
45
  @secret.command()
46
+ @click.option(
47
+ "--file",
48
+ type=click.Path(exists=True, file_okay=True, dir_okay=False, resolve_path=True),
49
+ help="Load the secret value from the file at the provided path",
50
+ )
45
51
  @click.argument("name", type=click.STRING)
46
52
  @pass_config
47
- def put(config, name):
53
+ def put(config, file, name):
48
54
  """
49
55
  Set a secret value.
50
56
 
51
57
  Secret is created with the specified NAME.
52
58
  """
53
59
  project = config.proximl.run(config.proximl.client.projects.get_current())
54
-
55
- value = click.prompt("Enter the secret value", type=str, hide_input=True)
60
+ if file:
61
+ with open(os.path.expanduser(file)) as f:
62
+ value = f.read()
63
+ else:
64
+ value = click.prompt("Enter the secret value", type=str, hide_input=True)
56
65
 
57
66
  return config.proximl.run(project.secrets.put(name=name, value=value))
58
67
 
@@ -4,37 +4,37 @@ from datetime import datetime
4
4
  from dateutil import parser, tz
5
5
 
6
6
 
7
- class ProjectKeys(object):
7
+ class ProjectCredentials(object):
8
8
  def __init__(self, proximl, project_id):
9
9
  self.proximl = proximl
10
10
  self.project_id = project_id
11
11
 
12
12
  async def list(self, **kwargs):
13
13
  resp = await self.proximl._query(
14
- f"/project/{self.project_id}/keys", "GET", kwargs
14
+ f"/project/{self.project_id}/credentials", "GET", kwargs
15
15
  )
16
- keys = [ProjectKey(self.proximl, **service) for service in resp]
17
- return keys
16
+ credentials = [ProjectCredential(self.proximl, **service) for service in resp]
17
+ return credentials
18
18
 
19
19
  async def put(self, type, key_id, secret, tenant=None, **kwargs):
20
20
  data = dict(key_id=key_id, secret=secret, tenant=tenant)
21
21
  payload = {k: v for k, v in data.items() if v is not None}
22
- logging.info(f"Creating Project Key {type}")
22
+ logging.info(f"Creating Project Credential {type}")
23
23
  resp = await self.proximl._query(
24
- f"/project/{self.project_id}/key/{type}", "PUT", None, payload
24
+ f"/project/{self.project_id}/credential/{type}", "PUT", None, payload
25
25
  )
26
- key = ProjectKey(self.proximl, **resp)
27
- logging.info(f"Created Project Key {type} in project {self.project_id}")
26
+ credential = ProjectCredential(self.proximl, **resp)
27
+ logging.info(f"Created Project Credential {type} in project {self.project_id}")
28
28
 
29
- return key
29
+ return credential
30
30
 
31
31
  async def remove(self, type, **kwargs):
32
32
  await self.proximl._query(
33
- f"/project/{self.project_id}/key/{type}", "DELETE", kwargs
33
+ f"/project/{self.project_id}/credential/{type}", "DELETE", kwargs
34
34
  )
35
35
 
36
36
 
37
- class ProjectKey:
37
+ class ProjectCredential:
38
38
  def __init__(self, proximl, **kwargs):
39
39
  self.proximl = proximl
40
40
  self._entity = kwargs
@@ -65,7 +65,7 @@ class ProjectKey:
65
65
  return json.dumps({k: v for k, v in self._entity.items()})
66
66
 
67
67
  def __repr__(self):
68
- return f"ProjectKey( proximl , **{self._entity.__repr__()})"
68
+ return f"ProjectCredential( proximl , **{self._entity.__repr__()})"
69
69
 
70
70
  def __bool__(self):
71
71
  return bool(self._type)
@@ -7,6 +7,12 @@ class ProjectDataConnectors(object):
7
7
  self.proximl = proximl
8
8
  self.project_id = project_id
9
9
 
10
+ async def get(self, id, **kwargs):
11
+ resp = await self.proximl._query(
12
+ f"/project/{self.project_id}/data_connectors/{id}", "GET", kwargs
13
+ )
14
+ return ProjectDataConnector(self.proximl, **resp)
15
+
10
16
  async def list(self, **kwargs):
11
17
  resp = await self.proximl._query(
12
18
  f"/project/{self.project_id}/data_connectors", "GET", kwargs
@@ -61,3 +67,13 @@ class ProjectDataConnector:
61
67
 
62
68
  def __bool__(self):
63
69
  return bool(self._id)
70
+
71
+ async def enable(self):
72
+ await self.proximl._query(
73
+ f"/project/{self._project_uuid}/data_connectors/{self._id}/enable", "PATCH"
74
+ )
75
+
76
+ async def disable(self):
77
+ await self.proximl._query(
78
+ f"/project/{self._project_uuid}/data_connectors/{self._id}/disable", "PATCH"
79
+ )
@@ -7,6 +7,12 @@ class ProjectDatastores(object):
7
7
  self.proximl = proximl
8
8
  self.project_id = project_id
9
9
 
10
+ async def get(self, id, **kwargs):
11
+ resp = await self.proximl._query(
12
+ f"/project/{self.project_id}/datastores/{id}", "GET", kwargs
13
+ )
14
+ return ProjectDatastore(self.proximl, **resp)
15
+
10
16
  async def list(self, **kwargs):
11
17
  resp = await self.proximl._query(
12
18
  f"/project/{self.project_id}/datastores", "GET", kwargs
@@ -56,3 +62,13 @@ class ProjectDatastore:
56
62
 
57
63
  def __bool__(self):
58
64
  return bool(self._id)
65
+
66
+ async def enable(self):
67
+ await self.proximl._query(
68
+ f"/project/{self._project_uuid}/datastores/{self._id}/enable", "PATCH"
69
+ )
70
+
71
+ async def disable(self):
72
+ await self.proximl._query(
73
+ f"/project/{self._project_uuid}/datastores/{self._id}/disable", "PATCH"
74
+ )
@@ -3,7 +3,7 @@ import logging
3
3
  from .datastores import ProjectDatastores
4
4
  from .data_connectors import ProjectDataConnectors
5
5
  from .services import ProjectServices
6
- from .keys import ProjectKeys
6
+ from .credentials import ProjectCredentials
7
7
  from .secrets import ProjectSecrets
8
8
 
9
9
 
@@ -26,8 +26,11 @@ class Projects(object):
26
26
  projects = [Project(self.proximl, **project) for project in resp]
27
27
  return projects
28
28
 
29
- async def create(self, name, copy_keys=False, copy_secrets=False, **kwargs):
30
- data = dict(name=name, copy_keys=copy_keys, copy_secrets=copy_secrets)
29
+ async def create(self, name, copy_credentials=False, **kwargs):
30
+ data = dict(
31
+ name=name,
32
+ copy_credentials=copy_credentials,
33
+ )
31
34
  payload = {k: v for k, v in data.items() if v is not None}
32
35
  logging.info(f"Creating Project {name}")
33
36
  resp = await self.proximl._query("/project", "POST", None, payload)
@@ -51,7 +54,7 @@ class Project:
51
54
  self.datastores = ProjectDatastores(self.proximl, self._id)
52
55
  self.data_connectors = ProjectDataConnectors(self.proximl, self._id)
53
56
  self.services = ProjectServices(self.proximl, self._id)
54
- self.keys = ProjectKeys(self.proximl, self._id)
57
+ self.credentials = ProjectCredentials(self.proximl, self._id)
55
58
  self.secrets = ProjectSecrets(self.proximl, self._id)
56
59
 
57
60
  @property
@@ -24,7 +24,7 @@ class ProjectSecrets(object):
24
24
  f"/project/{self.project_id}/secret/{name}", "PUT", None, payload
25
25
  )
26
26
  secret = ProjectSecret(self.proximl, **resp)
27
- logging.info(f"Created Project Key {name} in project {self.project_id}")
27
+ logging.info(f"Created Project Secret {name} in project {self.project_id}")
28
28
  return secret
29
29
 
30
30
  async def remove(self, name, **kwargs):
@@ -7,6 +7,12 @@ class ProjectServices(object):
7
7
  self.proximl = proximl
8
8
  self.project_id = project_id
9
9
 
10
+ async def get(self, id, **kwargs):
11
+ resp = await self.proximl._query(
12
+ f"/project/{self.project_id}/services/{id}", "GET", kwargs
13
+ )
14
+ return ProjectService(self.proximl, **resp)
15
+
10
16
  async def list(self, **kwargs):
11
17
  resp = await self.proximl._query(
12
18
  f"/project/{self.project_id}/services", "GET", kwargs
@@ -61,3 +67,13 @@ class ProjectService:
61
67
 
62
68
  def __bool__(self):
63
69
  return bool(self._id)
70
+
71
+ async def enable(self):
72
+ await self.proximl._query(
73
+ f"/project/{self._project_uuid}/services/{self._id}/enable", "PATCH"
74
+ )
75
+
76
+ async def disable(self):
77
+ await self.proximl._query(
78
+ f"/project/{self._project_uuid}/services/{self._id}/disable", "PATCH"
79
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: proximl
3
- Version: 0.5.11
3
+ Version: 0.5.13
4
4
  Summary: proxiML client SDK and command line utilities
5
5
  Home-page: https://github.com/proxiML/python-sdk
6
6
  Author: proxiML
@@ -44,9 +44,9 @@ proximl/cli/cloudbender/service.py
44
44
  proximl/cli/job/__init__.py
45
45
  proximl/cli/job/create.py
46
46
  proximl/cli/project/__init__.py
47
+ proximl/cli/project/credential.py
47
48
  proximl/cli/project/data_connector.py
48
49
  proximl/cli/project/datastore.py
49
- proximl/cli/project/key.py
50
50
  proximl/cli/project/secret.py
51
51
  proximl/cli/project/service.py
52
52
  proximl/cloudbender/__init__.py
@@ -60,9 +60,9 @@ proximl/cloudbender/providers.py
60
60
  proximl/cloudbender/regions.py
61
61
  proximl/cloudbender/services.py
62
62
  proximl/projects/__init__.py
63
+ proximl/projects/credentials.py
63
64
  proximl/projects/data_connectors.py
64
65
  proximl/projects/datastores.py
65
- proximl/projects/keys.py
66
66
  proximl/projects/projects.py
67
67
  proximl/projects/secrets.py
68
68
  proximl/projects/services.py
@@ -79,10 +79,10 @@ tests/integration/cloudbender/__init__.py
79
79
  tests/integration/cloudbender/test_providers_integration.py
80
80
  tests/integration/projects/__init__.py
81
81
  tests/integration/projects/conftest.py
82
+ tests/integration/projects/test_projects_credentials_integration.py
82
83
  tests/integration/projects/test_projects_data_connectors_integration.py
83
84
  tests/integration/projects/test_projects_datastores_integration.py
84
85
  tests/integration/projects/test_projects_integration.py
85
- tests/integration/projects/test_projects_keys_integration.py
86
86
  tests/integration/projects/test_projects_secrets_integration.py
87
87
  tests/integration/projects/test_projects_services_integration.py
88
88
  tests/unit/__init__.py
@@ -115,9 +115,9 @@ tests/unit/cli/cloudbender/test_cli_provider_unit.py
115
115
  tests/unit/cli/cloudbender/test_cli_region_unit.py
116
116
  tests/unit/cli/cloudbender/test_cli_service_unit.py
117
117
  tests/unit/cli/projects/__init__.py
118
+ tests/unit/cli/projects/test_cli_project_credential_unit.py
118
119
  tests/unit/cli/projects/test_cli_project_data_connector_unit.py
119
120
  tests/unit/cli/projects/test_cli_project_datastore_unit.py
120
- tests/unit/cli/projects/test_cli_project_key_unit.py
121
121
  tests/unit/cli/projects/test_cli_project_secret_unit.py
122
122
  tests/unit/cli/projects/test_cli_project_service_unit.py
123
123
  tests/unit/cli/projects/test_cli_project_unit.py
@@ -131,9 +131,9 @@ tests/unit/cloudbender/test_providers_unit.py
131
131
  tests/unit/cloudbender/test_regions_unit.py
132
132
  tests/unit/cloudbender/test_services_unit.py
133
133
  tests/unit/projects/__init__.py
134
+ tests/unit/projects/test_project_credentials_unit.py
134
135
  tests/unit/projects/test_project_data_connectors_unit.py
135
136
  tests/unit/projects/test_project_datastores_unit.py
136
- tests/unit/projects/test_project_keys_unit.py
137
137
  tests/unit/projects/test_project_secrets_unit.py
138
138
  tests/unit/projects/test_project_services_unit.py
139
139
  tests/unit/projects/test_projects_unit.py
@@ -4,7 +4,7 @@ from pytest import fixture
4
4
  @fixture(scope="module")
5
5
  async def project(proximl):
6
6
  project = await proximl.projects.create(
7
- name="New Project", copy_keys=False, copy_secrets=False
7
+ name="New Project", copy_credentials=False, copy_secrets=False
8
8
  )
9
9
  yield project
10
10
  await project.remove()
@@ -0,0 +1,45 @@
1
+ import re
2
+ import sys
3
+ import asyncio
4
+ from pytest import mark, fixture
5
+
6
+ pytestmark = [mark.sdk, mark.integration, mark.projects]
7
+
8
+
9
+ @mark.create
10
+ @mark.asyncio
11
+ class ProjectCredentialsTests:
12
+ @fixture(scope="class")
13
+ async def project_credential(self, project):
14
+ project_credential = await project.credentials.put(
15
+ type="aws", key_id="ASFHALKF", secret="IUHKLHKAHF"
16
+ )
17
+ yield project_credential
18
+ await project.credentials.remove(type="aws")
19
+
20
+ async def test_list_project_credentials(self, project, project_credential):
21
+ credentials = await project.credentials.list()
22
+ assert len(credentials) > 0
23
+
24
+ async def test_project_credential_properties(self, project, project_credential):
25
+ assert isinstance(project_credential.project_uuid, str)
26
+ assert isinstance(project_credential.type, str)
27
+ assert isinstance(project_credential.key_id, str)
28
+ assert project_credential.type == "aws"
29
+ assert project.id == project_credential.project_uuid
30
+
31
+ async def test_project_credential_str(self, project_credential):
32
+ string = str(project_credential)
33
+ regex = r"^{.*\"type\": \"" + project_credential.type + r"\".*}$"
34
+ assert isinstance(string, str)
35
+ assert re.match(regex, string)
36
+
37
+ async def test_project_credential_repr(self, project_credential):
38
+ string = repr(project_credential)
39
+ regex = (
40
+ r"^ProjectCredential\( proximl , \*\*{.*'type': '"
41
+ + project_credential.type
42
+ + r"'.*}\)$"
43
+ )
44
+ assert isinstance(string, str)
45
+ assert re.match(regex, string)
@@ -17,7 +17,7 @@ class ProjectSecretsTests:
17
17
  yield project_secret
18
18
  await project.secrets.remove(name="secret_value")
19
19
 
20
- async def test_list_project_keys(self, project, project_secret):
20
+ async def test_list_project_secrets(self, project, project_secret):
21
21
  secrets = await project.secrets.list()
22
22
  assert len(secrets) > 0
23
23
 
@@ -175,7 +175,7 @@ class JobAPIResourceValidationTests:
175
175
  disk_size=10,
176
176
  )
177
177
  assert (
178
- "Invalid Request - None (CPU Only) may be not be combined with other GPU Types"
178
+ "Invalid Request - CPU Only may be not be combined with other GPU Types"
179
179
  in error.value.message
180
180
  )
181
181
 
@@ -6,21 +6,21 @@ from pytest import mark, fixture, raises
6
6
 
7
7
  pytestmark = [mark.cli, mark.unit, mark.projects]
8
8
 
9
- from proximl.cli.project import key as specimen
9
+ from proximl.cli.project import credential as specimen
10
10
  from proximl.projects import (
11
11
  Project,
12
12
  )
13
13
 
14
14
 
15
- def test_list_keys(runner, mock_project_keys):
15
+ def test_list_credentials(runner, mock_project_credentials):
16
16
  with patch("proximl.cli.ProxiML", new=AsyncMock) as mock_proximl:
17
17
  project = create_autospec(Project)
18
18
  mock_proximl.projects = AsyncMock()
19
19
  mock_proximl.projects.get = AsyncMock(return_value=project)
20
20
  mock_proximl.projects.get_current = AsyncMock(return_value=project)
21
- project.keys = AsyncMock()
22
- project.keys.list = AsyncMock(return_value=mock_project_keys)
21
+ project.credentials = AsyncMock()
22
+ project.credentials.list = AsyncMock(return_value=mock_project_credentials)
23
23
  result = runner.invoke(specimen, ["list"])
24
24
  print(result)
25
25
  assert result.exit_code == 0
26
- project.keys.list.assert_called_once()
26
+ project.credentials.list.assert_called_once()