Skip to content

Commit 636c092

Browse files
fix emr serverless python deps sample dockerfile (#255)
--------- Co-authored-by: Mathieu Cloutier <[email protected]>
1 parent ec34fa0 commit 636c092

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pyspark_env

emr-serverless-python-dependencies/Dockerfile-localstack

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@ COPY . .
2222
## Build and export stages for standard Python projects
2323
## ----------------------------------------------------------------------------
2424
# Build stage - installs required dependencies and creates a venv package
25-
FROM base as build-poetry
26-
RUN poetry self add poetry-plugin-bundle && \
27-
poetry bundle venv dist/bundle
25+
FROM base AS build-poetry
26+
WORKDIR /app
27+
28+
RUN poetry self add [email protected]
29+
RUN poetry bundle venv /app/dist/bundle --clear
2830

29-
FROM scratch as export-poetry
31+
FROM scratch AS export-poetry
3032
COPY --from=build-poetry /app/dist/bundle /pyspark_env/

emr-serverless-python-dependencies/Makefile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ build-aws:
1414
docker build . --file Dockerfile-aws --output .
1515

1616
deploy:
17-
docker-compose up --detach
17+
docker compose up --detach
1818
terraform workspace select local
1919
AWS_ENDPOINT_URL=https://localhost.localstack.cloud:4566 terraform apply --auto-approve
2020

@@ -31,7 +31,11 @@ run-aws:
3131
./start_job.sh aws
3232

3333
stop:
34-
docker-compose down
34+
docker compose down
35+
36+
logs:
37+
@localstack logs > logs.txt
38+
cat logs.txt
3539

3640
destroy:
3741
terraform workspace select local
@@ -44,5 +48,5 @@ destroy-aws:
4448
terraform destroy --auto-approve
4549

4650
test-ci:
47-
make init build deploy run; return_code=`echo $$?`;\
48-
make stop; exit $$return_code;
51+
make init build deploy logs run; return_code=`echo $$?`;\
52+
make logs; make stop; exit $$return_code;

0 commit comments

Comments
 (0)