- Notifications
You must be signed in to change notification settings - Fork91
This repo is for the codelabs (free, online, self-paced tutorials) showing developers how they can deploy the same app locally *and* to all three fully-managed serverless compute platforms from Google Cloud w/just minor config changes.
License
googlecodelabs/cloud-nebulous-serverless
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
💥 ALERT!! |
---|
This repo will soon be relocating toGoogleCloudPlatform as we better organize these code samples! Stay tuned as more info is coming soon. |
This is the repo for a set of sample apps and corresponding codelabs (self-paced, hands-on tutorials) demonstrating how to call Google APIs fromGoogle Cloud serverless compute platforms (App Engine, Cloud Functions, Cloud Run). More on each platform below. Working wthCloud APIs differs fromnon-Cloud Google APIs, so that is how the samples are organized. The common aspect of all of sample apps is that they can be run locally or deployed to any of the 3 platforms without code changes (all done in configuration).
- App Engine (standard environment) — source-based application deployments (app-hosting in the cloud; "PaaS")
- App Engine is for users who wish to deploy a traditional (but not containerized) web stack (LAMP, MEAN, etc.) application direct from source code.
- Cloud Functions — cloud-hosted functions or microservices ("FaaS"), possibly event-driven
- If your app is relatively simple, is a single function, or perhaps some event-driven microservice,Cloud Functions may be the right platform for you.
- Cloud Run — fully-managed serverless container-hosting in the cloud ("CaaS") service
- If your apps are containerized or you have containerization as part of your software development workflow, useCloud Run. Containers free developers from any language, library, or binary restrictions with App Engine or Cloud Functions.
A "fourth" product,App Engine flexible environment, which sits somewhere between App Engine standard environment and Cloud Run, is out-of-scope for these sample apps at this time.
When running on App Engine or Cloud Functions, the Python runtime supplies a default web server (gunicorn
), but for Node.js,Express.js was selected. No default servers are available at all for Cloud Run, so Python developers can either run theFlask development server (default) or self-bundlegunicorn
(per your configuration). All Node.js deployments specify Express.js.
These samples were inspired by auser's suboptimal experience trying to create a simple App Engine app using a Cloud API. This was followed-up with the realization that there aren't enough examples showing users how to access non-Cloud Google APIs from serverless, hencethose samples.
The table below outlines the development languages, supported versions, deployments tested, and selected web frameworks (whose bundled development servers are used for running locally):
Language | Versions | Deployment | Framework |
---|---|---|---|
Python | 2.7 | local, cloud | Flask |
Python | 3.6+ | local, cloud | Flask |
Node.js | 10, 17 | local | Express.js |
Node.js | 10, 12, 14, 16 | cloud | Express.js |
While many Google APIs can be used without fees, use of GCP products & APIs isnot free. Certain products do offer an"Always Free" tier which you have to exceed in order to be billed. Reference any relevant pricing information linked below before doing so.
When enabling services, you may be asked for an active billing account which requires a financial instrument such as a credit card. Reference relevant pricing information before doing so. While Cloud Functions and Cloud Run share a similar Always Free tier and pricing model, App Engine is slightly different.
Furthermore, deploying to GCP serverless platforms incurminor build and storage costs.Cloud Build has its own free quota as doesCloud Storage. For greater transparency, Cloud Build builds your application image which is then sent to theCloud Container Registry, orArtifact Registry, its successor; storage of that image uses up some of that (Cloud Storage) quota as does network egress when transferring that image to the service you're deploying to. However you may live in region that does not have such a free tier, so be aware of your storage usage to minimize potential costs. (You may look at what storage you're using and how much, including deleting build artifacts viayour Cloud Storage browser.)
More specific cost information for each sample is available in their respective README files.
If you are a faculty member or lecturer at a regionally-accredited, degree-granting, and not-for-profit higher ed institution in one of75+ supported countries worldwide teaching a course where students are expected to code or use resources in the cloud, you may be eligible to grant your students (plus yourself and teaching assistants) free usage of Google Cloud. Explore faculty resources athttp://cloud.google.com/edu to learn more about oureducation (teaching and [initial] research) grants.@Students: send your instructors there so they can get you access to Google Cloud.
If you are an educator who wishes to add cloud computing to your curriculum or seek to enhance it with Google Cloud teaching materials, take a look at ourfree 10-module, 40-hour complete course.
For a hands-on learning experience on all aspects of Google Cloud, both students and faculty can get their hands on freetraining credits forCloud Skills Boost hands-on labs powered by QwikLabs. Apply for those credits athttp://cloud.google.com/edu as well.
Each app has its own testing battery; refer to each sample's folder to learn about implemented tests.
About
This repo is for the codelabs (free, online, self-paced tutorials) showing developers how they can deploy the same app locally *and* to all three fully-managed serverless compute platforms from Google Cloud w/just minor config changes.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.