Giter VIP home page Giter VIP logo

udacity-cloud-developer-capstone-project's Introduction

Capstone Project for Udacity Cloud Developer Nanodegree

This project fulfills the requirements of the Udacity Cloud Developer Capstone Project. A web app is containerized and deployed to a kubernetes cluster. This webapp runs a sentiment analysis on tweets of a Twitter handle and gives feedback on sentiments over a period of time.

๐Ÿ“ƒ Information on Some of the files

1) build_images.sh - This file contains the shell commands needed to build the image using docker.

2) K8s/ - This folder contains the kubernetes resource configuration files that will deploy the application image on AWS EKS using kubectl once configured properly.

3) Dockerfile - This file contains all the commands needed to assemble the app image.

4) update_deployed_version.sh - This file uses the command line tool 'sed' in updating the kubernetes configuration file in other to force the pods to update with the new image. The reason for this is that Kubernetes (wrongly) considers Docker tags as immutable (i.e., once a tag is set, it is never changed). The rolling update is also activated by the change in image name.

5) .travis.yml - This file contains the commands for Travis to handle CI/CD process of the application.

๐Ÿ“ƒ Local Docker Setup

To run this app using docker, a script has been attached that builds an image from the Dockerfile and spins up a container running the web app:

โ ./run_docker.sh

There is also a script that uploads the Docker image to a designated repo. This should be edited before execution:

โ ./upload_docker.sh

Please view the aforementioned scripts before running to understand the logic behind them.

๐Ÿ“ƒ Setup Instructions for local testing

1) Fire up your favourite console & clone this repo somewhere:

โ git clone https://github.com/vahiwe/Udacity-Cloud-Developer-Capstone-Project.git

2) Enter this directory:

โ cd TwitterAnalysis/model_setup

3) Install python if not already installed and run this command to install python packages/dependencies:

โ pip install -e .

4) Go back to previous directory:

โ cd ..

5) Generate secret key for Django project here and create this environment variable. There is a default DJANGO_KEY already set in the project:

    export DJANGO_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

6) Get your Twitter Developer credentials and create the following environment variables :

    export TWITTER_CONSUMER_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    export TWITTER_CONSUMER_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    export TWITTER_ACCESS_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    export TWITTER_ACCESS_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

7) If you need to serve static files from an S3 bucket, you can set the following environment variables. The credentials should have permissions to perform the operations listed here on the S3 Bucket:

    export DEBUG_VALUE=False
    export AWS_STORAGE_BUCKET_NAME=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    export AWS_ACCESS_KEY_ID=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    export AWS_SECRET_ACCESS_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

8) If you would like to use a database in storing the tweets and feedback data, you can set the following environment variables:

    export DATABASE_URL=postgres://dbuser:dbpassword@hostname:5432/dbname

9) Install spacy language model:

โ python -m spacy download en

10) Run to create migrations for changes:

โ python manage.py makemigrations

11) Run to apply those changes to the database:

โ python manage.py migrate

12) Start the server to view the webapp:

โ python manage.py runserver

13) Open your browser and type in this URL to view the webapp:

โ http://127.0.0.1:8000/

Happy developing!

udacity-cloud-developer-capstone-project's People

Contributors

vahiwe avatar

Watchers

 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.