Exemplo n.º 1
0
    def setUp(self):
        ray.init(num_cpus=1, num_gpus=0, local_mode=True)
        tmpdir = tempfile.mkdtemp()
        test_name = "TuneRestoreTest"
        tune.run(
            "PG",
            name=test_name,
            stop={"training_iteration": 1},
            checkpoint_freq=1,
            local_dir=tmpdir,
            config={
                "env": "CartPole-v0",
            },
        )

        logdir = os.path.expanduser(os.path.join(tmpdir, test_name))
        self.logdir = logdir
        self.checkpoint_path = recursive_fnmatch(logdir, "checkpoint-1")[0]
Exemplo n.º 2
0
from ray.autoscaler._private.azure.config import (_configure_key_pair as
                                                  _azure_configure_key_pair)
from ray.autoscaler._private.gcp import config as gcp_config
from ray.autoscaler._private.local import config as local_config
from ray.autoscaler._private.util import prepare_config, validate_config,\
    _get_default_config, merge_setup_commands
from ray.autoscaler._private.providers import _NODE_PROVIDERS
from ray.autoscaler._private._kubernetes.node_provider import\
    KubernetesNodeProvider
from ray.autoscaler.tags import NODE_TYPE_LEGACY_HEAD, NODE_TYPE_LEGACY_WORKER

from ray.test_utils import load_test_config, recursive_fnmatch

RAY_PATH = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
CONFIG_PATHS = recursive_fnmatch(os.path.join(RAY_PATH, "autoscaler"),
                                 "*.yaml")

CONFIG_PATHS += recursive_fnmatch(os.path.join(RAY_PATH, "tune", "examples"),
                                  "*.yaml")


def ignore_k8s_operator_configs(paths):
    return [
        path for path in paths if "kubernetes/operator_configs" not in path
        and "kubernetes/job-example.yaml" not in path
    ]


CONFIG_PATHS = ignore_k8s_operator_configs(CONFIG_PATHS)

EXPECTED_LOCAL_CONFIG_STR = """