Instantly Run An App in the Cloud

(Difference between revisions)
Jump to: navigation, search
(Additional Information:: added topics)
(Suggestions to Open Source Mentors:)
(6 intermediate revisions by one user not shown)
Line 11: Line 11:
 
* Understand what Cloud / Utility Computing is
 
* Understand what Cloud / Utility Computing is
 
* Be able to quickly spin up an app in an online PaaS environment
 
* Be able to quickly spin up an app in an online PaaS environment
 +
* Able to express your troubleshooting and solutions
 
* Create your own open source blog and post to it
 
* Create your own open source blog and post to it
 +
* Explain what else PaaS can be used for
 
|}
 
|}
  
 
[[File:WordpressOpenShift.png|500px]]
 
[[File:WordpressOpenShift.png|500px]]
 +
 +
----
  
 
=== Background: ===
 
=== Background: ===
Line 20: Line 24:
  
 
Students need to know what Cloud Computing really means, how it fits into the wider computing context, and what the different types are (IaaS, PaaS, SaaS). Students can dig into PasS, as a powerful development platform - and understand how quickly, easily, and powerfully they can spin up new applications. Gone are the days of having to setup a physical server, know the details on how to setup the OS, fiddle with the kernel, setup web-servers (Apache), databases (Postgres, Mysql), and middle-ware micros-services (AMQP Message busses, JBoss Fuse, Apache Camel). In a PaaS environment like OpenShift, the developer just fires up an instance of whatever pieces they want, and start coding. Seriously - its that easy. Of course, the developer has to know how to develop in said language or platform, but it makes development considerably easier by removing focus from lower layers. Basically, those lower layers (most mentioned above) are automated away by the PaaS platform.
 
Students need to know what Cloud Computing really means, how it fits into the wider computing context, and what the different types are (IaaS, PaaS, SaaS). Students can dig into PasS, as a powerful development platform - and understand how quickly, easily, and powerfully they can spin up new applications. Gone are the days of having to setup a physical server, know the details on how to setup the OS, fiddle with the kernel, setup web-servers (Apache), databases (Postgres, Mysql), and middle-ware micros-services (AMQP Message busses, JBoss Fuse, Apache Camel). In a PaaS environment like OpenShift, the developer just fires up an instance of whatever pieces they want, and start coding. Seriously - its that easy. Of course, the developer has to know how to develop in said language or platform, but it makes development considerably easier by removing focus from lower layers. Basically, those lower layers (most mentioned above) are automated away by the PaaS platform.
 
  
 
This activity shows students, step-by-visual-step, how to start up a new coding environment and actually implement a small chunk of working software on Openshift.
 
This activity shows students, step-by-visual-step, how to start up a new coding environment and actually implement a small chunk of working software on Openshift.
Line 30: Line 33:
 
* Read about open sources role in cloud computing. http://opensource.com/business/13/1/future-cloud-computing
 
* Read about open sources role in cloud computing. http://opensource.com/business/13/1/future-cloud-computing
 
* Read about PaaS. http://www.thoughtsoncloud.com/2014/02/what-is-platform-as-a-service-paas/
 
* Read about PaaS. http://www.thoughtsoncloud.com/2014/02/what-is-platform-as-a-service-paas/
* Read about Node.js http://blog.langoor.mobi/node-js-mobile-web-apps/
 
  
  
 
=== Directions: ===
 
=== Directions: ===
You may have heard of Software as a Service (SaaS), or Cloud Computing before. Examples of SaaS are that of Google Docs, Twitter, DropBox. Another flavor of Cloud Computing is Platform as a Service (PaaS). This cloud-hosted service allows developers to program apps and functionality in an easy to grasp and scale and demo online environment. You can push stuff live '''very''' quickly, and you dont have to worry about backup or the Operating System, or getting database services running. Your infrastructure and coding platform are pre-taken-care-of. You just code your app. Lets go signup for one and start a simple blog app.
+
You may have heard of Software as a Service (SaaS), or Cloud Computing before. Examples of SaaS are that of Google Docs, Twitter, DropBox. Another flavor of Cloud Computing is Platform as a Service (PaaS). This cloud-hosted service allows developers to program apps and functionality in an easy to grasp, scale, and demo online environment. You can push stuff live '''very''' quickly, and you don't have to worry about the Operating System or getting database services running. Your infrastructure and coding platform are pre-taken-care-of. You just code your app. In the below tutorial, you will signup to the Openshift PaaS environment and start a simple Wordpress blog app.
  
