Skip to content

Commit

Permalink
change work directory
Browse files Browse the repository at this point in the history
Signed-off-by: helenxie-bit <[email protected]>
  • Loading branch information
helenxie-bit committed Sep 18, 2024
1 parent 25d99b1 commit fcd64fa
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 19 deletions.
18 changes: 0 additions & 18 deletions .github/workflows/e2e-test-tune-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Move docker data directory
shell: bash
run: |
echo "Stopping docker service ..."
sudo systemctl stop docker
DOCKER_DEFAULT_ROOT_DIR=/var/lib/docker
DOCKER_ROOT_DIR=/mnt/docker
echo "Moving ${DOCKER_DEFAULT_ROOT_DIR} -> ${DOCKER_ROOT_DIR}"
sudo mv ${DOCKER_DEFAULT_ROOT_DIR} ${DOCKER_ROOT_DIR}
echo "Creating symlink ${DOCKER_DEFAULT_ROOT_DIR} -> ${DOCKER_ROOT_DIR}"
sudo ln -s ${DOCKER_ROOT_DIR} ${DOCKER_DEFAULT_ROOT_DIR}
echo "$(sudo ls -l ${DOCKER_DEFAULT_ROOT_DIR})"
echo "Starting docker service ..."
sudo systemctl daemon-reload
sudo systemctl start docker
echo "Docker service status:"
sudo systemctl --no-pager -l -o short status docker

- name: Setup Test Env
uses: ./.github/workflows/template-setup-e2e-test
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/template-e2e-test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,4 @@ runs:
else
./test/e2e/v1beta1/scripts/gh-actions/run-e2e-experiment.sh ${{ inputs.experiments }}
fi
working-directory: /mnt/docker
21 changes: 20 additions & 1 deletion test/e2e/v1beta1/scripts/gh-actions/run-e2e-tune-api.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,25 @@ def get_experiment_pods_logs(katib_client: KatibClient, exp_name: str, exp_names
namespace=exp_namespace,
container="metrics-logger-and-collector" # Specify the desired container
)
logging.info(f"Logs for pod {pod.metadata.name}:\n{pod_logs}")
except Exception as e:
logging.error(f"Failed to get logs for pod {pod.metadata.name}: {str(e)}")

def get_experiment_pods_logs_2(katib_client: KatibClient, exp_name: str, exp_namespace: str):
# List all the pods in the namespace
v1 = client.CoreV1Api()
pods = v1.list_namespaced_pod(namespace=exp_namespace)

# Filter pods related to the specific Katib Experiment
for pod in pods.items:
if exp_name in pod.metadata.name:
logging.info(f"Fetching logs for pod: {pod.metadata.name}")
try:
# Specify the container name when retrieving logs
pod_logs = v1.read_namespaced_pod_log(
name=pod.metadata.name,
namespace=exp_namespace,
)
logging.info(f"Logs for pod {pod.metadata.name} (container: metrics-logger-and-collector):\n{pod_logs}")
except Exception as e:
logging.error(f"Failed to get logs for pod {pod.metadata.name}: {str(e)}")
Expand Down Expand Up @@ -197,7 +216,7 @@ def run_e2e_experiment_create_by_tune_with_external_model(
logging.info("---------------------------------------------------------------")
logging.info(f"E2E is failed for Experiment created by tune: {exp_namespace}/{exp_name}-2")
get_experiment_pods_logs(katib_client, f"{exp_name}-2", exp_namespace)
get_experiment_pods_logs(katib_client, "katib-controller", "kubeflow")
get_experiment_pods_logs_2(katib_client, "katib-controller", "kubeflow")
raise e
finally:
# Delete the Experiment.
Expand Down

0 comments on commit fcd64fa

Please sign in to comment.