Esempio n. 1
0
    def from_proto(cls, proto: DeploymentInfoProto):
        deployment_config = (DeploymentConfig.from_proto(
            proto.deployment_config) if proto.deployment_config else None)
        data = {
            "deployment_config":
            deployment_config,
            "replica_config":
            ReplicaConfig.from_proto(
                proto.replica_config,
                deployment_config.deployment_language
                if deployment_config else DeploymentLanguage.PYTHON,
            ),
            "start_time_ms":
            proto.start_time_ms,
            "actor_name":
            proto.actor_name if proto.actor_name != "" else None,
            "serialized_deployment_def":
            proto.serialized_deployment_def
            if proto.serialized_deployment_def != b"" else None,
            "version":
            proto.version if proto.version != "" else None,
            "end_time_ms":
            proto.end_time_ms if proto.end_time_ms != 0 else None,
            "deployer_job_id":
            ray.get_runtime_context().job_id,
        }

        return cls(**data)
Esempio n. 2
0
File: common.py Progetto: parasj/ray
    def from_proto(cls, proto: DeploymentInfoProto):
        deployment_config = (DeploymentConfig.from_proto(
            proto.deployment_config) if proto.deployment_config else None)
        data = {
            "deployment_config":
            deployment_config,
            "replica_config":
            ReplicaConfig.from_proto(
                proto.replica_config,
                deployment_config.needs_pickle()
                if deployment_config else True,
            ),
            "start_time_ms":
            proto.start_time_ms,
            "actor_name":
            proto.actor_name if proto.actor_name != "" else None,
            "version":
            proto.version if proto.version != "" else None,
            "end_time_ms":
            proto.end_time_ms if proto.end_time_ms != 0 else None,
            "deployer_job_id":
            ray.get_runtime_context().job_id,
        }

        return cls(**data)