Skip to content

Commit 06636d2

Browse files
author
Emerson Antony
committed
latest tests
1 parent 97f956f commit 06636d2

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

cloudformation/sam-imagebuilder.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ Resources:
133133
- echo Downloading requires source files from git
134134
- git clone https://github.com/aws-samples/spark-on-aws-lambda.git
135135
- cd spark-on-aws-lambda
136-
- git checkout fixes
136+
- git checkout dockerfilefixes
137137
- echo Build started on `date`
138138
- echo Building the Docker image...
139139
- docker build --build-arg FRAMEWORK=$FRAMEWORK -t $IMAGE_REPO_NAME:latest .

sparkLambdaHandler.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,12 @@ def spark_submit(s3_bucket_script: str,input_script: str, event: dict)-> None:
3838
# Source input and output if available in event
3939
input_path = event.get('INPUT_PATH','')
4040
output_path = event.get('OUTPUT_PATH', '')
41+
for key,value in event:
42+
os.environ[key] = value
4143
# Run the spark-submit command on the local copy of teh script
4244
try:
4345
logger.info(f'Spark-Submitting the Spark script {input_script} from {s3_bucket_script}')
44-
subprocess.run(["spark-submit", "/tmp/spark_script.py", "--event", json.dumps(event)], check=True, env=event )
46+
subprocess.run(["spark-submit", "/tmp/spark_script.py", "--event", json.dumps(event)], check=True, env=os.environ)
4547
except Exception as e :
4648
logger.error(f'Error Spark-Submit with exception: {e}')
4749
raise e

0 commit comments

Comments
 (0)