----
 
  
==== Overview ====
+
Assure that you read the Background readings, so that you understand the Cloud Computing paradigm and what a Paas is.
  
Here are the major steps you will implement:
 
  
* Get OpenShift Online account
+
Follow this tutorial:
* Quick Setup
+
* <font size="4">http://code.tutsplus.com/tutorials/running-wordpress-on-openshift-an-introduction--cms-20058</font>
* Quick Win - Start Wordpress
+
** Do not follow 2B
* Setup Wordpress Instance
+
***Likely, you will not need to follow Step 2B, though skim through it for some additional understanding of the OpenShift structure.
* Instance launched
+
** Do not follow 3, 3A, 3B
* Startup / Use Wordpress
+
***Likely, you will not need to read or follow Steps 3, 3A or 3B - unless you have interest in using an existing domain name that you own.
  
<!--
 
** Implement phpmyadmin
 
* Setup OpenShift
 
** URL
 
** SSH setup ??? https://developers.openshift.com/en/managing-remote-connection.html#keys
 
** Rhc setup https://developers.openshift.com/en/getting-started-osx.html#client-tools
 
-->
 
  
 
----
 
----
  
 
==== Get OpenShift Online account ====
 
One such PaaS provider (amongst many) is Red Hats OpenShift. Other examples are Heroku, Google AppEngine, Engineyard, Microsoft Azure, VMWare's CloudFoundry. The list goes on. However, one of the cool things bout OpenShift is that its open sourced. You will remain free to move your code and environment to other vendors within OpenShift. Say that Red Hat starts charging too much - many vendors can be implementing the same environment,allowing you to easily move (at least, more easily than proprietary solutions). Alternatively, you could take OpenShifts code and implement your own PaaS server, on your computer at home. Only those whose source code is open sourced can claim this.
 
 
* Head to https://www.openshift.com/ and look for "Openshift Online".
 
* Signup for a free account
 
* Verify it by email
 
 
[[File:SignupOpenShift.png|300px]]
 
 
----
 
 
==== Quick Setup ====
 
* Login to OpenShift Online
 
* Click on the '''Settings''' tab on the webpage
 
* '''Namespace''' field, fill it in
 
** This will define the URL that you and others will visit to see your live apps that your create.
 
** So, for example, we enter "teachingoss" and our URLs will be something like:
 
http://wordpress-teachingoss.rhcloud.com/
 
 
[[File:OpenShiftSettings.png|300px]]
 
 
* '''Public Keys''', for now, we will leave this blank
 
** If you know what a public key is, and you have one on your existing machine, go ahead and enter it here
 
** This will allow you to extremely easily access the SSH command line of your virtual app
 
** We will touch on it in a later activity
 
 
----
 
 
==== Quick Win - Start Wordpress ====
 
