New developer experiences for Cloud Platform

MAR 26, 2014
By Cody Bratt, Google Cloud Platform team

Cross-posted from the Google Cloud Platform blog

Editor's note: This post is a follow-up to the announcements we made on March 25th at Google Cloud Platform Live.

Yesterday, we unveiled a new set of developer experiences for Google Cloud Platform that are inspired by the work we've done inside of Google to improve our developers productivity. We want to walk you through these experiences in more detail and how we think they can help you focus on developing your applications and growing your business.

Isolating production problems faster

Understanding how applications are running in production can be challenging and sometimes it's unavoidable that errors will make it into production. We've started adding new capabilities to Cloud Platform this week that make it easier to isolate and fix production problems in your application running on Google App Engine.

We are adding a 'Diff' link to the Releases page (shown below) which will bring you to a rollup of all the commits that happened between deployments and the source code changes they introduced. Invaluable when you are trying to isolate a production issue.
deploymentdiff.png
You can see here where Brad introduced an error into production.
But, looking at source changes can still be like looking for a needle in a haystack. This is why we're working to combine data from your application running in production and link it with your source code. logviewer
In the new and improved logs viewer, we aggregate logs from all your instances in a single view in near real time. Of course, with high traffic levels, just browsing is unlikely to be helpful. You can filter based on a number of different criteria including regular expressions and the time when you saw an issue. We've also improved the overall usability by letting you scroll continuously rather than viewing 20 logs per page at a time.

Ordinarily, debugging investigations from the logs viewer would require you to find the code, track down the right file and line and ensure it's the same version that was deployed in production. This can cause you to completely lose context. In order to address this, we've added links from stack traces to the associated code causing them for push-to-deploy users. In one click you are brought to the source viewer at the revision causing the problem with the associated line highlighted. Screen
      Shot 2014-03-21 at 1.36.21 PM.png Shortening your time to fix

You may have noticed the 'Edit' buttons in the source viewer. We're introducing this because we think that finding the error in production is only part of the effort required when things go awry. We continue to ask ourselves how we can make it even faster for you to fix problems. One of the ways we do this inside Google today is to make the fix immediately from the browser.

So, we're bringing this to you by making it possible to edit a file in place directly from the source viewer in the Console. You can simply click the 'Edit' button, make your changes to that file, and click the 'Commit' button. No local setup required. We also know that sometimes fixes aren't that simple and we're investigating ways we can make it easy to seamlessly open your files in a desktop editor or IDE directly from the Console.
commitdialog.png
Fix simple problems directly in the browser
commit successful.png
Trigger your push-to-deploy setup instantly
Since we've integrated this with your push-to-deploy configuration, the commit triggers any build and test steps you have to ensure your code is fully vetted before it reached production. Further, since we've built this on top of Git, each change is fully attributed and traceable in your Git repository. This is not SSHing into a machine and hacking on code in production.

An integrated ecosystem of tools you know

Speaking of using other editors, we believe that you are most productive when you have access to all the tools you know and love. That's why we're committed to creating a well integrated set of experiences across those tools, rather than than asking you to switch. With the Git push-to-deploy feature we launched last year, we wanted to make it easy for you to deploy your application utilizing standard Git commands while giving you free private hosted Git repositories. In addition, we understand that many of you host your source code on GitHub and in fact so does the Google Cloud Platform team. As you can see from the new 'Releases' page we showed this week, we're introducing the ability to connect your GitHub repository to push-to-deploy. We will register a post-commit hook with GitHub to give you all the deployment benefits without moving your source code. Just push to the master branch of your GitHub repository and your code will be deployed!
Push-to-deploy now supports Java builds
Next, we're excited to introduce new release types for you to use with push-to-deploy. As you can see above, this project is set up to trigger a build, run all your unit tests, and if they all pass, deploy. Taking a peek under the covers, we utilize a standard Google Compute Engine virtual machine that you own running in your project to perform this build and test. In this case, Google has automatically provisioned the machine with Maven and Jenkins and everything you need to build and run your tests. Your build and tests can be as complex as they need to be and they can use all the resources available on that machine they need to run. What's more is that all the builds will be done on a clean machine ensuring reliable, repeatable builds on every release. We're starting with Maven-based Java builds, but working to release support for other languages, test frameworks and build systems in the future.
releasehistory.png
The release history showing build, test and deployment status
Tying this together, we've simplified getting started on your projects by introducing the new 'gcloud' command in the Google Cloud SDK. The Google Cloud SDK contains all the tools and libraries you need to create and manage resources on the Cloud Platform. We recently posted some Cloud SDK tips and tricks. Now, using the 'gcloud init' command, we make setting up a local copy of your project fast by finding your project's associated Git repository and downloading the source code, so all you have to do is change directories and open your favorite editor. gcloudinit
Once you are initialized, all you need to do is start writing code. After you're done, running 'git push' will push your changes back to the remote repository and trigger your push-to-deploy flow. Then, all your changes will also be available to view on the 'Source' page in the Console.

We'll be rolling out these features to you in stages over the coming weeks, but if you are interested in being a trusted tester for any of them, please contact us here. We're very excited to hear how you're using these tools and what features we can build on top of them to make your developer experience even more seamless and fast. We're just getting started.

Cody Bratt is a product manager on the Google Cloud Platform team

Posted by Louis Gray, Googler