Skip to main content

Cluster environment API Reference (Legacy)

Cluster environment API Reference (Legacy)

warning

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

Cluster environment CLI

anyscale image archive Legacy

Limited support

This command is not actively maintained. Use with caution.

Usage

anyscale image archive [OPTIONS]

Archive the specified cluster environment.

Options

  • --name/-n: Name of the cluster environment to archive.
  • --cluster-env-id/--id: Id of the cluster environment to archive. Must be provided if a cluster environment name is not given.

anyscale image build Legacy

warning

This command is deprecated. Upgrade to anyscale image build.

Usage

anyscale image build [OPTIONS] CLUSTER_ENV_FILE

Build a new cluster environment from config file.

Options

  • --name/-n: Name to save built cluster environment as. Default will be used if not provided

anyscale image get Legacy

warning

This command is deprecated. Upgrade to anyscale image get.

Usage

anyscale image get [OPTIONS] [CLUSTER_ENV_NAME]

Get details about cluster environment build. The cluster-env-name argument is a cluster environment name optionally followed by a colon and a build version number. Eg: my_cluster_env:1

Options

  • --cluster-env-build-id/--id: Get details about cluster environment build by this id.

anyscale image list Legacy

Limited support

This command is not actively maintained. Use with caution.

Usage

anyscale image list [OPTIONS]

List information about cluster environments on Anyscale. By default only list cluster environments you have created.

Options

  • --name/-n: List information about all builds of the cluster environment with this name.
  • --cluster-env-id/--id: List information about all builds of the cluster environment with this id.
  • --include-shared: Include all cluster environments you have access to.
  • --max-items: Max items to show in list.

Cluster environment 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_byod_cluster_environment_build

Creates and starts a BYOD Cluster Environment Build.

Parameters

NameTypeDescriptionNotes
create_byod_cluster_environment_buildCreateBYODClusterEnvironmentBuild

Returns ClusterenvironmentbuildoperationResponse

create_cluster_environment_build

Creates and starts a Cluster Environment Build. This is a long running operation.

Parameters

NameTypeDescriptionNotes
create_cluster_environment_buildCreateClusterEnvironmentBuild

Returns ClusterenvironmentbuildoperationResponse

find_cluster_environment_build_by_identifier

Looks for a cluster environment build given a cluster environment identifier. Identifiers are in the format my-cluster-env:1

Parameters

NameTypeDescriptionNotes
identifierstrIdentifier of the cluster env to look for. Identifiers are in the format my-cluster-env:1Defaults to null

Returns ClusterenvironmentbuildResponse

get_cluster_environment_build

Retrieves a Cluster Environment Build.

Parameters

NameTypeDescriptionNotes
cluster_environment_build_idstrID of the Cluster Environment Build to retrieve.Defaults to null

Returns ClusterenvironmentbuildResponse

get_default_cluster_environment_build

Retrieves a default cluster environment with the preferred attributes.

Parameters

NameTypeDescriptionNotes
python_versionPythonVersionPython version for the cluster environmentDefaults to null
ray_versionstrRay version to use for this cluster environment. Should match a version string found in the ray version history on pypi. See here for full list: https://pypi.org/project/ray/#historyDefaults to null

Returns ClusterenvironmentbuildResponse

list_cluster_environment_builds

Lists all Cluster Environment Builds belonging to an Cluster Environment.

Parameters

NameTypeDescriptionNotes
cluster_environment_idstrID of the Cluster Environment to list builds for.Defaults to null
descoptional boolOrders the list of builds from latest to oldest.Defaults to false
paging_tokenoptional strDefaults to null
countoptional intDefaults to 10

Returns ClusterenvironmentbuildListResponse

create_byod_cluster_environment

Creates a BYOD Cluster Environment.

Parameters

NameTypeDescriptionNotes
create_byod_cluster_environmentCreateBYODClusterEnvironment

Returns ClusterenvironmentResponse

create_cluster_environment

Creates a Cluster Environment.

Parameters

NameTypeDescriptionNotes
create_cluster_environmentCreateClusterEnvironment

Returns ClusterenvironmentResponse

get_cluster_environment

Retrieves a Cluster Environment.

Parameters

NameTypeDescriptionNotes
cluster_environment_idstrID of the Cluster Environment to retrieve.Defaults to null

Returns ClusterenvironmentResponse

search_cluster_environments

Lists all Cluster Environments that the logged in user has permissions to access.

Parameters

NameTypeDescriptionNotes
cluster_environments_queryClusterEnvironmentsQuery

