diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 04756f3..257c8d8 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -50,6 +50,8 @@ jobs: KV_NAMESPACE_ID: ${{ secrets.KV_NAMESPACE_ID }} ALLOW_APP_DB_AS_TARGET: ${{ vars.ALLOW_APP_DB_AS_TARGET }} LIVY_JARS_DIR: ${{ vars.LIVY_JARS_DIR }} + CRON_SCHEDULE: ${{ vars.CRON_SCHEDULE }} + WAKER_SIGNING_KEY: ${{ secrets.WAKER_SIGNING_KEY }} run: node scripts/patch-wrangler.mjs wrangler.toml - name: Write secrets file @@ -58,6 +60,7 @@ jobs: SETUP_SECRET: ${{ secrets.SETUP_SECRET }} CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} ENCRYPTION_KEY: ${{ secrets.ENCRYPTION_KEY }} + WAKER_SIGNING_KEY: ${{ secrets.WAKER_SIGNING_KEY }} run: | set -euo pipefail umask 077 @@ -76,6 +79,12 @@ jobs: --arg ENCRYPTION_KEY "${ENCRYPTION_KEY}" \ '{JWT_SECRET: $JWT_SECRET, SETUP_SECRET: $SETUP_SECRET, CLOUDFLARE_API_TOKEN: $CLOUDFLARE_API_TOKEN, ENCRYPTION_KEY: $ENCRYPTION_KEY}' \ > "$RUNNER_TEMP/secrets.json" + # Optional: include only when configured (tech-scheme §7 red line 6 — empty means off). + if [ -n "${WAKER_SIGNING_KEY:-}" ]; then + jq --arg WAKER_SIGNING_KEY "${WAKER_SIGNING_KEY}" \ + '. + {WAKER_SIGNING_KEY: $WAKER_SIGNING_KEY}' "$RUNNER_TEMP/secrets.json" > "$RUNNER_TEMP/secrets.json.tmp" + mv "$RUNNER_TEMP/secrets.json.tmp" "$RUNNER_TEMP/secrets.json" + fi chmod 0600 "$RUNNER_TEMP/secrets.json" - name: Deploy Worker diff --git a/web/src/lib/translations.ts b/web/src/lib/translations.ts index 58c463a..e1f8e4d 100644 --- a/web/src/lib/translations.ts +++ b/web/src/lib/translations.ts @@ -595,6 +595,7 @@ export const translations: Record> = { 'livy.no_logs': 'No log output available.', 'livy.close_logs': 'Close Log', 'livy.loading': 'Loading…', + 'livy.log_truncated': 'Log truncated — showing the tail only.', }, zh: { // App @@ -1171,6 +1172,7 @@ export const translations: Record> = { 'livy.no_logs': '暂无日志输出。', 'livy.close_logs': '收起日志', 'livy.loading': '加载中…', + 'livy.log_truncated': '日志已截断,仅保留尾部。', }, } diff --git a/web/src/pages/SparkJobs.tsx b/web/src/pages/SparkJobs.tsx index 1c5cd0b..81408d7 100644 --- a/web/src/pages/SparkJobs.tsx +++ b/web/src/pages/SparkJobs.tsx @@ -17,6 +17,7 @@ export default function SparkJobsPage() { const [logLines, setLogLines] = useState([]) const [logLoading, setLogLoading] = useState(false) const [logError, setLogError] = useState('') + const [logTruncated, setLogTruncated] = useState(false) const [terminatingBatchId, setTerminatingBatchId] = useState(null) const [actionError, setActionError] = useState('') const [sparkUiError, setSparkUiError] = useState('') @@ -45,10 +46,12 @@ export default function SparkJobsPage() { setActiveBatchId(batchId) setLogLoading(true) setLogError('') + setLogTruncated(false) try { const res = await livyApi.getBatchLog(id, batchId, { size: 100 }) let lines = res.log || [] - if (typeof res.total === 'number' && res.total > 100) { + // An archived body (terminal batch) is already the tail, so no second tail fetch is needed. + if (!res.archived && !res.truncated && typeof res.total === 'number' && res.total > 100) { const tail = await livyApi.getBatchLog(id, batchId, { from: Math.max(0, res.total - 100), size: 100, @@ -56,6 +59,7 @@ export default function SparkJobsPage() { lines = tail.log || [] } setLogLines(lines) + setLogTruncated(res.truncated === true) } catch (err) { setLogError(err instanceof Error ? err.message : t('errors.generic')) } finally { @@ -219,9 +223,14 @@ export default function SparkJobsPage() {
- - {t('livy.batch_logs')} · #{batchId} - +
+ + {t('livy.batch_logs')} · #{batchId} + + {logTruncated && ( + {t('livy.log_truncated')} + )} +