Skip to content

Commit

Permalink
perf(deployment): poll deployment till provisioning phase
Browse files Browse the repository at this point in the history
This commit changes the deployment polling from succeeded to provisioning.

BREAKING CHANGE: Deployment will be polled till provisioning
  • Loading branch information
smrutisenapati authored and pallabpain committed Jul 19, 2023
1 parent e52406e commit d7bafdf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 2 additions & 2 deletions riocli/deployment/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import click
from rapyuta_io import Client
from rapyuta_io.clients.catalog_client import Package
from rapyuta_io.clients.deployment import DeploymentNotRunningException
from rapyuta_io.clients.deployment import DeploymentNotRunningException, DeploymentPhaseConstants
from rapyuta_io.clients.native_network import NativeNetwork
from rapyuta_io.clients.package import ProvisionConfiguration, RestartPolicy, \
ExecutableMount
Expand Down Expand Up @@ -220,7 +220,7 @@ def create_object(self, client: Client, **kwargs) -> typing.Any:
deployment = pkg.provision(self.metadata.name, provision_config)

try:
deployment.poll_deployment_till_ready(retry_count=retry_count, sleep_interval=retry_interval)
deployment.poll_deployment_till_ready(retry_count=retry_count, sleep_interval=retry_interval, ready_phases=[DeploymentPhaseConstants.PROVISIONING.value])
except DeploymentNotRunningException as e:
raise Exception(process_deployment_errors(e)) from e
except Exception as e:
Expand Down
2 changes: 0 additions & 2 deletions riocli/deployment/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,6 @@ def add_mount_volume_provision_config(provision_config, component_name, device,
isinstance(mount, ExecutableMount) for mount in executable_mounts):
raise InvalidParameterException(
'executable_mounts must be a list of rapyuta_io.clients.package.ExecutableMount')
if not device.is_online():
raise OperationNotAllowedError('Device should be online')
if device.get_runtime() != Device.DOCKER_COMPOSE and not device.is_docker_enabled():
raise OperationNotAllowedError('Device must be a {} device'.format(Device.DOCKER_COMPOSE))
component_params = provision_config.parameters.get(component_id)
Expand Down

0 comments on commit d7bafdf

Please sign in to comment.