মূল বিষয়বস্তুতে যান

Run Spark Submit (spark-submit) on Kubernetes

ইলুমের একটি সাধারণ স্পার্ক কাজ স্ট্যান্ডার্ডের মাধ্যমে জমা দেওয়া একটির মতোই কাজ করে স্পার্ক-সাবমিট কমান্ড, তবে ব্যবহারের সহজতা, কনফিগারেশন এবং বাহ্যিক সরঞ্জামগুলির সাথে সংহতকরণের জন্য অতিরিক্ত বর্ধন সহ।

আপনি আপনার স্থানীয় স্পার্ক ইনস্টলেশন বা আপনার কাছে থাকা কোনও কাস্টম জার থেকে স্পার্ক উদাহরণ সহ জার ফাইলটি ব্যবহার করতে পারেন।

নীচে একটি সাধারণ স্পার্ক কাজ সেট আপ এবং চালানোর জন্য একটি ধাপে ধাপে গাইড রয়েছে স্পার্ক-সাবমিট on Ilum. This guide demonstrates the core configuration needed and shows how to monitor your job’s progress within the Ilum platform. For a complete overview of Ilum's architecture, check the Architecture Overview.


Quick Start (TL;DR)

How do I run a Spark job on Kubernetes with স্পার্ক-সাবমিট ?

To run a Spark job on Ilum (Kubernetes), ensure Java 17 and Spark 3.5.7 are installed, upload your JAR, and run:

Quick Start: Spark Submit on K8s
./বিন/স্পার্ক-সাবমিট \ 
--মাস্টার k8s://http://<ilum-core-address>:<ilum-core-port> \
--মোতায়েন-মোড ক্লাস্টার \
--class org.apache.spark.examples.SparkPi \
--conf spark.driver.memory=4g \
--conf spark.ilum.cluster=default \
--conf spark.kubernetes.container.image=ilum/spark:3.5.7 \
--conf spark.kubernetes.submission.waitAppCompletion=true \
s3a://ilum-files/spark-examples_2.12-3.5.7.jar

Note: Replace <ilum-core-address> with your actual Ilum Core endpoint.

Step-by-Step Guide

1. Prerequisites

  • নিশ্চিত করুন যে জাভা 17 ইনস্টল করা আছে এবং আপনার মধ্যে সঠিকভাবে সেট করা আছে JAVA_HOME .
  • ডাউনলোড এবং এক্সট্রাক্ট করুন Apache Spark 3.5.7(বা সমতুল্য সংস্করণ):
Download Spark
wget https://dlcdn.apache.org/spark/spark-3.5.7/spark-3.5.7-bin-hadoop3.tgz
tar -xzf spark-3.5.7-bin-hadoop3.tgz
cd spark-3.5.7-bin-hadoop3

2. Connect to Ilum

If Ilum is deployed on Kubernetes, forward the service port to your local machine to make Ilum accessible at লোকালহোস্ট:9888 .

Forward Core
- কুবেক্টল পোর্ট-ফরোয়ার্ড এসভিসি / আইএলইউএম-কোর 9888: 9888 
Production Tip

