trainml 0.5.14__tar.gz → 0.5.16__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.
- {trainml-0.5.14 → trainml-0.5.16}/PKG-INFO +1 -1
- {trainml-0.5.14 → trainml-0.5.16}/pyproject.toml +1 -0
- trainml-0.5.16/tests/integration/cloudbender/conftest.py +28 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/integration/cloudbender/test_providers_integration.py +3 -8
- trainml-0.5.16/tests/integration/cloudbender/test_regions_integration.py +42 -0
- trainml-0.5.16/tests/integration/cloudbender/test_services_integration.py +87 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/integration/conftest.py +1 -1
- {trainml-0.5.14 → trainml-0.5.16}/tests/integration/projects/conftest.py +2 -1
- {trainml-0.5.14 → trainml-0.5.16}/tests/integration/projects/test_projects_credentials_integration.py +1 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/integration/projects/test_projects_data_connectors_integration.py +1 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/integration/projects/test_projects_datastores_integration.py +1 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/integration/projects/test_projects_integration.py +1 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/integration/projects/test_projects_members_integration.py +1 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/integration/projects/test_projects_secrets_integration.py +1 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/integration/projects/test_projects_services_integration.py +1 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/integration/test_checkpoints_integration.py +1 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/integration/test_datasets_integration.py +1 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/integration/test_jobs_integration.py +5 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/integration/test_models_integration.py +1 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/integration/test_volumes_integration.py +1 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/__init__.py +1 -1
- {trainml-0.5.14 → trainml-0.5.16}/trainml/cloudbender/services.py +29 -1
- {trainml-0.5.14 → trainml-0.5.16}/trainml/projects/services.py +17 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml.egg-info/PKG-INFO +1 -1
- {trainml-0.5.14 → trainml-0.5.16}/trainml.egg-info/SOURCES.txt +3 -0
- {trainml-0.5.14 → trainml-0.5.16}/LICENSE +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/README.md +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/examples/__init__.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/examples/create_dataset_and_training_job.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/examples/local_storage.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/examples/training_inference_pipeline.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/setup.cfg +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/setup.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/integration/__init__.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/integration/cloudbender/__init__.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/integration/projects/__init__.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/integration/test_environments_integration.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/integration/test_gpu_types_integration.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/__init__.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/cli/__init__.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/cli/cloudbender/__init__.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/cli/cloudbender/test_cli_datastore_unit.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/cli/cloudbender/test_cli_device_unit.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/cli/cloudbender/test_cli_node_unit.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/cli/cloudbender/test_cli_provider_unit.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/cli/cloudbender/test_cli_region_unit.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/cli/cloudbender/test_cli_service_unit.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/cli/conftest.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/cli/projects/__init__.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/cli/projects/test_cli_project_credential_unit.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/cli/projects/test_cli_project_data_connector_unit.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/cli/projects/test_cli_project_datastore_unit.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/cli/projects/test_cli_project_secret_unit.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/cli/projects/test_cli_project_service_unit.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/cli/projects/test_cli_project_unit.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/cli/test_cli_checkpoint_unit.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/cli/test_cli_datasets_unit.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/cli/test_cli_environment_unit.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/cli/test_cli_gpu_unit.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/cli/test_cli_job_unit.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/cli/test_cli_model_unit.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/cli/test_cli_volume_unit.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/cloudbender/__init__.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/cloudbender/test_data_connectors_unit.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/cloudbender/test_datastores_unit.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/cloudbender/test_device_configs_unit.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/cloudbender/test_devices_unit.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/cloudbender/test_nodes_unit.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/cloudbender/test_providers_unit.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/cloudbender/test_regions_unit.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/cloudbender/test_services_unit.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/conftest.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/projects/__init__.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/projects/test_project_credentials_unit.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/projects/test_project_data_connectors_unit.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/projects/test_project_datastores_unit.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/projects/test_project_members_unit.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/projects/test_project_secrets_unit.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/projects/test_project_services_unit.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/projects/test_projects_unit.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/test_auth_unit.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/test_checkpoints_unit.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/test_connections_unit.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/test_datasets_unit.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/test_environments_unit.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/test_exceptions.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/test_gpu_types_unit.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/test_jobs_unit.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/test_models_unit.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/test_trainml_unit.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/tests/unit/test_volumes_unit.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/__main__.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/auth.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/checkpoints.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/cli/__init__.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/cli/checkpoint.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/cli/cloudbender/__init__.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/cli/cloudbender/data_connector.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/cli/cloudbender/datastore.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/cli/cloudbender/device.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/cli/cloudbender/node.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/cli/cloudbender/provider.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/cli/cloudbender/region.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/cli/cloudbender/service.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/cli/connection.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/cli/dataset.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/cli/environment.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/cli/gpu.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/cli/job/__init__.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/cli/job/create.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/cli/model.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/cli/project/__init__.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/cli/project/credential.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/cli/project/data_connector.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/cli/project/datastore.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/cli/project/secret.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/cli/project/service.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/cli/volume.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/cloudbender/__init__.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/cloudbender/cloudbender.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/cloudbender/data_connectors.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/cloudbender/datastores.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/cloudbender/device_configs.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/cloudbender/devices.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/cloudbender/nodes.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/cloudbender/providers.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/cloudbender/regions.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/connections.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/datasets.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/environments.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/exceptions.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/gpu_types.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/jobs.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/models.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/projects/__init__.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/projects/credentials.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/projects/data_connectors.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/projects/datastores.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/projects/members.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/projects/projects.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/projects/secrets.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/trainml.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml/volumes.py +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml.egg-info/dependency_links.txt +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml.egg-info/entry_points.txt +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml.egg-info/requires.txt +0 -0
- {trainml-0.5.14 → trainml-0.5.16}/trainml.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
|
|
2
|
+
from pytest import fixture, mark
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
pytestmark = [mark.integration,mark.cloudbender]
|
|
6
|
+
|
|
7
|
+
@fixture(scope="session")
|
|
8
|
+
@mark.create
|
|
9
|
+
@mark.asyncio
|
|
10
|
+
@mark.xdist_group("cloudbender_resources")
|
|
11
|
+
async def provider( trainml):
|
|
12
|
+
provider = await trainml.cloudbender.providers.enable(type="test")
|
|
13
|
+
await provider.wait_for("ready")
|
|
14
|
+
yield provider
|
|
15
|
+
await provider.remove()
|
|
16
|
+
|
|
17
|
+
@fixture(scope="session")
|
|
18
|
+
@mark.create
|
|
19
|
+
@mark.asyncio
|
|
20
|
+
@mark.xdist_group("cloudbender_resources")
|
|
21
|
+
async def region(trainml, provider):
|
|
22
|
+
region = await trainml.cloudbender.regions.create(provider_uuid=provider.id,name="test-region",
|
|
23
|
+
public=False,
|
|
24
|
+
storage=dict(mode="local"),)
|
|
25
|
+
await region.wait_for("healthy")
|
|
26
|
+
yield region
|
|
27
|
+
await region.remove()
|
|
28
|
+
await region.wait_for("archived")
|
{trainml-0.5.14 → trainml-0.5.16}/tests/integration/cloudbender/test_providers_integration.py
RENAMED
|
@@ -8,14 +8,9 @@ pytestmark = [mark.sdk, mark.integration, mark.cloudbender, mark.providers]
|
|
|
8
8
|
|
|
9
9
|
@mark.create
|
|
10
10
|
@mark.asyncio
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
async def
|
|
14
|
-
provider = await trainml.cloudbender.providers.enable(type="test")
|
|
15
|
-
yield provider
|
|
16
|
-
await provider.remove()
|
|
17
|
-
|
|
18
|
-
async def test_get_providers(self, trainml):
|
|
11
|
+
@mark.xdist_group("cloudbender_resources")
|
|
12
|
+
class GetProviderTests:
|
|
13
|
+
async def test_get_providers(self, trainml, provider):
|
|
19
14
|
providers = await trainml.cloudbender.providers.list()
|
|
20
15
|
assert len(providers) > 0
|
|
21
16
|
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import re
|
|
2
|
+
import sys
|
|
3
|
+
import asyncio
|
|
4
|
+
from pytest import mark, fixture
|
|
5
|
+
|
|
6
|
+
pytestmark = [mark.sdk, mark.integration, mark.cloudbender, mark.regions]
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@mark.create
|
|
10
|
+
@mark.asyncio
|
|
11
|
+
@mark.xdist_group("cloudbender_resources")
|
|
12
|
+
class GetRegionTests:
|
|
13
|
+
async def test_get_regions(self, trainml, provider, region):
|
|
14
|
+
regions = await trainml.cloudbender.regions.list(provider_uuid=provider.id)
|
|
15
|
+
assert len(regions) > 0
|
|
16
|
+
|
|
17
|
+
async def test_get_region(self, trainml, provider, region):
|
|
18
|
+
response = await trainml.cloudbender.regions.get(provider.id, region.id)
|
|
19
|
+
assert response.id == region.id
|
|
20
|
+
|
|
21
|
+
async def test_region_properties(self, provider, region):
|
|
22
|
+
assert isinstance(region.id, str)
|
|
23
|
+
assert isinstance(region.provider_uuid, str)
|
|
24
|
+
assert isinstance(region.type, str)
|
|
25
|
+
assert region.type == "test"
|
|
26
|
+
assert region.provider_uuid == provider.id
|
|
27
|
+
|
|
28
|
+
async def test_region_str(self, region):
|
|
29
|
+
string = str(region)
|
|
30
|
+
regex = r"^{.*\"region_uuid\": \"" + region.id + r"\".*}$"
|
|
31
|
+
assert isinstance(string, str)
|
|
32
|
+
assert re.match(regex, string)
|
|
33
|
+
|
|
34
|
+
async def test_region_repr(self, region):
|
|
35
|
+
string = repr(region)
|
|
36
|
+
regex = (
|
|
37
|
+
r"^Region\( trainml , \*\*{.*'region_uuid': '"
|
|
38
|
+
+ region.id
|
|
39
|
+
+ r"'.*}\)$"
|
|
40
|
+
)
|
|
41
|
+
assert isinstance(string, str)
|
|
42
|
+
assert re.match(regex, string)
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import re
|
|
2
|
+
import sys
|
|
3
|
+
import asyncio
|
|
4
|
+
from pytest import mark, fixture
|
|
5
|
+
from cryptography import x509
|
|
6
|
+
from cryptography.x509.oid import NameOID, ExtendedKeyUsageOID
|
|
7
|
+
from cryptography.hazmat.primitives.asymmetric import rsa
|
|
8
|
+
from cryptography.hazmat.primitives import serialization, hashes
|
|
9
|
+
|
|
10
|
+
pytestmark = [mark.sdk, mark.integration, mark.cloudbender, mark.regions]
|
|
11
|
+
|
|
12
|
+
def get_csr(service_id):
|
|
13
|
+
private_key = rsa.generate_private_key(
|
|
14
|
+
public_exponent=65537,
|
|
15
|
+
key_size=4096
|
|
16
|
+
)
|
|
17
|
+
csr = x509.CertificateSigningRequestBuilder().subject_name(x509.Name([
|
|
18
|
+
x509.NameAttribute(NameOID.COUNTRY_NAME, "US"),
|
|
19
|
+
x509.NameAttribute(NameOID.ORGANIZATION_NAME, "proxiML"),
|
|
20
|
+
x509.NameAttribute(NameOID.ORGANIZATIONAL_UNIT_NAME, service_id),
|
|
21
|
+
x509.NameAttribute(NameOID.COMMON_NAME, "test-client"), # Client identity
|
|
22
|
+
])).add_extension(
|
|
23
|
+
x509.ExtendedKeyUsage([
|
|
24
|
+
ExtendedKeyUsageOID.CLIENT_AUTH # Client authentication usage
|
|
25
|
+
]),
|
|
26
|
+
critical=True
|
|
27
|
+
).sign(private_key, hashes.SHA256())
|
|
28
|
+
return csr.public_bytes(serialization.Encoding.PEM).decode("utf-8")
|
|
29
|
+
|
|
30
|
+
@mark.create
|
|
31
|
+
@mark.asyncio
|
|
32
|
+
@mark.xdist_group("cloudbender_resources")
|
|
33
|
+
class GetServiceTests:
|
|
34
|
+
@fixture(scope="class")
|
|
35
|
+
async def service(self, trainml, region):
|
|
36
|
+
service = await trainml.cloudbender.services.create(
|
|
37
|
+
provider_uuid=region.provider_uuid,
|
|
38
|
+
region_uuid=region.id,
|
|
39
|
+
name="CLI Automated Service",
|
|
40
|
+
type="tcp",
|
|
41
|
+
port="8989",
|
|
42
|
+
public=False,
|
|
43
|
+
)
|
|
44
|
+
await service.wait_for("active")
|
|
45
|
+
yield service
|
|
46
|
+
await service.remove()
|
|
47
|
+
await service.wait_for("archived")
|
|
48
|
+
|
|
49
|
+
async def test_get_services(self, trainml, region,service):
|
|
50
|
+
services = await trainml.cloudbender.services.list(provider_uuid=region.provider_uuid, region_uuid=region.id)
|
|
51
|
+
assert len(services) > 0
|
|
52
|
+
|
|
53
|
+
async def test_get_service(self, trainml, provider, region, service):
|
|
54
|
+
response = await trainml.cloudbender.services.get(provider.id, region.id, service.id)
|
|
55
|
+
assert response.id == service.id
|
|
56
|
+
|
|
57
|
+
async def test_service_properties(self, region, service):
|
|
58
|
+
assert isinstance(service.id, str)
|
|
59
|
+
assert isinstance(service.provider_uuid, str)
|
|
60
|
+
assert isinstance(service.region_uuid, str)
|
|
61
|
+
assert isinstance(service.public, bool)
|
|
62
|
+
assert service.port == "8989"
|
|
63
|
+
assert service.provider_uuid == region.provider_uuid
|
|
64
|
+
assert service.region_uuid == region.id
|
|
65
|
+
|
|
66
|
+
async def test_service_str(self, service):
|
|
67
|
+
string = str(service)
|
|
68
|
+
regex = r"^{.*\"service_id\": \"" + service.id + r"\".*}$"
|
|
69
|
+
assert isinstance(string, str)
|
|
70
|
+
assert re.match(regex, string)
|
|
71
|
+
|
|
72
|
+
async def test_service_repr(self, service):
|
|
73
|
+
string = repr(service)
|
|
74
|
+
regex = (
|
|
75
|
+
r"^Service\( trainml , \*\*{.*'service_id': '"
|
|
76
|
+
+ service.id
|
|
77
|
+
+ r"'.*}\)$"
|
|
78
|
+
)
|
|
79
|
+
assert isinstance(string, str)
|
|
80
|
+
assert re.match(regex, string)
|
|
81
|
+
|
|
82
|
+
async def test_service_certificate(self, service):
|
|
83
|
+
service = await service.generate_certificate()
|
|
84
|
+
assert isinstance(service._service.get("auth_cert"), str)
|
|
85
|
+
csr = get_csr(service.id)
|
|
86
|
+
certificate = await service.sign_client_certificate(csr)
|
|
87
|
+
assert isinstance(certificate, str)
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
from pytest import fixture
|
|
1
|
+
from pytest import fixture, mark
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
@fixture(scope="module")
|
|
5
|
+
@mark.xdist_group("project_resources")
|
|
5
6
|
async def project(trainml):
|
|
6
7
|
project = await trainml.projects.create(
|
|
7
8
|
name="New Project", copy_credentials=False, copy_secrets=False
|
|
@@ -20,6 +20,7 @@ def extract_domain_suffix(hostname):
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
@fixture(scope="class")
|
|
23
|
+
@mark.xdist_group("job_lifecycle")
|
|
23
24
|
async def job(trainml):
|
|
24
25
|
job = await trainml.jobs.create(
|
|
25
26
|
name="CLI Automated Tests - Job Lifecycle",
|
|
@@ -38,6 +39,7 @@ async def job(trainml):
|
|
|
38
39
|
|
|
39
40
|
@mark.create
|
|
40
41
|
@mark.asyncio
|
|
42
|
+
@mark.xdist_group("job_lifecycle")
|
|
41
43
|
class JobLifeCycleTests:
|
|
42
44
|
async def test_wait_for_running(self, job):
|
|
43
45
|
assert job.status != "running"
|
|
@@ -413,6 +415,7 @@ class JobAPIWorkerValidationTests:
|
|
|
413
415
|
|
|
414
416
|
@mark.create
|
|
415
417
|
@mark.asyncio
|
|
418
|
+
@mark.xdist_group("job_io")
|
|
416
419
|
class JobIOTests:
|
|
417
420
|
async def test_job_local_output(self, trainml, capsys):
|
|
418
421
|
temp_dir = tempfile.TemporaryDirectory()
|
|
@@ -527,6 +530,7 @@ class JobIOTests:
|
|
|
527
530
|
|
|
528
531
|
@mark.create
|
|
529
532
|
@mark.asyncio
|
|
533
|
+
@mark.xdist_group("job_types")
|
|
530
534
|
class JobTypeTests:
|
|
531
535
|
async def test_endpoint(self, trainml):
|
|
532
536
|
|
|
@@ -648,6 +652,7 @@ class JobTypeTests:
|
|
|
648
652
|
|
|
649
653
|
@mark.create
|
|
650
654
|
@mark.asyncio
|
|
655
|
+
@mark.xdist_group("job_features")
|
|
651
656
|
class JobFeatureTests:
|
|
652
657
|
async def test_cpu_instance(self, trainml, capsys):
|
|
653
658
|
job = await trainml.jobs.create(
|
|
@@ -2,6 +2,7 @@ import json
|
|
|
2
2
|
import logging
|
|
3
3
|
import asyncio
|
|
4
4
|
import math
|
|
5
|
+
from enum import Enum
|
|
5
6
|
|
|
6
7
|
from trainml.exceptions import (
|
|
7
8
|
ApiError,
|
|
@@ -9,6 +10,14 @@ from trainml.exceptions import (
|
|
|
9
10
|
TrainMLException,
|
|
10
11
|
)
|
|
11
12
|
|
|
13
|
+
class SERVICE_CERT_ALGORITHMS(str, Enum):
|
|
14
|
+
RSA_2048 = 'rsa2048'
|
|
15
|
+
RSA_4096 = 'rsa4096'
|
|
16
|
+
ED25519 = 'ed25519'
|
|
17
|
+
P256 = 'p256'
|
|
18
|
+
P384 ='p384'
|
|
19
|
+
P521='p521'
|
|
20
|
+
|
|
12
21
|
|
|
13
22
|
class Services(object):
|
|
14
23
|
def __init__(self, trainml):
|
|
@@ -67,7 +76,7 @@ class Services(object):
|
|
|
67
76
|
|
|
68
77
|
|
|
69
78
|
class Service:
|
|
70
|
-
def __init__(self, trainml,
|
|
79
|
+
def __init__(self, trainml, **kwargs):
|
|
71
80
|
self.trainml = trainml
|
|
72
81
|
self._service = kwargs
|
|
73
82
|
self._id = self._service.get("service_id")
|
|
@@ -177,3 +186,22 @@ class Service:
|
|
|
177
186
|
logging.debug(f"self: {self}, retry count {count}")
|
|
178
187
|
|
|
179
188
|
raise TrainMLException(f"Timeout waiting for {status}")
|
|
189
|
+
|
|
190
|
+
async def generate_certificate(self, algorithm=SERVICE_CERT_ALGORITHMS.ED25519.value, **kwargs):
|
|
191
|
+
resp = await self.trainml._query(
|
|
192
|
+
f"/provider/{self._provider_uuid}/region/{self._region_uuid}/service/{self._id}/certificate",
|
|
193
|
+
"POST",
|
|
194
|
+
kwargs,
|
|
195
|
+
dict(algorithm=algorithm)
|
|
196
|
+
)
|
|
197
|
+
self.__init__(self.trainml, **resp)
|
|
198
|
+
return self
|
|
199
|
+
|
|
200
|
+
async def sign_client_certificate(self, csr, **kwargs):
|
|
201
|
+
certificate = await self.trainml._query(
|
|
202
|
+
f"/provider/{self._provider_uuid}/region/{self._region_uuid}/service/{self._id}/certificate/sign",
|
|
203
|
+
"POST",
|
|
204
|
+
kwargs,
|
|
205
|
+
dict(csr=csr)
|
|
206
|
+
)
|
|
207
|
+
return certificate
|
|
@@ -77,3 +77,20 @@ class ProjectService:
|
|
|
77
77
|
await self.trainml._query(
|
|
78
78
|
f"/project/{self._project_uuid}/services/{self._id}/disable", "PATCH"
|
|
79
79
|
)
|
|
80
|
+
|
|
81
|
+
async def get_service_ca_certificate(self, **kwargs):
|
|
82
|
+
certificate = await self.trainml._query(
|
|
83
|
+
f"/project/{self._project_uuid}/services/{self._id}/certificate/ca",
|
|
84
|
+
"GET",
|
|
85
|
+
kwargs,
|
|
86
|
+
)
|
|
87
|
+
return certificate
|
|
88
|
+
|
|
89
|
+
async def sign_client_certificate(self, csr, **kwargs):
|
|
90
|
+
certificate = await self.trainml._query(
|
|
91
|
+
f"/project/{self._project_uuid}/services/{self._id}/certificate/sign",
|
|
92
|
+
"POST",
|
|
93
|
+
kwargs,
|
|
94
|
+
dict(csr=csr)
|
|
95
|
+
)
|
|
96
|
+
return certificate
|
|
@@ -16,7 +16,10 @@ tests/integration/test_jobs_integration.py
|
|
|
16
16
|
tests/integration/test_models_integration.py
|
|
17
17
|
tests/integration/test_volumes_integration.py
|
|
18
18
|
tests/integration/cloudbender/__init__.py
|
|
19
|
+
tests/integration/cloudbender/conftest.py
|
|
19
20
|
tests/integration/cloudbender/test_providers_integration.py
|
|
21
|
+
tests/integration/cloudbender/test_regions_integration.py
|
|
22
|
+
tests/integration/cloudbender/test_services_integration.py
|
|
20
23
|
tests/integration/projects/__init__.py
|
|
21
24
|
tests/integration/projects/conftest.py
|
|
22
25
|
tests/integration/projects/test_projects_credentials_integration.py
|
|
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
|
|
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
|
{trainml-0.5.14 → trainml-0.5.16}/tests/unit/cli/projects/test_cli_project_credential_unit.py
RENAMED
|
File without changes
|
{trainml-0.5.14 → trainml-0.5.16}/tests/unit/cli/projects/test_cli_project_data_connector_unit.py
RENAMED
|
File without changes
|
{trainml-0.5.14 → trainml-0.5.16}/tests/unit/cli/projects/test_cli_project_datastore_unit.py
RENAMED
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|