Skip to content

chore(docs): update e2e README with new batch job examples - #760

Open
Goku2099 wants to merge 8 commits into
kubeflow:mainfrom
Goku2099:e2e-readme
Open

chore(docs): update e2e README with new batch job examples#760
Goku2099 wants to merge 8 commits into
kubeflow:mainfrom
Goku2099:e2e-readme

Conversation

@Goku2099

Copy link
Copy Markdown
Member

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).

  • Adds descriptions for all interactive session and batch job examples under Test Files
  • Documents the batch job RBAC/ServiceAccount prerequisite
  • Adds troubleshooting entries for batch job RBAC errors and jobs stuck waiting on status
  • Expands Quick Validation to cover all example scripts, not just spark_connect_simple.py

No test logic changes — docs only.

@google-oss-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign astefanutti for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Goku2099

Copy link
Copy Markdown
Member Author

cc @tariq-hasan @Shekharrajak

@Goku2099

Copy link
Copy Markdown
Member Author

Hi @andreyvelich, could you please take a look at this PR when you get a chance? Thanks!

@tariq-hasan tariq-hasan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hi @Goku2099! I have added a few comments.

Comment thread test/e2e/spark/README.md Outdated
Comment on lines +39 to +40
4. For batch job examples: a `spark-operator-spark` ServiceAccount in the target namespace with the required `SparkApplication` RBAC permissions.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should remove this portion as kubeflow/spark-operator#3049 has been marked completed.

Suggested change
4. For batch job examples: a `spark-operator-spark` ServiceAccount in the target namespace with the required `SparkApplication` RBAC permissions.

Comment thread test/e2e/spark/README.md Outdated
Comment on lines +106 to +115
### 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
```

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The same applies for this portion.

Suggested change
### 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
```

Comment thread test/e2e/spark/README.md Outdated
**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)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please remove this test as it not does exist in test/e2e/spark/test_spark_examples.py.

Suggested change
- `test_demo_existing_sparkconnect_example` - Validates demo_existing_sparkconnect.py structure (SKIPPED - requires manual port-forward)

Comment thread test/e2e/spark/README.md Outdated
- `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)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
- `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)

Comment thread test/e2e/spark/README.md Outdated
- `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)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This should be removed as well.

Suggested change
- `test_connect_url.py` - Tests URL-based connection to Spark Connect (not confirmed to have an automated test)

Comment thread test/e2e/spark/README.md Outdated
@@ -8,9 +8,19 @@

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
### **test_spark_examples.py** (7 tests)

Comment thread test/e2e/spark/README.md
- `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**

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should add a line before starting the batch job section to ensure the header renders properly.

Suggested change
**Batch Jobs**
**Batch Jobs**

Comment thread test/e2e/spark/README.md
Comment on lines 48 to 52
### 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
```

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

One example is sufficient I believe since we just want to illustrate how to run a specific test.

Suggested change
### 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>
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>
@google-oss-prow google-oss-prow Bot added size/S and removed size/M labels Aug 30, 2026
@Goku2099

Copy link
Copy Markdown
Member Author

Hi @tariq-hasan, I’ve addressed the review comments and pushed the updates. Could you please take another look when you get a chance?

@tariq-hasan

Copy link
Copy Markdown
Member

Thanks!
/lgtm

@Goku2099

Copy link
Copy Markdown
Member Author

cc @andreyvelich

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants