Python API Reference
Command Line API Reference
coiled.create_software_environment([name, …])
coiled.create_software_environment
Create a software environment
coiled.create_cluster_configuration(name, …)
coiled.create_cluster_configuration
Create a cluster configuration
coiled.create_notebook(name[, container, …])
coiled.create_notebook
Create a notebook
coiled.create_job_configuration(name, …[, …])
coiled.create_job_configuration
dict
coiled.list_software_environments([account])
coiled.list_software_environments
List software environments
coiled.list_cluster_configurations([account])
coiled.list_cluster_configurations
List cluster configurations
coiled.list_clusters([account])
coiled.list_clusters
List clusters
coiled.list_job_configurations([account])
coiled.list_job_configurations
List job configurations
coiled.delete_software_environment(name)
coiled.delete_software_environment
Delete a software environment
coiled.delete_cluster_configuration(name)
coiled.delete_cluster_configuration
Delete a cluster configuration
coiled.delete_cluster(name[, account])
coiled.delete_cluster
Delete a cluster
coiled.Cluster([n_workers, configuration, …])
coiled.Cluster
Create a Dask cluster with Coiled
coiled.cluster_cost_estimate([n_workers, …])
coiled.cluster_cost_estimate
Estimate the cluster hourly cost
coiled.install(coiled_uri)
coiled.install
Create a Coiled software environment locally
coiled.start_job(configuration[, account, …])
coiled.start_job
coiled.stop_job([name])
coiled.stop_job
coiled.list_jobs([account])
coiled.list_jobs
List jobs
coiled.
create_software_environment
name (Optional[str]) – Name of software environment. Name can’t contain uppercase letters.
Optional
str
conda (Union[list, dict, str, None]) – Specification for packages to install into the software environment using conda. Can be a list of packages, a dictionary, or a path to a conda environment YAML file.
Union
list
None
pip (Union[list, str, None]) – Packages to install into the software environment using pip. Can be a list of packages or a path to a pip requirements file.
container (Optional[str]) – Docker image to use for the software environment. Must be the name of a docker image on Docker hub. Defaults to coiled/default.
coiled/default
post_build (Union[list, str, None]) – List of commands or path to a local executable script to run after pip and conda packages have been installed.
log_output – Stream to output logs to. Defaults to sys.stdout.
sys.stdout
conda_env_name (Optional[str]) – Name of conda environment to install packages into. Note that this should only be used when specifying a non-default value for container and when the non-default Docker image used expects commands to run in a conda environment not named “base”. Defaults to “base”.
container
backend_options (Optional[Dict]) – Dictionary of backend specific options (e.g. {'region': 'us-east-2'}). Any options specified with this keyword argument will take precedence over those stored in the coiled.backend-options cofiguration value.
Dict
{'region': 'us-east-2'}
coiled.backend-options
private (bool) – Whether this software environment is private or public. Defaults to False
bool
False
list_software_environments
account – Name of the Coiled account to list software environments. If not provided, will use the coiled.account configuration value.
coiled.account
Dictionary with information about each software environment in the specified account. Keys in the dictionary are names of software environments, while the values contain information about the corresponding software environment.
delete_software_environment
name – Name of software environment to delete.
install
coiled_uri (str) –
Identifier of the software environment to use, in the format (<account>/)<name>. If the software environment is owned by the same account as that passed into “account”, the (<account>/) prefix is optional.
For example, suppose your account is “wondercorp”, but your friends at “friendlycorp” have an environment named “xgboost” that you want to use; you can specify this with “friendlycorp/xgboost”. If you simply entered “xgboost”, this is shorthand for “wondercorp/xgboost”.
The “name” portion of (<account>/)<name> can only contain ASCII letters, hyphens and underscores.
Examples
>>> import coiled >>> coiled.install("coiled/default")
inspect
View the details of a Coiled software environment
name (str) –
>>> import coiled >>> coiled.inspect("coiled/default")
create_cluster_configuration
name (str) – Name of cluster configuration. Optionally prefixed with an account name like “myaccount/myname”
software (str) –
worker_cpu (int) – Number of CPUs allocated for each worker. Defaults to 1.
int
worker_gpu (int) – Number of GPUs allocated for each worker. Defaults to 0 (no GPU support). Note that this will _always_ allocate GPU-enabled workers, so is expensive.
worker_memory (str) – Amount of memory to allocate for each worker. Defaults to 4 GiB.
worker_class (str) – Worker class to use. Defaults to “dask.distributed.Nanny”.
worker_options (Optional[dict]) – Mapping with keyword arguments to pass to worker_class. Defaults to {}.
worker_class
{}
scheduler_cpu (int) – Number of CPUs allocated for the scheduler. Defaults to 1.
scheduler_memory (str) – Amount of memory to allocate for the scheduler. Defaults to 4 GiB.
scheduler_class (str) – Scheduler class to use. Defaults to “dask.distributed.Scheduler”.
scheduler_options (Optional[dict]) – Mapping with keyword arguments to pass to scheduler_class. Defaults to {}.
scheduler_class
private (bool) – Whether this cluster configuration is private or public. Defaults to False
See also
dask.utils.parse_bytes
list_cluster_configurations
account – Name of the Coiled account to list cluster configurations. If not provided, will use the coiled.account configuration value.
Dictionary with information about each cluster configuration in the specified account. Keys in the dictionary are names of cluster configurations, while the values contain information about the corresponding cluster configuration.
delete_cluster_configuration
name – Name of cluster configuration to delete.
Cluster
n_workers (int) – Number of workers in this cluster. Defaults to 4.
configuration (Optional[str]) – Name of cluster configuration to create cluster from. If not specified, defaults to coiled/default for the current Python version.
name (Optional[str]) – Name to use for identifying this cluster. Defaults to None.
software (Optional[str]) –
worker_cpu (Optional[int]) – Number of CPUs allocated for each worker. Defaults to 2.
worker_gpu (Optional[int]) – Number of GPUs allocated for each worker. Defaults to 0 (no GPU support). Note that this will _always_ allocate GPU-enabled workers, so is expensive.
worker_memory (Optional[str]) – Amount of memory to allocate for each worker. Defaults to 8 GiB.
worker_class (Optional[str]) – Worker class to use. Defaults to “dask.distributed.Nanny”.
scheduler_cpu (Optional[int]) – Number of CPUs allocated for the scheduler. Defaults to 1.
scheduler_memory (Optional[str]) – Amount of memory to allocate for the scheduler. Defaults to 4 GiB.
scheduler_class (Optional[str]) – Scheduler class to use. Defaults to “dask.distributed.Scheduler”.
asynchronous (bool) – Set to True if using this Cloud within async/await functions or within Tornado gen.coroutines. Otherwise this should remain False for normal use. Default is False.
async
await
gen.coroutines
cloud (Optional[Cloud]) – Cloud object to use for interacting with Coiled.
Cloud
account (Optional[str]) – Name of Coiled account to use. If not provided, will default to the user account for the cloud object being used.
cloud
shutdown_on_close – Whether or not to shut down the cluster when it finishes. Defaults to True, unless name points to an existing cluster.
credentials (Optional[str]) – Which credentials to use for Dask operations and forward to Dask clusters – options are “account”, “local”, or “none”. The default behavior is to prefer credentials associated with the Coiled Account, if available, then try to use local credentials, if available. NOTE: credential handling currently only works with AWS credentials.
dashboard_link
get_logs
Return logs for the scheduler and workers :type scheduler: bool :param scheduler: Whether or not to collect logs for the scheduler :type scheduler: boolean :type workers: bool :param workers: Whether or not to collect logs for the workers :type workers: boolean
logs – A dictionary of logs, with one item for the scheduler and one for the workers
Dict[str]
loop
scale
Scale cluster to n workers
n
n (int) – Number of workers to scale cluster size to.
Tuple[List[Dict], List[Dict]]
Tuple
List
list_clusters
account – Name of the Coiled account to list clusters. If not provided, will use the coiled.account configuration value.
Dictionary with information about each cluster in the specified account. Keys in the dictionary are names of clusters, while the values contain information about the corresponding cluster.
delete_cluster
name (str) – Name of cluster to delete.
cluster_cost_estimate
worker_cpu (Optional[int]) – Number of CPUs allocated for each worker. Defaults to 1.
worker_memory (Optional[str]) – Amount of memory to allocate for each worker. Defaults to 4 GiB.
create_notebook
This allows you to create a hosted notebook which is runnable on https://cloud.coiled.io.
name – Name of the notebook.
container – Docker image to use for the notebook’s software environment. Defaults to coiled/notebook:latest. Note that when using a non-default container, you should check whether the default command is compatible with the container being used and, if not, update the command such that it launches a Jupyter session within the container.
coiled/notebook:latest
command
conda – Specification for packages to install into the notebook’s software environment using conda. Can be a list of packages, a dictionary, or a path to a conda environment YAML file.
pip – Packages to install into the notebook’s software environment using pip. Can be a list of packages or a path to a pip requirements file.
post_build – List of commands or path to a local executable script to run after pip and conda packages have been installed.
cpu (int) – Number of CPUs allocated for the notebook session. Defaults to 1.
gpu (int) – Number of GPUs allocated for the notebook session. Defaults to 0 (no GPU support).
memory (str) – Amount of memory to allocated for the notebook session. Defaults to 4 GiB.
files – List of local files to upload.
command – Command to run. If not specified, defaults to running JupyterLab.
ports – List of ports to expose. If not specified, defaults to (8888,)
(8888,)
description – Description for notebook.
create_job_configuration
delete_job_configuration
Delete a job configuration
name – Name of job configuration to delete.
list_job_configurations
account – Name of the Coiled account to list job configurations. If not provided, will use the coiled.account configuration value.
Dictionary with information about each job configuration in the specified account. Keys in the dictionary are names of job configurations, while the values contain information about the corresponding job configuration.
start_job
stop_job
list_jobs
account – Name of the Coiled account to list jobs. If not provided, will use the coiled.account configuration value.
Dictionary with information about each job in the specified account. Keys in the dictionary are names of jobs, while the values contain information about the corresponding job.
Configure your Coiled account credentials
coiled login [OPTIONS]
Options
-s
,
--server
<server>
Coiled server to use
-t
--token
<token>
Coiled user token
Create Coiled conda software environment locally
coiled install [OPTIONS] COILED_URI
Arguments
COILED_URI
Required argument
Create a Coiled software environment
coiled env create [OPTIONS]
-n
--name
<name>
Name of software environment, it must be lowercase.
--container
<container>
Base docker image to use.
--conda
<conda>
Conda environment file.
--pip
<pip>
Pip requirements file.
--post-build
<post_build>
Post-build script.
Delete a Coiled software environment
coiled env delete [OPTIONS] NAME
NAME
List the Coiled software environments in an account
coiled env list [OPTIONS] [ACCOUNT]
ACCOUNT
Optional argument
coiled env inspect [OPTIONS] NAME
Create a kubeconfig file for connecting Coiled to a Kubernetes cluster.
coiled create-kubeconfig [OPTIONS]
--namespace
<namespace>
Namespace to grant Coiled access to.
-o
--output
<output>
Path to output kubeconfig file.