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
9 changes: 8 additions & 1 deletion .github/workflows/gpu_jax.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,14 @@ concurrency:
jobs:
skyrl_jax_gpu_tests:
# Forks inherit these workflows but not the secrets they need -- only run upstream.
if: github.repository == 'NovaSky-AI/SkyRL'
# A pull request from a fork runs in the upstream repository, but GitHub does not
# pass secrets to it, so the Anyscale login fails. Skip the job for those too.
if: >
github.repository == 'NovaSky-AI/SkyRL' &&
(
github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name == github.repository
)
runs-on: ubuntu-latest
defaults:
run:
Expand Down
27 changes: 27 additions & 0 deletions ci/submit_anyscale_job.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
# ANYSCALE_API_ATTEMPTS tries per control-plane call (default 6)
# ANYSCALE_JOBS_FILE where submitted job names are recorded, for
# ci/terminate_anyscale_jobs.sh to clean up after a cancel
# ANYSCALE_LOG_TAIL_LINES remote log lines to print on real failure (default 100)

set -euo pipefail

Expand All @@ -68,6 +69,11 @@ API_ATTEMPTS="${ANYSCALE_API_ATTEMPTS:-6}"
TERMINATE_ATTEMPTS="${ANYSCALE_TERMINATE_ATTEMPTS:-5}"
# Consecutive unreadable status polls before we stop waiting on a job.
UNKNOWN_POLL_LIMIT="${ANYSCALE_UNKNOWN_POLL_LIMIT:-10}"
LOG_TAIL_LINES="${ANYSCALE_LOG_TAIL_LINES:-100}"
Comment thread
bvolpato marked this conversation as resolved.
if [[ ! "$LOG_TAIL_LINES" =~ ^[1-9][0-9]*$ ]]; then
echo "ANYSCALE_LOG_TAIL_LINES must be a positive integer; using 100." >&2
LOG_TAIL_LINES=100
fi

API_ERR_LOG="$(mktemp)"

Expand Down Expand Up @@ -231,6 +237,26 @@ ensure_terminal() {
is_terminal "$state"
}

# Best-effort diagnostics for failures after the entrypoint started. Keep this
# bounded because the CI log should show the failure context without replacing
# the job's own output. Do not let a log-fetch failure change the job result.
print_remote_log_tail() {
local job_name="$1"
local logs

echo "--- Anyscale log tail for ${job_name} (last ${LOG_TAIL_LINES} lines) ---" >&2
if ! logs="$(anyscale job logs --cloud "$CLOUD" --name "$job_name" --tail --max-lines "$LOG_TAIL_LINES" 2>/dev/null)"; then
echo "Unable to fetch Anyscale logs for ${job_name}." >&2
return 0

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Failure log fetch skips retries

Medium Severity

print_remote_log_tail issues a single anyscale job logs call and swallows errors, while the same command in entrypoint_produced_logs goes through anyscale_retry. After status polling, that unretried fetch often hits the rate limits this script already documents, so the failure tail never appears and the original job result is all CI still shows.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 628e497. Configure here.

fi

if [[ -n "${logs//[[:space:]]/}" ]]; then
printf '%s\n' "$logs" >&2
else
echo "(no remote logs available)" >&2
fi
}

for ((attempt = 1; attempt <= MAX_ATTEMPTS; attempt++)); do
run_name="$JOB_NAME"
if [[ "$attempt" -gt 1 ]]; then
Expand Down Expand Up @@ -262,6 +288,7 @@ for ((attempt = 1; attempt <= MAX_ATTEMPTS; attempt++)); do

if entrypoint_ran "$runs" "$run_name"; then
echo "Job ${run_name} failed (state: ${state}) but the entrypoint ran -- real failure, not retrying." >&2
print_remote_log_tail "$run_name" || true
exit 1
fi

Expand Down
Loading