⏱️ Time to complete: 5 min
This tutorial shows you how to:
- Submit Anyscale Jobs
- View and monitor the job in Anyscale UI.
We recommend running batch Ray apps as Anyscale Jobs if the following features are needed:
- Automated failure handling and retries
- Alerting
- Programmatic submission API & CI/CD integration
- Cron jobs
- Job queue and priority-based scheduling
- Record and persist outputs such as logs
Note:
- In open source Ray, users run batch Ray apps with "Ray Jobs". Anyscale Jobs launch Ray Jobs on standalone Ray Clusters and manage the lifecycle of them. It also provides the additional features listed above. No code change to your Ray script is needed when running your existing Ray Jobs as Anyscale Jobs.
- For development work that requires rapid iteration, it is better to use Anyscale Workspaces or other development environments.
You can submit jobs from any machines, using the Anyscale CLI or SDK. In this tutorial, we use Anyscale CLI as an example.
# Install the lastet version of Anyscale CLI
$ pip install -U anyscale
# Authenticate
$ anyscale login
This example includes a simple processing job that runs a few Ray Tasks. Run the following command to submit it as an Anyscale Job
$ anyscale job submit --wait -f job.yaml
This example includes two important files
- job.yaml: set the entrypoint and configs of your job. Learn more about the supported fields
- main.py: the Ray script to run
It's also possible to set the entrypoint and configs directly without using YAML files. However, YAML files are recommended for better flexibility, maintainability, etc. For more details, check out the Anyscale Job reference.
The output from the submission command should print the URL to your job in Anyscale UI. You can view the job state, logs, metrics, and Ray Dashboard in UI.
This tutorial shows your how to:
- Submit Anyscale Jobs
- View and monitor the job in Anyscale UI.
Check out Anyscale Jobs documentation for more guides:
- Run cron jobs
- Run multiple jobs on the same cluster with job queue
- monitor and debug
- and more