I'm quite new to develop on GAE. Need just sort out few questions about setting up development.
I'm currently using Eclipse 3.7.x, Google Suite Plugin 2.5.2 r37
Related links I found:
http://code.google.com/p/googleappengine/issues/detail?id=1787
GAE - Development server in Eclipse doesn't update?
http://code.google.com/p/gae-wtp-plugin/
I came from standard LAMP development environment. Changes are propagated immediately to development server (usually localhost) and I can control deployment of application to production server through DCVS/SVN and attached handlers updating remote codebase.
I'd expect Google Plugin allowing us to do the same. Necessary functions I (probably) need:
On-Save handler to recompile and update development code
Production like development environment (for testing in almost-real conditions)
Deployment to production environment
The last one is simply using DCVS/SVN to tag code and save the trunk branch, and using Google > Deploy to App Engine option to push it to remote server.
But how can I solve the first two requirements? Do I really need them, or is it only my hangover from web development, and development process in GAE works differently?
If the first one is solvable through GAE WTP Plugin, can you please more elaborate on how to setup development with this plugin, as I was not able to achieve anything more, than server, which has to be restarted in the same manner as Google Plugin default GAE development server
does.
You can update development code pretty quickly with the yellow reload button. For me, with about 100 server classes, this takes 2-5 seconds.
The development environment is reasonably good - you can simulate HRD and stuff like that. Of course, it's not actually a distributed cloud environment - we do most testing on local servers, and then have a whole test app on the cloud for a last round of simulation. Of course, some things change when 1000 people are accessing it at once, but I don't know how to get around that.
You can find the reload button on the Development View pane:
Related
I have a Java Spring Boot Application, and I build it with Maven. With
spring-boot-maven-plugin,
I can create fat, executable jar file.
Then I copy it to the remote server and run. But sometimes,
I change only one line or event one word in my code and I had to do whole build/copy step again. I'm sure that I'm doing it wrong, but I couldn't find another way that more efficient (Like capistrano in Rails).
At this point, I'm planning to clone source code to server, push from local, pull from remote, build and run approach. What is the correct (or elegant) way of doing this deployment?
For automatic build and deployment process (continuous integration), you can use Jenkins. Refer this documentation for more details: https://jenkins.io/doc/
I would say it depends where are you trying to do it.
The best and the most agile way to do it for a controlled environment is surely a CI-CD (Continuous Integration and Continuous Deployment) pipelines, which complies-builds-tests-deploys your code against every commit made to the source code BUT it may be too slow to use CI-CD for a development environment where you had like to have a shorter feedback cycle and faster feedback to see how the code is progressing.
However, if you are talking about development environment, I will hit another chord and ask you why to deploy to the external server AT ALL while developing. When you use Spring Boot, which helps you develop a self-contained application, you get the Tomcat Server embedded with it for free. That gives you the choice to run the code anywhere you develop and test to move forward.
A simple maven goal - mvn spring-boot:run can make the code run anywhere you had like.
There is another magical library available in Spring-Boot, known as Devtools, which is meant to support agile developers. The library once in the app classpath, performs hot-swapping of byte-code to auto reload of code into the running application (running locally with embedded Tomcat) as soon there is a saved change. This is one of the coolest gadget that a developer can have.
Use of Spring-Loaded (or JRebel for non spring-boot apps) libraries can also help a developer do hot-swapping of byte code to load changes in running application as soon saved.
I hope it helps.
I'm making my GAE app using Eclipse. All the plugins, and other functionalities involved support development for the Standard Environment. Is there a way to convert my current project to the Flexible Environment? Barring that, once uploaded to GAE, can this change be done online?
The Flexible environment is an almost entirely different beast than the Standard environment.
Support for various pieces of infra differs. You need to check each piece of infra you use in the Migrating Services from the Standard Environment to the Flexible Environment guide for an equivalent, if there is one. Effectively you'd be re-writing the app.
Note the service in above article title - the environment choice is done at the app service/module level, one can mix services with both environments inside the same app.
And no - the change can not be done online, you need to explicitly deploy the re-written app service to switch its environment.
It would be nice if, once new code is tested, I could release changes to either a particular subdomain of my GAE app (such as demo.my-gae-app.com instead of my live environment at my-gae-app.com) or a particular backend instance (if subdomains are prohibited or not the right solution here).
Then, I can demo new code changes to my beta testers, and run performance tests against a real-life GAE environment. I know that the GAE SDK comes with a dev appserver, but it stubs most of the API calls, and doesn't handle scaling at all like a production environment would. And although we will absolutely use it for developers' local sandboxes as well as our QA environment, I just don't feel right release code into prod that hasn't ran against an environment that really mimics production.
How do other GAE developers/teams deal with this? I'm really just looking to have a pre-production environment (like "Demo")...but actually on live GAE app servers. Of course, I need to restrict access to this code so that only myself, my developers, my beta testers and our automated perf tests can access it... (that's the kicker).
You can deploy your code to a non-default application version, either by:
changing the version tag value in appengine-web.xml
calling appcfg.sh with -V version argument
changing the version in the deploy options of Google Eclipse plugin
After doing so, you can access your application by visiting version.appid.appspot.com
Note that different versions can access the same application datastore.
I registered a new application in Google app engine and deployed the beta version to it by changing project 's settings in eclipse. Then using google's tools (see Google doc) I copied the production datastore's content to the new beta app.
datastore in read-only mode while extracting data
Entity Keys could be problematic when working with unowned relationships - does anyone have information about this?
This provides me a perfect beta live environment.
I understand that Google's plugin for Eclipse tries to emphasize the "code-test-debug" cycle and make it as quick as possible, and that it comes with a medley of tools for doing just this.
What I don't understand is the need for a "developer" browser plugin for running your app inside Eclipse and testing locally on localhost. Why can't the plugin just start an embedded webserver and host it from there? Why does the browser require this plugin in the first place?
Tangential to that is the question of how it relates to development mode in general. Is Eclipse running in some kind of "special configuration" when in development mode that lets it talk with this browser plugin under the hood? If so, why is this necessary? Thanks in advance!
I believe you mixed two separate things here: GWT and GAE. GAE does not require browser plugin to run local dev server, while GWT requires browser plugin to run local dev mode (and even this is going away with 2.5 super devmode).
The confusion comes from the fact that Google bundles this two separate technologies into one plugin bundle, the GPE.
To avoid this just uncheck GWT when creating new GAE app.
Edit:
GWT dev plugin is only needed during dev mode. In this mode GWT Java source is not translated to javascript, but actually running in JVM as Java. This is needed to support debugging: https://developers.google.com/web-toolkit/doc/latest/DevGuideCompilingAndDebugging#DevGuideDevMode
Edit 2:
If you do not like the browser plugin, then you can use production mode on your local server. The downside to this is that compile-run will be greatly extended, since devmode compiles in-place: you can simply change GWT code and see changes by simply reloading browser window.
I am split between the benefits of developing Java (non-commercial) webapps and deploying to something like Aptana or Google cloud, or just going with a Slice Host account. Tomcat or Jetty and MySQL are really my only big requirements. Aptana and Google App Engine come with some cool Eclipse deployment options, but does scalability really matter without a large user base for the apps?
Also, both Aptana and Google App Engine seem to be in infant stages, so I'm wondering if there will be too many restrictions, even for small time development. Anyone have experience with these?
I can't speak to Aptana but Google App Engine is a radically different development experience from what you'll get with something like Slicehost. It scales differently (i.e. you've got the possibility of handling much larger loads) but it's also totally different than running your own web app server (e.g. Glassfish, Tomcat, JBoss, etc.) and coding using "standard" Java tools.
With Slicehost or any hosted solution it's easy to setup your own development environment locally which exactly mimics what you'll be running on the server. Same software, same VM, maybe even the same version of Linux. You could even move to a different host and still be able to setup that same environment.
With Google App Engine you'll find yourself building on an emulator (you don't really run BigTable locally) so there's not a one to one correspondence between your environment and that on the server. There's no alternative place to move to and still be running in the same environment either. Also, some perhaps many of the popular Java frameworks you might use for a web app development will either not work at all (e.g. ) or will not work out-of-the-box (see here for more details).
I'm not down on the App Engine, in fact, I think it's really cool. If the demand for your apps is relatively low and therefore you're not in need of the huge scaling requirements, but your traffic is not so low that you fit comfortably within the free allowance at Google then I would probably lean towards a hosted solution like Slicehost instead.
I use slicehost and I am happy with the result so far. Its easy to upgrade your slice (I had to do it once already) and its easy to rollback to a backup of the slice (I had to do that once too). I am hosting Tomcat and MySQL.
Bear in mind, Google App Engine does not give you a full JRE. You cannot spawn threads directly, for example. Also, I have found that the GAE datastore performance is too slow -- I run into timeout exceptions constantly. In sum, it is not a true application hosting solution. You have to heavily tailor your application to make it run on GAE.
I'd suggest using Amazon Web Services. You get the power of the cloud with no limitations to your app, unlike App Engine.