Service API Reference (0.26.64)
Service API Reference (0.26.64)
note
This is archived documentation for version 0.26.64. For the current documentation, see current documentation.
Customer-hosted cloud features
note
Some features are only available on customer-hosted clouds. Reach out to support@anyscale.com for info.
Service CLI
anyscale service list
Usage
anyscale service list [OPTIONS]
List services.
Options
--service-id/--id: ID of the service to display.--name/-n: Name of the service to display.--cloud: The Anyscale Cloud of this workload; defaults to your org/workspace cloud.--project: Named project to use; defaults to your org/workspace project.--created-by-me: List services created by me only.--state/-s: Filter by service state (repeatable). Allowed: STARTING, RUNNING, UPDATING, ROLLING_OUT, ROLLING_BACK, UNHEALTHY, TERMINATING, TERMINATED, UNKNOWN, SYSTEM_FAILURE--include-archived: Include archived services.--max-items: Max total items (only with --no-interactive).--page-size: Items per page (max 50).--interactive/--no-interactive: Use interactive paging.--sort: Sort by FIELD (prefix with '-' for desc). Allowed: STATUS, NAME, CREATED_AT-v/--verbose: Include full config in JSON output.-j/--json: Emit structured JSON to stdout.
Examples
- CLI
$ anyscale service list --state running --sort -created_at
anyscale service deploy
Usage
anyscale service deploy [OPTIONS] [IMPORT_PATH] [ARGUMENTS]...
Deploy or update a service.
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: Unique name for the service. When running in a workspace, this defaults to the workspace name.--image-uri: Container image to use for the service. This cannot be changed when using --in-place and is exclusive with --containerfile. When running in a workspace, this defaults to the image of the workspace.--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 service. This cannot be changed when using --in-place and 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 service. This cannot be changed when using --in-place. When running in a workspace, this defaults to the compute configuration of the workspace.-w/--working-dir: Path to a local directory or a remote URI to a .zip file (S3, GS, HTTP) that will be the working directory for the service. The files in the directory will be automatically uploaded to cloud storage. When running in a workspace, this defaults to the current working directory.-e/--exclude: File pattern to exclude when uploading local directories. This argument can be specified multiple times and the patterns will be appended to the 'excludes' list in the config file (if any).-r/--requirements: Path to a requirements.txt file containing dependencies for the service. Anyscale installs these dependencies on top of the image. If you deploy a service from a workspace, the default is to use the workspace dependencies, but specifying this option overrides them.-i/--in-place: Perform an in-place upgrade without starting a new cluster. This can be used for faster iteration during development but is not currently recommended for production deploys. This cannot be used to change cluster-level options such as image and compute config (they will be ignored).--canary-percent: The percentage of traffic to send to the canary version of the service (0-100). This can be used to manually shift traffic toward (or away from) the canary version. If not provided, traffic will be shifted incrementally toward the canary version until it reaches 100. Not supported when using --in-place. This is ignored when restarting a service or creating a new service.--max-surge-percent: Amount of excess capacity allowed to be used while updating the service (0-100). Defaults to 100. Not supported when using --in-place.--env: Environment variables to set for the service. 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.--py-module: Python modules to be available for import in the Ray workers. Each entry must be a path to a local directory.--cloud: The Anyscale Cloud of this workload. 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 service. If not provided, the default project for the cloud will be used (or, if running in a workspace, the project of the workspace).
anyscale service status
Usage
anyscale service status [OPTIONS]
Get the status of a service.
Options
-n/--name: Name of the service.-f/--config-file: Path to a YAML config file to read the name from.--cloud: The Anyscale Cloud of this workload. 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 service. If not provided, the default project for the cloud will be used (or, if running in a workspace, the project of the workspace).-j/--json: Output the status in a structured JSON format.-v/--verbose: Include verbose details in the status.
anyscale service wait
Usage
anyscale service wait [OPTIONS]
Wait for a service to enter a target state.
Options
-n/--name: Name of the service.-f/--config-file: Path to a YAML config file to read the name from.--cloud: The Anyscale Cloud of this workload. 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 service. If not provided, the default project for the cloud will be used (or, if running in a workspace, the project of the workspace).-s/--state: The ServiceState to wait for the service to reach. Defaults to RUNNING.-t/--timeout-s: Timeout to wait for the service to reach the target state. Defaults to 600s (10min).
anyscale service rollback
Usage
anyscale service rollback [OPTIONS]
Roll back a service.
Options
--service-id/--id: ID of service.-n/--name: Name of service.--project-id: Filter by project id.-f/--config-file/--service-config-file: Path to a YAML config file to read the name from.--service-config-fileis deprecated, use-for--config-file.--max-surge-percent: Max amount of excess capacity allocated during the rollback (0-100).
anyscale service terminate
Usage
anyscale service terminate [OPTIONS]
Terminate a service.
Options
--service-id/--id: ID of service.-n/--name: Name of service.--project-id: Filter by project id.-f/--config-file/--service-config-file: Path to a YAML config file to read the name from.--service-config-fileis deprecated, use-for--config-file.