python/ray/tests/kuberay/test_autoscaling_e2e.py
def _get_ray_cr_config_file(self) -> str:
        """Formats a RayCluster CR based on the example in the Ray documentation.

        - Replaces Ray node and autoscaler images in example CR with the test image.
        - Set image pull policies to IfNotPresent.
        - Writes modified CR to temp file.
        - Returns temp file's name.
        """
        # Set Ray and autoscaler images.
        with open(EXAMPLE_CLUSTER_PATH) as example_cluster_file:
            ray_cr_config_str = example_cluster_file.read()
        ray_images = [
            word for word in ray_cr_config_str.split() if "rayproject/ray:" in word
        ]
        for ray_image in ray_images:
            ray_cr_config_str = ray_cr_config_str.replace(ray_image, RAY_IMAGE)

        # CI should set pull policies to IfNotPresent to ensure no issues using a local
        # test image on kind.
        ray_cr_config_str = ray_cr_config_str.replace("Always", PULL_POLICY)

        raycluster_cr_file = tempfile.NamedTemporaryFile(delete=False)
        raycluster_cr_file.write(ray_cr_config_str.encode())
        raycluster_cr_file.close()
        return raycluster_cr_file.name
Formats a RayCluster CR based on the example in the Ray documentation.

        - Replaces Ray node and autoscaler images in example CR with the test image.
        - Set image pull policies to IfNotPresent.
        - Writes modified CR to temp file.
        - Returns temp file's name.
        
Formats a RayCluster CR based on the example in the Ray documentation.
Replaces Ray node and autoscaler images in example CR with the test image.
Set image pull policies to IfNotPresent.
Writes modified CR to temp file.
Returns temp file's name.
Formats a RayCluster CR based on the example in the Ray documentation . Replaces Ray node and autoscaler images in example CR with the test image . Set image pull policies to IfNotPresent . Writes modified CR to temp file . Returns temp file ' s name .
def _get_ray_cr_config_file(self) -> str:
        with open(EXAMPLE_CLUSTER_PATH) as example_cluster_file:
            ray_cr_config_str = example_cluster_file.read()
        ray_images = [
            word for word in ray_cr_config_str.split() if "rayproject/ray:" in word
        ]
        for ray_image in ray_images:
            ray_cr_config_str = ray_cr_config_str.replace(ray_image, RAY_IMAGE)
        ray_cr_config_str = ray_cr_config_str.replace("Always", PULL_POLICY)
        raycluster_cr_file = tempfile.NamedTemporaryFile(delete=False)
        raycluster_cr_file.write(ray_cr_config_str.encode())
        raycluster_cr_file.close()
        return raycluster_cr_file.name
def _get_ray_cr_config_file ( self ) -> str : with open ( EXAMPLE_CLUSTER_PATH ) as example_cluster_file : ray_cr_config_str = example_cluster_file . read ( ) ray_images = [ word for word in ray_cr_config_str . split ( ) if "rayproject/ray:" in word ] for ray_image in ray_images : ray_cr_config_str = ray_cr_config_str . replace ( ray_image , RAY_IMAGE ) ray_cr_config_str = ray_cr_config_str . replace ( "Always" , PULL_POLICY ) raycluster_cr_file = tempfile . NamedTemporaryFile ( delete = False ) raycluster_cr_file . write ( ray_cr_config_str . encode ( ) ) raycluster_cr_file . close ( ) return raycluster_cr_file . name
Formats a RayCluster CR based on the example in the Ray documentation.
Formats a RayCluster CR based on the example in the Ray documentation .
"""Formats a RayCluster CR based on the example in the Ray documentation.

        - Replaces Ray node and autoscaler images in example CR with the test image.
        - Set image pull policies to IfNotPresent.
        - Writes modified CR to temp file.
        - Returns temp file's name.
        """ # Set Ray and autoscaler images. # CI should set pull policies to IfNotPresent to ensure no issues using a local # test image on kind.
self