Date: Aim: ToinstallGoogleAppEngine.Createhelloworldappandothersimplewebapplicationsusingpython/java
GoogleCloudPlatform(GCP)
GoogleCloudPlatform(GCP),offeredbyGoogle,isasuiteofcloud computingservicesthatrunsonthesameinfrastructurethatGoogleuses internally for its end-user products, such as Google Search,Gmail,filestorage, andYouTube. Alongsideasetofmanagementtools,itprovidesaseriesofmodularcloudservicesincludingcomputing,datastorage,dataanalyticsandmachinelearning. GoogleCloudPlatformprovidesinfrastructureasaservice,platformasaservice,andserverlesscomputingenvironments.
Platform asaService(PaaS) Cloudcomputingservicewhichprovidesacomputingplatformandasolutionstack asaservice. Consumercreatesthesoftwareusingtoolsand/or libraries fromtheprovider. Providerprovidesthenetworks,servers,storage,etc.
GoogleAppEngine:
GoogleAppEnginewasfirstreleasedasabetaversioninApril2008. 2 5
It isaisa PlatformasaService(PaaS)cloudcomputingplatformfordevelopingandhostingwebapplicationsinGoogle-manageddatacenters. Google‘sAppEngineopensGoogle‘sproductiontoanypersonintheworldatno charge. GoogleAppEngineissoftwarethat facilitatestheusertorunhiswebapplicationsonGoogleinfrastructure. Itismorereliablebecausefailureofanyserver willnotaffecteithertheperformanceoftheenduserortheserviceoftheGoogle. Itvirtualizesapplicationsacross multipleserversanddatacenters. Othercloud-basedplatformsincludeofferingssuchas Amazon Web
ServicesandMicrosoft's AzureServices Platform.
IntroductionofGoogleAppEngine GoogleAppEngineletsyourunyourwebapplicationsonGoogle'sinfrastructure. App Engine applications are easy to build, easy to maintain,andeasytoscaleasyourtrafficanddatastorageneedsgrow.WithAppEngine,there are no servers to maintain :You just upload your application, and it'sreadytoserveyourusers. You can serve your app from your own domain name (suchas https://www.example.com/) using Google Apps. Or, you can serve yourapp using a free name on the appspot.com domain. You can share yourapplicationwiththeworld, orlimitaccesstomembersofyour organization. GoogleAppEnginesupportsappswritteninseveral programminglanguages. With AppEngine'sJavaruntimeenvironment,youcan buildyourappusingstandardJavatechnologies,includingtheJVM,Javaservlets,andtheJavaprogramming language—oranyotherlanguageusingaJVM-basedinterpreterorcompiler,suchasJavaScriptorRuby. AppEnginealsofeaturesadedicatedPythonruntimeenvironment,whichincludesafastPythoninterpreter and thePythonstandardlibrary.TheJavaandPythonruntimeenvironmentsarebuilttoensurethatyourapplicationrunsquickly,securely,andwithoutinterferencefromotherappsonthesystem. With AppEngine, you only pay for what you use. There are no set-up costsand no recurring fees. The resources your application uses, such as storageandbandwidth,aremeasuredbythegigabyte,andbilledatcompetitiverates.You control the maximum amounts of resources your app can consume, so italwaysstayswithinyourbudget.App Enginecostsnothingto getstarted. Allapplicationscanuseupto500MBofstorageandenoughCPUandbandwidth to support an efficient app serving around 5million page views amonth,absolutelyfree.Whenyouenablebillingforyourapplication,yourfreelimits are raised, and you only pay for resources you use above the freelevels. Architecture ofGoogleAppEngine
GAEApplicationEnvironment:
Google App Engine makesit easy tobuild an application that runs reliably,even under heavy load and with large amounts of data. App Engine includes thefollowingfeatures: Persistentstoragewithqueries, sortingandtransactions Automaticscalingandloadbalancing APIsforauthenticatingusersandsendingemailusingGoogleAccounts Taskqueuesforperforming workoutsideofthescopeofawebrequest Scheduledtasksfortriggering eventsatspecifiedtimesandregularintervals
Dynamicwebserving,withfullsupport forcommonwebtechnologies
JavaRuntimeEnvironment
You can develop your application for the Java runtime environment usingcommon Java web development tools and API standards. Your app interactswith the environment using the Java Servlets standard, and can use commonwebapplication technologiessuchasJavaServerPages TheJavaruntimeenvironmentusesJava6.TheAppEngineJavaSDKsupports developing apps using either Java5 or 6.The environment includestheJavaSERuntimeEnvironment(JRE)6platformandlibraries.TherestrictionsofthesandboxenvironmentareimplementedintheJVM.Anappcan use any JVM byte code or library feature, as long as it does not exceedthesandboxrestrictions.Forinstance,bytecodethatattemptstoopenasocketorwritetoafilewillthrow aruntimeexception. YourappaccessesmostAppEngineservicesusingJavastandardAPIs.Forthe AppEngine data store, the Java SDK includes implementations of the JavaDataObjects(JDO)andJavaPersistenceAPI(JPA)interfaces.Yourappcanuse the JavaMailAPItosend emailmessageswiththeAppEngineMailservice.Thejava.netHTTPAPIsaccessestheAppEngineURLfetchservice. AppEnginealsoincludeslow-levelAPIsforitsservicestoimplementadditionaladapters,ortousedirectlyfromtheapplication.Seethedocumentationforthedatastore,memcache,URLfetch,mail,imagesandGoogleAccountsAPIs.Typically,JavadevelopersusetheJava programming languageandAPIstoimplementwebapplicationsfortheJVM. WiththeuseofJVM-compatiblecompilersorinterpreters,youcanalso useotherlanguagestodevelopwebapplications,suchas JavaScript,Ruby.
WorkflowofGoogleAppEngine
Step1:Logintowww.cloud.google.com
Step2:GotoConsole
Step3:GoogleCloudPlatformisshown
Step4:ClickDashboardintheGoogleCloudPlaform
Step5:DashboardintheGoogleCloudPlaform
Step6:ClickNewProjectandgiveuniqueProjectName.
Example:kcet-cloud-project
Step7:GoogleAppEngineisinitated
Step8: ClickcreateApplication
Step9:CreateappandSelectLanguagePython
Step10: PythonappiscreatedinGoogleAppEngine
Step11 :PythonappEngineapplicationiscreated
Step12:ClickCloudShellintheKathir-Cloud-Project
Step13:CreateaDirectoryPythonProjectusingmkdircommand
Syntax: mkdirPythonProject Step14:ClickEditortocreatePython application
Step 15:ClickNew Filein thePythonProjectFolder(Pythonfile)
Step16:Createmain.pyfile
print("HelloWorld")
Step17:Createapp.yamlfile
runtime:python27api-version:1threadsafe:falsehandlers: url:1script:Index.py
Step18:Createrequirements.txtfile
requirements.txt Flask= =0.11.1 gunicorn==19.6.0
Step19:MovetoCloudShellEnvironmenttoruntheapplication
Step20:MovetoCloudShellEnvironmenttoruntheapplication Syntax:gcloudappdeploy
Continuetheapplication.Itenableserviceonthegivenproject
Itstartedbuildingtheobjectandfetchingthestorageobjectforthecreatedapplication
Itisupdatingtheservice
TheapplicationissuccessfullydeployedandURLishttps://expanded- curve-289413.uc.r.appspot.com Step21:Run yourprograminthebrowser
Step22:Hello WorldProgramissucessfullyruninthebrowser
Result:
Thus the Google App Engine is installed successfully and a web application todisplayhelloworldusingpythonisdevelopedanddeployedintheGAEandusedGAELaunchertolaunchthe webapplications.