From f39bd402280216c65fc62f84f215453a5d0cc543 Mon Sep 17 00:00:00 2001 From: Electronic-Waste <2690692950@qq.com> Date: Tue, 30 Jul 2024 16:39:44 +0000 Subject: [PATCH] test(sdk): add debug logs. Signed-off-by: Electronic-Waste <2690692950@qq.com> --- .../scripts/gh-actions/run-e2e-experiment.py | 17 ++++++----------- .../scripts/gh-actions/run-e2e-experiment.sh | 2 +- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/test/e2e/v1beta1/scripts/gh-actions/run-e2e-experiment.py b/test/e2e/v1beta1/scripts/gh-actions/run-e2e-experiment.py index d48f398e94a..822cd40d2f5 100644 --- a/test/e2e/v1beta1/scripts/gh-actions/run-e2e-experiment.py +++ b/test/e2e/v1beta1/scripts/gh-actions/run-e2e-experiment.py @@ -225,7 +225,7 @@ def run_e2e_experiment_create_by_tune( base_image: str ): # Create Katib Experiment and wait until it is finished. - logging.debug("Creating Experiment: {}/{}".format(exp_namespace, exp_name)) + logging.debug("Creating Experiment: {}/{} with trial image {}".format(exp_namespace, exp_name, base_image)) # Use the test case from get-started tutorial. # https://www.kubeflow.org/docs/components/katib/getting-started/#getting-started-with-katib-python-sdk @@ -240,7 +240,7 @@ def objective(parameters): "b": search.double(min=0.1, max=0.2) } - # [3] Create Katib Experiment with 4 Trials and 2 CPUs per Trial. + # [3] Create Katib Experiment with 2 Trials and 2 CPUs per Trial. # And Wait until Experiment reaches Succeeded condition. katib_client.tune( name=exp_name, @@ -249,7 +249,7 @@ def objective(parameters): objective=objective, parameters=parameters, objective_metric_name="result", - max_trial_count=4, + max_trial_count=2, resources_per_trial={"cpu": "2"}, ) experiment = katib_client.wait_for_experiment_condition( @@ -359,15 +359,10 @@ def objective(parameters): katib_client.delete_experiment(exp_name, exp_namespace) # Test with run_e2e_experiment_create_by_tune - tune_exp_name = exp_name + "-by-tune" - tune_trial_image = "docker.io/kubeflowkatib/" + args.trial_image + ":e2e-test" + tune_exp_name = f"{exp_name}{TUNE_EXP_NAME_SUFFIX}" + tune_trial_image = f"{REGISTRY}/{args.trial_image}:{TAG}" try: - run_e2e_experiment_create_by_tune( - katib_client, - f"{exp_name}{TUNE_EXP_NAME_SUFFIX}", - exp_namespace, - f"{REGISTRY}/{args.trial_image}:{TAG}" - ) + run_e2e_experiment_create_by_tune(katib_client, tune_exp_name, exp_namespace, tune_trial_image) logging.info("---------------------------------------------------------------") logging.info(f"E2E is succeeded for Experiment created by tune: {exp_namespace}/{tune_exp_name}") except Exception as e: diff --git a/test/e2e/v1beta1/scripts/gh-actions/run-e2e-experiment.sh b/test/e2e/v1beta1/scripts/gh-actions/run-e2e-experiment.sh index d6cc54d7174..7af3c14c64c 100755 --- a/test/e2e/v1beta1/scripts/gh-actions/run-e2e-experiment.sh +++ b/test/e2e/v1beta1/scripts/gh-actions/run-e2e-experiment.sh @@ -43,7 +43,7 @@ if [ -z "$EXPERIMENT_FILES" ]; then fi for exp_name in "${EXPERIMENT_FILE_ARRAY[@]}"; do - echo "Running Experiment from $exp_name file" + echo "Running Experiment from $exp_name file with image $TRIAL_IMAGE" exp_path=$(find ../../../../../examples/v1beta1 -name "${exp_name}.yaml") python run-e2e-experiment.py --experiment-path "${exp_path}" --namespace default --trial-image "${TRIAL_IMAGE}" \ --verbose || (kubectl get pods -n kubeflow && exit 1)