Skip to content

Commit 28dea6a

Browse files
Docs: Update sample configurations for new Flex runtimes (#3105)
* Update sample configurations for new Flex runtimes * Update README and create yaml files for 18 and later * Fix header licenses --------- Co-authored-by: Karl Weinmeister <[email protected]>
1 parent 3c55ba7 commit 28dea6a

File tree

14 files changed

+121
-15
lines changed

14 files changed

+121
-15
lines changed

appengine/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Refer to the `README.md` file in the sample folder.
5555

5656
Many samples in this folder can be deployed to both App Engine Node.js standard
5757
environment and flexible environment. Those samples come with two different
58-
App Engine configuration files: `app.flexible.yaml` for flexible environment,
58+
App Engine configuration files: `app.flexible.yaml` for flexible environment Node.js 16 and earlier, `app.flexible_os.yaml` for Node.js 18 and later
5959
and `app.standard.yaml` for standard environment.
6060

6161
Samples with one single configuration file, `app.yaml`, can only be deployed
@@ -76,9 +76,13 @@ Generally speaking, to deploy a sample application:
7676

7777
gcloud app deploy app.standard.yaml
7878

79-
To deploy to App Engine Node.js Flexible Environment, run
79+
To deploy to App Engine Flexible Environment Node.js 16 and earlier , run
8080

8181
gcloud app deploy app.flexible.yaml
82+
83+
For App Engine Flexible Environment Node.js 18 and later, run
84+
85+
gclooud app deploy app.flexible_os.yaml
8286

8387
For samples with one configuration file (`app.yaml`), run
8488

appengine/analytics/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,18 @@ Before you can run or deploy the sample, you need to do the following:
3434
gcloud app deploy app.standard.yaml
3535
```
3636

37-
## Deploying to App Engine flexible Environment
37+
## Deploying to App Engine flexible Environment for Node.js 16 and earlier
3838

3939
```
4040
gcloud app deploy app.flexible.yaml
4141
```
4242

43+
## Deploying to App Engine flexible Environment for Node.js 18 and later
44+
45+
```
46+
gcloud app deploy app.flexible_os.yaml
47+
```
48+
4349

4450
## Running the tests
4551

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright 2023 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
runtime: nodejs
16+
env: flex
17+
runtime_config:
18+
operating_system: ubuntu22
19+
runtime_version: 18
20+
21+
env_variables:
22+
GA_TRACKING_ID: YOUR_TRACKING_ID

appengine/datastore/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,14 @@ Before you can run or deploy the sample, you need to do the following:
3030

3131
gcloud app deploy app.standard.yaml
3232

33-
## Deploying to App Engine flexible environment
33+
## Deploying to App Engine flexible environment for Node.js 16 and earlier
3434

3535
gcloud app deploy app.flexible.yaml
3636

37+
## Deploying to App Engine flexible environment for Node.js 18 and later
38+
39+
gcloud app deploy app.flexible_os.yaml
40+
3741
## Running the tests
3842

3943
See [Contributing][contributing].
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Copyright 2023 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
runtime: nodejs
16+
env: flex
17+
runtime_config:
18+
operating_system: ubuntu22
19+
runtime_version: 18

appengine/hello-world/flexible/app.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
# Copyright 2017, Google, Inc.
1+
# Copyright 2023 Google LLC
2+
#
23
# Licensed under the Apache License, Version 2.0 (the "License");
34
# you may not use this file except in compliance with the License.
45
# You may obtain a copy of the License at
56
#
6-
# http://www.apache.org/licenses/LICENSE-2.0
7+
# http://www.apache.org/licenses/LICENSE-2.0
78
#
89
# Unless required by applicable law or agreed to in writing, software
910
# distributed under the License is distributed on an "AS IS" BASIS,
@@ -14,7 +15,8 @@
1415
# [START gae_flex_quickstart_yaml]
1516
runtime: nodejs
1617
env: flex
17-
18+
runtime_config:
19+
operating_system: ubuntu22
1820
# This sample incurs costs to run on the App Engine flexible environment.
1921
# The settings below are to reduce costs during testing and are not appropriate
2022
# for production use. For more information, see:

appengine/hello-world/flexible/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"url": "https://github.com/GoogleCloudPlatform/nodejs-docs-samples.git"
1111
},
1212
"engines": {
13-
"node": "=v16.19.1"
13+
"node": ">=18.x.x"
1414
},
1515
"scripts": {
1616
"start": "node app.js",
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
# Copyright 2016, Google, Inc.
1+
# Copyright 2023 Google LLC
2+
#
23
# Licensed under the Apache License, Version 2.0 (the "License");
34
# you may not use this file except in compliance with the License.
45
# You may obtain a copy of the License at
56
#
6-
# http://www.apache.org/licenses/LICENSE-2.0
7+
# http://www.apache.org/licenses/LICENSE-2.0
78
#
89
# Unless required by applicable law or agreed to in writing, software
910
# distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,3 +14,5 @@
1314

1415
runtime: nodejs
1516
env: flex
17+
runtime_config:
18+
operating_system: ubuntu22

appengine/metadata/flexible/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"url": "https://github.com/GoogleCloudPlatform/nodejs-docs-samples.git"
1111
},
1212
"engines": {
13-
"node": "16.x.x"
13+
"node": ">= 18.x.x"
1414
},
1515
"scripts": {
1616
"system-test": "mocha --exit test/*.test.js",

appengine/pubsub/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,12 @@ In the current directory, deploy using `gcloud`:
9696

9797
gcloud app deploy app.standard.yaml
9898

99-
To deploy to App Engine Node.js Flexible Environment, run
99+
To deploy to App Engine Node.js Flexible Environment for Node.js 16 and earlier, run:
100100

101101
gcloud app deploy app.flexible.yaml
102102

103+
For App Engine Flexible deployments for 18 and later, deploy via:
104+
105+
gcloud app deploy app.flexible_os.yaml
106+
103107
You can now access the application at https://[your-app-id].appspot.com. You can use the form to submit messages, but it's non-deterministic which instance of your application will receive the notification. You can send multiple messages and refresh the page to see the received message.

0 commit comments

Comments
 (0)