Esempio n. 1
0
    def setUp(self):
        """Set up KubeRay operator and Ray autoscaler RBAC."""

        # Switch to parent of Ray repo, because that's what the doc examples do.
        logger.info("Switching to parent of Ray directory.")
        os.chdir(RAY_PARENT)

        logger.info("Cloning KubeRay and setting up KubeRay configuration.")
        subprocess.check_call(
            [
                "bash",
                "-c",
                "ls kuberay || ./ray/python/ray/autoscaler/kuberay/init-config.sh",
            ]
        )
        logger.info("Creating KubeRay operator.")
        subprocess.check_call(
            [
                "kubectl",
                "apply",
                "-k",
                "ray/python/ray/autoscaler/kuberay/config/default",
            ]
        )
        logger.info("Creating autoscaler RBAC objects.")
        subprocess.check_call(
            [
                "kubectl",
                "apply",
                "-f",
                "ray/python/ray/autoscaler/kuberay/kuberay-autoscaler-rbac.yaml",
            ]
        )
        logger.info("Making sure RayCluster CRD has been registered.")
        wait_for_crd("rayclusters.ray.io")
Esempio n. 2
0
    def setUp(self):
        """Set up KubeRay operator and Ray autoscaler RBAC."""

        # Switch to parent of Ray repo, because that's what the doc examples do.
        logger.info("Switching to parent of Ray directory.")
        os.chdir(RAY_PARENT)

        logger.info("Cloning KubeRay and setting up KubeRay configuration.")
        # For faster run-time when triggering the test locally, don't run the init
        # script if it has already been run.
        subprocess.check_call([
            "bash",
            "-c",
            ("ls ray/python/ray/autoscaler/kuberay/config ||"
             " ./ray/python/ray/autoscaler/kuberay/init-config.sh"),
        ])
        logger.info("Creating KubeRay operator.")
        subprocess.check_call([
            "kubectl",
            "create",
            "-k",
            "ray/python/ray/autoscaler/kuberay/config/default",
        ])
        logger.info("Making sure RayCluster CRD has been registered.")
        wait_for_crd("rayclusters.ray.io")