ISAC - Modulo Architectures and Technologies - LAB #2
Development and execution of a simple cloud app on Google App Engine.
1) SIGN UP FOR A CLOUD ACCOUNT AND INSTALL GOOGLE CLOUD SDK FOR JAVA
Follow the instruction reported at https://console.developers.google.com/start/appengine
2) IMPLEMENTING A SIMPLE CLOUD APP EXAMPLE
Download Lab.zip available at http://campus.unibo.it/151792/ and unpack it.
The same file is available at:
https://dl.dropboxusercontent.com/u/3652585/Lab.zip
The file containes a couple of directories:
- ISAC (Eclipse project)
- simple-cloud-app, which is the cloud app directort, including src/ and war/ subdirectories.
The cloud app simply answers to GET/POST messages and interact with the Datastore service using the Datastore API.
2) DEPLOY AND RUN THE APP LOCALLY
Note: App Engine supports Java 7. Make sure you have the Java 7 JDK installed.
Download and install Apache Maven version 3.0 or later.
The starter app includes an Apache Maven build file.
Build and run the sample locally using the following commands:
cd simple-cloud-app
mvn package
dev_appserver.sh target/simple-cloud-app-1.0
You can stop the server by pressing Ctrl-C in the command window.
Visit the locally running app in your browser: http://localhost:8080/demo
3) DEPLOY AND RUN THE APP ON THE CLOUD
Follow the instruction reported at https://console.developers.google.com/start/appengine,
for CREATING AND DEPLOYING THE PROJECT
As soon as a new project has been created, with some specific <ID> (e.g. omega-wind-601), then the app can be deployed from the local dev environment using the command:
appcfg.sh -A <ID> update target/simple-cloud-app
e.g.:
appcfg.sh -A omega-wind-601 update target/simple-cloud-app-1.0
being omega-wind-601 my project identifier.
After deploying your app, you can visit it with your browser at this URL:
<ID>.appspot.com
(e.g. omega-wind-601.appspot.com)
4) ANALYZING THE CLOUD APP BEHAVIOUR WITH THE GOOGLE DEV CONSOLE
https://console.developers.google.com/project