Skip to main content

Compute Config API Reference (Legacy)

Compute Config API Reference (Legacy)

warning

These APIs are legacy and deprecated. Please use the current APIs instead.

Compute Config SDK

The AnyscaleSDK class must be constructed in order to make calls to the SDK. This class allows you to create an authenticated client in which to use the SDK.

ParamTypeDescription
auth_tokenOptional StringAuthentication token used to verify you have permissions to access Anyscale. If not provided, permissions default to the credentials set for your current user. Credentials can be set by following the instructions on this page: https://console.anyscale.com/credentials

Example

from anyscale import AnyscaleSDK

sdk = AnyscaleSDK()

create_cluster_compute

Creates a Cluster Compute. If the specified compute config is anonymous, returns an existing compute config if an anonymous one exists with the same config.

Parameters

NameTypeDescriptionNotes
create_cluster_computeCreateClusterCompute

Returns ClustercomputeResponse

delete_cluster_compute

Deletes a Cluster Compute.

Parameters

NameTypeDescriptionNotes
cluster_compute_idstrID of the Cluster Compute to delete.Defaults to null

Returns void (empty response body)

get_cluster_compute

Retrieves a Cluster Compute.

Parameters

NameTypeDescriptionNotes
cluster_compute_idstrID of the Cluster Compute to retrieve.Defaults to null

Returns ClustercomputeResponse

get_default_cluster_compute

Returns a default cluster compute that can be used with a given cloud.

Parameters

NameTypeDescriptionNotes
cloud_idoptional strThe cloud id whose default cluster compute you want to fetch. If None, will use the default cloud.Defaults to null

Returns ClustercomputeResponse

search_cluster_computes

Lists all Cluster Computes the user has access to, matching the input query.

Parameters

NameTypeDescriptionNotes
cluster_computes_queryClusterComputesQuery

Returns ClustercomputeListResponse

Compute Config Models

ClusterCompute

NameTypeDescriptionNotes
idstr[default to null]
namestr[default to null]
creator_idstr[default to null]
organization_idstr[default to null]
project_idstr[optional] [default to null]
created_atdatetime[default to null]
last_modified_atdatetime[default to null]
deleted_atdatetime[optional] [default to null]
archived_atdatetime[optional] [default to null]
configClusterComputeConfig[default to null]
versionint[default to null]
anonymousbool[default to null]

ClusterComputeConfig

Configuration of compute resources to use for launching a Cluster. Used when reading a cluster compute.

NameTypeDescriptionNotes
cloud_idstrThe ID of the Anyscale cloud to use for launching Clusters.[default to null]
maximum_uptime_minutesintIf set to a positive number, Anyscale will terminate the cluster this many minutes after cluster start.[optional] [default to null]
deployment_configsList[CloudDeploymentComputeConfig]A list of cloud deployment-specific configs to use.[optional] [default to null]
max_workersintDEPRECATED. This attribute will be ignored - please use the "max_resources" flag to configure resource limits.[optional] [default to null]
regionstrThe region to launch Clusters in, e.g. "us-west-2".[optional] [default to null]
allowed_azsList[str]The availability zones that sessions are allowed to be launched in, e.g. "us-west-2a". If not specified or "any" is provided as the option, any AZ may be used. If "any" is provided, it must be the only item in the list.[optional] [default to null]
head_node_typeComputeNodeTypeNode configuration to use for the head node.[default to null]
worker_node_typesList[WorkerNodeType]A list of node types to use for worker nodes.[optional] [default to null]
aws_advanced_configurations_jsonobject[DEPRECATED: use advanced_configurations_json instead] The advanced configuration json that we pass directly AWS APIs when launching an instance. We may do some validation on this json and reject the json if it is using a configuration that Anyscale does not support.[optional] [default to null]
gcp_advanced_configurations_jsonobject[DEPRECATED: use advanced_configurations_json instead] The advanced configuration json that we pass directly GCP APIs when launching an instance. We may do some validation on this json and reject the json if it is using a configuration that Anyscale does not support.[optional] [default to null]
advanced_configurations_jsonobjectAdvanced configurations for this compute node type to pass to the cloud provider when launching this instance.[optional] [default to null]
auto_select_worker_configboolIf set to true, worker node groups will automatically be selected based on workload.[optional] [default to false]
flagsobjectA set of advanced cluster-level flags that can be used to configure a particular workload.[optional] [default to null]
idle_termination_minutesintIf set to a positive number, Anyscale will terminate the cluster this many minutes after the cluster is idle. Idle time is defined as the time during which a Cluster is not running a user command or a Ray driver. Time spent running commands on Jupyter or ssh is still considered 'idle'. To disable, set this field to 0.[optional] [default to null]

