Skip to main content

Custom images on Anyscale

Anyscale recommends building a custom image before moving any workload from development to production.

Custom images package environment variables, dependencies, and code assets into an immutable container image. Anyscale provides the following options for building, uploading, and configuring access to custom images:

For a tutorial on building custom images and referencing them from an external registry, see Tutorial: Build a custom container image.

Anyscale-compatible custom images

Most custom images extend a base image provided by Anyscale. For a full list of base images and their dependencies, see Anyscale base images.

You can build an image that's not based on an Anyscale base image, but must follow minimum specifications. See Requirements for an Anyscale container image.

If you're building your custom image on Anyscale, you can use init scripts to run arbitrary programs as part of the build process. See Use init scripts with custom images.

The Anyscale base images come with a default entrypoint set. Overwriting this entrypoint may break the web terminal and Jupyter notebook server when you launch your cluster.

Register a custom image

You can use the Anyscale console, CLI, or SDK to register custom images from an external image registry to your Anyscale organization. When you register an image, it becomes available to all users in your Anyscale organization.

Once you've registered an image to Anyscale, you can use it the same way you use a custom image built on Anyscale. The Anyscale URI for registered images uses the following format:

anyscale/image/<image-name>:<version>
note

You can use images from external image registries without registering them to your organization. After accessing your image from an external registry, Anyscale builds and caches an optimized version of your image in the object storage configured for the Anyscale cloud in which your job, service, or workspace runs. Anyscale uses the cached image to deploy all nodes in your Ray cluster. See Use container images from an external registry.

The following table describes the fields you must configure when registering an image:

FieldDescription
NameThe name used to register the image in the Anyscale container image registry. If you reuse an existing name, registering an image creates a new version.
Image URIThe URI for the image in your external registry.
Ray versionThe version of Ray in the image.
Registry login secretThe name of the secret that contains the login credentials to your registry. Required unless the image registry is public or accessible through the IAM role of your Anyscale cloud. You must configure a secret to store login credentials. See Store credentials for a private image registry.

To register an image from an external registry, complete the following steps:

  1. Navigate to the Anyscale console.
  2. From the console home screen, select Configuration > Container images.
  3. Click + Build.
  4. In the Name field, provide a unique name for the image.
    • The URI of the image generates automatically. Use this URI to reference this image when you create a workspace, job, or service.
  5. Under Build step, select Use an image from an external registry.
  6. Enter the URI for the image in your external registry in the Image URI field.
  7. For the Ray version option, select the version that corresponds to your image.
  8. If required, enter the name of the secret that contains your login credentials in the Registry login secret field.
  9. Click Build.