Deploying jPregel Applications

A tutorial introduction

Deploying Applications

merlin with student

Table of Contents

  1. Deploying on 1 machine
  2. Deploying on a Local Area Network (LAN)
  3. Deploying on Amazon Web Services (AWS)
    1. Initial set up
    2. Starting a jpregel client on EC2

Deploying on Amazon Web Services (AWS)

Our deployment strategy entails an Initial set up: launching an AWS micro-instance as a client: It will send the jpregel Master jobs to perform. Once launched, you will stop the client when you are finished with a jpregel job. You never terminate the client instance. Instead, when you want to run another job, perhaps many days later, you begin by starting the client instance. The sequence of steps to run a job from your client is much shorter than the sequence to launch the client instance. We do endeavor to keep both of these instruction sequences as short as possible.

Initial set up

The initial set up of your AWS deployment environment consists of the following steps:

  1. Create a free GitHub account.
  2. Create a GitHub repository for jpregel-aws.
  3. Create an AWS account.
  4. Create a file with your AWS jpregel-aws access key.
  5. Launch an instance that serves as a jpregel-aws client.

We now explain how to perform these steps.

  1. Create a free GitHub account

    If you do not have a GitHub account, please create one. Rather than repeat the explanation here, please see the GitHub explanation for creating a free account.

  2. Create a GitHub repository for jpregel-aws

    Using your web browser, go to https://github.com/PeterCappello/jpregel-aws. Click the Fork button in the upper right part of the page. A screen fragment of the web page is given below.

    fork button on GitHub repository

    You now have your own jpregel-aws repository.

  3. Create an AWS account

    Using your web browser, go to The latest AWS EC2 Getting Started Guide. You will see that getting started entails 4 steps.

    EC2 Getting Started steps.

    Here, we are interested in the first 2 steps:

    1. Sign up for EC2
    2. Launch instance

    To sign up for EC2, create an AWS account:

    1. Go to http://aws.amazon.com, and click Create an AWS Account.
    2. Follow the on-screen instructions.
    Part of the sign-up procedure involves receiving a phone call and entering a PIN using the phone keypad. When you create an account, AWS automatically signs up the account for all services. You are charged only for the services that you use.

  4. Create a file with your jpregel AWS access keys.

    Running a jpregel job first entails instantiating a Master machine and a set of Worker machines. To do this, you need a jpregel access key. Here is how to create a file with this key.

    1. Sign in to your AWS account.
    2. In the upper right hand corner of the page, you will see your name. Click on it, which generates a drop-down menu.
    3. Click on the Security Credentials entry.
    4. On that page, click on the Access Credentials link.
    5. Under the Access Credentials section, click on Create a new Access Key.
  5. Launch an instance

    Now launch an instance that subsequently will serve as a jpregel-aws client.

    1. Go to Getting Started: Launch Instance instructions.
    2. Follow the on-screen instructions.
      1. Name the instance something meaningful, such as "jpregel client."
      2. Create a key pair, naming it "jpregel".
      3. Download the private part of the key pair and store it somewhere safe.
      4. For Launch Configuration, select the Amazon Linux, 64-bit option.
      5. Click Continue.
    3. Launch the instance, executing the following Unix commands:
      1. chmod 400 jpregel.pem (make sure your private key is not publicly viewable)
      2. ssh -i jpregel.pem ec2-user@publicDNS, where publicDNS is the public domain name of your instance.
      3. sudo yum install git
      4. git clone (url of your jpregel repository)
      5. ./deploy.sh
      6. scp -i jpregel.pem key.AWSkey

    At this point you have a running jpregel client. Stop it, but do not terminate it.

    When you want to deploy a jpregel job on EC2, you will start this client instance. Stop it when you are done. If you terminate it, you must create another instance using the steps above.

Start a jpregel application on AWS

  1. Start your EC2 instance.
  2. Using ssh, access a shell on the instance:
    1. git pull your jpregel-aws repository.
    2. Using ant, run your chosen jpregel client.

We now explain how to perform these steps.

  1. Start your EC2 instance

    1. In EC2 console page, there is a Navigation column on the left. In that column, there is a heading called Instances. Under that heading, click Instances which takes you to a page that lists your instances.
    2. In the My Instances block of that page, check the instance that you want to start. Doing so, activates the Instance Actions drop down.
    3. Select start from the Instance Actions drop down. This will start the instance, which typically takes a few seconds.
  2. Using ssh, access a shell on the instance

    In the example below, "ec2-54-242-89-232.compute-1.amazonaws.com" is the public domain name of the machine being used as the client. The ssh command given below is issued from within the directory that has your jpregel.pem file.

    ssh -i jpregel.pem \
    ec2-user@ec2-54-242-89-232.compute-1.amazonaws.com
    			

    Using the shell:

    1. change directory to your jpregel-aws directory

      cd jpregel
    2. git pull your jpregel-aws repository

      git pull
    3. Using ant, run your chosen jpregel client

      We give an example ant command below

      ant run -propertyfile \
      nbproject/configs/ShortestPath.properties \
      -Dapplication.args="foobucket 10 10 true true"