GithubHelp home page GithubHelp logo

s3toadl's Introduction

S3 to Azure Data Lake Store incremental data copy

This tool is designed to copy data from AWS S3 to Azure Data Lake Store Incrementaly.
For initial data copy Azure Data Factory is recommended.
The tool will detect which files exist in S3 and are missing from ADL.
It will download them from S3 to a local folder and then upload them to Azure Data Lake.

When running the tool often, it is recommended to add integration with Redis for persistency.
The redis will hold the metadata of the files that were copied from S3 to ADL.

In order to run the tool the following environment variables needs to be defined:

  • AWS configuration: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION, AWS_BUCKET_NAME
  • Azure Configuration: AZURE_CLIENT_ID, AZURE_DOMAIN, AZURE_SECRET, AZURE_ADL_ACCOUNT_NAME
  • Local folder for temporary download the files: TEMP_FOLDER
  • Optional Parameters for running with Redis: USE_REDIS - should be set to "true" to integrate with Redis.
    REDIS_PORT - default is 6379, REDIS_HOST- default is "redis".

Prerequisites

To use this tool, first you need to have an Azure Service Principal configured in the Azure Data Lake Store.

  1. Create an Azure Service Principal through Azure CLI or Azure portal.
  2. Open your Azure data lake store from Azure Portal. Open Data Explorer and click on 'Access'.
    Click on 'Add' and select the service principal you've just created.

Run With Docker

  1. If running with Redis, run:
docker run --name *redisName* -d -v /dir:/data  redis --appendonly yes 
  1. docker build -t **image name** .
  2. To run the docker file update the environment variables in the docker file, and then run:
`docker run -v '/dir:/tempdir' -p 80:4200 **image name**`

or add the environment variables as part of the docker run command:

docker run -v '/dir:/tempdir' -e AWS_ACCESS_KEY_ID='access_Key_Id' -e AWS_SECRET_ACCESS_KEY='secret_access_key' -e AWS_REGION='region' -e AWS_BUCKET_NAME='bucket_name' -e AZURE_CLIENT_ID='azure_cliet_id' -e AZURE_DOMAIN='Azure_domain' -e AZURE_SECRET='azure_secret' -e AZURE_ADL_ACCOUNT_NAME='adl_accountName' -e TEMP_FOLDER='/tempdir' -p 80:4200 **image name**

If running with Redis add : --link *redisName*:redis to the run command.
Go to http://[host-ip]/ to check out the copy status and progress.
The -v flag mounts the current working directory into the container. Documentation
4. Docker image is also available at Docker Hub - docker pull catalystcode/s3toadl
At the end of the run log file will be written to TEMP_FOLDER.

Run Locally

In order to run the tool locally node should be installed.

  1. Define the required environment variables.
  2. run the following:
git clone https://github.com/CatalystCode/s3toadl.git
npm install
node lib/index.js
  1. Go to http://localhost:4200/ to check out the copy status and progress At the end of the run log file will be written to TEMP_FOLDER.

Run Tests

npm test

Run E2E
For sanity check, you can run an E2E test, which will upload one file to S3, run the tool, and will validate that the file was uploaded to Azure Data Lake.
It is recommend to run this test on an empty S3 bucket - otherwise the test will upload ALL the files in the bucket to the data lake.

node lib/test/e2eTest.js

Licence

MIT

s3toadl's People

Contributors

ilanak avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.