WebFund 2016W: Tutorial 8: Difference between revisions

From Soma-notes
 
(2 intermediate revisions by the same user not shown)
Line 5: Line 5:
===Creating your instance===
===Creating your instance===


* Visit [https://openstack.scs.carleton.ca the SCS OpenStack web portal].  Note that you can only access the SCS Openstack machines when on the Carleton network.  If you are elsewhere, you'll need to [http://carleton.ca/ccs/all-services/wireless-and-internet/vpn/ VPN into Carleton].  You can log in to OpenStack using your MyCarletonOne username.  The temporary password is your MyCarletonOne username (all lowercase) and your student number (no spaces).
* Visit [https://openstack.scs.carleton.ca the SCS OpenStack web portal].  Note that you can only access the SCS Openstack machines when on the Carleton network.  If you are elsewhere, you'll need to [http://carleton.ca/ccs/all-services/wireless-and-internet/vpn/ VPN into Carleton].  You can log in to OpenStack using your MyCarletonOne username.  The temporary password is your MyCarletonOne username (all lowercase) and your student number (no spaces).  '''Note:''' You may have problems in the latest build of Firefox; if so, please use Chrome.
*  After you've logged in, change your password in Settings (see the menu in the top-right corner, the drop-down menu under your username.)
*  After you've logged in, change your password in Settings (see the menu in the top-right corner, the drop-down menu under your username.)
* Create an instance as follows:
* Create an instance as follows:
Line 19: Line 19:
*** (ignore the key pair option)
*** (ignore the key pair option)
** Under Networking:
** Under Networking:
*** Add the "comp2406-net-26" available network to Selected Networks (click the + sign)
*** Add the "comp2406-net-31" or "comp2406-net-26" available network to Selected Networks (click the + sign) '''NOTE:''' Please choose net-31!
** click Launch to create the instance!
** click Launch to create the instance!
* As the instance is launching, select "Associate Floating IP" under Actions.
* As the instance is launching, select "Associate Floating IP" under Actions.  If you picked net-26, choose a 134.117.26. address; if you chose net-31, choose a 134.117.31 address.
** Select any IP address that is available.  If no IP addresses are available, talk to a TA!
** Select any IP address that is available.  If no IP addresses are available, talk to a TA!
** Select the "Port to be associated" to be the name of your instance.
** Select the "Port to be associated" to be the name of your instance.

Latest revision as of 15:39, 18 March 2016

In this tutorial you will be playing with the SCS OpenStack install and making progress on Assignment 5.

OpenStack

Creating your instance

  • Visit the SCS OpenStack web portal. Note that you can only access the SCS Openstack machines when on the Carleton network. If you are elsewhere, you'll need to VPN into Carleton. You can log in to OpenStack using your MyCarletonOne username. The temporary password is your MyCarletonOne username (all lowercase) and your student number (no spaces). Note: You may have problems in the latest build of Firefox; if so, please use Chrome.
  • After you've logged in, change your password in Settings (see the menu in the top-right corner, the drop-down menu under your username.)
  • Create an instance as follows:
    • Make sure you are in the COMP2406 project (you can change at the top of the page, to the right of the openstack logo).
    • Go to Project=>Compute=>Instances
    • Click the Launch Instance button, you'll get a dialog box.
    • Under Details:
      • set instance name to be "<your username>-comp2406-1". For example, if your username was janedoe, set the instance name to "janedoe-comp2406-1".
      • Select the Instance Boot Source to be "Boot from snapshot"
      • Select the "COMP2406-W16" Instance Snapshot"
    • Under Access & Security:
      • select the "ping, ssh, https" and "default" options
      • (ignore the key pair option)
    • Under Networking:
      • Add the "comp2406-net-31" or "comp2406-net-26" available network to Selected Networks (click the + sign) NOTE: Please choose net-31!
    • click Launch to create the instance!
  • As the instance is launching, select "Associate Floating IP" under Actions. If you picked net-26, choose a 134.117.26. address; if you chose net-31, choose a 134.117.31 address.
    • Select any IP address that is available. If no IP addresses are available, talk to a TA!
    • Select the "Port to be associated" to be the name of your instance.
    • Click associate.
  • Reload the page

Configuring your instance

Your instance should now have 2 IP addresses, a private one (starting with 192.168) and a public one (starting with 134.117). You can now connect to your instance by the public IP address. Your username is "student", the password is "tneduts!".

  • Log in to your running instance using ssh on the command line (Linux, MacOS X) or putty (Windows).
  • Change the student account password by running the command "passwd". (Otherwise anyone can log in to your instance.)
  • Install zip and unzip using the command
sudo apt-get install zip unzip
  • Make node able to bind privileged ports by running the command
sudo setcap 'cap_net_bind_service=+ep' /usr/bin/nodejs

Run a web app

  • Transfer code to the instance either by using sftp (e.g., WinSCP) or by grabbing a zip file at the command line, e.g.
 wget http://homeostasis.scs.carleton.ca/~soma/webfund-2016w/code/analyzeLogs-template.zip
  • If necessary, unzip it:
 unzip analyzeLogs-template.zip
  • Run it normally except set the port to 443. (Do you remember how to do this?)
  • Now connect to it by visiting your instance on port 443 in a local web browser, e.g., http://134.117.1.1:443

Now you can edit the files locally and re-run the web app. emacs, vi, and nano are all available.

IMPORTANT: Make sure to backup any files you change on your openstack instance. The data there is NOT backed up and it is possible for an instance to be destroyed at any time. Use rsync, WinSCP (Windows), Cyberduck (MacOS X, Windows), or any other utility supporting sftp to copy files to and from your instance.

Once you are developing in OpenStack, you can use it to do all of your development for COMP 2406 - you no longer need the Linux VM in VirtualBox. However, you are welcome to continue to use a local Linux VM - the only requirement here is that you at least get an instance working with a web app.

Progress on Assignment 5

Once you have your OpenStack instance running, work on Assignment 5.

Completing the tutorial

To complete this tutorial, show a TA that you have a web app running on your OpenStack instance and that you have implemented at least one of the requirements from Assignment 5. You may also get credit if it is clear you have been working diligently on these tasks throughout the tutorial.