Deploy Services
cc.deploy
Deploy a function service to Covalent Cloud.
Parameters
function_service(FunctionService
): A function decorated with @cc.service
.
volume(Volume
): Grant access to a cloud storage volume in Covalent Cloud. Defaults to None.
settings(Settings
): User settings for Covalent Cloud. Defaults to settings on the client machine.
Return Type
Callable[[Any], Deployment]
Returns
A callable which launches the deployment and has the same signature as the initializer for function_service
.
Examples
import covalent_cloud as cc
ex = cc.CloudExecutor(env="my-basic-env", num_cpus=2, memory="4GB", time_limit="45 minutes")
@cc.service(executor=ex)
def sample_service(x: int, y: int) -> int:
return {"total": x + y}
@sample_service.endpoint("/add")
def special_addition(total: int, z: int) -> int:
return total + z
# Deploy the function service to Covalent Cloud.
client = cc.deploy(sample_service)(x=6, y=7)