Skip to content

Commit

Permalink
test(sdk): add debug logs.
Browse files Browse the repository at this point in the history
Signed-off-by: Electronic-Waste <[email protected]>
  • Loading branch information
Electronic-Waste committed Jul 30, 2024
1 parent ed05190 commit f39bd40
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
17 changes: 6 additions & 11 deletions test/e2e/v1beta1/scripts/gh-actions/run-e2e-experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand All @@ -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(
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/v1beta1/scripts/gh-actions/run-e2e-experiment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f39bd40

Please sign in to comment.