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

fix wrong kuberay image used by compatibility test #327

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 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 @@ -45,8 +46,12 @@ def apply_kuberay_resources():
shell_assert_success('kind load docker-image kuberay/apiserver:{}'.format(kuberay_sha))
shell_assert_success(
'kubectl create -k manifests/cluster-scope-resources')
# use kustomize to build the yaml, then change the image to the one we want to testing.
shell_assert_success(
'kubectl create -k manifests/base')
('rm -f kustomization.yaml && kustomize create --resources manifests/base && ' +
'kustomize edit set image ' +
'kuberay/operator:nightly=kuberay/operator:{0} kuberay/apiserver:nightly=kuberay/apiserver:{0} && ' +
'kubectl apply -k .').format(kuberay_sha))


def create_kuberay_cluster():
Expand Down Expand Up @@ -128,11 +133,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 +165,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 +183,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