Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[xray] Add Travis build for testing xray on Linux. #2047

Merged
merged 9 commits into from
May 14, 2018
Merged
52 changes: 52 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,58 @@ matrix:
- PYTHON=3.5
- RAY_USE_NEW_GCS=on

- os: linux
dist: trusty
env: PYTHON=3.5 RAY_USE_XRAY=1
install:
- ./.travis/install-dependencies.sh
- export PATH="$HOME/miniconda/bin:$PATH"
- ./.travis/install-ray.sh
- ./.travis/install-cython-examples.sh
script:
- export PATH="$HOME/miniconda/bin:$PATH"

- python python/ray/common/test/test.py
- python python/ray/common/redis_module/runtest.py
- python python/ray/plasma/test/test.py
# - python python/ray/local_scheduler/test/test.py
# - python python/ray/global_scheduler/test/test.py

- python -m pytest test/xray_test.py

- python test/runtest.py
- python test/array_test.py
- python test/actor_test.py
- python test/autoscaler_test.py
- python test/tensorflow_test.py
- python test/failure_test.py
- python test/microbenchmarks.py
- python test/stress_tests.py
# - python test/component_failures_test.py
- python test/multi_node_test.py
- python test/recursion_test.py
# - python test/monitor_test.py
- python test/cython_test.py
- python test/credis_test.py

# ray dataframe tests
# - python -m pytest python/ray/dataframe/test/test_dataframe.py
- python -m pytest python/ray/dataframe/test/test_concat.py
- python -m pytest python/ray/dataframe/test/test_io.py

# ray tune tests
# - python python/ray/tune/test/dependency_test.py
# - python -m pytest python/ray/tune/test/trial_runner_test.py
- python -m pytest python/ray/tune/test/trial_scheduler_test.py
# - python -m pytest python/ray/tune/test/tune_server_test.py

# ray rllib tests
- python -m pytest python/ray/rllib/test/test_catalog.py
- python -m pytest python/ray/rllib/test/test_filters.py
- python -m pytest python/ray/rllib/test/test_optimizers.py
- python -m pytest python/ray/rllib/test/test_evaluators.py


install:
- ./.travis/install-dependencies.sh
- export PATH="$HOME/miniconda/bin:$PATH"
Expand Down
8 changes: 7 additions & 1 deletion python/ray/scripts/scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import click
import json
import os
import subprocess