আপনি যদি একই কুবারনেটস ক্লাস্টারের মধ্যে থেকে যোগাযোগ করছেন তবে আপনি কুবারনেটস ডিএনএস-ভিত্তিক পরিষেবা ঠিকানাগুলি ব্যবহার করতে পারেন (উদাঃ, http://ilum-core.namespace.svc.cluster.local ) or expose services using Ingress.

3. Submit Your Spark Job

Choose the submission method that best fits your workflow:

This method is suitable for quick local testing.

1. Upload your JAR File

For demonstration, we assume the JAR is uploaded manually to MinIO.

  • Locate the example JAR: examples/jars/spark-examples_2.12-3.5.7.jar

  • Upload it to MinIO (bucket ইলুম-ফাইল ). Example path: s3a://ilum-files/spark-examples_2.12-3.5.7.jar

    2. Submit via REST

    Limitation

    spark.ilum.pyRequirements is not supported in this mode, as REST does not support PySpark submissions.

    Run the following command:

    REST Submit
    ./বিন/স্পার্ক-সাবমিট \ 
    --মাস্টার spark://localhost:9888 \
    --মোতায়েন-মোড ক্লাস্টার \
    --class org.apache.spark.examples.SparkPi \
    --conf spark.master.rest.enabled=true \
    --conf spark.ilum.cluster=default \
    --conf spark.app.name=my-spark-job \
    s3a://ilum-files/spark-examples_2.12-3.5.7.jar

    Parameters:

Parameterবর্ণনা
--মাস্টার Ilum Core address via REST (e.g. spark://localhost:9888).
--conf spark.master.rest.enabled=true Enables REST submission.
s3a://... JAR file path in MinIO.
Expected Output
আরইএসটি অ্যাপ্লিকেশন জমা দেওয়ার প্রোটোকল ব্যবহার করে চলমান স্পার্ক। 
25/03/12 12:58:01 INFO RestSubmissionClient: spark://localhost:9888 মধ্যে একটি অ্যাপ্লিকেশন চালু করার জন্য একটি অনুরোধ জমা দেওয়া।
25/03/12 12:58:03 INFO RestSubmissionClient: জমা দেওয়া সফলভাবে 20250312-1158-qdnioef2rny হিসাবে তৈরি করা হয়েছে। ভোট জমা দেওয়ার রাজ্য...
25/03/12 12:58:03 INFO RestSubmissionClient: spark://localhost:9888 সালে 20250312-1158-qdnioef2rny জমা দেওয়ার স্থিতির জন্য একটি অনুরোধ জমা দেওয়া।
25/03/12 12:58:03 INFO RestSubmissionClient: ড্রাইভারের অবস্থা 20250312-1158-qdnioef2rny এখন জমা দেওয়া হয়েছে।
25/03/12 12:58:03 INFO RestSubmissionClient: ড্রাইভার ILUM_UI_ADDRESS/ওয়ার্কলোডস/ডিটেইলস/জব/20250312-1158-qdnioef2rny-এ ওয়ার্কার ILUM এ চলছে।
25/03/12 12:58:03 INFO RestSubmissionClient: সার্ভার ক্রিয়েটসাবমিশনরেসপন্স দিয়ে প্রতিক্রিয়া জানিয়েছে:
{
"ক্রিয়া": "জমা দেওয়ার প্রতিক্রিয়া তৈরি করুন",
"serverSparkVersion" : "3.5.7",
"সাবমিশনআইডি" : "20250312-1158-qdnioef2rny",
"সাফল্য" : সত্য
}
25/03/12 12:58:03 তথ্য শাটডাউনহুকম্যানেজার: শাটডাউন হুক কল করা হয়েছে
25/03/12 12:58:03 INFO ShutdownHookManager: মুছে ফেলা হচ্ছে ডিরেক্টরি /tmp/spark-fa2603be-488a-4e2a-9b7f-5e49825d379b

4. Monitor and Troubleshoot

Using the Ilum UI:

  • কাজের অগ্রগতি পর্যবেক্ষণ করুন: Track executors, memory usage, and job stages.
  • Review Results: Access logs and the integrated Spark History Server.
  • Troubleshoot: Diagnose failures by checking detailed executor logs.

For more details on monitoring metrics, see the Monitoring Guide.


Comparison: Classic spark-submit vs Ilum Approach

Running Spark directly on Kubernetes requires significant administrative effort. Ilum simplifies this by automating infrastructure management.

Traditional Approach (Native Spark on K8s) vs Ilum

বৈশিষ্ট্য Native Spark on K8sIlum (Managed Spark)
SetupManual Docker image build & complex স্পার্ক-সাবমিট args.Automated. Use existing JARs; Ilum handles images.
কনফিগার Verbose (Service Accounts, Volumes, Secrets).Simplified. Minimal args; configs are injected automatically.
সঞ্চয় Manual Hadoop/S3 configuration per job.Integrated. Automatic credential injection for S3/GCS/Azure.
নজরদারি CLI-based (kubectl logs), ephemeral.Centralized UI. Persistent logs, metrics, and history.
পর্যবেক্ষণযোগ্যতা Basic Spark UI (if exposed).উন্নত . উপাত্ত বংশ , detailed resource metrics.

Key Benefits of Ilum:

  1. Automatic Image Selection: Ilum selects a compatible Spark Docker image matching the cluster version.
  2. Advanced Observability: Ilum provides deep lineage observability and advanced monitoring capabilities.
  3. Simplified Configuration: Reduce স্পার্ক-সাবমিট parameters by 3x-4x.
  4. Integrated Storage Access: Credentials for all configured storages are automatically injected.
  5. Instant Monitoring: Logs and metrics (CPU/RAM) appear in the Ilum UI immediately.

For a developer, this means less time fighting with infrastructure and error-prone configurations, and more time delivering business logic.

For advanced customization, refer to the official Spark documentation.