بنقرة واحدة
oleander-spark-submit
How to submit, monitor, and configure Spark jobs on oleander using the CLI & TypeScript SDK.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
How to submit, monitor, and configure Spark jobs on oleander using the CLI & TypeScript SDK.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
| name | oleander-spark-submit |
| description | How to submit, monitor, and configure Spark jobs on oleander using the CLI & TypeScript SDK. |
Use this skill when submitting Spark jobs to oleander, monitoring run state, or building automated workflows that execute Spark jobs.
Upload a script and submit it from the terminal:
oleander spark jobs submit my_job.py \
--namespace my_namespace \
--name my-job-name \
--wait
With arguments passed to the script:
oleander spark jobs submit my_job.py \
--namespace my_namespace \
--name my-job-name \
--wait \
--args "--input-table oleander.default.sf_311 --output-catalog oleander.results"
--wait blocks until the run reaches a terminal state (COMPLETE, FAIL, or ABORT).
Use @oleanderhq/sdk to submit jobs programmatically:
import { Oleander, RunNotFoundError } from "@oleanderhq/sdk";
const oleander = new Oleander(); // reads OLEANDER_API_KEY from env
const { runId } = await oleander.submitSparkJob({
cluster: "oleander",
namespace: "my_namespace",
name: "my-job-name",
entrypoint: "my_job.py",
});
Submit and wait for completion with built-in polling:
const result = await oleander.submitSparkJobAndWait({
cluster: "oleander",
namespace: "my_namespace",
name: "my-job-name",
entrypoint: "my_job.py",
});
When not using submitSparkJobAndWait, poll manually with getRun:
import { Oleander, RunNotFoundError } from "@oleanderhq/sdk";
const oleander = new Oleander();
const { runId } = await oleander.submitSparkJob({ ... });
const started = Date.now();
const timeoutMs = 900_000; // 15 minutes
let notFoundRetries = 10;
while (Date.now() - started < timeoutMs) {
await wait.for({ seconds: 60 });
try {
const run = await oleander.getRun(runId);
const state = run.state ?? "";
if (state === "COMPLETE" || state === "FAIL" || state === "ABORT") {
return { runId, state, run };
}
} catch (error) {
if (error instanceof RunNotFoundError) {
notFoundRetries--;
if (notFoundRetries <= 0) throw error;
continue; // run may not be visible yet; retry
}
throw error;
}
}
throw new Error(`Timeout waiting for run ${runId}`);
Always handle RunNotFoundError — a freshly submitted run may not be immediately visible.
| Cluster | Use case |
|---|---|
"oleander" | Default managed Spark cluster |
"emr-serverless" | AWS EMR Serverless |
"glue" | AWS Glue |
Use "oleander" unless you have a specific reason to use a different backend.
Machine types follow the pattern spark.<size>.<class>:
b (balanced), c (compute), m (memory)1 through 16spark.1.b for both driver and executorsChoose memory-optimized (m) when joins or aggregations spill. Choose compute-optimized (c) for CPU-bound transformations.
argparse arguments, not hardcoded.sys.exit(2)), not just a log message.