You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-3
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,8 @@
1
+
|:boom: ALERT!! |
2
+
|:---------------------------|
3
+
| This repo will soon be relocating to [GoogleCloudPlatform](https://github.com/GoogleCloudPlatform) as we better organize these code samples! Stay tuned as more info is coming soon. |
4
+
5
+
1
6
# Modernizing Google Cloud serverless compute applications
2
7
### To the latest Cloud services and serverless platforms
3
8
@@ -57,15 +62,29 @@ These are the challenges developers are facing, so the purpose of this content i
57
62
> **NOTE:** App Engine ([Flexible](https://cloud.google.com/appengine/docs/flexible/python/runtime?hl=en#interpreter)) is a next-gen service but is not within the scope of these tutorials. Curious developers can compare App Engine [Standard vs. Flexible](https://cloud.google.com/appengine/docs/the-appengine-environments) to find out more. Also, many of the Flexible use cases can now be handled by [Cloud Run](http://cloud.run).
58
63
59
64
60
-
## Progression (START and FINISH)
65
+
## Progression (what order to do things)
66
+
67
+
### "START" and "FINISH" repo folders
61
68
62
69
All codelabs begin with code in a START repo folder and end with code in a FINISH folder, implementing a single migration. Upon completion, users should confirm their code (for the most part) matches what's in the FINISH folder. The baseline migration sample app (Module 0; link below) is a barebones Python 2.7 App Engine app that uses the `webapp2` web framework plus the `ndb` Datastore library.
63
70
64
71
1. With _Module 0_ as the STARTing point, the Module 1 codelab migrates from the `webapp2` web framework to Flask, FINISHing at code matching the _Module 1_ repo.
65
72
1. Next, STARTing with the _Module 1_ application code (yours or ours), _Module 2_ migrates from `ndb` to Cloud NDB, ending with code matching the (Module 2) FINISH repo folder. There's also has a bonus migration to Python 3, resulting in another FINISH repo folder, this one deployed on the next-generation platform.
66
73
1._Your_ Python 2 apps may be using other built-in services like Task Queues or Memcache, so additional migration modules follow, some more optional than others, and not all are available yet (keep checking back here for updates).
67
74
68
-
Beyond Module 2, with some exceptions, **there is no specific order** of what migrations modules to tackle next. It depends on your needs (and your applications').
75
+
### The order of migrations
76
+
77
+
Beyond Module 2, with some exceptions, **there is no specific order** of what migrations modules to tackle next. It depends on your needs (and your applications'). However, there are related migrations where one or more modules must be completed beforehand. This table attempts to put an order on module subsets.
78
+
79
+
Topic | Module ordering | Description
80
+
--- | --- | ---
81
+
Baseline | 0 ⇒ 1 | Not a migration but a description of the baseline application (review this material before doing any migrations)
82
+
Web framework | 1 ⇒_everything else_ | Current App Engine runtimes do not come with a web framework, so this must be the first migration performed. All migrations below can be performed after this one.
83
+
Datastore | 2 [⇒ 3 [⇒ 6]] | Moving off App Engine `ndb` makes your apps more portable, so the **Module 2** Cloud NDB migration is _recommended_. **Module 3:** Migrating to Cloud Datastore (Firestore in Datastore mode) is _optional_ and only recommended if you have other code using Cloud Datastore. **Module 6**: Migrating to Cloud Firestore (Native mode) is generally _not recommended_ unless you must have the Firebase features it has, and those features will eventually be integrated into Cloud Datastore.
84
+
(Push) Task Queues | [7 ⇒] 8 [⇒ 9] | Moving off App Engine `taskqueue` makes your apps more portable, so the **Module 8** Cloud Tasks migration is _recommended_ for those using push tasks. Those unfamiliar with push tasks should do **Module 7** first to add push tasks to the sample app. **Module 9:** Migrating to Cloud Datastore (Firestore in Datastore mode), Cloud Tasks (v2), and Python 3 is _optional_ and only recommended if you have other code using Cloud Datastore and considering upgrading to Python 3.
85
+
Memcache | [12 ⇒] 13 | Moving off App Engine `memcache` makes your apps more portable, so the **Module 13** Cloud Memorystore (for Redis) migration is _recommended_ for those using `memcache`. Those unfamiliar with `memcache` should do **Module 12** first to add its usage to the sample app.
86
+
Cloud Functions | 11 | Cloud Functions does not support Python 2, so after the Module 1 migration, you need to upgrade your app to Python 3 before attempting this migration, recommended if you have a very small App Engine app, or it has only one function/feature.
87
+
Cloud Run | 4 or 5 | **Module 4** covers migrating to Cloud Run with Docker. Those unfamiliar with containers or do not wish to create/maintain a `Dockerfile` should do **Module 5**. Those doing **Module 4** will get additional information about Cloud Run in **Module 5** not covered in **Module 4**.
69
88
70
89
71
90
## Migration modules
@@ -86,7 +105,7 @@ Module | Topic | Video | Codelab | START here | FINISH here
86
105
6|Migrate to Cloud Firestore| _N/A_ | _N/A_ | Module 3 [code](/mod3b-datastore) (3.x) | _no work required; [Datastore upgrade automatic](https://cloud.google.com/datastore/docs/upgrade-to-firestore)_
# Module 13 - Migrate from App Engine `memcache` to Cloud Memorystore
2
2
3
-
This repo folder is the corresponding Python 3 code to a pair of different migrations related to the Module 12 and 13 codelabs. The tutorial either...
3
+
This repo folder is the corresponding Python 3 version of the Module 13 app.
4
4
5
-
- STARTs with the _Python 3_ code in the [Module 12b repo folder](/mod12b-memcache) and leads developers through migrations from App Engine `memcache` to Cloud Memorystore and App Engine `ndb` to Cloud Datastore (skipping Cloud NDB); **or**,
6
-
- STARTs with the _Python 2_ code in the [Module 13a repo folder](/mod13a-memorystore) and leads developers through migrations from Cloud NDB to Cloud Datastore, mirroring the content covered in [Module 3](http://g.co/codelabs/pae-migrate-datastore), and also a BONUS migration from Python 2 to 3.
7
-
8
-
Either way, both set of migrations culminate in the code in this (`mod13b-memorystore`) folder.
5
+
- All files in this folder are identical to the _Python 2_ code in the [Module 13a repo folder](/mod13a-memorystore)**except**:
6
+
1.`app.yaml` was modified for the Python 3 runtime.
7
+
1.`appengine_config.py` is unused and thus deleted.
8
+
- An optional migration from Cloud NDB to Cloud Datastore can be achieved via the content covered in [Module 3](http://g.co/codelabs/pae-migrate-datastore).
9
+
- The _Python 3_ version of the Module 12 app ([Module 12b repo folder](/mod12b-memcache)) features additional code to support those App Engine legacy ("bundled") services (like `memcache`). Because the app in this folder does not use such services (moved to Cloud Memorystore), that extra support does not appear, so the code here should not be considered a direct migration of that app to Cloud Memorystore (and Cloud NDB), unlike the Python 2 equivalents (Modules [12a](/mod12-memcache) and [13a](/mod13a-memorystore)) which can.
Copy file name to clipboardExpand all lines: mod9-py3dstasks/README.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Module 9 - Migrate from Python 2 to 3 and Cloud NDB to Cloud Datastore
2
2
3
-
This repo folder is the corresponding Python 3 code to the [Module 9 codelab](http://g.co/codelabs/pae-migrate-py3dstasks). The tutorial STARTs with the Python 2 code in the [Module 8 repo folder](/mod7-cloudtasks) and leads developers through migrating from Python 2 to 3, Cloud NDB to Cloud Datastore plus any changes from Cloud Tasks v1 to v2, culminating in the code in this folder. One major addition to look for here vs. Module 8 is that App Engine `taskqueue` creates a `default` push queue while Cloud Tasks does not, so that now has to be done in code.
3
+
This repo folder is the corresponding Python 3 code to the Module 9 codelab (_TBD_). The tutorial STARTs with the Python 2 code in the [Module 8 repo folder](/mod7-cloudtasks) and leads developers through migrating from Python 2 to 3, Cloud NDB to Cloud Datastore plus any changes from Cloud Tasks v1 to v2, culminating in the code in this folder. One major addition to look for here vs. Module 8 is that App Engine `taskqueue` creates a `default` push queue while Cloud Tasks does not, so that now has to be done in code.
4
4
5
5
**NOTE: Backport to Python 2**: When migrating this app to Python 3, we added a Python 3 dependency: the `print()` function. If for any reason you need to get back on Python 2 App Engine, you would have to:
0 commit comments