Developing in the cloud

Cloud Source Repositories

Is a way to keep code private to a GCP project and use IAM permissions to protect it, but not have to maintain the Git instance yourself. It provides Git version control for services, including the ones that run on App Engine, Compute Engine and Kubernetes Engine.

You can have any number of private Git repositories. It contains a source viewer.

Cloud Functions

Avoids the need to integrate several functions into your application for event-driven parts. This need is solved by writing a single purpose function that can automatically react to events.

With this you don’t have to worry about servers or runtime binaries. You just write your code for a GCP environment that GCP provides and then configure when it should fire.

There’s no need for you to pay for servers. You just pay whenever your functions run, in 100ms intervals.

Cloud Functions can trigger on

  • events in Cloud Storage
  • Cloud Pub/Sub
  • in HTTP call

How it works? You choose which events you care about. For each event type, you tell Cloud Functions you’re interested in it. These declarations are called triggers. Then you attach JavaScript functions to your triggers. You don’t have to provision compute resources for them.

This can hold entire microservices apps. Another usage is to enhance existing applications without having to worry about scaling.

Deployment Manager

It’s an Infrastructure Management Service that automates the creation and management of your GCP resources for you.

It allows you to set a declarative specification of what an environment should look like (template), instead of guessing commands and do it by hand (imperative).

To use it, you create a template file, using either YAML or Python, that describes what you want the components of your environment to look like. Then you give this template to Deployment Manager, which figures out an ddoes the actions needed to create the environments your template describes. If you need to change something, just edit your template and tell Deployment Manager to update.

You can source control your templates in Cloud Source repositorioes.

Stackdriver

This is GCP’s tool for monitoring, logging and diagnostics. Gives you access to many signals and metrics from your software and gives you insight into your apps health, performance and availability.

Core components

  • monitoring checks the endpoints of web apps and other internet accessible services running on your cloud environment
  • logging lets you view logs from your apps and filter and search on them. It also lets you define metrics, export logs to BigQuery, Cloud Storage and Cloud PubSub
  • trace samples the latency of App Engine apps and report per-URL statistics
  • error reporting tracks and groups the errors in your cloud apps and it notifies you when new errors are detected
  • debugger It connects your apps production data to your source code so you can inspect the state of your app at any code location in product. This means you can view the stage without adding new logging statements
  • profiler