mirror of https://github.com/kubeflow/examples.git
Fix miscellaneous bugs with the xgboost_synthetic test (#676)
* namespace where test runs should correspond to the namespace of a Kubeflow profile * There was a bug in the logging format string * There was a bug in the print statement for the job
This commit is contained in:
parent
67041ec4d5
commit
7a2977ef11
|
|
@ -74,3 +74,4 @@ workflows:
|
||||||
- postsubmit
|
- postsubmit
|
||||||
include_dirs:
|
include_dirs:
|
||||||
- xgboost_synthetic/*
|
- xgboost_synthetic/*
|
||||||
|
- py/kubeflow/examples/create_e2e_workflow.py
|
||||||
|
|
|
||||||
|
|
@ -240,7 +240,7 @@ class Builder:
|
||||||
command = ["pytest", "xgboost_test.py",
|
command = ["pytest", "xgboost_test.py",
|
||||||
# Increase the log level so that info level log statements show up.
|
# Increase the log level so that info level log statements show up.
|
||||||
"--log-cli-level=info",
|
"--log-cli-level=info",
|
||||||
"--log-cli-format='%(levelname)s|%(asctime)s|%(pathname)s|%(lineno)d| %(message)'",
|
"--log-cli-format='%(levelname)s|%(asctime)s|%(pathname)s|%(lineno)d| %(message)s'",
|
||||||
# Test timeout in seconds.
|
# Test timeout in seconds.
|
||||||
"--timeout=1800",
|
"--timeout=1800",
|
||||||
"--junitxml=" + self.artifacts_dir + "/junit_xgboost-synthetic-test.xml",
|
"--junitxml=" + self.artifacts_dir + "/junit_xgboost-synthetic-test.xml",
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,10 @@ def pytest_addoption(parser):
|
||||||
"--name", help="Name for the job. If not specified one was created "
|
"--name", help="Name for the job. If not specified one was created "
|
||||||
"automatically", type=str, default="")
|
"automatically", type=str, default="")
|
||||||
parser.addoption(
|
parser.addoption(
|
||||||
"--namespace", help="The namespace for the application", type=str,
|
"--namespace", help=("The namespace to run in. This should correspond to"
|
||||||
default="kubeflow-test-infra")
|
"a namespace associated with a Kubeflow namespace."),
|
||||||
|
type=str,
|
||||||
|
default="kubeflow-kubeflow-testing")
|
||||||
parser.addoption(
|
parser.addoption(
|
||||||
"--image", help="Notebook image to use", type=str,
|
"--image", help="Notebook image to use", type=str,
|
||||||
default="gcr.io/kubeflow-images-public/tensorflow-1.14.0-notebook-gpu"
|
default="gcr.io/kubeflow-images-public/tensorflow-1.14.0-notebook-gpu"
|
||||||
|
|
|
||||||
|
|
@ -63,17 +63,17 @@ def test_xgboost_synthetic(record_xml_attribute, name, namespace, # pylint: disa
|
||||||
actual_job = batch_api.create_namespaced_job(job["metadata"]["namespace"],
|
actual_job = batch_api.create_namespaced_job(job["metadata"]["namespace"],
|
||||||
job)
|
job)
|
||||||
logging.info("Created job %s.%s:\n%s", namespace, name,
|
logging.info("Created job %s.%s:\n%s", namespace, name,
|
||||||
yaml.safe_dump(actual_job))
|
yaml.safe_dump(actual_job.to_dict()))
|
||||||
|
|
||||||
final_job = util.wait_for_job(api_client, namespace, name,
|
final_job = util.wait_for_job(api_client, namespace, name,
|
||||||
timeout=datetime.timedelta(minutes=30))
|
timeout=datetime.timedelta(minutes=30))
|
||||||
|
|
||||||
logging.info("Final job:\n%s", yaml.safe_dump(final_job))
|
logging.info("Final job:\n%s", yaml.safe_dump(final_job.to_dict()))
|
||||||
|
|
||||||
if not job.status.conditions:
|
if not final_job.status.conditions:
|
||||||
raise RuntimeError("Job {0}.{1}; did not complete".format(namespace, name))
|
raise RuntimeError("Job {0}.{1}; did not complete".format(namespace, name))
|
||||||
|
|
||||||
last_condition = job.status.conditions[-1]
|
last_condition = final_job.status.conditions[-1]
|
||||||
|
|
||||||
if last_condition.type not in ["Complete"]:
|
if last_condition.type not in ["Complete"]:
|
||||||
logging.error("Job didn't complete successfully")
|
logging.error("Job didn't complete successfully")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue