A lightweight Python toolkit for developing and testing AWS Glue jobs locally at no cost. It wraps common Glue and Spark utilities so you can iterate quickly in a Docker-based environment — without spinning up real Glue resources or incurring AWS charges.
Key capabilities:
- Run Glue job logic locally using a containerised Spark session
- Reusable helpers for Glue job setup (
glue_utils.glue) and Spark transformations (glue_utils.spark) - Fast feedback loop via local unit tests and an optional Jupyter Notebook interface
| Module | Purpose |
|---|---|
glue_utils.glue |
Glue job setup and context helpers |
glue_utils.spark |
Spark read/write data and transformation utilities |
- Docker
- docker-compose
docker-compose build glue-dev# lint
docker-compose run glue-dev -c "inv lint"
# Auto fix lint
docker-compose run glue-dev -c "inv lint-fix"
# test
docker-compose run glue-dev -c "inv test"
# run command line in container
docker-compose run glue-devTo interact with Jupyter Notebook and access AWS resources (e.g. read/write data in S3), you may need to log in to AWS locally. We recommend setting up AWS login with the following steps:
Recommended setup for AWS login
-
~/.aws/config- example[sso-session sha-personal] sso_start_url = <sso sign-in url> sso_region = eu-west-2 sso_registration_scopes = sso:account:access [profile sha-personal-etl-user] sso_session = sha-personal sso_account_id = <aws account id> sso_role_name = <sso role> region = eu-west-2 -
~/.zshrc- add customised function to assist loginaws_login_sso() { if [ -z "$1" ]; then echo "Usage: aws_login_sso <profile>" return 1 fi aws sso login --sso-session $(aws configure get sso_session --profile $1) export AWS_PROFILE="$1" echo "successfully login $1, caller identity:" aws sts get-caller-identity --query Arn --output text eval "$(aws configure export-credentials --profile $1 --format env)" }
-
Run AWS login command in terminal
aws_login_sso sha-personal-etl-user
Start Jupyter Notebook
- Run command in terminal
docker-compose run glue-dev -c "jupyter notebook"- After starting the notebook, copy and paste the URL provided in the terminal output to access the notebook.