import ray.services as services
Expand Down Expand Up @@ -144,7 +145,7 @@ def cli():
@click.option(
"--use-raylet",
is_flag=True,
default=False,
default=None,
help="use the raylet code path, this is not supported yet")
def start(node_ip_address, redis_address, redis_port, num_redis_shards,
redis_max_clients, redis_shard_ports, object_manager_port,
Expand All @@ -157,6 +158,11 @@ def start(node_ip_address, redis_address, redis_port, num_redis_shards,
if redis_address is not None:
redis_address = services.address_to_ip(redis_address)

if use_raylet is None and os.environ.get("RAY_USE_XRAY") == "1":
# This environment variable is used in our testing setup.
print("Detected environment variable 'RAY_USE_XRAY'.")
use_raylet = True

try:
resources = json.loads(resources)
except Exception as e:
Expand Down
12 changes: 11 additions & 1 deletion python/ray/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -1440,6 +1440,11 @@ def _init(address_info=None,
raise Exception("Driver_mode must be in [ray.SCRIPT_MODE, "
"ray.PYTHON_MODE, ray.SILENT_MODE].")

if use_raylet is None and os.environ.get("RAY_USE_XRAY") == "1":
# This environment variable is used in our testing setup.
print("Detected environment variable 'RAY_USE_XRAY'.")
use_raylet = True

# Get addresses of existing services.
if address_info is None:
address_info = {}
Expand Down Expand Up @@ -1580,7 +1585,7 @@ def init(redis_address=None,
huge_pages=False,
include_webui=True,
object_store_memory=None,
use_raylet=False):
use_raylet=None):
"""Connect to an existing Ray cluster or start one and connect to it.

This method handles two cases. Either a Ray cluster already exists and we
Expand Down Expand Up @@ -1635,6 +1640,11 @@ def init(redis_address=None,
Exception: An exception is raised if an inappropriate combination of
arguments is passed in.
"""
if use_raylet is None and os.environ.get("RAY_USE_XRAY") == "1":
# This environment variable is used in our testing setup.
print("Detected environment variable 'RAY_USE_XRAY'.")
use_raylet = True

# Convert hostnames to numerical IP address.
if node_ip_address is not None:
node_ip_address = services.address_to_ip(node_ip_address)
Expand Down
39 changes: 39 additions & 0 deletions test/actor_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ class ActorAPI(unittest.TestCase):
def tearDown(self):
ray.worker.cleanup()

@unittest.skipIf(
os.environ.get("RAY_USE_XRAY") == "1",
"This test does not work with xray yet.")
def testKeywordArgs(self):
ray.init(num_workers=0, driver_mode=ray.SILENT_MODE)

Expand Down Expand Up @@ -68,6 +71,9 @@ def get_values(self, arg0, arg1=2, arg2="b"):
with self.assertRaises(Exception):
ray.get(actor.get_values.remote())

@unittest.skipIf(
os.environ.get("RAY_USE_XRAY") == "1",
"This test does not work with xray yet.")
def testVariableNumberOfArgs(self):
ray.init(num_workers=0)

Expand Down Expand Up @@ -234,6 +240,9 @@ class Actor(object):
def __init__(self):
pass

@unittest.skipIf(
os.environ.get("RAY_USE_XRAY") == "1",
"This test does not work with xray yet.")
def testRandomIDGeneration(self):
ray.init(num_workers=0)

Expand Down Expand Up @@ -327,6 +336,9 @@ def f(self, y):
with self.assertRaises(Exception):
t.f(1)

@unittest.skipIf(
os.environ.get("RAY_USE_XRAY") == "1",
"This test does not work with xray yet.")
def testActorDeletion(self):
ray.init(num_workers=0)

Expand Down Expand Up @@ -359,6 +371,9 @@ def method(self):
# called.
self.assertEqual(ray.get(Actor.remote().method.remote()), 1)

@unittest.skipIf(
os.environ.get("RAY_USE_XRAY") == "1",
"This test does not work with xray yet.")
def testActorDeletionWithGPUs(self):
ray.init(num_workers=0, num_gpus=1)

Expand Down Expand Up @@ -549,6 +564,9 @@ def get_values(self, z):
actor2 = Actor2.remote(3, 4)
self.assertEqual(ray.get(actor2.get_values.remote(5)), (3, 4))

@unittest.skipIf(
os.environ.get("RAY_USE_XRAY") == "1",
"This test does not work with xray yet.")
def testDefineActorWithinRemoteFunction(self):
# Make sure we can define and actors within remote funtions.
ray.init(num_cpus=10)
Expand Down Expand Up @@ -684,6 +702,9 @@ class ActorsOnMultipleNodes(unittest.TestCase):
def tearDown(self):
ray.worker.cleanup()

@unittest.skipIf(
os.environ.get("RAY_USE_XRAY") == "1",
"This test does not work with xray yet.")
def testActorsOnNodesWithNoCPUs(self):
ray.init(num_cpus=0)

Expand Down Expand Up @@ -1098,6 +1119,9 @@ def locations_to_intervals_for_many_tasks():
ready_ids, remaining_ids = ray.wait(results, timeout=1000)
self.assertEqual(len(ready_ids), 0)

@unittest.skipIf(
os.environ.get("RAY_USE_XRAY") == "1",
"This test does not work with xray yet.")
def testActorsAndTasksWithGPUsVersionTwo(self):
# Create tasks and actors that both use GPUs and make sure that they
# are given different GPUs
Expand Down Expand Up @@ -1170,6 +1194,9 @@ def sleep(self):
self.assertLess(interval1[1], interval2[0])
self.assertLess(interval2[0], interval2[1])

@unittest.skipIf(
os.environ.get("RAY_USE_XRAY") == "1",
"This test does not work with xray yet.")
def testBlockingActorTask(self):
ray.init(num_cpus=1, num_gpus=1)

Expand Down Expand Up @@ -1763,6 +1790,9 @@ def read(self):

return Queue.remote()

@unittest.skipIf(
os.environ.get("RAY_USE_XRAY") == "1",
"This test does not work with xray yet.")
def testFork(self):
queue = self.setup_queue_actor()

Expand All @@ -1778,6 +1808,9 @@ def fork(queue, key, item):
filtered_items = [item[1] for item in items if item[0] == i]
self.assertEqual(filtered_items, list(range(1)))

@unittest.skipIf(
os.environ.get("RAY_USE_XRAY") == "1",
"This test does not work with xray yet.")
def testForkConsistency(self):
queue = self.setup_queue_actor()

Expand Down Expand Up @@ -1871,6 +1904,9 @@ class ActorPlacementAndResources(unittest.TestCase):
def tearDown(self):
ray.worker.cleanup()

@unittest.skipIf(
os.environ.get("RAY_USE_XRAY") == "1",
"This test does not work with xray yet.")
def testLifetimeAndTransientResources(self):
ray.init(num_cpus=1)

Expand Down Expand Up @@ -1928,6 +1964,9 @@ def get_location(self):
for location in locations2:
self.assertNotEqual(location, local_plasma)

@unittest.skipIf(
os.environ.get("RAY_USE_XRAY") == "1",
"This test does not work with xray yet.")
def testCreatingMoreActorsThanResources(self):
ray.init(
num_workers=0,
Expand Down
15 changes: 15 additions & 0 deletions test/failure_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,9 @@ class WorkerDeath(unittest.TestCase):
def tearDown(self):
ray.worker.cleanup()

@unittest.skipIf(
os.environ.get("RAY_USE_XRAY") == "1",
"This test does not work with xray yet.")
def testWorkerRaisingException(self):
ray.init(num_workers=1, driver_mode=ray.SILENT_MODE)

Expand All @@ -272,6 +275,9 @@ def f():
wait_for_errors(b"worker_died", 1)
self.assertEqual(len(ray.error_info()), 2)

@unittest.skipIf(
os.environ.get("RAY_USE_XRAY") == "1",
"This test does not work with xray yet.")
def testWorkerDying(self):
ray.init(num_workers=0, driver_mode=ray.SILENT_MODE)

Expand All @@ -288,6 +294,9 @@ def f():
self.assertIn("died or was killed while executing the task",
ray.error_info()[0][b"message"].decode("ascii"))

@unittest.skipIf(
os.environ.get("RAY_USE_XRAY") == "1",
"This test does not work with xray yet.")
def testActorWorkerDying(self):
ray.init(num_workers=0, driver_mode=ray.SILENT_MODE)

Expand All @@ -306,6 +315,9 @@ def consume(x):
self.assertRaises(Exception, lambda: ray.get(consume.remote(obj)))
wait_for_errors(b"worker_died", 1)

@unittest.skipIf(
os.environ.get("RAY_USE_XRAY") == "1",
"This test does not work with xray yet.")
def testActorWorkerDyingFutureTasks(self):
ray.init(num_workers=0, driver_mode=ray.SILENT_MODE)

Expand All @@ -328,6 +340,9 @@ def sleep(self):

wait_for_errors(b"worker_died", 1)

@unittest.skipIf(
os.environ.get("RAY_USE_XRAY") == "1",
"This test does not work with xray yet.")
def testActorWorkerDyingNothingInProgress(self):
ray.init(num_workers=0, driver_mode=ray.SILENT_MODE)

Expand Down
6 changes: 5 additions & 1 deletion test/multi_node_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
from __future__ import division
from __future__ import print_function

import unittest
import os
import ray
import subprocess
import sys
import tempfile
import time
import unittest

from ray.test.test_utils import run_and_get_output

Expand Down Expand Up @@ -153,6 +154,9 @@ def g(x):
# Make sure the other driver succeeded.
self.assertIn("success", out)

@unittest.skipIf(
os.environ.get("RAY_USE_XRAY") == "1",
"This test does not work with xray yet.")
def testDriverExitingQuickly(self):
# This test will create some drivers that submit some tasks and then
# exit without waiting for the tasks to complete.
Expand Down
Loading