Example #1
0
    async def edit(self, mr: PackagingIntegration) -> PackagingIntegration:
        """
        Edit Packaging Integration

        :param mr: Packaging Integration
        :return Message from API server
        """
        return PackagingIntegration.from_dict(await self.query(
            PACKING_INTEGRATION_URL, action='PUT', payload=mr.to_dict()))
Example #2
0
    def create(self, mr: PackagingIntegration) -> PackagingIntegration:
        """
        Create Packaging Integration

        :param mr: Packaging Integration
        :return Message from API server
        """
        return PackagingIntegration.from_dict(
            self.query(PACKING_INTEGRATION_URL,
                       action='POST',
                       payload=mr.to_dict()))
Example #3
0
    async def get(self, name: str) -> PackagingIntegration:
        """
        Get Packaging Integration from API server

        :param name: Packaging Integration name
        :type name: str
        :return: Packaging Integration
        """
        return PackagingIntegration.from_dict(
            await self.query(f'{PACKING_INTEGRATION_URL}/{name}'))
Example #4
0
    def get_all(self) -> typing.List[PackagingIntegration]:
        """
        Get all Packaging Integrations from API server

        :return: all Packaging Integrations
        """
        return [
            PackagingIntegration.from_dict(mr)
            for mr in self.query(PACKING_INTEGRATION_URL)
        ]
Example #5
0
PACKAGING = EntityTestData(
    ModelPackagingClient(),
    ModelPackaging(id=ENTITY_ID,
                   spec=ModelPackagingSpec(artifact_name='test-artifact-name',
                                           integration_name='test'),
                   status=ModelPackagingStatus(state=SUCCEEDED_STATE, )),
    packaging.packaging,
    'ModelPackaging',
)

PACKAGING_INTEGRATION = EntityTestData(
    PackagingIntegrationClient(),
    PackagingIntegration(
        id=ENTITY_ID,
        spec=PackagingIntegrationSpec(default_image="odahu:image",
                                      entrypoint="some_entrypoint"),
    ),
    packaging_integration.packaging_integration,
    'PackagingIntegration',
)

DEPLOYMENT = EntityTestData(
    ModelDeploymentClient(),
    ModelDeployment(id=ENTITY_ID,
                    spec=ModelDeploymentSpec(image="odahu:image",
                                             min_replicas=0),
                    status=ModelDeploymentStatus(
                        state=READY_STATE,
                        available_replicas=1,
                    )),