Skip to content
Closed
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
80 changes: 76 additions & 4 deletions kcl/alluxio/posix_read/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3462,16 +3462,52 @@ jobs:
require_secret() {
[[ -n "${!1:-}" && "${!1}" != '$('* ]] || fail "Required secret pipeline variable $1 is missing"
}
resource_failure_details() {
local kind="$1" name="$2" pods pod
# Project status only: the resource spec and annotations can contain the license or SAS.
if ! kubectl get "$kind" "$name" -n alx-ns -o json |
jq '{
name: .metadata.name,
status: (.status | {phase, state, reason, message, error, conditions})
} | walk(if type == "string" then
reduce ([env.ALLUXIO_LICENSE_STRING, env.BLOB_SAS][] | select(. != null and . != "")) as $secret
(.; split($secret) | join("<redacted>"))
else . end)' | redact >&2; then
echo "Could not collect status for $kind/$name" >&2
fi
if [[ "$kind" == license ]]; then
if ! pods="$(kubectl get pods -n alluxio-operator -o json |
jq -r '.items[] | select(.metadata.name | startswith("alluxio-license-controller-")) | .metadata.name')"; then
echo "Could not list the license-controller pods" >&2
return 0
fi
[[ -n "$pods" ]] || echo "No license-controller pods found" >&2
for pod in $pods; do
echo "Recent license-controller logs: $pod" >&2
if ! kubectl logs -n alluxio-operator "$pod" --all-containers=true --tail=100 --since=10m |
jq -Rs -r 'reduce ([env.ALLUXIO_LICENSE_STRING, env.BLOB_SAS][] | select(. != null and . != "")) as $secret
(.; split($secret) | join("<redacted>"))' | redact >&2; then
echo "Could not collect logs for $pod" >&2
fi
done
fi
}
wait_phase() {
local kind="$1" name="$2" field="$3" expected="$4" phase deadline=$((SECONDS + 900))
while :; do
phase="$(kubectl get \
"$kind" "$name" -n alx-ns -o "jsonpath={.status.$field}")"
[[ "$phase" != "$expected" ]] || return 0
case "$phase" in
Failed|Error|Terminated) fail "$kind/$name failed; inspect securely in cluster" ;;
Failed|Error|Terminated)
resource_failure_details "$kind" "$name"
fail "$kind/$name failed; see status and controller diagnostics above"
;;
esac
(( SECONDS < deadline )) || fail "$kind/$name did not reach $expected before timeout"
if (( SECONDS >= deadline )); then
resource_failure_details "$kind" "$name"
fail "$kind/$name did not reach $expected before timeout; see diagnostics above"
fi
sleep 10
done
}
Expand Down Expand Up @@ -3538,16 +3574,52 @@ jobs:
require_secret() {
[[ -n "${!1:-}" && "${!1}" != '$('* ]] || fail "Required secret pipeline variable $1 is missing"
}
resource_failure_details() {
local kind="$1" name="$2" pods pod
# Project status only: the resource spec and annotations can contain the license or SAS.
if ! kubectl get "$kind" "$name" -n alx-ns -o json |
jq '{
name: .metadata.name,
status: (.status | {phase, state, reason, message, error, conditions})
} | walk(if type == "string" then
reduce ([env.ALLUXIO_LICENSE_STRING, env.BLOB_SAS][] | select(. != null and . != "")) as $secret
(.; split($secret) | join("<redacted>"))
else . end)' | redact >&2; then
echo "Could not collect status for $kind/$name" >&2
fi
if [[ "$kind" == license ]]; then
if ! pods="$(kubectl get pods -n alluxio-operator -o json |
jq -r '.items[] | select(.metadata.name | startswith("alluxio-license-controller-")) | .metadata.name')"; then
echo "Could not list the license-controller pods" >&2
return 0
fi
[[ -n "$pods" ]] || echo "No license-controller pods found" >&2
for pod in $pods; do
echo "Recent license-controller logs: $pod" >&2
if ! kubectl logs -n alluxio-operator "$pod" --all-containers=true --tail=100 --since=10m |
jq -Rs -r 'reduce ([env.ALLUXIO_LICENSE_STRING, env.BLOB_SAS][] | select(. != null and . != "")) as $secret
(.; split($secret) | join("<redacted>"))' | redact >&2; then
echo "Could not collect logs for $pod" >&2
fi
done
fi
}
wait_phase() {
local kind="$1" name="$2" field="$3" expected="$4" phase deadline=$((SECONDS + 900))
while :; do
phase="$(kubectl get \
"$kind" "$name" -n alx-ns -o "jsonpath={.status.$field}")"
[[ "$phase" != "$expected" ]] || return 0
case "$phase" in
Failed|Error|Terminated) fail "$kind/$name failed; inspect securely in cluster" ;;
Failed|Error|Terminated)
resource_failure_details "$kind" "$name"
fail "$kind/$name failed; see status and controller diagnostics above"
;;
esac
(( SECONDS < deadline )) || fail "$kind/$name did not reach $expected before timeout"
if (( SECONDS >= deadline )); then
resource_failure_details "$kind" "$name"
fail "$kind/$name did not reach $expected before timeout; see diagnostics above"
fi
sleep 10
done
}
Expand Down
160 changes: 152 additions & 8 deletions kcl/alluxio/s3_read/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -565,16 +565,52 @@ jobs:
require_secret() {
[[ -n "${!1:-}" && "${!1}" != '$('* ]] || fail "Required secret pipeline variable $1 is missing"
}
resource_failure_details() {
local kind="$1" name="$2" pods pod
# Project status only: the resource spec and annotations can contain the license or SAS.
if ! kubectl get "$kind" "$name" -n alx-ns -o json |
jq '{
name: .metadata.name,
status: (.status | {phase, state, reason, message, error, conditions})
} | walk(if type == "string" then
reduce ([env.ALLUXIO_LICENSE_STRING, env.BLOB_SAS][] | select(. != null and . != "")) as $secret
(.; split($secret) | join("<redacted>"))
else . end)' | redact >&2; then
echo "Could not collect status for $kind/$name" >&2
fi
if [[ "$kind" == license ]]; then
if ! pods="$(kubectl get pods -n alluxio-operator -o json |
jq -r '.items[] | select(.metadata.name | startswith("alluxio-license-controller-")) | .metadata.name')"; then
echo "Could not list the license-controller pods" >&2
return 0
fi
[[ -n "$pods" ]] || echo "No license-controller pods found" >&2
for pod in $pods; do
echo "Recent license-controller logs: $pod" >&2
if ! kubectl logs -n alluxio-operator "$pod" --all-containers=true --tail=100 --since=10m |
jq -Rs -r 'reduce ([env.ALLUXIO_LICENSE_STRING, env.BLOB_SAS][] | select(. != null and . != "")) as $secret
(.; split($secret) | join("<redacted>"))' | redact >&2; then
echo "Could not collect logs for $pod" >&2
fi
done
fi
}
wait_phase() {
local kind="$1" name="$2" field="$3" expected="$4" phase deadline=$((SECONDS + 900))
while :; do
phase="$(kubectl get \
"$kind" "$name" -n alx-ns -o "jsonpath={.status.$field}")"
[[ "$phase" != "$expected" ]] || return 0
case "$phase" in
Failed|Error|Terminated) fail "$kind/$name failed; inspect securely in cluster" ;;
Failed|Error|Terminated)
resource_failure_details "$kind" "$name"
fail "$kind/$name failed; see status and controller diagnostics above"
;;
esac
(( SECONDS < deadline )) || fail "$kind/$name did not reach $expected before timeout"
if (( SECONDS >= deadline )); then
resource_failure_details "$kind" "$name"
fail "$kind/$name did not reach $expected before timeout; see diagnostics above"
fi
sleep 10
done
}
Expand Down Expand Up @@ -641,16 +677,52 @@ jobs:
require_secret() {
[[ -n "${!1:-}" && "${!1}" != '$('* ]] || fail "Required secret pipeline variable $1 is missing"
}
resource_failure_details() {
local kind="$1" name="$2" pods pod
# Project status only: the resource spec and annotations can contain the license or SAS.
if ! kubectl get "$kind" "$name" -n alx-ns -o json |
jq '{
name: .metadata.name,
status: (.status | {phase, state, reason, message, error, conditions})
} | walk(if type == "string" then
reduce ([env.ALLUXIO_LICENSE_STRING, env.BLOB_SAS][] | select(. != null and . != "")) as $secret
(.; split($secret) | join("<redacted>"))
else . end)' | redact >&2; then
echo "Could not collect status for $kind/$name" >&2
fi
if [[ "$kind" == license ]]; then
if ! pods="$(kubectl get pods -n alluxio-operator -o json |
jq -r '.items[] | select(.metadata.name | startswith("alluxio-license-controller-")) | .metadata.name')"; then
echo "Could not list the license-controller pods" >&2
return 0
fi
[[ -n "$pods" ]] || echo "No license-controller pods found" >&2
for pod in $pods; do
echo "Recent license-controller logs: $pod" >&2
if ! kubectl logs -n alluxio-operator "$pod" --all-containers=true --tail=100 --since=10m |
jq -Rs -r 'reduce ([env.ALLUXIO_LICENSE_STRING, env.BLOB_SAS][] | select(. != null and . != "")) as $secret
(.; split($secret) | join("<redacted>"))' | redact >&2; then
echo "Could not collect logs for $pod" >&2
fi
done
fi
}
wait_phase() {
local kind="$1" name="$2" field="$3" expected="$4" phase deadline=$((SECONDS + 900))
while :; do
phase="$(kubectl get \
"$kind" "$name" -n alx-ns -o "jsonpath={.status.$field}")"
[[ "$phase" != "$expected" ]] || return 0
case "$phase" in
Failed|Error|Terminated) fail "$kind/$name failed; inspect securely in cluster" ;;
Failed|Error|Terminated)
resource_failure_details "$kind" "$name"
fail "$kind/$name failed; see status and controller diagnostics above"
;;
esac
(( SECONDS < deadline )) || fail "$kind/$name did not reach $expected before timeout"
if (( SECONDS >= deadline )); then
resource_failure_details "$kind" "$name"
fail "$kind/$name did not reach $expected before timeout; see diagnostics above"
fi
sleep 10
done
}
Expand Down Expand Up @@ -714,16 +786,52 @@ jobs:
require_secret() {
[[ -n "${!1:-}" && "${!1}" != '$('* ]] || fail "Required secret pipeline variable $1 is missing"
}
resource_failure_details() {
local kind="$1" name="$2" pods pod
# Project status only: the resource spec and annotations can contain the license or SAS.
if ! kubectl get "$kind" "$name" -n alx-ns -o json |
jq '{
name: .metadata.name,
status: (.status | {phase, state, reason, message, error, conditions})
} | walk(if type == "string" then
reduce ([env.ALLUXIO_LICENSE_STRING, env.BLOB_SAS][] | select(. != null and . != "")) as $secret
(.; split($secret) | join("<redacted>"))
else . end)' | redact >&2; then
echo "Could not collect status for $kind/$name" >&2
fi
if [[ "$kind" == license ]]; then
if ! pods="$(kubectl get pods -n alluxio-operator -o json |
jq -r '.items[] | select(.metadata.name | startswith("alluxio-license-controller-")) | .metadata.name')"; then
echo "Could not list the license-controller pods" >&2
return 0
fi
[[ -n "$pods" ]] || echo "No license-controller pods found" >&2
for pod in $pods; do
echo "Recent license-controller logs: $pod" >&2
if ! kubectl logs -n alluxio-operator "$pod" --all-containers=true --tail=100 --since=10m |
jq -Rs -r 'reduce ([env.ALLUXIO_LICENSE_STRING, env.BLOB_SAS][] | select(. != null and . != "")) as $secret
(.; split($secret) | join("<redacted>"))' | redact >&2; then
echo "Could not collect logs for $pod" >&2
fi
done
fi
}
wait_phase() {
local kind="$1" name="$2" field="$3" expected="$4" phase deadline=$((SECONDS + 900))
while :; do
phase="$(kubectl get \
"$kind" "$name" -n alx-ns -o "jsonpath={.status.$field}")"
[[ "$phase" != "$expected" ]] || return 0
case "$phase" in
Failed|Error|Terminated) fail "$kind/$name failed; inspect securely in cluster" ;;
Failed|Error|Terminated)
resource_failure_details "$kind" "$name"
fail "$kind/$name failed; see status and controller diagnostics above"
;;
esac
(( SECONDS < deadline )) || fail "$kind/$name did not reach $expected before timeout"
if (( SECONDS >= deadline )); then
resource_failure_details "$kind" "$name"
fail "$kind/$name did not reach $expected before timeout; see diagnostics above"
fi
sleep 10
done
}
Expand Down Expand Up @@ -787,16 +895,52 @@ jobs:
require_secret() {
[[ -n "${!1:-}" && "${!1}" != '$('* ]] || fail "Required secret pipeline variable $1 is missing"
}
resource_failure_details() {
local kind="$1" name="$2" pods pod
# Project status only: the resource spec and annotations can contain the license or SAS.
if ! kubectl get "$kind" "$name" -n alx-ns -o json |
jq '{
name: .metadata.name,
status: (.status | {phase, state, reason, message, error, conditions})
} | walk(if type == "string" then
reduce ([env.ALLUXIO_LICENSE_STRING, env.BLOB_SAS][] | select(. != null and . != "")) as $secret
(.; split($secret) | join("<redacted>"))
else . end)' | redact >&2; then
echo "Could not collect status for $kind/$name" >&2
fi
if [[ "$kind" == license ]]; then
if ! pods="$(kubectl get pods -n alluxio-operator -o json |
jq -r '.items[] | select(.metadata.name | startswith("alluxio-license-controller-")) | .metadata.name')"; then
echo "Could not list the license-controller pods" >&2
return 0
fi
[[ -n "$pods" ]] || echo "No license-controller pods found" >&2
for pod in $pods; do
echo "Recent license-controller logs: $pod" >&2
if ! kubectl logs -n alluxio-operator "$pod" --all-containers=true --tail=100 --since=10m |
jq -Rs -r 'reduce ([env.ALLUXIO_LICENSE_STRING, env.BLOB_SAS][] | select(. != null and . != "")) as $secret
(.; split($secret) | join("<redacted>"))' | redact >&2; then
echo "Could not collect logs for $pod" >&2
fi
done
fi
}
wait_phase() {
local kind="$1" name="$2" field="$3" expected="$4" phase deadline=$((SECONDS + 900))
while :; do
phase="$(kubectl get \
"$kind" "$name" -n alx-ns -o "jsonpath={.status.$field}")"
[[ "$phase" != "$expected" ]] || return 0
case "$phase" in
Failed|Error|Terminated) fail "$kind/$name failed; inspect securely in cluster" ;;
Failed|Error|Terminated)
resource_failure_details "$kind" "$name"
fail "$kind/$name failed; see status and controller diagnostics above"
;;
esac
(( SECONDS < deadline )) || fail "$kind/$name did not reach $expected before timeout"
if (( SECONDS >= deadline )); then
resource_failure_details "$kind" "$name"
fail "$kind/$name did not reach $expected before timeout; see diagnostics above"
fi
sleep 10
done
}
Expand Down
Loading
Loading