Returns ClusterenvironmentListResponse

Cluster environment Models

ClusterEnvironment

NameTypeDescriptionNotes
idstrServer assigned unique identifier.[default to null]
namestrName of the Cluster Environment.[default to null]
project_idstrID of the Project this Cluster Environment is for.[optional] [default to null]
organization_idstrID of the Organization this Cluster Environment was created in.[default to null]
creator_idstrID of the User that created this record.[default to null]
created_atdatetimeTimestamp of when this record was created.[default to null]
last_modified_atdatetimeTimestamp of when this record was last updated.[default to null]
deleted_atdatetimeTimestamp of when this record was deleted.[optional] [default to null]
anonymousboolTrue if this is an anonymous Cluster Environment.[optional] [default to false]
is_defaultboolTrue if this Cluster Environment is created and managed by anyscale[optional] [default to false]

ClusterEnvironmentBuild

Usable Cluster Environment Build to start a Cluster.

NameTypeDescriptionNotes
cluster_environment_idstrID of the Cluster Environment this Build belongs to.[default to null]
config_jsonAppConfigConfigSchemaConfig JSON used to create this Cluster Environment Build.[optional] [default to null]
containerfilestrThe containerfile used to build the image.[optional] [default to null]
docker_image_namestrThe name of the docker image for this Build.[optional] [default to null]
registry_login_secretstrThe name or identifier of a secret containing credentials to authenticate to the docker registry hosting the image.[optional] [default to null]
ray_versionstrThe Ray version to use for this build.[optional] [default to null]
idstrServer assigned unique identifier.[default to null]
revisionintAuto incrementing version number for this Build[default to null]
creator_idstrID of the user who created this Build.[default to null]
error_messagestrDetailed error message. This will only be populated if the Build operation failed.[optional] [default to null]
statusClusterEnvironmentBuildStatusStatus of the Build. `pending` - Build operation is queued and has not started yet. `in_progress` - Build operation is in progress. `succeeded` - Build operation completed successfully. `failed` - Build operation completed unsuccessfully. `pending_cancellation` - Build operation is marked for cancellation. `cancelled` - Build operation was cancelled before it completed.[default to null]
created_atdatetimeTimestamp of when this Build was created.[default to null]
last_modified_atdatetimeTimestamp of when this Build was last updated.[default to null]
deleted_atdatetimeTimestamp of when this Build was deleted.[optional] [default to null]
is_byodboolTrue if the image URI used in this build was user-specified.[default to null]
cloud_idstrThe build cloud associated with this build. If None, the build is a v1 build.[optional] [default to null]
digeststrThe digest of the image for this Build.[optional] [default to null]

ClusterEnvironmentBuildOperation

Describes a long running operation that will eventually complete. Consider this an abstract class. Specific kinds of operations should subclass this.

NameTypeDescriptionNotes
idstrID of this operation.[default to null]
completedboolBoolean indicating if this operation is completed.[default to null]
progressOperationProgressDetails about the progress of this operation at the time of the request. This will be absent for completed operations.[optional] [default to null]
resultOperationResultThe result of this operation after it has completed. This is always provided when the operation is complete.[optional] [default to null]
cluster_environment_build_idstrID of the Cluster Environment Build this operation is for.[default to null]

ClusterEnvironmentBuildStatus

An enumeration.

Possible Values: ['pending', 'in_progress', 'succeeded', 'failed', 'pending_cancellation', 'canceled']

ClusterEnvironmentsQuery

NameTypeDescriptionNotes
project_idstrFilters Cluster Environments by project id. If absent, no filtering is done.[optional] [default to null]
creator_idstrFilters Cluster Environments by creator id. If absent, no filtering is done.[optional] [default to null]
nameTextQueryFilters Cluster Environments by name. Currently only contains is supported.If absent, no filtering is done.[optional] [default to null]
image_nameTextQueryFilters Cluster Environments by image name. Image name is a virtual concept. It starts with 'anyscale/image' (for customer-built images) or 'anyscale/ray' (default images).Currently only contains is supported. If absent, no filtering is done.[optional] [default to null]
pagingPageQueryPagination information.[optional] [default to null]
include_archivedboolWhether to include archived Cluster Environments in the results.[optional] [default to false]
include_anonymousboolWhether to include anonymous Cluster Environments in the results.[optional] [default to false]

ClusterenvironmentListResponse

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

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

ClusterenvironmentResponse

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

NameTypeDescriptionNotes
resultClusterEnvironment[default to null]

ClusterenvironmentbuildListResponse

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

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

