Skip to content

Commit

Permalink
fix wrong kuberay image used by compatibility test
Browse files Browse the repository at this point in the history
  • Loading branch information
wilsonwang371 committed Jun 29, 2022
1 parent 4f96425 commit 5c2b5d4
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions tests/compatibility-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@
raycluster_service_file = 'tests/config/raycluster-service.yaml'

logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.INFO)

kuberay_sha = 'nightly'


def shell_run(cmd):
logger.info(cmd)
logger.info('executing cmd: {}'.format(cmd))
return os.system(cmd)


Expand All @@ -46,7 +47,8 @@ def apply_kuberay_resources():
shell_assert_success(
'kubectl create -k manifests/cluster-scope-resources')
shell_assert_success(
'kubectl create -k manifests/base')
'kustomize build manifests/base | sed "s/image: kuberay\\/\\(.*\\):nightly/image: kuberay\\/\\1:{}/g" | kubectl apply -f -'.format(
kuberay_sha))


def create_kuberay_cluster():
Expand Down Expand Up @@ -128,11 +130,11 @@ def f(x):
container.stop()

if stdout_str != b'[0, 1, 4, 9]\n':
print(output, file=sys.stderr)
logger.info(output)
raise Exception('invalid result.')
if rtn_code != 0:
msg = 'invalid return code {}'.format(rtn_code)
print(msg, file=sys.stderr)
logger.info(msg)
raise Exception(msg)

client.close()
Expand Down Expand Up @@ -160,11 +162,11 @@ def test_cluster_info(self):
container.stop()

if stdout_str != b'2\n':
print(output, file=sys.stderr)
logger.info(output)
raise Exception('invalid result.')
if rtn_code != 0:
msg = 'invalid return code {}'.format(rtn_code)
print(msg, file=sys.stderr)
logger.info(msg)
raise Exception(msg)

client.close()
Expand All @@ -178,11 +180,11 @@ def parse_environment():
global ray_version, ray_image, kuberay_sha
for k, v in os.environ.items():
if k == 'RAY_VERSION':
print('Setting Ray image to: {}'.format(v), file=sys.stderr)
logger.info('Setting Ray image to: {}'.format(v))
ray_version = v
ray_image = 'rayproject/ray:{}'.format(ray_version)
if k == 'KUBERAY_IMG_SHA':
print('Using KubeRay docker build SHA: {}'.format(v))
logger.info('Using KubeRay docker build SHA: {}'.format(v))
kuberay_sha = v


Expand Down

0 comments on commit 5c2b5d4

Please sign in to comment.