{"id":20446399,"url":"https://github.com/ray-project/spark-ray-example","last_synced_at":"2025-04-13T00:45:33.853Z","repository":{"id":41067502,"uuid":"264968941","full_name":"ray-project/spark-ray-example","owner":"ray-project","description":"A simple demonstration of embedding Ray in a Spark UDF. For Spark + AI Summit 2020.","archived":false,"fork":false,"pushed_at":"2020-06-27T14:19:45.000Z","size":6057,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-26T18:51:59.758Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ray-project.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-18T14:42:46.000Z","updated_at":"2024-03-21T12:46:33.000Z","dependencies_parsed_at":"2022-09-20T22:02:26.365Z","dependency_job_id":null,"html_url":"https://github.com/ray-project/spark-ray-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ray-project%2Fspark-ray-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ray-project%2Fspark-ray-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ray-project%2Fspark-ray-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ray-project%2Fspark-ray-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ray-project","download_url":"https://codeload.github.com/ray-project/spark-ray-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248650420,"owners_count":21139672,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T10:19:55.526Z","updated_at":"2025-04-13T00:45:33.820Z","avatar_url":"https://github.com/ray-project.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# README - Ray and PySpark Example\n\n[Dean Wampler](mailto:dean@anyscale.com), May 2020\n\nThis repo contains Dean's demo for his talk at Spark + AI Summit 2020.\n\n## Setup\n\n### Java 8\n\nYou will need Java 8 for Spark.\n\nInstall Java 8 from [here](https://www.java.com/en/download/). Once installed, verify the version:\n\n```shell\n$ java -version\njava version \"1.8.0_221\"\nJava(TM) SE Runtime Environment (build 1.8.0_221-b11)\nJava HotSpot(TM) 64-Bit Server VM (build 25.221-b11, mixed mode)\n```\n\n(The patch version `221` may be different.)\n\n### Python 3.6 or 3.7\n\nPython 3.6 or 3.7 is required. PySpark doesn't yet support 3.8.\n\n#### Anaconda\n\nWe recommend using [Anaconda](https://www.anaconda.com/). Installation instructions are [here](https://www.anaconda.com/distribution/).\n\nThen run the following commands to set up the demo environment, including Python 3.7, PySpark, and Ray:\n\n```shell\n$ conda env create -f environment.yml\n$ conda activate spark-ray\n```\n\n#### Pip\n\nIf you prefer to use `pip` instead, first ensure you have a supported version of Python installed:\n\n```shell\n$ python --version\nPython 3.7.7\n```\n\nIf needed, Python installation instructions are [here](https://www.python.org/downloads/).\n\nInstallation instructions for `pip` are [here](https://pip.pypa.io/en/stable/installing/).\n\nNow run the following command to complete the setup.\n\n```shell\n$ pip install -r requirements.txt\n```\n\n## Running the Demo\n\nFirst, start Jupyter Lab as follows:\n\n```shell\n$ jupyter lab\n```\n\nA browser window will open with the UI.\n\nDouble click [Spark-RayUDF.ipynb](Spark-RayUDF.ipynb) to open the notebook and work through the self-contained example.\n\n## Ray Serve Implementation\n\nThere is a second implementation (for completeness), where the UDF makes HTTP requests to a separate service, implemented with [Ray Serve](https://docs.ray.io/en/master/rayserve/overview.html). In other words, Ray _isn't_ embedded in the PySpark UDF for this example. The service invoked could be implemented in any technology.\n\nTo Run this variant, first evaluate all the cells in the [ray-serve/DataGovernanceServer.ipynb](ray-serve/DataGovernanceServer.ipynb) notebook. This runs the server for Data Governance requests.\n\nThen work through the [ray-serve/Spark-RayServiceUDF.ipynb](ray-serve/Spark-RayServiceUDF.ipynb) notebook.\n\n## For More about Ray\n\n* https://ray.io: The entry point for all things Ray\n* Tutorials: https://anyscale.com/academy\n* GitHub repo: https://github.com/ray-project/ray\n* Need help?\n    * Ray Slack: https://ray-distributed.slack.com\n    * [ray-dev](https://groups.google.com/forum/?nomobile=true#!forum/ray-dev) Google group\n* Check out these forthcoming events online: https://anyscale.com/events\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fray-project%2Fspark-ray-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fray-project%2Fspark-ray-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fray-project%2Fspark-ray-example/lists"}