ClusterComputesQuery

NameTypeDescriptionNotes
project_idstrFilters Cluster Computes by project. If this field is absent, no filtering is done.[optional] [default to null]
creator_idstrFilters Cluster Computes by creator. If this field is absent, no filtering is done.[optional] [default to null]
nameTextQueryFilters Cluster Computes by name. If this field is absent, no filtering is done.[optional] [default to null]
include_anonymousboolWhether to include anonymous Cluster Computes in the search.[optional] [default to false]
pagingPageQueryPagination information.[optional] [default to null]
cloud_idstrFilters Compute Computes by cloud. If this field is absent, no filtering is done.[optional] [default to null]
versionintFilters Cluster Computes by version. Versions are positive integers. Setting this field to -1 will return only the latest version of each Cluster Compute. Setting this field to -2 will not filter by version. For example, this can be used to fetch all versions of a Cluster Compute. Deprecated behavior: Setting version to None is equivalent to setting version to '-1'.[optional] [default to null]

ClustercomputeListResponse

A list response form the API. Contains a field "results" which has the contents of the response.

NameTypeDescriptionNotes
resultsList[ClusterCompute][default to null]
metadataListResponseMetadata[optional] [default to null]

ClustercomputeResponse

A response from the API. Contains a field "result" which has the contents of the response.

NameTypeDescriptionNotes
resultClusterCompute[default to null]

ComputeNodeType

NameTypeDescriptionNotes
namestrAn arbitrary name for this node type, which will be registered with OSS available_node_types.[default to null]
instance_typestrThe cloud provider instance type to use for this node.[default to null]
resourcesResourcesDeclaration of node resources for Autoscaler.[optional] [default to null]
labelsDict(str, str)Labels to associate the node with for scheduling purposes. Defaults to the list of Ray & Anyscale default labels.[optional] [default to null]
aws_advanced_configurations_jsonobjectThe advanced configuration json that we pass directly AWS APIs when launching an instance. We may do some validation on this json and reject the json if it is using a configuration that Anyscale does not support.[optional] [default to null]
gcp_advanced_configurations_jsonobjectThe advanced configuration json that we pass directly GCP APIs when launching an instance. We may do some validation on this json and reject the json if it is using a configuration that Anyscale does not support.[optional] [default to null]
advanced_configurations_jsonobjectAdvanced configurations for this compute node type to pass to the cloud provider when launching this instance.[optional] [default to null]
flagsobjectA set of advanced node-level flags that can be used to configure a particular workload.[optional] [default to null]

ComputeTemplate

DEPRECATED: Please use ClusterCompute instead.

NameTypeDescriptionNotes
idstr[default to null]
namestr[default to null]
creator_idstr[default to null]
organization_idstr[default to null]
project_idstr[optional] [default to null]
created_atdatetime[default to null]
last_modified_atdatetime[default to null]
deleted_atdatetime[optional] [default to null]
archived_atdatetime[optional] [default to null]
configComputeTemplateConfig[default to null]
versionint[default to null]
anonymousbool[default to null]

ComputeTemplateConfig

DEPRECATED: Please use ClusterCompute and the corresponding ClusterComputeConfig instead. Configuration of compute resources to use for launching a session. Used when reading a compute template.

