File tree Expand file tree Collapse file tree
appengine/standard/migration/memorystore Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ## App Engine Memorystore for Redis Sample
2+
3+ [ ![ Open in Cloud Shell] [ shell_img ]] [ shell_link ]
4+
5+ [ shell_img ] : http://gstatic.com/cloudssh/images/open-btn.png
6+ [ shell_link ] : https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=appengine/standard/migration/memorystore/README.md
7+
8+ This is a sample app for Google App Engine that demonstrates how to replace
9+ use of the [ Memcache API] ( https://cloud.google.com/appengine/docs/standard/python/memcache )
10+ with the [ Memorystore for Redis offering] ( https://cloud.google.com/memorystore ) .
11+ This newer library can be used on App Engine with either Python 2.7
12+ or Python 3.
13+
14+ Prior to deploying this sample, a
15+ [ serverless VPC connector] ( https://cloud.google.com/vpc/docs/configure-serverless-vpc-access )
16+ must be created and then a
17+ [ Memorystore for Redis instance] ( https://cloud.google.com/memorystore/docs/redis/quickstart-console )
18+ on the same VPC. The IP address and port number of the Redis instance, and
19+ the name of the VPC connector should be entered in either app.yaml
20+ (for Python 2.7) or app3.yaml (for Python 3).
21+
22+ To deploy and run this sample in App Engine standard for Python 2.7:
23+
24+ pip install -t lib -r requirements.txt
25+ gcloud app deploy
26+
27+ To deploy and run this sample in App Engine standard for Python 3.7:
28+
29+ gcloud app deploy app3.yaml
30+
Original file line number Diff line number Diff line change @@ -13,9 +13,8 @@ libraries:
1313 version : 1.0.0
1414
1515env_variables :
16- REDISHOST : ' 10.32.97.227 '
17- REDISPORT : ' 6379 '
16+ REDISHOST : ' <REDIS_IP> '
17+ REDISPORT : ' <REDIS_PORT> '
1818
1919vpc_access_connector :
20- name : ' projects/engelke-vpc-sample/locations/us-central1/connectors/redis-access'
21-
20+ name : ' projects/<PROJECT_ID>/locations/<REGION>/connectors/<CONNECTOR_NAME>'
Original file line number Diff line number Diff line change 11runtime : python38
22
33env_variables :
4- REDISHOST : ' 10.32.97.227 '
5- REDISPORT : ' 6379 '
4+ REDISHOST : ' <REDIS_IP> '
5+ REDISPORT : ' <REDIS_PORT> '
66
77vpc_access_connector :
8- name : ' projects/engelke-vpc-sample /locations/us-central1 /connectors/redis-access '
8+ name : ' projects/<PROJECT_ID> /locations/<REGION> /connectors/<CONNECTOR_NAME> '
Original file line number Diff line number Diff line change 11pytest==4.6.11; python_version < '3.0'
2+ mock==3.0.5
You can’t perform that action at this time.
0 commit comments