diff --git a/emr-serverless-python-dependencies/.gitignore b/emr-serverless-python-dependencies/.gitignore new file mode 100644 index 0000000..692c12f --- /dev/null +++ b/emr-serverless-python-dependencies/.gitignore @@ -0,0 +1 @@ +pyspark_env \ No newline at end of file diff --git a/emr-serverless-python-dependencies/Dockerfile-localstack b/emr-serverless-python-dependencies/Dockerfile-localstack index 42065d1..6db7f53 100644 --- a/emr-serverless-python-dependencies/Dockerfile-localstack +++ b/emr-serverless-python-dependencies/Dockerfile-localstack @@ -22,9 +22,11 @@ COPY . . ## Build and export stages for standard Python projects ## ---------------------------------------------------------------------------- # Build stage - installs required dependencies and creates a venv package -FROM base as build-poetry -RUN poetry self add poetry-plugin-bundle && \ - poetry bundle venv dist/bundle +FROM base AS build-poetry +WORKDIR /app + +RUN poetry self add poetry-plugin-bundle@1.4.1 +RUN poetry bundle venv /app/dist/bundle --clear -FROM scratch as export-poetry +FROM scratch AS export-poetry COPY --from=build-poetry /app/dist/bundle /pyspark_env/ diff --git a/emr-serverless-python-dependencies/Makefile b/emr-serverless-python-dependencies/Makefile index 5a25e8d..e60f435 100644 --- a/emr-serverless-python-dependencies/Makefile +++ b/emr-serverless-python-dependencies/Makefile @@ -14,7 +14,7 @@ build-aws: docker build . --file Dockerfile-aws --output . deploy: - docker-compose up --detach + docker compose up --detach terraform workspace select local AWS_ENDPOINT_URL=https://localhost.localstack.cloud:4566 terraform apply --auto-approve @@ -31,7 +31,11 @@ run-aws: ./start_job.sh aws stop: - docker-compose down + docker compose down + +logs: + @localstack logs > logs.txt + cat logs.txt destroy: terraform workspace select local @@ -44,5 +48,5 @@ destroy-aws: terraform destroy --auto-approve test-ci: - make init build deploy run; return_code=`echo $$?`;\ - make stop; exit $$return_code; + make init build deploy logs run; return_code=`echo $$?`;\ + make logs; make stop; exit $$return_code;