feat(spark): convert spark job example to Jupyter notebook - #652
feat(spark): convert spark job example to Jupyter notebook#652Ashvatthaa wants to merge 1 commit into
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
|
[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 |
|
🎉 Welcome to the Kubeflow SDK! 🎉 Thanks for opening your first PR! We're happy to have you as part of our community 🚀 Here's what happens next:
Join the community:
Feel free to ask questions in the comments if you need any help or clarification! |
lntutor
left a comment
There was a problem hiding this comment.
The cell immediately before SparkSession.builder is marked cell_type: "code", but after the ## Create a Spark Session comment it contains the bare text Create a Spark session that will be used to execute the example.. Jupyter will execute that as Python and raise a SyntaxError, so the notebook cannot be run top-to-bottom.
Please make this a Markdown cell (like the other section introductions), or turn the prose into a Python comment, before merging.
|
@lntutor: changing LGTM is restricted to collaborators DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
2ea1633 to
59bdbd9
Compare
|
Hi @Ashvatthaa! Thanks for raising the PR. We should leave We would want all the other example modules sitting within |
|
@lntutor Thanks for the review! I moved the explanatory text into a Markdown cell before the SparkSession.builder code cell and updated the notebook. |
|
@tariq-hasan Thanks for the clarification! I'll keep examples/spark/spark_job.py unchanged since it's used by the Spark e2e tests. For this PR, would you prefer that I convert all of the remaining Python example modules under examples/spark into Jupyter notebooks, or would you prefer splitting that work into separate PRs? |
|
I think best to keep the example changes consolidated in this PR as some change will also be needed towards updating the test harness ( |
|
@tariq-hasan Thanks for the clarification. I investigated the existing notebook testing infrastructure and noticed the repository already uses Papermill via make test-e2e-notebook for notebook e2e tests. For the Spark examples, would you like the Spark e2e harness to reuse that notebook execution approach, or do you have a different mechanism in mind for executing the converted notebooks? |
|
@tariq-hasan Any objections to simple run E2E scripts w/ Jupyter Notebooks, and remove all Python examples from We do the same for Trainer: |
|
@andreyvelich That make sense to me - given that the Trainer project follows the same pattern. At this time the Trainer package tests run via the I was looking to get your thoughts on whether these should be consolidated into a single workflow or whether the workflows should remain separate - especially in the context of how e2e for other packages (pipelines, feast, etc.) need to be maintained as well. The difference in the two workflows is primarily in the cluster setup process - Trainer's setup is more involved while Spark uses a different setup. I'm thinking any attempt at possible consolidation - whether it's just cluster setup consolidation or something more involved - can be parked away as part of the common infra setup stream of work and we can keep this PR focused on just the Jupyter Notebook conversion for Spark examples - but it would be good to get your thoughts on this. |
|
@tariq-hasan Thanks for the review! I have updated the PR by: Converting the Spark SDK examples into Jupyter notebooks. Please let me know if there are any additional changes you'd like me to make. |
Summary
This PR converts the
spark_job.pyexample into a Jupyter notebook.Changes
examples/spark/spark_job.pywithexamples/spark/spark_job.ipynbMotivation
Notebook-based examples provide a more interactive learning experience and align the Spark SDK examples with the Trainer examples, making them easier to use in Kubeflow Notebooks.
Fixes #635