SCUACM / cloud-computing-workshop

A quick tutorial deploying example applications to the cloud

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ACM's Cloud Computing Workshop

Setup

Instructions

  1. Sign into your Amazon Web Services (AWS) account
  2. Click Services --> Lightsail
  3. Press create instance
  4. Choose the options (us-west-2, linux/ubuntu, Node.js, $5/month)

Connecting Using SSH (optional, but recommended!)

Note: This option will only work for Mac & Linux, unless you have PuTTY installed on your windows machine

  1. Visit the Lightsail home page (https://lightsail.aws.amazon.com)
  2. Press the Account button
  3. Go to SSH Keys
  4. Scroll down, and press the Download button corresponding to Default
  5. Move the .pem file from your downloads to your user account's .ssh folder (in my example I assume that all your downloads go to your user's download folder)
    $ mv ~/Downloads/LightsailDefaultPrivateKey-us-west-2.pem ~/.ssh/
  6. Change the permissions on your private key so that only you are allowed to read from it
    $ cd ~/.ssh
    $ chmod 400 LightsailDefaultPrivateKey-us-west-2.pem
  7. SSH into your instance by using the public IP of your instance
    $ cd ~/.ssh
    $ ssh -i LightsailDefaultPrivateKey-us-west-2.pem bitnami@34.216.141.44

Deploying an Example React.js Application

  1. Go to Lightsail, click on your instance, then click on the Networking tab
  2. Scroll down to Firewall then add another Custom application using the TCP protocol on port 3000
  3. SSH into your instance or use Lightsail's browser-based remote desktop (RDP) client
  4. Clone this workshop's repository
    $ git clone https://github.com/SCUACM/cloud-computing-tutorial.git
  5. Install the necessary packages, then run the application!
    $ cd ~/cloud-computing-tutorial/reactjs-app
    $ npm install
    $ npm start
  6. Open your browser, then paste in your instance's IP with :3000 appended to it! (For example, http://34.216.141.44:3000/)

Deploying an Example Twitter Bot

  1. Log onto https://apps.twitter.com/ and press Create New App
  2. Fill out the form, then press Create your Twitter application
  3. Press on the Keys and Access Tokens tab
  4. Scroll down and click Create my access token
  5. SSH into your instance or use Lightsail's browser-based remote desktop (RDP) client
  6. Clone this workshop's repository (skip this step if you already did it for the last application)
    $ git clone https://github.com/SCUACM/cloud-computing-tutorial.git
  7. Create a keys.json file with the keys and access tokens you just created. When finished, save and quit by pressing esc then :wq then enter
    $ cd ~/cloud-computing-tutorial/python-app
    $ vi keys.json
    {
        "consumer_key": "__your key here__",
        "consumer_key_secret": "__your key here__",
        "access_token": "__your key here__",
        "access_token_secret": "__your key here__"
    }
  8. Download pip which is a package management system used to install and manage software packages written in Python
    $ curl https://bootstrap.pypa.io/get-pip.py > get-pip.py
    $ sudo python get-pip.py
  9. Now we'll download Tweepy, an easy-to-use Python library for accessing the Twitter API
    $ sudo pip install tweepy
  10. Once that's finished, you can go ahead and run your tweetbot.py! If you want to change the keyword you're searching for, you can change the keywords variable inside the python file!
    $ cd ~/cloud-computing-tutorial/python-app
    $ python tweetbot.py

Resources

About

A quick tutorial deploying example applications to the cloud


Languages

Language:JavaScript 64.7%Language:Python 17.3%Language:HTML 12.5%Language:CSS 5.5%