Workspaces API Reference (0.26.90)
Workspaces API Reference (0.26.90)
This is archived documentation for version 0.26.90. For the current documentation, see current documentation.
Customer-hosted cloud features
Some features are only available on customer-hosted clouds. Reach out to support@anyscale.com for info.
Workspaces CLI
anyscale workspace_v2 create
Usage
anyscale workspace_v2 create [OPTIONS]
Create a workspace on Anyscale.
Options
-f/--config-file: Path to a YAML config file to deploy. When deploying from a file, import path and arguments cannot be provided. Command-line flags will overwrite values read from the file.-n/--name: Name of the workspace to create.--image-uri: Container image to use for the workspace. This is exclusive with --containerfile.--registry-login-secret: Name or identifier of the secret containing credentials to authenticate to the docker registry hosting the image. This can only be used when 'image_uri' is specified and the image is not hosted on Anyscale.--containerfile: Path to a containerfile to build the image to use for the workspace. This is exclusive with --image-uri.--ray-version: The Ray version (X.Y.Z) to the image specified by --image-uri. This is only used when --image-uri is provided. If you don't specify a Ray version, Anyscale defaults to the latest Ray version available at the time of the Anyscale CLI/SDK release.--compute-config: Named compute configuration to use for the workspace.--cloud: The Anyscale Cloud to run this workload on. If not provided, the organization default will be used (or, if running in a workspace, the cloud of the workspace).--project: Named project to use for the workspace. If not provided, the default project for the cloud will be used (or, if running in a workspace, the project of the workspace).-r/--requirements: Path to a requirements.txt file containing dependencies for the workspace. These will be installed on top of the image.--env: Environment variables to set for the workspace. The format is 'key=value'. This argument can be specified multiple times. When the same key is also specified in the config file, the value from the command-line flag will overwrite the value from the config file.--tag: Tag in key=value (or key:value) format. Repeat to add multiple.
Examples
- CLI
$ anyscale workspace_v2 create -f config.yml
(anyscale +2.7s) Workspace created successfully id: expwrk_jstjkv15a1vmle2j1t59s4bm35
(anyscale +3.9s) Applied dynamic requirements to workspace id: my-workspace
(anyscale +4.8s) Applied environment variables to workspace id: my-workspace
$ cat config.yml
name: my-workspace
idle_termination_minutes: 10
env_vars:
HUMPDAY: WEDS
requirements: requirements.txt
anyscale workspace_v2 start
Usage
anyscale workspace_v2 start [OPTIONS]
Start a workspace.
To specify the workspace by name, use the --name flag. To specify the workspace by id, use the --id flag. Either name or id should be used, specifying both will result in an error.
Options
--id/--workspace-id: Unique ID of the workspace.--name/-n: Name of the workspace.--cloud: The Anyscale Cloud to run this workload on. If not provided, the organization default will be used.--project: Named project to use for the workpsace. If not provided, the default project for the cloud will be used.
Examples
- CLI
$ anyscale workspace_v2 start --name my-workspace
(anyscale +5.8s) Starting workspace 'my-workspace'
anyscale workspace_v2 terminate
Usage
anyscale workspace_v2 terminate [OPTIONS]
Terminate a workspace.
To specify the workspace by name, use the --name flag. To specify the workspace by id, use the --id flag. Either name or id should be used, specifying both will result in an error.
Options
--id/--workspace-id: Unique ID of the workspace.--name/-n: Name of the workspace.--cloud: The Anyscale Cloud to run this workload on. If not provided, the organization default will be used.--project: Named project to use for the workpsace. If not provided, the default project for the cloud will be used.
Examples
- CLI
$ anyscale workspace_v2 terminate --name my-workspace
(anyscale +2.5s) Terminating workspace 'my-workspace'
anyscale workspace_v2 status
Usage
anyscale workspace_v2 status [OPTIONS]
Get the status of a workspace.
To specify the workspace by name, use the --name flag. To specify the workspace by id, use the --id flag. Either name or id should be used, specifying both will result in an error.
Options
--id/--workspace-id: Unique ID of the workspace.--name/-n: Name of the workspace.--cloud: The Anyscale Cloud to run this workload on. If not provided, the organization default will be used.--project: Named project to use for the workpsace. If not provided, the default project for the cloud will be used.
Examples
- CLI
$ anyscale workspace_v2 status --name my-workspace
(anyscale +2.3s) STARTING
anyscale workspace_v2 wait
Usage
anyscale workspace_v2 wait [OPTIONS]
Wait for a workspace to reach a terminal state.
To specify the workspace by name, use the --name flag. To specify the workspace by id, use the --id flag. Either name or id should be used, specifying both will result in an error.
Options
--id/--workspace-id: Unique ID of the workspace.--name/-n: Name of the workspace.--cloud: The Anyscale Cloud to run this workload on. If not provided, the organization default will be used.--project: Named project to use for the workpsace. If not provided, the default project for the cloud will be used.--timeout-s: The maximum time in seconds to wait for the workspace to reach the desired state. Default to 30 minutes.--state: The desired terminal state to wait for. Default is 'RUNNING'.
Examples
- CLI
$ anyscale workspace_v2 wait --name my-workspace --state RUNNING
(anyscale +2.5s) Waiting for workspace 'expwrk_jstjkv15a1vmle2j1t59s4bm35' to reach target state RUNNING, currently in state: RUNNING
(anyscale +2.8s) Workspace 'expwrk_jstjkv15a1vmle2j1t59s4bm35' reached target state, exiting