chore(docs): update e2e README with new batch job examples - #760
chore(docs): update e2e README with new batch job examples#760Goku2099 wants to merge 8 commits into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @andreyvelich, could you please take a look at this PR when you get a chance? Thanks! |
tariq-hasan
left a comment
There was a problem hiding this comment.
Hi @Goku2099! I have added a few comments.
| 4. For batch job examples: a `spark-operator-spark` ServiceAccount in the target namespace with the required `SparkApplication` RBAC permissions. | ||
|
|
There was a problem hiding this comment.
We should remove this portion as kubeflow/spark-operator#3049 has been marked completed.
| 4. For batch job examples: a `spark-operator-spark` ServiceAccount in the target namespace with the required `SparkApplication` RBAC permissions. |
| ### Batch job tests fail with RBAC or permission errors | ||
|
|
||
| **Cause:** Batch job submission needs a `spark-operator-spark` ServiceAccount with `SparkApplication` RBAC permissions in the target namespace — this is separate from the interactive session prerequisites. | ||
|
|
||
| **Solution:** Verify the ServiceAccount and role bindings exist in the test namespace: | ||
| ```bash | ||
| kubectl get serviceaccount spark-operator-spark -n spark-test | ||
| kubectl get rolebinding -n spark-test | ||
| ``` | ||
|
|
There was a problem hiding this comment.
The same applies for this portion.
| ### Batch job tests fail with RBAC or permission errors | |
| **Cause:** Batch job submission needs a `spark-operator-spark` ServiceAccount with `SparkApplication` RBAC permissions in the target namespace — this is separate from the interactive session prerequisites. | |
| **Solution:** Verify the ServiceAccount and role bindings exist in the test namespace: | |
| ```bash | |
| kubectl get serviceaccount spark-operator-spark -n spark-test | |
| kubectl get rolebinding -n spark-test | |
| ``` |
| **Interactive Sessions** | ||
| - `test_spark_connect_simple_example` - Validates spark_connect_simple.py runs without errors | ||
| - `test_spark_advanced_options_example` - Validates spark_advanced_options.py runs without errors | ||
| - `test_demo_existing_sparkconnect_example` - Validates demo_existing_sparkconnect.py structure (SKIPPED - requires manual port-forward) |
There was a problem hiding this comment.
Please remove this test as it not does exist in test/e2e/spark/test_spark_examples.py.
| - `test_demo_existing_sparkconnect_example` - Validates demo_existing_sparkconnect.py structure (SKIPPED - requires manual port-forward) |
| - `test_spark_connect_simple_example` - Validates spark_connect_simple.py runs without errors | ||
| - `test_spark_advanced_options_example` - Validates spark_advanced_options.py runs without errors | ||
| - `test_demo_existing_sparkconnect_example` - Validates demo_existing_sparkconnect.py structure (SKIPPED - requires manual port-forward) | ||
| - `connect_existing_session.py` - Connects to an existing Spark Connect session via `base_url` (not confirmed to have an automated test — likely requires a running session to connect to, similar to demo_existing_sparkconnect.py) |
There was a problem hiding this comment.
| - `connect_existing_session.py` - Connects to an existing Spark Connect session via `base_url` (not confirmed to have an automated test — likely requires a running session to connect to, similar to demo_existing_sparkconnect.py) | |
| - `test_connect_existing_session_example` - Validates connect_existing_session.py (SKIPPED unless `SPARK_E2E_RUN_IN_CLUSTER=1`; requires in-cluster execution) |
| - `test_spark_advanced_options_example` - Validates spark_advanced_options.py runs without errors | ||
| - `test_demo_existing_sparkconnect_example` - Validates demo_existing_sparkconnect.py structure (SKIPPED - requires manual port-forward) | ||
| - `connect_existing_session.py` - Connects to an existing Spark Connect session via `base_url` (not confirmed to have an automated test — likely requires a running session to connect to, similar to demo_existing_sparkconnect.py) | ||
| - `test_connect_url.py` - Tests URL-based connection to Spark Connect (not confirmed to have an automated test) |
There was a problem hiding this comment.
This should be removed as well.
| - `test_connect_url.py` - Tests URL-based connection to Spark Connect (not confirmed to have an automated test) |
| @@ -8,9 +8,19 @@ | |||
There was a problem hiding this comment.
| ### **test_spark_examples.py** (7 tests) |
| - `test_demo_existing_sparkconnect_example` - Validates demo_existing_sparkconnect.py structure (SKIPPED - requires manual port-forward) | ||
| - `connect_existing_session.py` - Connects to an existing Spark Connect session via `base_url` (not confirmed to have an automated test — likely requires a running session to connect to, similar to demo_existing_sparkconnect.py) | ||
| - `test_connect_url.py` - Tests URL-based connection to Spark Connect (not confirmed to have an automated test) | ||
| **Batch Jobs** |
There was a problem hiding this comment.
We should add a line before starting the batch job section to ensure the header renders properly.
| **Batch Jobs** | |
| **Batch Jobs** |
| ### Specific Test | ||
| ```bash | ||
| uv run pytest test/e2e/spark/test_spark_examples.py::TestSparkExamples::test_spark_connect_simple_example -v | ||
| uv run pytest test/e2e/spark/test_spark_examples.py::TestSparkExamples::test_batch_job_lifecycle_example -v | ||
| ``` |
There was a problem hiding this comment.
One example is sufficient I believe since we just want to illustrate how to run a specific test.
| ### Specific Test | |
| ```bash | |
| uv run pytest test/e2e/spark/test_spark_examples.py::TestSparkExamples::test_spark_connect_simple_example -v | |
| uv run pytest test/e2e/spark/test_spark_examples.py::TestSparkExamples::test_batch_job_lifecycle_example -v | |
| ``` | |
| ### Specific Test | |
| ```bash | |
| uv run pytest test/e2e/spark/test_spark_examples.py::TestSparkExamples::test_spark_connect_simple_example -v |
Signed-off-by: Sameer_yadav <159073326+Goku2099@users.noreply.github.com>
Signed-off-by: Sameer_yadav <159073326+Goku2099@users.noreply.github.com>
Signed-off-by: Sameer_yadav <159073326+Goku2099@users.noreply.github.com>
Signed-off-by: Sameer_yadav <159073326+Goku2099@users.noreply.github.com>
Signed-off-by: Sameer_yadav <159073326+Goku2099@users.noreply.github.com>
|
Hi @tariq-hasan, I’ve addressed the review comments and pushed the updates. Could you please take another look when you get a chance? |
|
Thanks! |
Description:
Updates test/e2e/spark/README.md to reflect the batch job examples added under KEP-107 (batch_job_lifecycle.py, batch_func_job_lifecycle.py, batch_failed_job.py, batch_job_options.py, spark_job.py).
No test logic changes — docs only.