Tools Required:
- Ruby 2.7.0
- awscli
- docker
Steps:
- Pull docker images
docker pull pafortin/goaws:latest
docker pull timescale/timescaledb:latest-pg12
- Run docker instances of dependent services
docker run --name sqs --network host -dit pafortin/goaws:latest
docker run -d --name db --network host -e POSTGRES_PASSWORD=postgres timescale/timescaledb:latest-pg12
- Create SQS queues
aws configure # set random values for access id and secret key, use any valid region.
aws --endpoint-url http://localhost:4100 sqs create-queue --queue-name influencer_id_store
aws --endpoint-url http://localhost:4100 sqs create-queue --queue-name influencer_data_points
- Start Mockstagram
cd mockstagram-api-master
npm install
npm start
- Setup rails environment
ruby -v # 2.7.0
cd influencer_analytics
bundle install
rake db:create db:migrate
- Seed data in SQS
rake sqs:seed:million_influencer_id
- Start processor pipeline
rake influencer:processor
- Start sink to db pipeline
rake influencer:sink_to_db
Management Commands
- Check logs for sqs docker
docker logs --follow --tail 100 <sqs/db>
- Connect to docker db using psql
psql -h localhost -U postgres -d postgres # use password provided in docker run command above, default: postgres
- Check rails logs
cd influencer_analytics
tail -100f log/development.log # use specific environment name for test and production