NameTypeDescriptionNotes
cloud_idstrThe ID of the Anyscale cloud to use for launching sessions.[default to null]
maximum_uptime_minutesintIf set to a positive number, Anyscale will terminate the cluster this many minutes after cluster start.[optional] [default to null]
deployment_configsList[CloudDeploymentComputeConfig]A list of cloud deployment-specific configs to use.[optional] [default to null]
max_workersintDEPRECATED. This attribute will be ignored - please use the "max_resources" flag to configure resource limits.[optional] [default to null]
regionstrThe region to launch sessions in, e.g. "us-west-2".[optional] [default to null]
allowed_azsList[str]The availability zones that sessions are allowed to be launched in, e.g. "us-west-2a". If not specified or "any" is provided as the option, any AZ may be used. If "any" is provided, it must be the only item in the list.[optional] [default to null]
head_node_typeComputeNodeTypeNode configuration to use for the head node.[default to null]
worker_node_typesList[WorkerNodeType]A list of node types to use for worker nodes.[optional] [default to null]
aws_advanced_configurations_jsonobjectThe advanced configuration json that we pass directly AWS APIs when launching an instance. We may do some validation on this json and reject the json if it is using a configuration that Anyscale does not support.[optional] [default to null]
gcp_advanced_configurations_jsonobjectThe advanced configuration json that we pass directly GCP APIs when launching an instance. We may do some validation on this json and reject the json if it is using a configuration that Anyscale does not support.[optional] [default to null]
advanced_configurations_jsonobjectAdvanced configurations for this compute node type to pass to the cloud provider when launching this instance.[optional] [default to null]
auto_select_worker_configboolIf set to true, worker node groups will automatically be selected based on workload.[optional] [default to false]
flagsobjectA set of advanced cluster-level flags that can be used to configure a particular workload.[optional] [default to null]
idle_termination_minutesintIf set to a positive number, Anyscale will terminate the cluster this many minutes after the cluster is idle. Idle time is defined as the time during which a Cluster is not running a user command or a Ray driver. Time spent running commands on Jupyter or ssh is still considered 'idle'. To disable, set this field to 0.[optional] [default to null]

ComputetemplateResponse

A response from the API. Contains a field "result" which has the contents of the response.

NameTypeDescriptionNotes
resultComputeTemplate[default to null]

ComputetemplateconfigResponse

A response from the API. Contains a field "result" which has the contents of the response.

NameTypeDescriptionNotes
resultComputeTemplateConfig[default to null]

CreateClusterCompute

NameTypeDescriptionNotes
namestr[optional] [default to null]
project_idstr[optional] [default to null]
configCreateClusterComputeConfig[default to null]
anonymousboolAn anonymous Cluster Compute does not show up in the list of cluster configs. They can still have a name so they can be easily identified.[optional] [default to false]
new_versionboolIf a Cluster Compute with the same name already exists, create this config as a new version.[optional] [default to false]

CreateClusterComputeConfig

Configuration of compute resources to use for launching a Cluster. Used when creating a cluster compute.

NameTypeDescriptionNotes
cloud_idstrThe ID of the Anyscale cloud to use for launching Clusters.[default to null]
maximum_uptime_minutesintIf set to a positive number, Anyscale will terminate the cluster this many minutes after cluster start.[optional] [default to null]
deployment_configsList[CloudDeploymentComputeConfig]A list of cloud deployment-specific configs to use.[optional] [default to null]
max_workersintDEPRECATED. This attribute will be ignored - please use the "max_resources" flag to configure resource limits.[optional] [default to null]
regionstrDeprecated! When creating a cluster compute, a region does not have to be provided. Instead we will use the value from the cloud.[optional] [default to USE_CLOUD]
allowed_azsList[str]The availability zones that sessions are allowed to be launched in, e.g. "us-west-2a". If not specified or "any" is provided as the option, any AZ may be used. If "any" is provided, it must be the only item in the list.[optional] [default to null]
head_node_typeComputeNodeTypeNode configuration to use for the head node.[default to null]
worker_node_typesList[WorkerNodeType]A list of node types to use for worker nodes.[optional] [default to null]
aws_advanced_configurations_jsonobject[DEPRECATED: use advanced_configurations_json instead] The advanced configuration json that we pass directly AWS APIs when launching an instance. We may do some validation on this json and reject the json if it is using a configuration that Anyscale does not support.[optional] [default to null]
gcp_advanced_configurations_jsonobject[DEPRECATED: use advanced_configurations_json instead] The advanced configuration json that we pass directly GCP APIs when launching an instance. We may do some validation on this json and reject the json if it is using a configuration that Anyscale does not support.[optional] [default to null]
advanced_configurations_jsonobjectAdvanced configurations for this compute node type to pass to the cloud provider when launching this instance.[optional] [default to null]
auto_select_worker_configboolIf set to true, worker node groups will automatically be selected based on workload.[optional] [default to false]
flagsobjectA set of advanced cluster-level flags that can be used to configure a particular workload.[optional] [default to null]
idle_termination_minutesintIf set to a positive number, Anyscale will terminate the cluster this many minutes after the cluster is idle. Idle time is defined as the time during which a Cluster is not running a user command or a Ray driver. Time spent running commands on Jupyter or ssh is still considered 'idle'. To disable, set this field to 0.[optional] [default to 120]