def deploy_app(self, config: ServeApplicationSchema) -> None: ray.get( self._controller.deploy_app.remote( config.import_path, config.runtime_env, config.dict(by_alias=True, exclude_unset=True).get("deployments", []), ) )
def deploy_app( self, config: ServeApplicationSchema, update_time: bool = True ) -> None: """Kicks off a task that deploys a Serve application. Cancels any previous in-progress task that is deploying a Serve application. Args: config: Contains the following: import_path: Serve deployment graph's import path runtime_env: runtime_env to run the deployment graph in deployment_override_options: Dictionaries that contain argument-value options that can be passed directly into a set_options() call. Overrides deployment options set in the graph's code itself. update_time: Whether to update the deployment_timestamp. """ if update_time: self.deployment_timestamp = time.time() config_dict = config.dict(exclude_unset=True) self.kv_store.put( CONFIG_CHECKPOINT_KEY, pickle.dumps((self.deployment_timestamp, config_dict)), ) if self.config_deployment_request_ref is not None: ray.cancel(self.config_deployment_request_ref) logger.info( "Received new config deployment request. Cancelling " "previous request." ) deployment_override_options = config.dict( by_alias=True, exclude_unset=True ).get("deployments", []) self.config_deployment_request_ref = run_graph.options( runtime_env=config.runtime_env ).remote(config.import_path, config.runtime_env, deployment_override_options)