ClusterenvironmentbuildoperationResponse

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

NameTypeDescriptionNotes
resultClusterEnvironmentBuildOperation[default to null]

CreateBYODClusterEnvironment

Model used to create a BYOD Cluster Environment.

NameTypeDescriptionNotes
namestrName of the Cluster Environment.[default to null]
config_jsonCreateBYODClusterEnvironmentConfigurationSchemaConfig JSON to use to create a new BYOD Cluster Environment.[default to null]
anonymousboolTrue if this is an anonymous Cluster Environment.[optional] [default to false]

CreateBYODClusterEnvironmentBuild

Model used to create a BYOD Cluster Environment Build.

NameTypeDescriptionNotes
cluster_environment_idstrID of the Cluster Environment this Build belongs to.[default to null]
config_jsonCreateBYODAppConfigConfigurationSchemaConfig JSON to use to create a new BYOD Build.[default to null]

CreateBYODClusterEnvironmentConfigurationSchema

NameTypeDescriptionNotes
docker_imagestrThe custom container base image used in the Cluster Environment.[default to null]
ray_versionstrThe version of Ray used in the customer docker image.[default to null]
env_varsobjectEnvironment variables in the docker image that will be used at runtime.[optional] [default to null]
registry_login_secretstrThe name or identifier of a secret containing credentials to authenticate to the docker registry hosting the image.[optional] [default to null]

CreateClusterEnvironment

Model used to create an Cluster Environment.

NameTypeDescriptionNotes
namestrName of the Cluster Environment.[default to null]
project_idstrID of the Project this Cluster Environment is for.[optional] [default to null]
config_jsonCreateClusterEnvironmentConfigurationSchemaConfig JSON to use to create a new Cluster Environment.[optional] [default to null]
containerfilestrContainerfile to use to create a new Cluster Environment.[optional] [default to null]
anonymousboolTrue if this is an anonymous Cluster Environment.[optional] [default to false]

CreateClusterEnvironmentBuild

Model used to create a Cluster Environment Build.

NameTypeDescriptionNotes
cluster_environment_idstrID of the Cluster Environment this Build belongs to.[default to null]
config_jsonCreateAppConfigConfigurationSchemaConfig JSON to use to create a new Build.[optional] [default to null]
containerfilestrThe containerfile used to build the image.[optional] [default to null]
docker_image_namestrThe name of the docker image for this Build.[optional] [default to null]
registry_login_secretstrThe name or identifier of a secret containing credentials to authenticate to the docker registry hosting the image.[optional] [default to null]
ray_versionstrThe Ray version to use for this build.[optional] [default to null]

CreateClusterEnvironmentConfigurationSchema

NameTypeDescriptionNotes
base_imageSUPPORTEDBASEIMAGESENUMThe base image to use to create a new Cluster Environment. It needs to be one of the images that we currently support (SupportedBaseImages).[default to null]
env_varsobjectEnvironment varibles in the docker image that'll be used at runtime.[optional] [default to null]
debian_packagesList[str]List of debian packages that'll be included in the image.[optional] [default to null]
pythonPythonModulesPython related dependencies.[optional] [default to null]
post_build_cmdsList[str]List of post build commands that'll be included in the image.[optional] [default to null]

RayRuntimeEnvConfig

A runtime env config. Can be used to start a production job.

NameTypeDescriptionNotes
working_dirstrThe working directory that your code will run in. Must be a remote URI like an s3 or git path.[optional] [default to null]
py_modulesList[str]Python modules that will be installed along with your runtime env. These must be remote URIs.[optional] [default to null]
relative_working_dirstrRelative path to the working directory that your code will run in. The appropriate cloud deployment object storage will be prepended to this path.[optional] [default to null]
relative_py_modulesList[str]Relative paths to python modules that will be installed along with your runtime env. The appropriate cloud deployment object storage will be prepended to these paths. If `py_modules` are specified, they will be also be installed.[optional] [default to null]
py_executablestrSpecifies the executable used for running the Ray workers. It can include arguments as well.[optional] [default to null]
pipList[str]A list of pip packages to install.[optional] [default to null]
condaobject[Union[Dict[str, Any], str]: Either the conda YAML config or the name of a local conda env (e.g., "pytorch_p36"),[optional] [default to null]
env_varsDict(str, str)Environment variables to set.[optional] [default to null]
configobjectConfig for runtime environment. Can be used to setup setup_timeout_seconds, the timeout of runtime environment creation.[optional] [default to null]
image_uristrSpecifies the image URI of the container in which the job will run.[optional] [default to null]