Skip to content

Commit

Permalink
changed in glue_setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Vighnesh authored and Vighnesh committed Feb 13, 2024
1 parent 429357e commit d483a45
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup-glue-local:
chmod +x automation/glue_setup.sh
source automation/glue_setup.sh
. automation/glue_setup.sh $(SOURCE_FILE_PATH)

glue-demo-env:
cp app/.custom_env .env
Expand All @@ -19,7 +19,7 @@ lint:
test:
export KAGGLE_KEY=MOCKKEY
export KAGGLE_USERNAME=MOCKUSERNAME
coverage run --source=app -m unittest discover -s tests
coverage run --source=app -m unittest discover -s tests

coverage-report:
coverage report
Expand Down
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,24 @@ Example: ```export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_261.jdk/

2. For Glue-local-setup, run:
```bash
make setup-glue-local
# If default SHELL is zsh use
make setup-glue-local SOURCE_FILE_PATH=~/.zshrc

# If default SHELL is bash use
make setup-glue-local SOURCE_FILE_PATH=~/.bashrc
```

3. Source SHELL profile using:

```bash
# For zsh
source ~/.zshrc

# For bash
source ~/.bashrc
```

3. Install Dependencies:
4. Install Dependencies:
```bash
make install
```
Expand Down
25 changes: 18 additions & 7 deletions automation/glue_setup.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# Parameter 1 --> Shell profile path
SOURCE_FILE=$1
echo $SOURCE_FILE

echo -e "FIRST RUN TIME ESTIMATION: 30-45 MINS\nPlease do NOT exit"

export PROJECT_ROOT=$(pwd)

# Doing all the work in separate folder "libs"
cd ..
mkdir libs && cd libs
# Doing all the work in separate folder "glue-libs"
cd ~
mkdir glue-libs
cd glue-libs

# Clone AWS Glue Python Lib
git clone https://github.com/awslabs/aws-glue-libs.git
Expand All @@ -22,19 +27,25 @@ tar -xvf spark-3.1.1-amzn-0-bin-3.2.1-amzn-3.tgz
ln -s spark-3.1.1-amzn-0-bin-3.2.1-amzn-3 spark
export SPARK_HOME=$(pwd)/spark


# Export Paths
# Export Path
export PATH=$PATH:$SPARK_HOME/bin:$MAVEN_HOME/bin:$AWS_GLUE_HOME/bin
export PYTHONPATH=$PROJECT_ROOT

# Download Glue ETL .jar files
cd $AWS_GLUE_HOME
chmod +x bin/glue-setup.sh
bin/glue-setup.sh
./bin/glue-setup.sh
mvn install dependency:copy-dependencies
cp $AWS_GLUE_HOME/jarsv1/AWSGlue*.jar $SPARK_HOME/jars/
cp $AWS_GLUE_HOME/jarsv1/aws*.jar $SPARK_HOME/jars/

# Setup Done
echo "export AWS_GLUE_HOME=$AWS_GLUE_HOME
export MAVEN_HOME=$MAVEN_HOME
export SPARK_HOME=$SPARK_HOME
export PATH=$PATH:$SPARK_HOME/bin:$MAVEN_HOME/bin:$AWS_GLUE_HOME/bin
export PYTHONPATH=$PROJECT_ROOT" >> $SOURCE_FILE


cd $PROJECT_ROOT

echo -e "\nGLUE LOCAL SETUP COMPLETE"

0 comments on commit d483a45

Please sign in to comment.