Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for using AWS_PROFILE from local aws config #61

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ RUN curl -sL --retry 3 \
| tar -x -C /usr/ \
&& rm -rf $HADOOP_HOME/share/doc \
&& chown -R root:root $HADOOP_HOME
COPY conf/hadoop/core-site.xml /tmp/core-site.xml
RUN cp /tmp/core-site.xml $HADOOP_HOME/etc/hadoop

# SPARK
ENV SPARK_VERSION 2.4.1
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ To start `spark-shell` with your AWS credentials:

docker run --rm -it -e "AWS_ACCESS_KEY_ID=YOURKEY" -e "AWS_SECRET_ACCESS_KEY=YOURSECRET" -p 4040:4040 gettyimages/spark bin/spark-shell

To start `spark-shell` with your desired AWS_PROFILE from ${HOME}/.aws/credentials:

docker run --rm -it -e "AWS_PROFILE=YOURPROFILE" -v "${HOME}/.aws":/root/.aws -p 4040:4040 gettyimages/spark bin/spark-shell

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this credentials mount get mapped to other workers?


To do a thing with Pyspark

echo -e "import pyspark\n\nprint(pyspark.SparkContext().parallelize(range(0, 10)).count())" > count.py
Expand Down
8 changes: 8 additions & 0 deletions conf/hadoop/core-site.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>fs.s3a.aws.credentials.provider</name>
<value>com.amazonaws.auth.DefaultAWSCredentialsProviderChain</value>
</property>
</configuration>