<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Google Cloud Platform on Andrew Khoury</title><link>https://www.drewkhoury.com/tags/google-cloud-platform/</link><description>Recent content in Google Cloud Platform on Andrew Khoury</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><copyright>Copyright © 2021, Andrew Khoury; all rights reserved.</copyright><lastBuildDate>Mon, 14 Oct 2019 13:46:01 +0000</lastBuildDate><atom:link href="https://www.drewkhoury.com/tags/google-cloud-platform/index.xml" rel="self" type="application/rss+xml"/><item><title>Automating Google App Engine</title><link>https://www.drewkhoury.com/post/automating-google-app-engine-9599b51f0974/</link><pubDate>Mon, 14 Oct 2019 13:46:01 +0000</pubDate><guid>https://www.drewkhoury.com/post/automating-google-app-engine-9599b51f0974/</guid><description>
&lt;p>Google App Engine is &lt;a href="https://www.linkedin.com/pulse/how-do-devops-10-minutes-less-andrew-khoury/">a pretty amazing service&lt;/a>. You write code, and Google will make sure it runs, and scales well. This service was &lt;strong>available way back in 2008&lt;/strong>, well before everyone was getting excited over lambdas and serverless.&lt;/p>
&lt;p>In my opinion, AppEngine is one of the most underrated services I’ve seen. It’s beautifully simple, and it has planet-level scaling (Google words). You don’t have to configure load balancers, tweak an OS or install/configure a Runtime. The focus is on optimizing for the developer experience, and having your spend more time writing code.&lt;/p>
&lt;p>Even though Google makes it easy to get started with App Engine I wanted to reduce the steps even further. I’ve created a GAE demo that offers a local development and deployment environment via docker containers and simple to use commands.&lt;/p>
&lt;h3 id="google-app-enginedemo">Google App Engine Demo&lt;/h3>
&lt;p>&lt;strong>Local Development&lt;/strong>&lt;/p>
&lt;p>Creating a local development environment can be done with one command:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-fallback" data-lang="fallback">&lt;span class="ln">1&lt;/span>~/code/gae-demo $ docker-compose up local
&lt;/code>&lt;/pre>&lt;/div>&lt;p>This is what the console output should look like:&lt;/p>
&lt;p>&lt;img src="https://cdn-images-1.medium.com/max/800/1*3xPuZNa4CdEUxIPqDdYnGw.png" alt="">&lt;/p>
&lt;p>This is what the app looks running on your machine:&lt;/p>
&lt;p>&lt;img src="https://cdn-images-1.medium.com/max/800/1*nWX-jfZeUS7f4ctvgo2HZw.png" alt="">&lt;/p>
&lt;p>The demo app comes with instructions and sample code that adds entries to a local datastore.&lt;/p>
&lt;p>One of the amazing features of Google App Engine is the local admin environment that offers similar functionality to the online admin console from Google. The demo comes with everything pre-configured and ready to use.&lt;/p>
&lt;p>&lt;em>Local Datastore Viewer:&lt;/em>&lt;/p>
&lt;p>&lt;img src="https://cdn-images-1.medium.com/max/800/1*Hah8fDHL9W5LbpzgUG9MFw.png" alt="">&lt;/p>
&lt;p>&lt;em>Interactive Console:&lt;/em>&lt;/p>
&lt;p>&lt;img src="https://cdn-images-1.medium.com/max/800/1*Xd7M9eglzNFVjtEDQSN1IA.png" alt="">&lt;/p>
&lt;p>Not bad for one line of code!&lt;/p>
&lt;p>&lt;strong>Deploying&lt;/strong>&lt;/p>
&lt;p>Google has a wonderful feature called “ &lt;a href="https://cloud.google.com/resource-manager/docs/creating-managing-projects">Projects&lt;/a>” that allow you to group related resources to make them easier to manage. When you run the `new-deploy` command the demo will create a new project and related application, then deploy it for you.&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-fallback" data-lang="fallback">&lt;span class="ln">1&lt;/span>~/code/gae-demo $ docker-compose up new-deploy
&lt;/code>&lt;/pre>&lt;/div>&lt;p>Deploying updates to your application is quick and easy too. First specify your project id from the previous step, then run &lt;code>re-deploy&lt;/code>.&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-fallback" data-lang="fallback">&lt;span class="ln">1&lt;/span>~/code/gae-demo $ export CLOUDSDK\_CORE\_PROJECT=devops-demo-xxx ~/code/gae-demo $ docker-compose up re-deploy
&lt;/code>&lt;/pre>&lt;/div>&lt;p>That’s it, why are you still here? You could be spending this time deploying your new application.&lt;/p>
&lt;p>You can find the full demo and instructions here: &lt;a href="https://github.com/drewkhoury/gae-demo">https://github.com/drewkhoury/gae-demo&lt;/a>&lt;/p>
&lt;div class="notices info">
&lt;div class="label">Info&lt;/div>
&lt;p>Also posted on medium as &lt;a href="https://medium.com/@drew.khoury/automating-google-app-engine-9599b51f0974">Automating Google App Engine&lt;/a>.&lt;/p>
&lt;/div></description></item><item><title>DevOps in 10 minutes with Google App Engine</title><link>https://www.drewkhoury.com/post/devops-in-10-minutes-with-google-app-engine-d98638bd0699/</link><pubDate>Wed, 09 Oct 2019 13:16:01 +0000</pubDate><guid>https://www.drewkhoury.com/post/devops-in-10-minutes-with-google-app-engine-d98638bd0699/</guid><description>
&lt;p>Okay, now that I have your attention let’s talk about Google App Engine for a minute and how you can achieve your DevOps dreams with a fully managed serverless application platform.&lt;/p>
&lt;h3 id="app-enginehistory">App Engine history&lt;/h3>
&lt;p>&lt;a href="https://cloud.google.com/appengine/">App Engine&lt;/a> launched 10 years ago as a tool to run web applications on Google infrastructure. App Engine only supported Python at the time, but the service offered dynamic webserving, persistent storage (Datastore), and APIs for authenticating users and sending email.&lt;/p>
&lt;p>&lt;img src="https://cdn-images-1.medium.com/max/800/0*dn60QDAaQTjBob9I" alt="">&lt;/p>
&lt;p>Fast forward to 2019 and the App Engine offering has matured. The standard environment is optimised for rapid scaling (sudden and extreme spikes of traffic) or apps intended to run for free or at very low cost.&lt;/p>
&lt;ul>
&lt;li>Python 2.7, Python 3.7&lt;/li>
&lt;li>Java 8&lt;/li>
&lt;li>Node.js 8, and Node.js 10 (beta)&lt;/li>
&lt;li>PHP 5.5, and PHP 7.2 (beta)&lt;/li>
&lt;li>Go 1.9, and Go 1.11 (beta)&lt;/li>
&lt;/ul>
&lt;p>If you need something else, the flexible environment offers Python, Java, Node.js, Go, Ruby, PHP, or .NET, or any other software that you can run in a container.&lt;/p>
&lt;p>But it’s more than just a code runtime engine. Google markets App Engine as having zero-config deployments and zero server management, allowing you to focus on writing code (that sounds like my kind of DevOps). App Engine offers Monitoring, Logging &amp;amp; Diagnostics, Traffic Splitting and Application Versioning (those features you normally hear about when talking about “DevOps” or CI/CD).&lt;/p>
&lt;h3 id="getting-started-with-appengine">Getting started with App Engine&lt;/h3>
&lt;p>Assuming you already have a Google Cloud account, creating a deploying your first App Engine App consists three easy steps:&lt;/p>
&lt;ul>
&lt;li>Create a Project to store all your related resources&lt;/li>
&lt;li>Create an App&lt;/li>
&lt;li>Deploy your App&lt;/li>
&lt;/ul>
&lt;p>gcloud projects create project-demo-xxx \&lt;br>
&lt;em>--name=&amp;quot;project demo xxx&amp;quot; --labels=type=test&lt;/em>&lt;/p>
&lt;p>gcloud app create &lt;em>--region=australia-southeast1 \&lt;/em>&lt;br>
&lt;em>--project project-demo-xxx&lt;/em>&lt;/p>
&lt;p>gcloud app deploy &lt;em>--project project-demo-xxx&lt;/em>&lt;/p>
&lt;p>Normally, navigating a new Cloud vendor, a new product, and new concepts and troubleshooting demo code can be time consuming and error prone. I know, I’ve gone through this process myself.&lt;/p>
&lt;p>If you’re interested in giving App Engine a go (and I encourage you to do so, because it’s a fantastic example of what an integrated serverless platform should look like) you can head over to &lt;a href="https://github.com/drewkhoury/gae-demo">https://github.com/drewkhoury/gae-demo&lt;/a> and try it yourself. I’ve streamlined the whole process to try and get you up and running as quickly as possible:&lt;/p>
&lt;ul>
&lt;li>How to authenticate with Google via the command-line&lt;/li>
&lt;li>Taking advantage of the local environment Google provides (dev_appserver.py)&lt;/li>
&lt;li>Sample Python App that’s optimised for App Engine&lt;/li>
&lt;li>Docker containers / Docker compose for consistency (local development and deployment)&lt;/li>
&lt;/ul>
&lt;p>&lt;img src="https://cdn-images-1.medium.com/max/800/0*XL_nBGQDjt7SSZuK" alt="">&lt;/p>
&lt;p>Let me know what you think of Google App Engine after you give it a go!&lt;/p>
&lt;div class="notices info">
&lt;div class="label">Info&lt;/div>
&lt;p>Also posted on:&lt;/p>
&lt;ul>
&lt;li>medium as &lt;a href="https://medium.com/@drew.khoury/devops-in-10-minutes-with-google-app-engine-d98638bd0699">DevOps in 10 minutes with Google App Engine&lt;/a>&lt;/li>
&lt;li>and LinkedIn as &lt;a href="https://www.linkedin.com/pulse/how-do-devops-10-minutes-less-andrew-khoury/">DevOps in 10 minutes with Google App Engine&lt;/a>&lt;/li>
&lt;/ul>
&lt;/div></description></item></channel></rss>