{"id":17535549,"url":"https://github.com/gizmodata/spark-connect-proxy","last_synced_at":"2025-07-10T20:36:32.963Z","repository":{"id":256848115,"uuid":"856409904","full_name":"gizmodata/spark-connect-proxy","owner":"gizmodata","description":"A reverse proxy server which allows secure connectivity to a Spark Connect server","archived":false,"fork":false,"pushed_at":"2025-01-10T22:20:44.000Z","size":359,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-26T07:43:15.003Z","etag":null,"topics":["apache-spark","aws","emr","gizmodata","ibis","jwt-authentication","proxy","pyspark","spark","spark-connect","spark-connect-server","tls-support"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gizmodata.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-09-12T14:29:57.000Z","updated_at":"2025-06-19T20:50:04.000Z","dependencies_parsed_at":"2024-09-13T11:34:15.819Z","dependency_job_id":"89b1048d-a533-4868-a9ad-63e8981ea5d3","html_url":"https://github.com/gizmodata/spark-connect-proxy","commit_stats":null,"previous_names":["prmoore77/spark-connect-secure-reverse-proxy"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/gizmodata/spark-connect-proxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gizmodata%2Fspark-connect-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gizmodata%2Fspark-connect-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gizmodata%2Fspark-connect-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gizmodata%2Fspark-connect-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gizmodata","download_url":"https://codeload.github.com/gizmodata/spark-connect-proxy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gizmodata%2Fspark-connect-proxy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264652993,"owners_count":23644367,"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":["apache-spark","aws","emr","gizmodata","ibis","jwt-authentication","proxy","pyspark","spark","spark-connect","spark-connect-server","tls-support"],"created_at":"2024-10-20T19:06:59.908Z","updated_at":"2025-07-10T20:36:32.923Z","avatar_url":"https://github.com/gizmodata.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# spark-connect-proxy\nA reverse proxy server which allows secure connectivity to a Spark Connect server.\n\n[\u003cimg src=\"https://img.shields.io/badge/GitHub-gizmodata%2Fspark--connect--proxy-blue.svg?logo=Github\"\u003e](https://github.com/gizmodata/spark-connect-proxy)\n[![spark-connect-proxy-ci](https://github.com/gizmodata/spark-connect-proxy/actions/workflows/ci.yml/badge.svg)](https://github.com/gizmodata/spark-connect-proxy/actions/workflows/ci.yml)\n[![Supported Python Versions](https://img.shields.io/pypi/pyversions/spark-connect-proxy)](https://pypi.org/project/spark-connect-proxy/)\n[![PyPI version](https://badge.fury.io/py/spark-connect-proxy.svg)](https://badge.fury.io/py/spark-connect-proxy)\n[![PyPI Downloads](https://img.shields.io/pypi/dm/spark-connect-proxy.svg)](https://pypi.org/project/spark-connect-proxy/)\n\n# Why?\nBecause [Spark Connect does NOT provide authentication and/or TLS encryption out of the box](https://spark.apache.org/docs/latest/spark-connect-overview.html#client-application-authentication).  This project provides a reverse proxy server which can be used to secure the connection to a Spark Connect server.\n\n# Setup (to run locally)\n\n## Install Python package\nYou can install `spark-connect-proxy` from PyPi or from source.\n\n### Option 1 - from PyPi\n```shell\n# Create the virtual environment\npython3 -m venv .venv\n\n# Activate the virtual environment\n. .venv/bin/activate\n\npip install spark-connect-proxy[client]\n```\n\n### Option 2 - from source - for development\n```shell\ngit clone https://github.com/gizmodata/spark-connect-proxy\n\ncd spark-connect-proxy\n\n# Create the virtual environment\npython3 -m venv .venv\n\n# Activate the virtual environment\n. .venv/bin/activate\n\n# Upgrade pip, setuptools, and wheel\npip install --upgrade pip setuptools wheel\n\n# Install Spark Connect Proxy - in editable mode with client and dev dependencies\npip install --editable .[client,dev]\n```\n\n### Note\nFor the following commands - if you running from source and using `--editable` mode (for development purposes) - you will need to set the PYTHONPATH environment variable as follows:\n```shell\nexport PYTHONPATH=$(pwd)/src\n```\n\n### Usage\nThis repo contains scripts to let you provision an AWS EMR Spark cluster with a secure Spark Connect Proxy server to allow you to securely and remotely connect to it.\n\nFirst - you'll need to open up a port for public access to the AWS EMR Spark Cluster - in addition to the `ssh` port: `22`.  Add port: `50051` as shown here:   \n![Open port 50051](images/emr-public-access.png?raw=true \"Open port 50051\")   \n\n\n\u003e [!NOTE]   \n\u003e Even though you are opening this port to the public, the Spark Connect Proxy will secure it with TLS and JWT Authentication.\n\nThe scripts use the AWS CLI to provision the EMR Spark cluster - so you will need to have the [AWS CLI installed](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html) and configured with your AWS credentials.\n\nYou can create a file in your local copy of the `scripts` directory called `.env` with the following contents:\n```shell\nexport AWS_ACCESS_KEY_ID=\"put value from AWS here\"\nexport AWS_SECRET_ACCESS_KEY=\"put value from AWS here\"\nexport AWS_SESSION_TOKEN=\"put value from AWS here\"\nexport AWS_REGION=\"us-east-2\"\n```\n\nTo provision the EMR Spark cluster - run the following command from the root directory of this repo:\n```shell\nscripts/provision_emr_spark_cluster.sh\n```\n\nThat will output several files (which will be git ignored for security reasons):\n- `tls/ca.crt` - the EMR Spark cluster generated TLS certificate - needed for your PySpark client to trust the Spark Connect Proxy server (b/c it is self-signed)\n- `scripts/output/instance_details.txt` - shows the ssh command for connecting to the master node of the EMR Spark cluster\n- `scripts/output/spark_connect_proxy_details.log` - shows how to run a PySpark Ibis client example - which connects securely from your local computer to the remote EMR Spark cluster.  Example command:\n\n```shell\nspark-connect-proxy-ibis-client-example \\\n  --host ec2-01-01-01-01.us-east-2.compute.amazonaws.com \\\n  --port 50051 \\\n  --use-tls \\\n  --tls-roots tls/ca.crt \\\n  --token honey.badger.dontcare\n```\n\n\u003e [!IMPORTANT]   \n\u003e You must have installed the `spark-connect-proxy` package with the `[client]` extras onto the client computer to run the `spark-connect-proxy-ibis-client-example` command.   \n\n### Handy development commands\n\n#### Version management\n\n##### Bump the version of the application - (you must have installed from source with the [dev] extras)\n```bash\nbumpver update --patch\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgizmodata%2Fspark-connect-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgizmodata%2Fspark-connect-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgizmodata%2Fspark-connect-proxy/lists"}