Skip to content
Open
Show file tree
Hide file tree
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
51 changes: 50 additions & 1 deletion tools/diagnose-fluid-alluxio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,16 @@ print_usage() {
run() {
echo
echo "-----------------run $*------------------"
timeout 10s "$@"
if command -v timeout >/dev/null 2>&1; then
timeout 10s "$@"
elif command -v gtimeout >/dev/null 2>&1; then
gtimeout 10s "$@"
elif command -v perl >/dev/null 2>&1; then
# Use Perl to enforce timeout on systems without GNU coreutils (like standard macOS)
perl -e 'alarm shift; exec @ARGV' 10 "$@"
else
"$@"
fi
if [ $? != 0 ]; then
echo "failed to collect info: $*"
fi
Expand Down Expand Up @@ -57,6 +66,45 @@ runtime_pod_logs() {
core_component "${runtime_namespace}" "alluxio-fuse" "role=alluxio-fuse" "release=${runtime_name}"
}

serverless_pod_logs() {
# Check if kubectl is available
if ! command -v kubectl >/dev/null 2>&1; then
echo "kubectl not found, skipping serverless pod logs collection"
return
fi

local namespace="${runtime_namespace}"
local dataset_id="${runtime_namespace}-${runtime_name}"
# fluid.io/dataset falls back to the Dataset UID when namespace-name >= 63 chars (DNS1035 limit)
if [[ ${#dataset_id} -ge 63 ]]; then
dataset_id=$(kubectl get dataset "${runtime_name}" -n "${namespace}" -o jsonpath='{.metadata.uid}' 2>/dev/null) || dataset_id="${runtime_namespace}-${runtime_name}"
fi
local label_selector="serverless.fluid.io/inject=true,fluid.io/dataset=${dataset_id}"

Comment thread
Ayush-Patel-56 marked this conversation as resolved.
# Get all pods with the serverless inject label
local pods
pods=$(kubectl get po -n "${namespace}" -l "${label_selector}" -o jsonpath='{.items[*].metadata.name}' 2>/dev/null)
if [[ $? -ne 0 ]]; then
echo "failed to get serverless pods in namespace ${namespace}"
return
fi

if [[ -n "$pods" ]]; then
mkdir -p "$diagnose_dir/pods-${namespace}-serverless"
for po in ${pods}; do
# Find all containers containing fluid-fuse (covers init-fluid-fuse and fluid-fuse)
local containers
containers=$(kubectl get po "${po}" -n "${namespace}" -o jsonpath='{.spec.initContainers[*].name} {.spec.containers[*].name}' 2>/dev/null | tr ' ' '\n' | grep -E '^(init-)?fluid-fuse$')
if [[ -n "$containers" ]]; then
for container in ${containers}; do
kubectl logs "${po}" -c "${container}" -n "${namespace}" &>"$diagnose_dir/pods-${namespace}-serverless/${po}-${container}.log" 2>&1
done
Comment thread
Ayush-Patel-56 marked this conversation as resolved.
fi
done
fi
return
}

core_component() {
# namespace container selectors...
local namespace="$1"
Expand Down Expand Up @@ -105,6 +153,7 @@ pd_collect() {
pod_status "${fluid_namespace}"
pod_status "${runtime_namespace}"
runtime_pod_logs
serverless_pod_logs
fluid_pod_logs
kubectl_resource
archive
Expand Down
51 changes: 50 additions & 1 deletion tools/diagnose-fluid-curvine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,16 @@ print_usage() {
run() {
echo
echo "-----------------run $*------------------"
timeout 10s "$@"
if command -v timeout >/dev/null 2>&1; then
timeout 10s "$@"
elif command -v gtimeout >/dev/null 2>&1; then
gtimeout 10s "$@"
elif command -v perl >/dev/null 2>&1; then
# Use Perl to enforce timeout on systems without GNU coreutils (like standard macOS)
perl -e 'alarm shift; exec @ARGV' 10 "$@"
else
"$@"
fi
if [ $? != 0 ]; then
echo "failed to collect info: $*"
fi
Expand Down Expand Up @@ -49,6 +58,45 @@ runtime_pod_logs() {
core_component "${runtime_namespace}" "client" "cacheruntime.fluid.io/component-name=${runtime_name}-client"
}

serverless_pod_logs() {
# Check if kubectl is available
if ! command -v kubectl >/dev/null 2>&1; then
echo "kubectl not found, skipping serverless pod logs collection"
return
fi

local namespace="${runtime_namespace}"
local dataset_id="${runtime_namespace}-${runtime_name}"
# fluid.io/dataset falls back to the Dataset UID when namespace-name >= 63 chars (DNS1035 limit)
if [[ ${#dataset_id} -ge 63 ]]; then
dataset_id=$(kubectl get dataset "${runtime_name}" -n "${namespace}" -o jsonpath='{.metadata.uid}' 2>/dev/null) || dataset_id="${runtime_namespace}-${runtime_name}"
fi
local label_selector="serverless.fluid.io/inject=true,fluid.io/dataset=${dataset_id}"

# Get all pods with the serverless inject label
local pods
pods=$(kubectl get po -n "${namespace}" -l "${label_selector}" -o jsonpath='{.items[*].metadata.name}' 2>/dev/null)
if [[ $? -ne 0 ]]; then
echo "failed to get serverless pods in namespace ${namespace}"
return
fi

Comment thread
Ayush-Patel-56 marked this conversation as resolved.
Comment thread
Ayush-Patel-56 marked this conversation as resolved.
Comment thread
Ayush-Patel-56 marked this conversation as resolved.
if [[ -n "$pods" ]]; then
mkdir -p "$diagnose_dir/pods-${namespace}-serverless"
for po in ${pods}; do
# Find all containers containing fluid-fuse (covers init-fluid-fuse and fluid-fuse)
local containers
containers=$(kubectl get po "${po}" -n "${namespace}" -o jsonpath='{.spec.initContainers[*].name} {.spec.containers[*].name}' 2>/dev/null | tr ' ' '\n' | grep -E '^(init-)?fluid-fuse$')
if [[ -n "$containers" ]]; then
for container in ${containers}; do
kubectl logs "${po}" -c "${container}" -n "${namespace}" &>"$diagnose_dir/pods-${namespace}-serverless/${po}-${container}.log" 2>&1
done
Comment thread
Ayush-Patel-56 marked this conversation as resolved.
fi
done
fi
return
}

core_component() {
# namespace container selectors...
local namespace="$1"
Expand Down Expand Up @@ -92,6 +140,7 @@ pd_collect() {
pod_status "${fluid_namespace}"
pod_status "${runtime_namespace}"
runtime_pod_logs
serverless_pod_logs
fluid_pod_logs
kubectl_resource
archive
Expand Down
51 changes: 50 additions & 1 deletion tools/diagnose-fluid-jindo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,16 @@ print_usage() {
run() {
echo
echo "-----------------run $*------------------"
timeout 10s "$@"
if command -v timeout >/dev/null 2>&1; then
timeout 10s "$@"
elif command -v gtimeout >/dev/null 2>&1; then
gtimeout 10s "$@"
elif command -v perl >/dev/null 2>&1; then
# Use Perl to enforce timeout on systems without GNU coreutils (like standard macOS)
perl -e 'alarm shift; exec @ARGV' 10 "$@"
else
"$@"
fi
if [ $? != 0 ]; then
echo "failed to collect info: $*"
fi
Expand Down Expand Up @@ -55,6 +64,45 @@ runtime_pod_logs() {
core_component "${runtime_namespace}" "jindofs-fuse" "role=jindofs-fuse" "release=${runtime_name}"
}

serverless_pod_logs() {
# Check if kubectl is available
if ! command -v kubectl >/dev/null 2>&1; then
echo "kubectl not found, skipping serverless pod logs collection"
return
fi

local namespace="${runtime_namespace}"
local dataset_id="${runtime_namespace}-${runtime_name}"
# fluid.io/dataset falls back to the Dataset UID when namespace-name >= 63 chars (DNS1035 limit)
if [[ ${#dataset_id} -ge 63 ]]; then
dataset_id=$(kubectl get dataset "${runtime_name}" -n "${namespace}" -o jsonpath='{.metadata.uid}' 2>/dev/null) || dataset_id="${runtime_namespace}-${runtime_name}"
fi
local label_selector="serverless.fluid.io/inject=true,fluid.io/dataset=${dataset_id}"

Comment thread
Ayush-Patel-56 marked this conversation as resolved.
# Get all pods with the serverless inject label
local pods
pods=$(kubectl get po -n "${namespace}" -l "${label_selector}" -o jsonpath='{.items[*].metadata.name}' 2>/dev/null)
if [[ $? -ne 0 ]]; then
echo "failed to get serverless pods in namespace ${namespace}"
return
fi

if [[ -n "$pods" ]]; then
mkdir -p "$diagnose_dir/pods-${namespace}-serverless"
for po in ${pods}; do
# Find all containers containing fluid-fuse (covers init-fluid-fuse and fluid-fuse)
local containers
containers=$(kubectl get po "${po}" -n "${namespace}" -o jsonpath='{.spec.initContainers[*].name} {.spec.containers[*].name}' 2>/dev/null | tr ' ' '\n' | grep -E '^(init-)?fluid-fuse$')
if [[ -n "$containers" ]]; then
for container in ${containers}; do
kubectl logs "${po}" -c "${container}" -n "${namespace}" &>"$diagnose_dir/pods-${namespace}-serverless/${po}-${container}.log" 2>&1
done
Comment thread
Ayush-Patel-56 marked this conversation as resolved.
fi
done
fi
return
}

core_component() {
# namespace container selectors...
local namespace="$1"
Expand Down Expand Up @@ -99,6 +147,7 @@ pd_collect() {
pod_status "${fluid_namespace}"
pod_status "${runtime_namespace}"
runtime_pod_logs
serverless_pod_logs
fluid_pod_logs
kubectl_resource
archive
Expand Down
51 changes: 50 additions & 1 deletion tools/diagnose-fluid-juicefs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,16 @@ print_usage() {
run() {
echo
echo "-----------------run $*------------------"
timeout 10s "$@"
if command -v timeout >/dev/null 2>&1; then
timeout 10s "$@"
elif command -v gtimeout >/dev/null 2>&1; then
gtimeout 10s "$@"
elif command -v perl >/dev/null 2>&1; then
# Use Perl to enforce timeout on systems without GNU coreutils (like standard macOS)
perl -e 'alarm shift; exec @ARGV' 10 "$@"
else
"$@"
fi
if [ $? != 0 ]; then
echo "failed to collect info: $*"
fi
Expand Down Expand Up @@ -54,6 +63,45 @@ runtime_pod_logs() {
core_component "${runtime_namespace}" "juicefs-fuse" "role=juicefs-fuse" "release=${runtime_name}"
}

serverless_pod_logs() {
# Check if kubectl is available
if ! command -v kubectl >/dev/null 2>&1; then
echo "kubectl not found, skipping serverless pod logs collection"
return
fi

local namespace="${runtime_namespace}"
local dataset_id="${runtime_namespace}-${runtime_name}"
# fluid.io/dataset falls back to the Dataset UID when namespace-name >= 63 chars (DNS1035 limit)
if [[ ${#dataset_id} -ge 63 ]]; then
dataset_id=$(kubectl get dataset "${runtime_name}" -n "${namespace}" -o jsonpath='{.metadata.uid}' 2>/dev/null) || dataset_id="${runtime_namespace}-${runtime_name}"
fi
local label_selector="serverless.fluid.io/inject=true,fluid.io/dataset=${dataset_id}"

# Get all pods with the serverless inject label
local pods
pods=$(kubectl get po -n "${namespace}" -l "${label_selector}" -o jsonpath='{.items[*].metadata.name}' 2>/dev/null)
if [[ $? -ne 0 ]]; then
echo "failed to get serverless pods in namespace ${namespace}"
return
fi

if [[ -n "$pods" ]]; then
mkdir -p "$diagnose_dir/pods-${namespace}-serverless"
for po in ${pods}; do
# Find all containers containing fluid-fuse (covers init-fluid-fuse and fluid-fuse)
local containers
containers=$(kubectl get po "${po}" -n "${namespace}" -o jsonpath='{.spec.initContainers[*].name} {.spec.containers[*].name}' 2>/dev/null | tr ' ' '\n' | grep -E '^(init-)?fluid-fuse$')
if [[ -n "$containers" ]]; then
for container in ${containers}; do
kubectl logs "${po}" -c "${container}" -n "${namespace}" &>"$diagnose_dir/pods-${namespace}-serverless/${po}-${container}.log" 2>&1
done
Comment thread
Ayush-Patel-56 marked this conversation as resolved.
fi
done
fi
return
}

core_component() {
# namespace container selectors...
local namespace="$1"
Expand Down Expand Up @@ -98,6 +146,7 @@ pd_collect() {
pod_status "${fluid_namespace}"
pod_status "${runtime_namespace}"
runtime_pod_logs
serverless_pod_logs
fluid_pod_logs
kubectl_resource
archive
Expand Down
Loading