Ejemplo n.º 1
0
    def edit(self, md: ModelDeployment) -> ModelDeployment:
        """
        Edit Model Deployment

        :param md: Model Deployment
        :return Message from API server
        """
        return ModelDeployment.from_dict(
            self.query(MODEL_DEPLOYMENT_URL, action='PUT', payload=md.to_dict())
        )
Ejemplo n.º 2
0
    async def create(self, md: ModelDeployment) -> ModelDeployment:
        """
        Create Model Deployment

        :param md: Model Deployment
        :return Message from API server
        """
        return ModelDeployment.from_dict(
            await self.query(MODEL_DEPLOYMENT_URL, action='POST', payload=md.to_dict())
        )
Ejemplo n.º 3
0
    async def get(self, name: str) -> ModelDeployment:
        """
        Get Model Deployment from API server

        :param name: Model Deployment name
        :return: Model Deployment
        """
        return ModelDeployment.from_dict(await self.query(f'{MODEL_DEPLOYMENT_URL}/{name}'))
Ejemplo n.º 4
0
    def get_all(self, labels: typing.Dict[str, str] = None) -> typing.List[ModelDeployment]:
        """
        Get all Model Deployments from API server

        :return: all Model Deployments
        """
        if labels:
            url = f'{MODEL_DEPLOYMENT_URL}?{parse.urlencode(labels)}'
        else:
            url = MODEL_DEPLOYMENT_URL

        return [ModelDeployment.from_dict(md) for md in self.query(url)]
Ejemplo n.º 5
0
                                       limits=ResourceList(cpu="2024m",
                                                           memory="2024Mi")),
        vcs_name="odahu-flow-examples"),
)

packaging_id = "airlfow-wine"
packaging = ModelPackaging(
    id=packaging_id,
    spec=ModelPackagingSpec(
        targets=[Target(name="docker-push", connection_name="docker-ci")],
        integration_name="docker-rest"),
)

deployment_id = "airlfow-wine"
deployment = ModelDeployment(
    id=deployment_id,
    spec=ModelDeploymentSpec(min_replicas=1, ),
)

model_example_request = {
    "columns": [
        "alcohol", "chlorides", "citric acid", "density", "fixed acidity",
        "free sulfur dioxide", "pH", "residual sugar", "sulphates",
        "total sulfur dioxide", "volatile acidity"
    ],
    "data": [[12.8, 0.029, 0.48, 0.98, 6.2, 29, 3.33, 1.2, 0.39, 75, 0.66],
             [12.8, 0.029, 0.48, 0.98, 6.2, 29, 3.33, 1.2, 0.39, 75, 0.66]]
}

dag = DAG('airlfow-wine', default_args=default_args, schedule_interval=None)

with dag:
Ejemplo n.º 6
0
    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,
                    )),
    deployment.deployment,
    'ModelDeployment',
)

ROUTER = EntityTestData(
    ModelRouteClient(),
    ModelRoute(id=ENTITY_ID,
               spec=ModelRouteSpec(mirror="test", ),
               status=ModelRouteStatus(state=READY_STATE, )),
    route.route,
    'ModelRoute',
)