code: def test_canonical_tag(self) -> None:
      v = DEFAULT_PYTHON_VERSION
      pv = self.get_python_version(v)
      container = RayDockerContainer(
          v, "cpu", "ray", canonical_tag="abc"
      )
      assert container._get_canonical_tag() == "abc"
  
      container = RayDockerContainer(v, "cpu", "ray")
      assert container._get_canonical_tag() == f"123456-{pv}-cpu"
  
      container = RayDockerContainer(v, "cpu", "ray", "aarch64")
      assert (
          container._get_canonical_tag() == f"123456-{pv}-cpu-aarch64"
      )
  
      container = RayDockerContainer(v, "cu11.8.0", "ray-ml")
      assert container._get_canonical_tag() == f"123456-{pv}-cu118"
  
      with mock.patch.dict(
          os.environ, {"BUILDKITE_BRANCH": "releases/1.0.0"}
      ):
          container = RayDockerContainer(v, "cpu", "ray")
          assert (
              container._get_canonical_tag() == f"1.0.0.123456-{pv}-cpu"
          )
  
      with mock.patch.dict(
          os.environ,
          {"BUILDKITE_BRANCH": "abc", "BUILDKITE_PULL_REQUEST": "123"},
      ):
          container = RayDockerContainer(v, "cpu", "ray")
          assert (
              container._get_canonical_tag()
              == f"pr-123.123456-{pv}-cpu"
          )
  
file_path: ray/ci/ray_ci/test_ray_docker_container.py
imports: import os
  import sys
  from typing import List
  from unittest import mock
  import pytest
  from ci.ray_ci.builder_container import DEFAULT_PYTHON_VERSION
  from ci.ray_ci.container import _DOCKER_ECR_REPO
  from ci.ray_ci.ray_docker_container import RayDockerContainer
  from ci.ray_ci.test_base import RayCITestBase
  from ci.ray_ci.utils import RAY_VERSION
label_desc: Use image node_id 2 for calling the TestRayDockerContainer obj's underlying member method code with example usage: obj.test_canonical_tag() without return types