Lets actually do something with OpenShift! [https://en.wikipedia.org/wiki/WordPress Wordpress] is an open source blogging platform. They have an online SaaS offering (Software as a Service), and you can also implement your own instance of wordpress to operate and customize your own blog. You might operate your own if you want to customize the looks of it, or add custom functionality via plugins (which there thousands of), or if you just want to be in control of your data. Lets go.
 
 
* Click on the '''Applications''' tab
 
* If you have not started an app already, click the text '''Create your first application now'''
 
* A list of applications, coding platforms, coding languages, and middleware appear in a large grid / list.
 
** This is how you can explore what Red Hat offers "out of the box".
 
** Dont worry though, this is open source, and the community provides hundreds more at http://hub.openshift.com
 
** We wont use hub.openshift in this example
 
* Choose '''Wordpress''' as the app that we will launch.
 
** Troubleshoot: If you dont see Wordpress, there is a search field where you can type it in and find it
 
 
[[File:StartWordpress.png|300px]]
 
 
----
 
 
==== Setup Wordpress Instance ====
 
 
* You should now be in the screen that launches Wordpress, called '''Wordpress Quickstart'''
 
* See the screenshot below and note the red circled fields; those need interaction
 
 
[[File:WordpressLaunch.png|300px]]
 
 
Lets go through each of the fields, what they mean, and fill out a few:
 
 
* '''Based On''' explains what this application is, where you can get more info, and who maintains it (if its Red Hat upkept or community created)
 
* '''Public URL''' sets the http:// address that you will use to get to your Wordpress instance
 
** Notice that the "-teachingoss" (or whatever you used) from the earlier setup step, is hardcoded here
 
** You are now prepending that hardcoded piece of the url, so that each specific app that you start (you can run many) has a unique URL
 
** Enter "wordpress" here
 
* '''Source Code''' tells OpenShift where to get the code for Wordpress to start off of
 
** Very powerful feature alert!
 
** This one is already set (dont change it) because it is a pre-made one from Red Hat and OpenShift, however, you could tell OpenShift to use any piece of code here, if it is properly arranged
 
** Do not change this setting
 
* '''Gears''' sets what and how big of virtual resources your Wordpress instance gets access to
 
** RAM, Harddrive, etc.
 
** For this free hosted version of Openshift, you can only use "small"
 
** Small is useful for most beginning and one-off projects
 
** Organizations and heavily-trafficked websites may want to use bigger gears to allow more bandwidth or faster responses to many users
 
* '''Scaling''' tells OpenShift if you want this application to be auto-scaled
 
** Auto-scaling is for dynamically provisioning more and more or less and less instances to handle an unknown amount of traffic
 
** You wont need this unless you expect large and fluctuating traffic coming to your application
 
** It is very useful for advertisement or startup use-cases, where a sudden reddit-cloud or popular advertisement sends thousands to your website
 
** This is a key benefit of PaaS; it allows developers to code / setup their application, and not worry as much about how to scale it later
 
* '''Region''' tells OpenShift where to physically start your virtual machine
 
** Because OpenShift online relies on Amazon Web Services (AWS) to start these instances, it uses Amazons region terminology
 
** The choice for one or a handful of users wont make a different - a few milliseconds
 
** However, if you think hundreds of users will access your application from the west coast, or europe, you can change this here
 
 
 
 
Ok, '''FINISH IT''':
 
 
* After filling out what is needed, click '''Create Application'''
 
* This could take 1-5 minutes, depending on how trafficked the web is currently
 
** Basically you are starting up a new virtual machine and installing a few applications - so it takes time
 
** Note: this slowness may also be a bug of the web interface; when doing this via the command-line, it is often quicker
 
 
----
 
 
==== Instance launched ====
 
 
* '''Change the code?'''
 
** The next page asks "Will you be changing the code of this application?"
 
** In this activity, we will not be, so you select '''Now now, continue'''
 
** However, lets discuss the other options and what this means
 
** If you selected "Yes, help me get started", it brings up some additional prompts explaining that Git is used to sync code, and that you can get interactive SSH shell access to the command line of this virtual app box.
 
** To do this, you would need to setup a public SSH keypair
 
** This is involved, and we wont handle it here; however, know that it exists
 
 
[[File:ChangeCode.png|300px]]
 
 
* Finally, you see the Instance page for this new Wordpress app you have started!
 
 
[[File:WordpressInstance.png|300px]]
 
 
* You can see that the PHP and MySQL cartridges were started, and you are even given the login/passwords for these.
 
* '''RECORD THESE CREDENTIALS''', as you will use them later
 
* It tells you what was started, what gears are involved, what location it is hosted at, how many gears it takes (its size), and how much storage it is allotted, amongst other info
 
* You can always visit this Instance Info page once wordpress is running
 
* Technically, this costs someone money; Red Hat is paying for this via Amazon
 
* If you find youself not using it anymore, '''Delete the application...''' / Shut it down; Dont waste resources; Recycle; All that jazz!
 
 
----
 
 
==== Startup / Use Wordpress ====
 
Now lets actually see our Wordpress Instance running and quickly set it up, so that we can get to a genuinely useful screen (making a new blog, seeing existing blogs).
 
 
* Start by clicking the URL on the Instance page; For us it is https://wordpress-teachingoss.rhcloud.com/
 
* Click '''Continue''' when asked what language you prefer
 
* Fill out the '''Welcome''' page and '''RECORD''' your username and password
 
** Note that anyone visiting this page would be able to do this same thing
 
** This means if someone stumbled upon it, while in this initial setup-phase, they would steal your website
 
** Dont ever let an app sit in this "setup" phase very long, or it can get hacked
 
* Now use those credentials to '''Login' to the Wordpress instance
 
* Voila! You have access to your Blogs dashboard and can add new blogs, etc
 
 
[[File:WordpressStart.png|500px]]
 
 
----
 
 
<!--
 
 
===== Implement phpmyadmin =====
 
When we started Wordpress, Openshift also started PHP (the coding language wordpress uses) and MySQL (the database wordpress uses) cartridges. These were required in order to run Wordpress. In the past, developers had to assure that these pieces were running already and setup and worked. With PaaS, it takes care of all of that for you. Actually, lets let it take care of something even further!
 
 
The database used by Wordpress is MySQL. It saves all of the blog info, login and account data, and any other bits of persistant info into this database. But what if we needed to debug the database, or access the raw content, or reset it... or maybe we are just curious! You use '''phpmyadmin'''. It is a visual, web-based front-end to MySQL databases. You can click around and see the various tables created, and the columns and data inside of those tables.
 
 
* Navigate to your running Wordpress instance
 
 
==== Setup OpenShift ====
 
===== URL =====
 
===== SSH setup =====
 
https://developers.openshift.com/en/managing-remote-connection.html#keys
 
 
===== Rhc setup =====
 
https://developers.openshift.com/en/getting-started-osx.html#client-tools
 
 
-->
 
  
 
=== Deliverables: ===
 
=== Deliverables: ===
Create one blog item, with URL, that talks about:
+
Create a blog post, with public URL, that talks about:
 
# What you learned
 
# What you learned
 
#* Both specific to OpenShift and generally about Cloud Computing and PaaS
 
#* Both specific to OpenShift and generally about Cloud Computing and PaaS
Line 216: Line 61:
 
# What other ways you might use a PaaS environment in the future
 
# What other ways you might use a PaaS environment in the future
 
#* What other apps and coding platforms / languages could you use?
 
#* What other apps and coding platforms / languages could you use?
#* Why is the git "Source Code" feature so killer? What could it enable you to do?
 
  
 
=== Assessment: ===
 
=== Assessment: ===
Grading Rubric:
+
 
 
{| border="1" class="wikitable"
 
{| border="1" class="wikitable"
 
! Criteria
 
! Criteria
Line 226: Line 70:
 
! Level 3 (exceptional)
 
! Level 3 (exceptional)
 
|-
 
|-
| '''Directions followed; Running Wordpress blog'''
+
| '''Understands what Cloud / Utility Computing is'''
| Couldnt get it running
+
| Got it running, but with problems
+
| Wordpress Running, URL provided
+
 
+
|-
+
| '''Blog: Learned'''
+
 
| Little to no understanding of Cloud Computing concepts and what was done
 
| Little to no understanding of Cloud Computing concepts and what was done
 
| Some understanding of wider concepts, though no extra work was done to understand it further
 
| Some understanding of wider concepts, though no extra work was done to understand it further
Line 238: Line 76:
  
 
|-
 
|-
| '''Blog: Troubles & Info'''
+
| '''Be able to quickly spin up an app in an online PaaS environment'''
 +
| Couldnt get it running, didnt ask for help
 +
| Got it running, but with problems that needed teacher help
 +
| Wordpress Running, URL provided, no teacher help
 +
 
 +
|-
 +
| '''Able to express your troubleshooting and solutions'''
 
| Little to no explanation of misunderstandings or errors or additional knowledge attained
 
| Little to no explanation of misunderstandings or errors or additional knowledge attained
 
| Explanation of a problem or gaining of clarity via self-driven curiosity or need
 
| Explanation of a problem or gaining of clarity via self-driven curiosity or need
| Multiple points of troubleshooting and/or searching for seperate / additional information because of personal curiosity
+
| Multiple points of troubleshooting and/or searching for separate / additional information because of personal curiosity
 +
 
 +
|-
 +
| '''Create your own open source blog and post to it'''
 +
| Blog non-existant or blank
 +
| Blog expresses process and lessons learned but does not go further
 +
| Blog expresses what process the student went through, troubleshooting, and further uses of PaaS environments
  
 
|-
 
|-
| '''Blog: PaaS uses'''
+
| '''Explain what else PaaS can be used for'''
 
| No explanation of additional uses, or a complete mis-understanding of what PaaS offers
 
| No explanation of additional uses, or a complete mis-understanding of what PaaS offers
| Explanation of one additional language and usage-pattern, with little imagination behind PaaS's exanpsive possibilities
+
| Explanation of one additional language and usage-pattern, with little imagination behind PaaS's expansive possibilities
| Multiple creative uses explained for coding applications, and building web platforms; Mentioning of Git being useful because it allows easy open source code insertion
+
| Multiple creative uses explained for coding applications, and building web platforms
  
 
|}
 
|}
Line 257: Line 107:
  
 
What are some likely difficulties that an instructor may encounter using this activity?
 
What are some likely difficulties that an instructor may encounter using this activity?
Grading the activity may be subjective and note reflective of student effort since much of the effort goes into implementing the Wordpress app, but then they are graded on the blog they post that recaps what they did.
+
Grading the activity may be subjective and not reflective of student effort since much of the effort goes into implementing the Wordpress app, but then they are graded on the blog they post that recaps what they did.
  
  
Line 273: Line 123:
 
|'''Materials/Environment''' || What does the student need?  Internet access, Email
 
|'''Materials/Environment''' || What does the student need?  Internet access, Email
 
|-
 
|-
|'''Author''' || [https://www.linkedin.com/in/nickyeates Nick Yeates]
+
|'''Author''' || [https://www.linkedin.com/in/nickyeates Nick Yeates], Vinh Quốc Nguyễn
 
|-
 
|-
|'''Source''' || N/A
+
|'''Source''' || http://code.tutsplus.com/tutorials/running-wordpress-on-openshift-an-introduction--cms-20058
 
|-
 
|-
 
|'''License''' || Creative Commons CC-BY
 
|'''License''' || Creative Commons CC-BY
Line 294: Line 144:
 
[[Category: Communication_and_Tools]]
 
[[Category: Communication_and_Tools]]
 
[[Category: Use_and_Evaluate]]
 
[[Category: Use_and_Evaluate]]
 +
[[Category:Good Draft]]

Revision as of 17:54, 8 March 2017

Title Instantly Run An App in the Cloud Using OpenShift
Overview Students need to know what Cloud Computing really means, how it fits into the wider computing context, and how they can use an open source cloud alternative to quickly host coding platforms for them to toy around in. This activity sets out to do all of this as a walkthrough learn-as-you-go tutorial via Red Hats Open Shift platform - a completely open sourced cloud-hosted coding platform.
Prerequisite Knowledge Basics of computing, programming & virtualization concepts
Learning Objectives
  • Understand what Cloud / Utility Computing is
  • Be able to quickly spin up an app in an online PaaS environment
  • Able to express your troubleshooting and solutions
  • Create your own open source blog and post to it
  • Explain what else PaaS can be used for

WordpressOpenShift.png


Background:

What is the rational for this activity?

Students need to know what Cloud Computing really means, how it fits into the wider computing context, and what the different types are (IaaS, PaaS, SaaS). Students can dig into PasS, as a powerful development platform - and understand how quickly, easily, and powerfully they can spin up new applications. Gone are the days of having to setup a physical server, know the details on how to setup the OS, fiddle with the kernel, setup web-servers (Apache), databases (Postgres, Mysql), and middle-ware micros-services (AMQP Message busses, JBoss Fuse, Apache Camel). In a PaaS environment like OpenShift, the developer just fires up an instance of whatever pieces they want, and start coding. Seriously - its that easy. Of course, the developer has to know how to develop in said language or platform, but it makes development considerably easier by removing focus from lower layers. Basically, those lower layers (most mentioned above) are automated away by the PaaS platform.

This activity shows students, step-by-visual-step, how to start up a new coding environment and actually implement a small chunk of working software on Openshift.

Background readings:


Directions:

You may have heard of Software as a Service (SaaS), or Cloud Computing before. Examples of SaaS are that of Google Docs, Twitter, DropBox. Another flavor of Cloud Computing is Platform as a Service (PaaS). This cloud-hosted service allows developers to program apps and functionality in an easy to grasp, scale, and demo online environment. You can push stuff live very quickly, and you don't have to worry about the Operating System or getting database services running. Your infrastructure and coding platform are pre-taken-care-of. You just code your app. In the below tutorial, you will signup to the Openshift PaaS environment and start a simple Wordpress blog app.


Assure that you read the Background readings, so that you understand the Cloud Computing paradigm and what a Paas is.


Follow this tutorial:




Deliverables:

Create a blog post, with public URL, that talks about:

  1. What you learned
    • Both specific to OpenShift and generally about Cloud Computing and PaaS
  2. What troubles or more info you came across
    • Troubleshooting you did, additional info you learned about, etc
  3. What other ways you might use a PaaS environment in the future
    • What other apps and coding platforms / languages could you use?

Assessment:

Criteria Level 1 (fail) Level 2 (pass) Level 3 (exceptional)
Understands what Cloud / Utility Computing is Little to no understanding of Cloud Computing concepts and what was done Some understanding of wider concepts, though no extra work was done to understand it further Explained what they learned not only about the technical portion, but also about the Cloud computer paradigm in general; Showed proof of doing extra research or reading to understand wider concepts
Be able to quickly spin up an app in an online PaaS environment Couldnt get it running, didnt ask for help Got it running, but with problems that needed teacher help Wordpress Running, URL provided, no teacher help
Able to express your troubleshooting and solutions Little to no explanation of misunderstandings or errors or additional knowledge attained Explanation of a problem or gaining of clarity via self-driven curiosity or need Multiple points of troubleshooting and/or searching for separate / additional information because of personal curiosity
Create your own open source blog and post to it Blog non-existant or blank Blog expresses process and lessons learned but does not go further Blog expresses what process the student went through, troubleshooting, and further uses of PaaS environments
Explain what else PaaS can be used for No explanation of additional uses, or a complete mis-understanding of what PaaS offers Explanation of one additional language and usage-pattern, with little imagination behind PaaS's expansive possibilities Multiple creative uses explained for coding applications, and building web platforms

Comments:

What should the instructor know before using this activity? Instructor should understand what Cloud Computing is; If not, the pre-readings are necessary for the instructor. It would be useful for instrcutor to step through the instructions and create an app themselves.

What are some likely difficulties that an instructor may encounter using this activity? Grading the activity may be subjective and not reflective of student effort since much of the effort goes into implementing the Wordpress app, but then they are graded on the blog they post that recaps what they did.


Additional Information:

Knowledge Area/Knowledge Unit PD. Parallel and Distributed Computing / PD - Cloud Computing, PBD - Platform-based Development / PBD Web Platforms from ACM_Body_of_Knowledge
Topic Cloud services , Infrastructure as a service, Web programming languages (e.g., HTML5, Java Script, PHP, CSS) , Web platform constraints
Level of Difficulty Easy, though the Cloud Computing and Platform as a Service (PaaS) concepts are of medium difficulty to grasp
Estimated Time to Completion 2-3 hours
Materials/Environment What does the student need? Internet access, Email
Author Nick Yeates, Vinh Quốc Nguyễn
Source http://code.tutsplus.com/tutorials/running-wordpress-on-openshift-an-introduction--cms-20058
License Creative Commons CC-BY

Suggestions to Open Source Mentors:

Suggestions for an open source community member who is working in conjunction with the instructor.

  • Has the mentor ever programmed in a web or cloud computing environment of any kind? Share your experience and knowledge with the students.
  • Help students through troubleshooting and the last blog question: What else might PaaS platforms be used for? What kind of coding languages and apps might you use it to develop?



This work is licensed under a Creative Commons Attribution 4.0 International License

Personal tools
Namespaces
Variants
Actions
Events
Learning Resources
HFOSS Projects
Evaluation
Navigation
Toolbox